/* Particles animation for win effects */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ffce3e;
    opacity: 0;
    animation: particle-animation 2s ease-in-out forwards;
}

@keyframes particle-animation {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5);
    }
    25% {
        opacity: 0.8;
        transform: translate(var(--x, 0), var(--y, 0)) scale(1.2);
    }
    50% {
        opacity: 0.6;
        transform: translate(calc(var(--x, 0) * 1.5), calc(var(--y, 0) * 1.5)) scale(0.8);
    }
    75% {
        opacity: 0.4;
        transform: translate(calc(var(--x, 0) * 2), calc(var(--y, 0) * 2)) scale(0.6);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--x, 0) * 2.5), calc(var(--y, 0) * 2.5)) scale(0);
    }
}

/* Generate particles with random positions */
.particle:nth-child(1) { --x: 20px; --y: -30px; animation-delay: 0.1s; background-color: #ffce3e; }
.particle:nth-child(2) { --x: -25px; --y: -35px; animation-delay: 0.2s; background-color: #ff6b6b; }
.particle:nth-child(3) { --x: 30px; --y: -25px; animation-delay: 0.3s; background-color: #4ecdc4; }
.particle:nth-child(4) { --x: -35px; --y: -20px; animation-delay: 0.4s; background-color: #ffce3e; }
.particle:nth-child(5) { --x: 25px; --y: -40px; animation-delay: 0.5s; background-color: #ff6b6b; }
.particle:nth-child(6) { --x: -30px; --y: -45px; animation-delay: 0.6s; background-color: #4ecdc4; }
.particle:nth-child(7) { --x: 35px; --y: -35px; animation-delay: 0.7s; background-color: #ffce3e; }
.particle:nth-child(8) { --x: -40px; --y: -30px; animation-delay: 0.8s; background-color: #ff6b6b; }
.particle:nth-child(9) { --x: 45px; --y: -25px; animation-delay: 0.9s; background-color: #4ecdc4; }
.particle:nth-child(10) { --x: -50px; --y: -20px; animation-delay: 1.0s; background-color: #ffce3e; }

/* Additional particles for more celebration */
.particle:nth-child(11) { --x: 15px; --y: -50px; animation-delay: 0.15s; background-color: #ff6b6b; }
.particle:nth-child(12) { --x: -20px; --y: -55px; animation-delay: 0.25s; background-color: #4ecdc4; }
.particle:nth-child(13) { --x: 25px; --y: -60px; animation-delay: 0.35s; background-color: #ffce3e; }
.particle:nth-child(14) { --x: -30px; --y: -65px; animation-delay: 0.45s; background-color: #ff6b6b; }
.particle:nth-child(15) { --x: 35px; --y: -70px; animation-delay: 0.55s; background-color: #4ecdc4; }

/* Win celebration animation */
@keyframes celebrate {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 0 rgba(255, 206, 62, 0.4);
    }
    50% { 
        transform: scale(1.2); 
        box-shadow: 0 0 20px rgba(255, 206, 62, 0.8);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 rgba(255, 206, 62, 0.4);
    }
}

.win-animation {
    animation: celebrate 0.5s ease-in-out 3;
}

/* Confetti effect */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confetti-fall 3s ease-in-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-100vh) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Fireworks effect */
.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    opacity: 0;
    animation: firework-explode 1.5s ease-out forwards;
}

@keyframes firework-explode {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5);
    }
    50% {
        opacity: 0.8;
        transform: translate(var(--firework-x, 0), var(--firework-y, 0)) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--firework-x, 0) * 1.5), calc(var(--firework-y, 0) * 1.5)) scale(0);
    }
}