/* ==================== MENU SCREEN ==================== */
#menu-screen {
    background: linear-gradient(180deg, #0d0d1a 0%, #1a0a2e 50%, #2d1b4e 100%);
    background-size: cover;
    background-position: center;
}

.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-title {
    font-size: 48px;
    font-weight: bold;
    color: #e9d5ff;
    text-shadow: 3px 3px 0 #7c3aed, 6px 6px 0 rgba(0,0,0,0.3), 0 0 30px rgba(139, 92, 246, 0.4);
    text-align: center;
    animation: titleBounce 2s ease-in-out infinite;
}

.game-subtitle {
    font-size: 24px;
    color: #c084fc;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3), 0 0 15px rgba(192, 132, 252, 0.3);
    margin-top: -10px;
}

.mascot-menu {
    width: 180px;
    height: 180px;
    object-fit: contain;
    animation: mascotFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(139, 92, 246, 0.4));
}

/* ==================== QUESTION SCREEN ==================== */
#question-screen {
    padding: 15px;
    justify-content: space-between;
    background-size: cover;
    background-position: center;
    overflow: visible;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    margin-bottom: 10px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Quit button in game headers */
.quit-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 50%;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: 1px solid rgba(239, 68, 68, 0.4);
    flex-shrink: 0;
    line-height: 1;
}
.quit-btn:active {
    transform: scale(0.9);
    background: rgba(239, 68, 68, 0.5);
}

.score-display, .stars-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
}

