/* ==================== MENU SCREEN ==================== */
#menu-screen {
    background-image: url('../assets/bg-menu.png');
    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: #fff;
    text-shadow: 3px 3px 0 #ff6b6b, 6px 6px 0 rgba(0,0,0,0.3);
    text-align: center;
    animation: titleBounce 2s ease-in-out infinite;
}

.game-subtitle {
    font-size: 24px;
    color: #fbbf24;
    text-shadow: 2px 2px 0 rgba(0,0,0,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(0,0,0,0.3));
}

/* ==================== DIFFICULTY SCREEN ==================== */
#difficulty-screen {
    background-image: url('../assets/bg-menu.png');
    background-size: cover;
}

.difficulty-title {
    font-size: 32px;
    color: #fff;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 10px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.difficulty-btn:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.25);
}

.difficulty-btn img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.difficulty-btn .stars { color: #fbbf24; font-size: 20px; margin-bottom: 5px; }
.difficulty-btn .label { color: #fff; font-size: 14px; text-align: center; }

.back-btn {
    margin-top: 20px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
}

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

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    margin-bottom: 15px;
}

.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; }

/* 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, #4ade80, #22c55e);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

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

.timer-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    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.2); }

.timer-progress {
    stroke: #4ade80;
    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(255,255,255,0.95);
    border-radius: 20px;
    padding: 25px 40px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.question-text {
    font-size: 48px;
    font-weight: bold;
    color: #1e293b;
    text-align: center;
}

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

.answer-btn {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 42px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5), 0 0 20px rgba(255,255,255,0.3);
    transition: transform 0.2s, filter 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: crystalBounceIn 0.5s ease-out backwards;
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.3));
}

.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: correctCrystal 0.6s ease;
    filter: drop-shadow(0 0 30px #4ade80) brightness(1.3);
}

.answer-btn.wrong {
    animation: wrongCrystal 0.5s ease;
    filter: grayscale(0.5) brightness(0.7);
}

@keyframes crystalBounceIn {
    0% { transform: scale(0) rotate(-15deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes correctCrystal {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); filter: drop-shadow(0 0 40px #4ade80) brightness(1.5); }
    100% { transform: scale(1); }
}

@keyframes wrongCrystal {
    0%, 100% { transform: translateX(0) rotate(0); }
    20%, 60% { transform: translateX(-8px) rotate(-5deg); }
    40%, 80% { transform: translateX(8px) rotate(5deg); }
}

.crystal-blue { background-image: url('../assets/crystal-blue.png'); }
.crystal-green { background-image: url('../assets/crystal-green.png'); }
.crystal-red { background-image: url('../assets/crystal-red.png'); }

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

.mascot-game.mascot-happy {
    animation: mascotCelebrate 1s ease-out forwards;
    filter: drop-shadow(0 0 30px #fbbf24) drop-shadow(0 0 60px #fbbf24);
    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-image: url('../assets/bg-results.png');
    background-size: cover;
}

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

.results-title { font-size: 32px; font-weight: bold; color: #1e293b; margin-bottom: 20px; }
.results-score { font-size: 48px; font-weight: bold; color: #3b82f6; 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: #64748b; font-size: 18px; margin-bottom: 25px; }
.results-buttons { display: flex; flex-direction: column; gap: 12px; }

/* ==================== 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: 5px auto;
    }

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

    .question-container {
        padding: 12px 25px;
        margin: 8px 0;
    }

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

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

    .answer-btn {
        font-size: 28px;
    }

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