/* ---------- CONTAINER ---------- */

.quiz-game {
    width: 70%;
    max-width: 850px;
    background: #ffffffd0;
    margin-top: 40px;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    text-align: center;
}

/* ---------- AVATAR & QUESTION ---------- */

#avatar-box {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #d4b483;
    background: #eee;
}

#question-text {
    font-size: 1.4em;
    font-weight: bold;
    text-align: left;
    flex: 1;
}

/* ---------- ANSWERS ---------- */

#answers-box {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer {
    background: #f2e9d8;
    padding: 12px 18px;
    border-radius: 10px;
    border: 2px solid #c6b08a;
    cursor: pointer;
    transition: transform .2s, background .2s;
    text-align: left;
    position: relative;
    font-size: 1.1em;
}

.answer:hover {
    transform: scale(1.04);
    background: #e3d4b8;
}

/* ---------- FEEDBACK COULEURS ---------- */

.answer.correct {
    background: #b4e89e !important;
    border-color: #5aa045;
}

.answer.medium {
    background: #ffd699 !important;
    border-color: #d19a00;
}

.answer.wrong {
    background: #ffb3a8 !important;
    border-color: #c94343;
}

/* ---------- ICONES ✔ ~ ✘ ---------- */

.answer .icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4em;
    font-weight: bold;
}

/* ---------- BUTTON : NEXT QUESTION ---------- */

#next-btn {
    margin-top: 25px;
    padding: 12px 20px;
    background: #4f8f46;
    color: white;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .2s, background .2s;
}

#next-btn:hover {
    transform: scale(1.05);
    background: #3b6f35;
}

/* ---------- PROGRESS ---------- */

#progress {
    margin-top: 15px;
    font-size: 1.1em;
    color: #555;
}

.hidden {
    display: none !important;
}

/* ---------- RESULT SCREEN ---------- */

#result-screen {
    margin-top: 25px;
    background: #fffef3;
    padding: 30px;
    border-radius: 16px;
    border-left: 8px solid #d1b000;
    font-size: 1.3em;

    /* Animation correction */
    animation: resultEnter .8s ease forwards;
    opacity: 0;            /* état initial */
    transform: scale(0.8); /* état initial */

    text-align: center;
}

/* ---------- ANIMATION ENTREE RESULTAT (CORRIGÉE) ---------- */

@keyframes resultEnter {
    0% {
        transform: scale(0.7) translateY(30px);
        opacity: 0;
    }
    60% {
        transform: scale(1.05) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;  /* ← CORRECTION CRUCIALE */
    }
}

/* → Sécurité supplémentaire */
#result-screen {
    opacity: 1 !important;
}

/* Score number animation */
.score-number {
    font-size: 2.5em;
    font-weight: bold;
    animation: popNumber .7s ease forwards;
    opacity: 0;
}

@keyframes popNumber {
    0% { transform: scale(0.2); opacity: 0; }
    70% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Glow autour du message final */
.final-message {
    margin-top: 10px;
    font-size: 1.4em;
    animation: glow .9s ease forwards;
    opacity: 0;
}

@keyframes glow {
    0% { opacity: 0; text-shadow: none; }
    100% { opacity: 1; text-shadow: 0 0 12px rgba(255,255,180,0.8); }
}

/* Couleurs variantes selon score */

.score-bad {
    border-left-color: #c94343;
}

.score-medium {
    border-left-color: #eaa100;
}

.score-good {
    border-left-color: #4f8f46;
}

/* ---------- GUIDE REACTION ---------- */

.guide-reaction {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    animation: guidePop .7s ease forwards;
    opacity: 0;
}

.guide-reaction img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #d4b483;
}

.guide-reaction p {
    margin: 0;
    font-size: 1.1em;
    max-width: 380px;
    text-align: left;
}

@keyframes guidePop {
    0% { transform: translateY(15px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ---------- ACHIEVEMENT NOTIFICATION ---------- */

#achievement {
    position: fixed;
    top: 20px;
    right: -400px;
    background: #4f8f46;
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: right 0.6s ease;
    z-index: 9999;
}

#achievement.show {
    right: 20px;
}

#achievement.hide {
    right: -400px;
}

#achievement img {
    width: 40px;
    height: 40px;
}

/* ---------- OVERLAY CINEMATIQUE ---------- */

#result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity .6s ease;
    z-index: 9000;
}

#result-overlay.show {
    opacity: 1;
}

/* ---------- BADGE ANIMATION ---------- */

#nirdBadge.badge-animate {
    animation: badgePop 1s ease-out forwards;
}

@keyframes badgePop {
    0% { transform: scale(0.2) rotate(-20deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}

/* ---------- CONFETTIS ---------- */

#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9500;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 14px;
    background: #ffd54f;
    opacity: 0.9;
    animation-name: confetti-fall, confetti-sway;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: 1, infinite;
}

@keyframes confetti-fall {
    0% { transform: translateY(-10px); }
    100% { transform: translateY(110vh); }
}

@keyframes confetti-sway {
    0% { transform: translateX(0); }
    50% { transform: translateX(15px); }
    100% { transform: translateX(-15px); }
}

/* ---------- FEUILLES ---------- */

#leaf-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9400;
}

.leaf {
    position: absolute;
    top: -10px;
    font-size: 1.4em;
    animation-name: leaf-fall;
    animation-timing-function: linear;
    animation-iteration-count: 1;
}

@keyframes leaf-fall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(110vh) rotate(120deg); opacity: 0; }
}
/* ----------- BOUTONS DU RESULT SCREEN ----------- */

.result-btn {
    display: inline-block;
    margin-top: 15px;
    background: #4f8f46;
    color: white !important;
    padding: 12px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    transition: transform .2s ease, background .2s ease;
}

.result-btn:hover {
    transform: scale(1.05);
    background: #3b6f35;
}

.return-btn {
    background: #d4b483;
    color: #333 !important;
}

.return-btn:hover {
    background: #b7935f;
    transform: scale(1.05);
}
/* ----- Bandeau haut résultat ----- */
.result-header {
    background: linear-gradient(135deg, #d4b483, #f5e4c3);
    padding: 15px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 10px;
    text-align: center;
}

.score-title {
    margin: 0;
    font-size: 1.6em;
    font-weight: bold;
}

/* ----- Zone boutons ----- */
.result-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* ----- Result Screen amélioration ----- */
#result-screen {
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    border: 3px solid #e8d5b5;
    backdrop-filter: blur(5px);
    position: relative;
}

/* Effet de vignette subtile autour */
#result-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.15);
    pointer-events: none;
}
