/* Shared verbatim exercise answer effects, including their timings and particle styles. */
        :is(#choices, .placement-options, .choices) .choice.correct {
            border-color: var(--green);
            background: var(--green-soft);
            color: var(--crp-fg-166534, #166534);
            opacity: 1;
            transition: none !important;
            overflow: visible;
            box-shadow: none;
        }

        :is(#choices, .placement-options, .choices) .choice.incorrect {
            border-color: var(--red);
            background: var(--crp-bg-fee2e2, #fee2e2);
            color: var(--crp-fg-991b1b, #991b1b);
            opacity: 1;
            transition: none !important;
            box-shadow: none;
        }

        body .practice-view #choices button.choice.correct,
        body .practice-view #choices button.choice.correct:hover,
        body .practice-view #choices button.choice.correct:active {
            border-color: var(--green);
            background: var(--green-soft);
            color: var(--crp-fg-166534, #166534);
            transition: none;
        }

        body .practice-view #choices button.choice.incorrect,
        body .practice-view #choices button.choice.incorrect:hover,
        body .practice-view #choices button.choice.incorrect:active {
            border-color: var(--red);
            background: var(--crp-bg-fee2e2, #fee2e2);
            color: var(--crp-fg-991b1b, #991b1b);
            transition: none;
        }

        .choice.correct::before {
            content: "";
            position: absolute;
            inset: -18px;
            z-index: 2;
            border-radius: 14px;
            background:
                radial-gradient(circle, var(--crp-bg-22c55e, #22c55e) 0 2px, transparent 3px) 50% 0 / 8px 8px no-repeat,
                radial-gradient(circle, var(--crp-bg-86efac, #86efac) 0 2px, transparent 3px) 100% 50% / 8px 8px no-repeat,
                radial-gradient(circle, var(--crp-bg-f59e0b, #f59e0b) 0 2px, transparent 3px) 50% 100% / 8px 8px no-repeat,
                radial-gradient(circle, var(--crp-bg-06b6d4, #06b6d4) 0 2px, transparent 3px) 0 50% / 8px 8px no-repeat,
                radial-gradient(circle, var(--crp-bg-16a34a, #16a34a) 0 2px, transparent 3px) 86% 14% / 8px 8px no-repeat,
                radial-gradient(circle, var(--crp-bg-a855f7, #365c39) 0 2px, transparent 3px) 14% 86% / 8px 8px no-repeat;
            pointer-events: none;
            animation: choice-button-firework 760ms ease-out both;
        }

        .choice.answer-bump {
            animation: answer-bump 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28);
        }

        .choice.answer-shake {
            animation: answer-shake 0.34s ease;
        }

        .fireworks-layer {
            position: fixed;
            inset: 0;
            z-index: 2147483647;
            pointer-events: none;
            overflow: hidden;
        }

        .firework-particle {
            --x: 50vw;
            --y: 50vh;
            --dx: 0px;
            --dy: 0px;
            --size: 8px;
            --color: #22c55e;
            position: absolute;
            left: var(--x);
            top: var(--y);
            width: var(--size);
            height: var(--size);
            border-radius: 999px;
            background: var(--color);
            box-shadow: 0 0 12px var(--color);
            transform: translate(-50%, -50%);
            animation: firework-pop 2s ease-out forwards;
        }

        @keyframes answer-bump {
            0%, 100% { transform: translateY(0) scale(1); }
            34% { transform: translateY(-8px) scale(1.025); }
            66% { transform: translateY(-3px) scale(1.01); }
        }

        @keyframes prompt-card-correct-lift {
            0%, 100% { transform: translateY(0) scale(1); }
            45% { transform: translateY(-4px) scale(1.01); }
        }

        @keyframes prompt-card-flip-out {
            0% {
                opacity: 1;
                transform: perspective(720px) rotateY(0deg) scale(1);
            }
            100% {
                opacity: 0.15;
                transform: perspective(720px) rotateY(86deg) scale(0.96);
            }
        }

        @keyframes prompt-card-flip-in {
            0% {
                opacity: 0.15;
                transform: perspective(720px) rotateY(-86deg) scale(0.96);
            }
            100% {
                opacity: 1;
                transform: perspective(720px) rotateY(0deg) scale(1);
            }
        }

        @keyframes answer-shake {
            0%, 100% { transform: translateX(0); }
            15% { transform: translateX(-3px); }
            30% { transform: translateX(2.5px); }
            45% { transform: translateX(-2px); }
            60% { transform: translateX(1.5px); }
            75% { transform: translateX(-1px); }
        }

        @keyframes choice-button-firework {
            0% {
                opacity: 0;
                transform: scale(0.18) rotate(0deg);
            }
            18% {
                opacity: 1;
            }
            100% {
                opacity: 0;
                transform: scale(1.32) rotate(26deg);
            }
        }

        @keyframes firework-pop {
            0% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }
            100% {
                opacity: 0;
                transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2);
            }
        }


@media (prefers-reduced-motion: reduce) {
    .choice.answer-bump, .choice.answer-shake, .choice.correct::before, .firework-particle, .is-correct-lift { animation:none !important; }
    .fireworks-layer { display:none; }
}

/* Exercises' curriculum keeps answer faces flat; retain it on every shared surface. */
.choice.correct, .choice.incorrect { box-shadow:none; }

/* Paint and move the Chinese prompt together with the chosen answer. */
#promptMain.answer-prompt-correct,
.placement-content .placement-chinese.answer-prompt-correct {
    color: #16a34a;
    animation: prompt-card-correct-lift .36s ease-out both;
}
#promptMain.answer-prompt-incorrect,
.placement-content .placement-chinese.answer-prompt-incorrect {
    color: #dc2626;
    animation: answer-shake .34s ease;
}
@media (prefers-reduced-motion: reduce) {
    .answer-prompt-correct, .answer-prompt-incorrect { animation: none !important; }
}
