/* ===== ANIMATIONS ===== */

/* Countdown pulse */
@keyframes countPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.countdown-text {
    animation: countPulse 0.6s ease-out;
}

/* Screen shake on crash */
@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-8px) translateY(4px); }
    20% { transform: translateX(6px) translateY(-3px); }
    30% { transform: translateX(-5px) translateY(2px); }
    40% { transform: translateX(4px) translateY(-2px); }
    50% { transform: translateX(-3px) translateY(1px); }
    60% { transform: translateX(2px); }
    70% { transform: translateX(-1px); }
}

.shake {
    animation: screenShake 0.5s ease-out;
}

/* Flash red on crash */
@keyframes crashFlash {
    0% { box-shadow: inset 0 0 0 0 rgba(244, 67, 54, 0); }
    30% { box-shadow: inset 0 0 100px 20px rgba(244, 67, 54, 0.4); }
    100% { box-shadow: inset 0 0 0 0 rgba(244, 67, 54, 0); }
}

.crash-flash {
    animation: crashFlash 0.6s ease-out;
}

/* Gold flash for finish line */
@keyframes finishFlash {
    0% { box-shadow: inset 0 0 0 0 rgba(255, 215, 0, 0); }
    30% { box-shadow: inset 0 0 80px 15px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: inset 0 0 0 0 rgba(255, 215, 0, 0); }
}

.finish-flash {
    animation: finishFlash 0.8s ease-out;
}

/* Player card glow when active */
@keyframes activeGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(233, 69, 96, 0.2); }
    50% { box-shadow: 0 0 15px rgba(233, 69, 96, 0.4); }
}

.player-card.active-turn {
    animation: activeGlow 1.5s ease-in-out infinite;
}

/* Start button pulse */
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(233, 69, 96, 0); }
}

.start-race-btn {
    animation: btnPulse 2s infinite;
}

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Confetti */
@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    top: 0;
    z-index: 300;
    animation: confettiFall 3s ease-in forwards;
}
