﻿/* ===== Confetti-Animation ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}
.confetti-piece {
    position: fixed;
    top: -20px;
    left: calc(50% + var(--confetti-start-x, 0px));
    width: 10px;
    height: 18px;
    background: var(--confetti-color);
    border-radius: 2px;
    animation: confetti-fall 2.5s ease-out forwards;
    animation-delay: var(--confetti-delay);
    opacity: 0;
}
@keyframes confetti-fall {
    0% { opacity: 1; transform: translateY(0) translateX(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(100vh) translateX(var(--confetti-x)) rotate(var(--confetti-rotate)); }
}
.celebration-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center;
    z-index: 10000; pointer-events: none; animation: fade-in 0.3s ease-out;
}
.celebration-content {
    text-align: center;
    animation: celebration-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    background: white; padding: 40px 50px; border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); position: relative; z-index: 10001;
}
.celebration-emoji { font-size: 4em; animation: bounce 0.6s infinite; }
.celebration-title {
    font-size: 2em; font-weight: 900;
    background: linear-gradient(135deg, #f9a825, #ff6f00);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin: 10px 0 5px;
}
.celebration-subtitle { font-size: 1.2em; color: #5d4037; margin-bottom: 15px; }
.celebration-stars { display: flex; justify-content: center; gap: 8px; font-size: 2em; }
.celebration-star {
    display: inline-block; animation: star-spin 0.6s ease-out forwards;
    animation-delay: var(--star-delay); opacity: 0; transform: scale(0) rotate(-180deg);
}
@keyframes star-spin {
    0% { opacity: 0; transform: scale(0) rotate(-180deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.celebration-combo { margin-top: 15px; font-size: 1.1em; font-weight: bold; color: #ff6f00; animation: pulse-combo 1s infinite; }
@keyframes pulse-combo { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes celebration-pop { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
.points-popup {
    position: absolute; top: -10px; right: 60px;
    font-size: 1.3em; font-weight: bold; color: #ffd600;
    animation: float-up 1.2s ease-out forwards;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3); pointer-events: none;
}
@keyframes float-up {
    0% { opacity: 1; transform: translateY(0) scale(0.5); }
    50% { opacity: 1; transform: translateY(-30px) scale(1.2); }
    100% { opacity: 0; transform: translateY(-60px) scale(1); }
}
.header-glow { animation: header-pulse 0.5s ease-out; }
@keyframes header-pulse {
    0% { background: rgba(255,255,255,0); }
    50% { background: rgba(255,255,255,0.25); }
    100% { background: rgba(255,255,255,0); }
}
.star-bounce { display: inline-block; animation: star-bounce 0.4s ease-out; }
@keyframes star-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.5) rotate(20deg); }
    100% { transform: scale(1) rotate(0deg); }
}
.choice-correct { animation: correct-pulse 0.4s ease-out; }
.choice-wrong { animation: shake 0.4s ease-out; }
@keyframes correct-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}
.chip-correct { animation: chip-pop 0.3s ease-out; }
.chip-wrong { animation: shake 0.3s ease-out; }
@keyframes chip-pop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.result-banner {
    border-radius: 12px; padding: 24px; text-align: center; margin-bottom: 20px;
    animation: slide-up 0.5s ease-out;
}
.result-perfect { background: linear-gradient(135deg, #fff3e0, #ffe082); }
.result-good { background: linear-gradient(135deg, #e8f5e9, #a5d6a7); }
.result-tryagain { background: linear-gradient(135deg, #fce4ec, #ef9a9a); }
.result-emoji { font-size: 3em; margin-bottom: 8px; animation: bounce 0.6s infinite; }
@keyframes slide-up {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}
.score-animate {
    display: inline-block; font-size: 1.5em; font-weight: bold; color: #e65100;
    animation: score-pop 0.5s ease-out;
}
@keyframes score-pop {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}
