/* Overlay Styles */

/* Popup Box Base */
.popup-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #fdf2e9 0%, #f5e6d3 100%);
    border: 8px solid #a04000;
    box-shadow: 0 0 0 4px #2c1b0e, 0 0 50px rgba(0,0,0,0.8), inset 0 0 30px rgba(160,64,0,0.1);
    padding: 35px;
    color: #2c1b0e;
    display: none;
    width: 90%;
    max-width: 600px;
    z-index: 200;
    border-radius: 4px;
    text-align: center;
    animation: popIn 0.3s ease-out;
}
@keyframes popIn {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}
.popup-box h2 {
    color: #a04000;
    margin-top: 0;
}
#relic-bonus {
    font-size: 13px;
    color: #27ae60;
}

/* Game Over */
#game-over h2 {
    color: #8b0000;
}

/* Start Overlay */
#start-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.95), rgba(20,10,5,0.95));
    color: gold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    font-size: 28px;
    cursor: pointer;
    text-align: center;
    flex-direction: column;
    gap: 12px;
}
.sub-text {
    font-size: 14px;
    color: #ccc;
    line-height: 1.6;
}
.title-main {
    font-size: 56px;
    text-shadow: 0 0 30px #ffd700, 0 0 60px #ff8c00;
    letter-spacing: 4px;
    animation: titleGlow 2s ease-in-out infinite;
}
@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 30px #ffd700, 0 0 60px #ff8c00; }
    50% { text-shadow: 0 0 50px #ffd700, 0 0 100px #ff8c00, 0 0 150px #ffd700; }
}
.title-sub {
    font-size: 18px;
    color: #c9a227;
    letter-spacing: 8px;
}

/* Account Section */
.account-section {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 25px;
}
#user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffd700;
}
#user-name-display {
    color: #ffd700;
    font-weight: bold;
}
.logout-btn {
    background: rgba(255,100,100,0.3);
    border: 1px solid rgba(255,100,100,0.5);
    color: #ff6666;
    padding: 5px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.logout-btn:hover {
    background: rgba(255,100,100,0.5);
}
.guest-btn {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    font-size: 14px !important;
    padding: 8px 20px !important;
}
.guest-btn:hover {
    background: rgba(255,255,255,0.2) !important;
}
#google-signin-btn {
    margin: 5px 0;
}

/* Settings Row */
.settings-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}
.settings-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: #ccc;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.settings-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.settings-btn.off {
    color: #888;
    opacity: 0.7;
}

/* Pause Overlay */
#pause-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
    flex-direction: column;
    gap: 15px;
    backdrop-filter: blur(5px);
}
.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}

/* Victory/Game Over Overlays */
#victory-overlay, #level-editor-overlay, #multiplayer-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.95), rgba(20,15,5,0.95));
    color: gold;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    overflow-y: auto;
    padding: 20px;
}

/* Leaderboard */
#leaderboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 450;
}
#leaderboard-box {
    background: linear-gradient(135deg, #fdf2e9, #f5e6d3);
    border: 8px solid #a04000;
    padding: 25px;
    border-radius: 8px;
    max-width: 450px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
}
#leaderboard-box h2 {
    color: #a04000;
    margin: 0 0 15px 0;
}
.lb-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    color: #2c1b0e;
}

/* Tutorial */
#tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 480;
}
#tutorial-box {
    background: linear-gradient(135deg, #fdf2e9, #f5e6d3);
    border: 8px solid #a04000;
    padding: 25px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    color: #2c1b0e;
}
#tutorial-box h2 {
    color: #a04000;
}
.tutorial-step { display: none; }
.tutorial-step.active { display: block; }
.tutorial-img { font-size: 48px; margin: 15px 0; }
.tutorial-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}
.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}
.tutorial-dot.active { background: #a04000; }

/* Level Editor */
#editor-canvas {
    border: 3px solid #ffd700;
    background: #1a4331;
    cursor: crosshair;
}
.editor-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 15px 0;
}
.tool-btn {
    padding: 10px 15px;
    background: #333;
    color: #fff;
    border: 2px solid #666;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}
.tool-btn:hover {
    background: #555;
}
.tool-btn.selected {
    background: #a04000;
    border-color: #ffd700;
}
#editor-facts {
    width: 100%;
    max-width: 400px;
}
.fact-input {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Multiplayer */
#multiplayer-status {
    padding: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 5px;
    margin: 10px 0;
}
#player-name {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: none;
    margin: 10px;
    text-align: center;
}
#player-list {
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
}
.other-player {
    color: #00ff00;
    font-size: 12px;
    padding: 3px 0;
}

/* Multiplayer Room Styles */
.lobby-section {
    margin: 15px 0;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}
.lobby-section h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #c9a227;
}
.join-code-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}
.join-code-row input {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 4px;
}
.room-list {
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 5px;
    padding: 5px;
}
.room-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 4px 0;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.room-item:hover {
    background: rgba(255,215,0,0.2);
}
.room-code {
    font-weight: bold;
    color: #ffd700;
}
.room-host {
    color: #ccc;
}
.room-players {
    color: #00ff00;
}
.no-rooms {
    color: #888;
    padding: 20px;
    text-align: center;
}
.room-code-box {
    font-size: 14px;
    color: #ccc;
    margin: 10px 0;
}
.room-code-big {
    font-size: 32px;
    font-weight: bold;
    color: #ffd700;
    letter-spacing: 8px;
    display: block;
    margin-top: 5px;
}
.room-player-list {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    max-height: 150px;
    overflow-y: auto;
}
.room-player {
    padding: 8px;
    font-size: 14px;
}
.room-settings {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}
.room-settings label {
    color: #ccc;
    font-size: 12px;
}
.room-settings select {
    margin-left: 5px;
    padding: 5px;
    border-radius: 4px;
    border: none;
    background: #333;
    color: #fff;
}
.start-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
    font-size: 18px !important;
}
.room-chat {
    background: rgba(0,0,0,0.4);
    border-radius: 5px;
    padding: 10px;
    height: 100px;
    overflow-y: auto;
    margin: 10px 0;
    text-align: left;
    font-size: 12px;
}
.chat-message {
    padding: 3px 0;
    color: #ccc;
}
.chat-message strong {
    color: #ffd700;
}
.chat-input-row {
    margin-bottom: 10px;
}
.chat-input-row input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
}
