.quiz-celebration-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 1150;
}

.quiz-correct-ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--celebration-color, #00ff66);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--celebration-color, #00ff66) 30%, transparent),
        0 0 18px color-mix(in srgb, var(--celebration-color, #00ff66) 80%, transparent);
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0.95;
    pointer-events: none;
    animation: quizCorrectRipple 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    z-index: 3;
}

.quiz-option-btn.celebrating-correct {
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--celebration-color, #00ff66) 45%, rgba(255, 255, 255, 0.16)),
        0 0 24px color-mix(in srgb, var(--celebration-color, #00ff66) 45%, transparent),
        0 0 42px color-mix(in srgb, var(--celebration-color, #00ff66) 28%, transparent);
    animation:
        correctGlow 0.7s ease-out,
        quizCorrectPulse 0.95s ease-in-out 0.12s 2;
}

.quiz-praise-pop {
    position: fixed;
    left: 0;
    top: 0;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--celebration-color, #00ff66) 62%, rgba(255, 255, 255, 0.32));
    background: rgba(15, 23, 42, 0.88);
    color: var(--celebration-color, #00ff66);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-shadow: 0 0 12px color-mix(in srgb, var(--celebration-color, #00ff66) 55%, transparent);
    box-shadow:
        0 10px 28px rgba(2, 6, 23, 0.34),
        0 0 24px color-mix(in srgb, var(--celebration-color, #00ff66) 24%, transparent);
    transform: translate(-50%, 0) rotate(var(--praise-rotate, 0deg)) scale(0.72);
    opacity: 0;
    white-space: nowrap;
    animation: quizPraisePop 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.quiz-confetti-particle {
    position: fixed;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: quizConfettiBurst var(--particle-duration, 900ms) ease-out var(--particle-delay, 0ms) forwards;
}

.quiz-confetti-particle svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.18));
}

#quiz-score-pill {
    position: relative;
    overflow: visible;
}

.quiz-score-pop {
    animation: quizScorePillPulse 1s ease;
}

.quiz-score-value-pop {
    color: var(--celebration-color, #00ff66) !important;
    display: inline-block;
    animation: quizScoreValuePulse 1s ease;
}

.quiz-xp-burst {
    position: absolute;
    right: 0;
    top: -0.45rem;
    color: var(--celebration-color, #00ff66);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-shadow: 0 0 16px color-mix(in srgb, var(--celebration-color, #00ff66) 60%, transparent);
    white-space: nowrap;
    pointer-events: none;
    animation: quizXpBurst 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes quizCorrectRipple {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0.95;
    }
    100% {
        transform: translate(-50%, -50%) scale(7.4);
        opacity: 0;
    }
}

@keyframes quizCorrectPulse {
    0% {
        box-shadow:
            inset 0 0 0 1px color-mix(in srgb, var(--celebration-color, #00ff66) 34%, rgba(255, 255, 255, 0.16)),
            0 0 20px color-mix(in srgb, var(--celebration-color, #00ff66) 26%, transparent);
    }
    50% {
        box-shadow:
            inset 0 0 0 1px color-mix(in srgb, var(--celebration-color, #00ff66) 52%, rgba(255, 255, 255, 0.18)),
            0 0 26px color-mix(in srgb, var(--celebration-color, #00ff66) 50%, transparent),
            0 0 48px color-mix(in srgb, var(--celebration-color, #00ff66) 28%, transparent);
    }
    100% {
        box-shadow:
            inset 0 0 0 1px color-mix(in srgb, var(--celebration-color, #00ff66) 40%, rgba(255, 255, 255, 0.16)),
            0 0 24px color-mix(in srgb, var(--celebration-color, #00ff66) 34%, transparent),
            0 0 40px color-mix(in srgb, var(--celebration-color, #00ff66) 20%, transparent);
    }
}

@keyframes quizPraisePop {
    0% {
        transform: translate(-50%, 10px) rotate(var(--praise-rotate, 0deg)) scale(0.72);
        opacity: 0;
    }
    25% {
        transform: translate(-50%, -12px) rotate(var(--praise-rotate, 0deg)) scale(1.08);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -56px) rotate(var(--praise-rotate, 0deg)) scale(0.98);
        opacity: 0;
    }
}

@keyframes quizConfettiBurst {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(0.4);
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    100% {
        transform:
            translate(-50%, -50%)
            translate(var(--tx, 0), var(--ty, -120px))
            rotate(var(--particle-rotate, 120deg))
            scale(var(--particle-scale, 1));
        opacity: 0;
    }
}

@keyframes quizScorePillPulse {
    0% {
        transform: scale(1);
    }
    24% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes quizScoreValuePulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }
    24% {
        transform: scale(1.12);
        text-shadow: 0 0 16px color-mix(in srgb, var(--celebration-color, #00ff66) 55%, transparent);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }
}

@keyframes quizXpBurst {
    0% {
        transform: translateY(6px) scale(0.82);
        opacity: 0;
    }
    20% {
        transform: translateY(-4px) scale(1.02);
        opacity: 1;
    }
    100% {
        transform: translateY(-18px) scale(0.94);
        opacity: 0;
    }
}

.quiz-wrong-ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--celebration-color, #ff007a);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--celebration-color, #ff007a) 34%, transparent),
        0 0 20px color-mix(in srgb, var(--celebration-color, #ff007a) 65%, transparent);
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0.9;
    pointer-events: none;
    animation: quizWrongRipple 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 3;
}

.quiz-option-btn.celebrating-wrong {
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--celebration-color, #ff007a) 46%, rgba(255, 255, 255, 0.16)),
        0 0 20px color-mix(in srgb, var(--celebration-color, #ff007a) 36%, transparent),
        0 0 34px color-mix(in srgb, var(--celebration-color, #ff007a) 22%, transparent);
    animation:
        wrongGlow 0.5s ease-out,
        quizWrongShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) 1,
        quizWrongPulse 0.78s ease-out;
}

.quiz-warning-pop {
    position: fixed;
    left: 0;
    top: 0;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--celebration-color, #ff007a) 58%, rgba(255, 255, 255, 0.28));
    background: rgba(25, 10, 20, 0.9);
    color: var(--celebration-color, #ff007a);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-shadow: 0 0 12px color-mix(in srgb, var(--celebration-color, #ff007a) 55%, transparent);
    box-shadow:
        0 10px 28px rgba(2, 6, 23, 0.34),
        0 0 24px color-mix(in srgb, var(--celebration-color, #ff007a) 24%, transparent);
    transform: translate(-50%, 0) rotate(var(--praise-rotate, 0deg)) scale(0.7);
    opacity: 0;
    white-space: nowrap;
    animation: quizWarningPop 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.quiz-error-particle {
    position: fixed;
    left: 0;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: quizErrorBurst var(--particle-duration, 720ms) ease-out var(--particle-delay, 0ms) forwards;
}

.quiz-error-particle svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(255, 80, 140, 0.2));
}

.quiz-score-warning {
    animation: quizScoreWarningPulse 0.9s ease;
}

.quiz-score-warning-value {
    color: var(--celebration-color, #ff007a) !important;
    display: inline-block;
    animation: quizScoreWarningValue 0.9s ease;
}

@keyframes quizWrongRipple {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -50%) scale(6.2);
        opacity: 0;
    }
}

@keyframes quizWrongShake {
    0% { transform: scale(1) translateX(0); }
    20% { transform: scale(0.985) translateX(-6px); }
    40% { transform: scale(0.99) translateX(5px); }
    60% { transform: scale(0.99) translateX(-4px); }
    80% { transform: scale(0.995) translateX(3px); }
    100% { transform: scale(1) translateX(0); }
}

@keyframes quizWrongPulse {
    0% {
        filter: saturate(1);
    }
    40% {
        filter: saturate(1.2) brightness(1.04);
    }
    100% {
        filter: saturate(1);
    }
}

@keyframes quizWarningPop {
    0% {
        transform: translate(-50%, 8px) rotate(var(--praise-rotate, 0deg)) scale(0.72);
        opacity: 0;
    }
    24% {
        transform: translate(-50%, -10px) rotate(var(--praise-rotate, 0deg)) scale(1.04);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -44px) rotate(var(--praise-rotate, 0deg)) scale(0.96);
        opacity: 0;
    }
}

@keyframes quizErrorBurst {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(0.35);
        opacity: 0;
    }
    14% {
        opacity: 1;
    }
    100% {
        transform:
            translate(-50%, -50%)
            translate(var(--tx, 0), var(--ty, -56px))
            rotate(var(--particle-rotate, 120deg))
            scale(var(--particle-scale, 1));
        opacity: 0;
    }
}

@keyframes quizScoreWarningPulse {
    0% {
        transform: scale(1);
    }
    28% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes quizScoreWarningValue {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }
    28% {
        transform: scale(1.08);
        text-shadow: 0 0 14px color-mix(in srgb, var(--celebration-color, #ff007a) 55%, transparent);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }
}