.score-display img, .stars-display img { width: 25px; height: 25px; }
.stars-display span { color: #fbbf24; }

/* Score HUD */
.score-hud {
    display: flex;
    align-items: center;
    color: #fbbf24;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    min-width: 50px;
    text-align: center;
}

/* Combo Display */
.combo-display {
    position: absolute;
    top: 70px;
    right: 15px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: comboAppear 0.4s ease-out;
}
.combo-multiplier {
    font-size: 36px;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 2px 2px 0 #78350f, 0 0 20px rgba(251, 191, 36, 0.6);
    line-height: 1;
}
.combo-label {
    font-size: 11px;
    color: #fde68a;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
}
.combo-display.combo-x2 .combo-multiplier { font-size: 36px; color: #fbbf24; }
.combo-display.combo-x3 .combo-multiplier { font-size: 40px; color: #fb923c; }
.combo-display.combo-x4 .combo-multiplier { font-size: 44px; color: #f87171; }
.combo-display.combo-x5 .combo-multiplier { font-size: 48px; color: #c084fc; text-shadow: 2px 2px 0 #581c87, 0 0 30px rgba(192, 132, 252, 0.8); }
.combo-display.combo-bump { animation: comboBump 0.3s ease-out; }

@keyframes comboAppear {
    0% { transform: scale(0) rotate(-15deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes comboBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Floating Points */
.floating-points-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 70;
}
.floating-points {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 1px 1px 0 #78350f, 0 0 10px rgba(251, 191, 36, 0.5);
    pointer-events: none;
    animation: floatPoints 1.2s ease-out forwards;
    white-space: nowrap;
}
.floating-points.combo-bonus {
    color: #c084fc;
    font-size: 28px;
    text-shadow: 1px 1px 0 #581c87, 0 0 15px rgba(192, 132, 252, 0.6);
}
@keyframes floatPoints {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    20% { transform: translateY(-10px) scale(1.1); opacity: 1; }
    100% { transform: translateY(-80px) scale(0.8); opacity: 0; }
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Timer */
.timer-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 5px auto;
}

.timer-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.timer-circle svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-circle circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.timer-bg { stroke: rgba(255,255,255,0.15); }

.timer-progress {
    stroke: #8b5cf6;
    stroke-dasharray: 226;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-progress.warning {
    stroke: #ef4444;
    animation: timerPulse 0.5s ease-in-out infinite;
}

.timer-text {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    z-index: 1;
}

/* Question */
.question-container {
    background: rgba(0,0,0,0.7);
    border-radius: 20px;
    padding: 15px 25px;
    margin: 10px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 2px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(5px);
}

.question-label {
    font-size: 14px;
    color: #c084fc;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 20px;
    font-weight: bold;
    color: #e9d5ff;
    text-align: center;
    line-height: 1.4;
}

/* Answer Monster Options */
.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 350px;
    margin: 10px auto;
    flex-shrink: 1;
    overflow: visible;
}

.answer-btn {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: monsterBounceIn 0.5s ease-out backwards;
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.4));
}

.answer-btn.monster-option {
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-radius: 15px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    backdrop-filter: blur(3px);
}

.answer-btn.monster-option img {
    width: 75%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.answer-btn.monster-option .monster-name {
    font-size: 12px;
    font-weight: bold;
    color: #e9d5ff;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.answer-btn:nth-child(1) { animation-delay: 0.1s; }
.answer-btn:nth-child(2) { animation-delay: 0.2s; }
.answer-btn:nth-child(3) { animation-delay: 0.3s; }
.answer-btn:nth-child(4) { animation-delay: 0.4s; }

.answer-btn:active { transform: scale(0.92); }

.answer-btn.correct {
    animation: correctMonster 0.6s ease;
    border-color: #4ade80 !important;
    box-shadow: 0 0 25px rgba(74, 222, 128, 0.5);
}

.answer-btn.wrong {
    animation: wrongMonster 0.5s ease;
    border-color: #ef4444 !important;
    filter: grayscale(0.5) brightness(0.6);
}

@keyframes monsterBounceIn {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.05) rotate(3deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes correctMonster {
    0% { transform: scale(1); }
    30% { transform: scale(1.1); box-shadow: 0 0 40px rgba(74, 222, 128, 0.7); }
    100% { transform: scale(1); }
}

.answer-btn.correct-zoom {
    animation: correctZoom 0.8s ease forwards;
    z-index: 1000;
    position: relative;
}

@keyframes correctZoom {
    0% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(var(--zoom-x, 0), var(--zoom-y, 0)) scale(4); box-shadow: 0 0 80px rgba(74, 222, 128, 0.9); }
    80% { transform: translate(var(--zoom-x, 0), var(--zoom-y, 0)) scale(4); box-shadow: 0 0 80px rgba(74, 222, 128, 0.9); }
    100% { transform: translate(0, 0) scale(1); box-shadow: 0 0 25px rgba(74, 222, 128, 0.4); }
}

@keyframes wrongMonster {
    0%, 100% { transform: translateX(0) rotate(0); }
    20%, 60% { transform: translateX(-6px) rotate(-3deg); }
    40%, 80% { transform: translateX(6px) rotate(3deg); }
}

/* Mascot */
.mascot-game {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.4));
    transition: all 0.3s;
    z-index: 50;
}

.mascot-game.mascot-happy {
    animation: mascotCelebrate 1s ease-out forwards;
    filter: drop-shadow(0 0 30px #c084fc) drop-shadow(0 0 60px #c084fc);
    z-index: 500;
}

.mascot-game.mascot-sad {
    animation: mascotSad 0.8s ease-out forwards;
    z-index: 500;
}

@keyframes mascotCelebrate {
    0% { transform: scale(1) translate(0, 0); }
    30% { transform: scale(1.8) translate(-30px, -80px); }
    50% { transform: scale(2) translate(-35px, -100px); }
    70% { transform: scale(1.9) translate(-32px, -90px); }
    100% { transform: scale(1.6) translate(-25px, -70px); }
}

@keyframes mascotSad {
    0% { transform: scale(1) translate(0, 0) rotate(0deg); }
    20% { transform: scale(1.5) translate(-20px, -50px) rotate(-8deg); }
    40% { transform: scale(1.6) translate(-25px, -60px) rotate(8deg); }
    60% { transform: scale(1.5) translate(-22px, -55px) rotate(-4deg); }
    100% { transform: scale(1.4) translate(-18px, -45px) rotate(0deg); }
}

/* Flying Star */
.flying-star {
    position: absolute;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 200;
    animation: flyStar 0.8s ease-out forwards;
}

/* ==================== RESULTS SCREEN ==================== */
#results-screen {
    background: linear-gradient(135deg, #1a0a2e 0%, #0d0d1a 100%);
    background-size: cover;
}

.results-content {
    background: rgba(0,0,0,0.8);
    border-radius: 30px;
    padding: 30px;
    text-align: center;
    max-width: 350px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 2px solid rgba(139, 92, 246, 0.3);
    animation: resultsPopIn 0.5s ease-out;
}

.results-title { font-size: 32px; font-weight: bold; color: #e9d5ff; margin-bottom: 20px; }
.results-score { font-size: 48px; font-weight: bold; color: #c084fc; margin-bottom: 10px; }

.results-stars { display: flex; justify-content: center; gap: 10px; margin: 20px 0; }
.results-stars img { width: 50px; height: 50px; }
.results-stars img.earned { animation: starEarned 0.5s ease-out backwards; }
.results-stars img:not(.earned) { filter: grayscale(1) opacity(0.3); }

.results-stats { color: #a78bfa; font-size: 18px; margin-bottom: 25px; }
.results-buttons { display: flex; flex-direction: column; gap: 12px; }

/* ==================== BACK BUTTON ==================== */
.back-btn {
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #e9d5ff;
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.back-btn:active {
    background: rgba(139, 92, 246, 0.5);
    transform: scale(0.95);
}

/* ==================== MAP ACTION BUTTONS ==================== */
.map-actions {
    display: flex;
    gap: 8px;
}
.map-action-btn {
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #e9d5ff;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.map-action-btn:hover, .map-action-btn:active {
    background: rgba(139, 92, 246, 0.5);
    transform: scale(1.05);
}

/* Victory leaderboard button */
.btn-leaderboard-small {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 5px;
    transition: all 0.2s;
}
.btn-leaderboard-small:hover, .btn-leaderboard-small:active {
    background: rgba(251, 191, 36, 0.4);
    transform: scale(1.05);
}

/* ==================== RESPONSIVE - 16:9 and wider screens ==================== */
@media (min-aspect-ratio: 4/3) {
    #question-screen {
        padding: 8px;
        justify-content: space-between;
    }

    .game-header {
        padding: 5px 10px;
        margin-bottom: 5px;
    }

    .timer-container {
        width: 50px;
        height: 50px;
        margin: 3px auto;
    }

    .timer-text {
        font-size: 18px;
    }

    .question-container {
        padding: 10px 20px;
        margin: 5px 0;
    }

    .question-label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .question-text {
        font-size: 16px;
    }

    .answers-grid {
        gap: 8px;
        max-width: 280px;
        margin: 5px auto;
    }

    .answer-btn.monster-option .monster-name {
        font-size: 10px;
    }

    .mascot-game {
        width: 70px;
        height: 70px;
    }

    .score-hud { font-size: 14px; }
    .combo-display { top: 55px; right: 10px; }
    .combo-multiplier { font-size: 28px; }
    .floating-points { font-size: 18px; }
}
