/* ===== CONFETTI ANIMATION (Score >= 90%) ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f00;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===== FIREWORKS ANIMATION (Score 70-89%) ===== */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework-explode 1s ease-out forwards;
}

@keyframes firework-explode {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

/* ===== BALLOONS ANIMATION (Score >= 70%) ===== */
.balloon-container {
    position: fixed;
    bottom: -150px;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.balloon {
    position: absolute;
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: balloon-float 4s ease-in-out forwards;
    box-shadow: inset -10px -10px 20px rgba(0,0,0,0.2);
}

.balloon::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 40px;
    background: #333;
}

.balloon::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 15px;
    width: 15px;
    height: 15px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
}

@keyframes balloon-float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) translateX(var(--drift)) rotate(var(--rotate));
        opacity: 0;
    }
}

/* ===== STARS ANIMATION (Score >= 85%) ===== */
.star-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.star {
    position: absolute;
    font-size: 30px;
    animation: star-twinkle 1.5s ease-in-out forwards;
}

@keyframes star-twinkle {
    0%, 100% { 
        transform: scale(0) rotate(0deg); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.5) rotate(180deg); 
        opacity: 1; 
    }
}

/* ===== ENCOURAGING MESSAGE (Score < 60%) ===== */
.encourage-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: encourage-bounce 1s ease-in-out;
    pointer-events: none;
}

.encourage-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 50px;
    border-radius: 20px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: encourage-pulse 0.5s ease-in-out 3;
}

@keyframes encourage-bounce {
    0%, 100% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    75% { transform: translate(-50%, -50%) scale(0.9); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes encourage-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== TROPHY ANIMATION (Score >= 95%) ===== */
.trophy-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: trophy-appear 1s ease-out forwards;
    pointer-events: none;
}

.trophy {
    font-size: 120px;
    animation: trophy-rotate 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px gold);
}

@keyframes trophy-appear {
    0% { 
        transform: translate(-50%, -50%) scale(0) rotate(-180deg); 
        opacity: 0;
    }
    60% { 
        transform: translate(-50%, -50%) scale(1.2) rotate(10deg); 
    }
    100% { 
        transform: translate(-50%, -50%) scale(1) rotate(0deg); 
        opacity: 1;
    }
}

@keyframes trophy-rotate {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

/* ===== SADFACE ANIMATION (Score < 50%) ===== */
.sadface-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: sadface-shake 0.5s ease-in-out 3;
    pointer-events: none;
}

.sadface {
    font-size: 100px;
    animation: sadface-cry 2s ease-in-out infinite;
}

@keyframes sadface-shake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-50%, -50%) rotate(-5deg); }
    75% { transform: translate(-50%, -50%) rotate(5deg); }
}

@keyframes sadface-cry {
    0%, 100% { filter: grayscale(0%); }
    50% { filter: grayscale(100%); }
}

/* ===== PARTICLE BURST (General) ===== */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particle-burst 1s ease-out forwards;
}

@keyframes particle-burst {
    to {
        transform: translate(var(--px), var(--py)) scale(0);
        opacity: 0;
    }
}

/* ===== FADE OUT ANIMATION ===== */
.fade-out {
    animation: fade-out 0.5s ease-out forwards;
}

@keyframes fade-out {
    to { opacity: 0; }
}

/* Add to celebration-animations.css */

@media (max-width: 768px) {
    /* Reduce particle count on mobile */
    .confetti-container {
        /* Mobile will use fewer particles via JS */
        
    }
    
    .balloon {
        width: 40px;
        height: 60px;
        font-size: 0.8em;
    }
    
    .trophy {
        font-size: 80px;
    }
    
    .encourage-message {
        padding: 20px 30px;
        font-size: 18px;
        max-width: 90%;
    }
    
    .star {
        font-size: 20px;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .confetti,
    .firework,
    .balloon,
    .star,
    .trophy {
        animation-duration: 0.5s !important;
    }
}