/* ============================================
   ANIMATIONS GÉNÉRALES
   ============================================ */

/* Fade In */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pop Effect */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Number Pop */
@keyframes numberPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-10deg);
    }
    60% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* Monster Appear */
@keyframes monsterAppear {
    0% {
        opacity: 0;
        transform: scale(0) translateY(20px);
    }
    60% {
        transform: scale(1.2) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   ANIMATIONS DE FEEDBACK
   ============================================ */

/* Shake (erreur) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Correct Pop */
@keyframes correctPop {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Star Pop */
@keyframes starPop {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.3) rotate(20deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

/* ============================================
   ANIMATIONS DE CÉLÉBRATION
   ============================================ */

/* Celebration Pop */
@keyframes celebrationPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Confetti colors */
.confetti:nth-child(odd) {
    background: var(--color-primary);
}

.confetti:nth-child(even) {
    background: var(--color-accent);
}

.confetti:nth-child(3n) {
    background: var(--color-secondary);
}

.confetti:nth-child(4n) {
    background: var(--color-spark);
}

.confetti:nth-child(5n) {
    background: var(--color-glub);
}

/* ============================================
   ANIMATIONS DE PULSE
   ============================================ */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(78, 205, 196, 0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
    }
}

/* ============================================
   ANIMATIONS DE ROUE
   ============================================ */

@keyframes wheelSpin {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* Wheel item hover effect */
.wheel-item {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   ANIMATIONS DE TRANSITION D'ÉCRAN
   ============================================ */

.screen-enter {
    animation: screenEnter 0.4s ease forwards;
}

.screen-exit {
    animation: screenExit 0.3s ease forwards;
}

@keyframes screenEnter {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes screenExit {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50px);
    }
}

/* ============================================
   ANIMATIONS DE DRAG & DROP
   ============================================ */

.dragging {
    animation: dragging 0.2s ease;
    z-index: 1000;
}

@keyframes dragging {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.drop-target-active {
    animation: dropTargetPulse 0.8s ease-in-out infinite;
}

@keyframes dropTargetPulse {
    0%, 100% {
        border-color: var(--color-secondary);
        background: rgba(78, 205, 196, 0.1);
    }
    50% {
        border-color: var(--color-primary);
        background: rgba(255, 107, 107, 0.2);
    }
}

/* ============================================
   ANIMATIONS DE LOADING
   ============================================ */

@keyframes loading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: loading 1s linear infinite;
}

/* ============================================
   ANIMATIONS DE COMPTAGE
   ============================================ */

.counting {
    animation: countingPulse 0.5s ease;
}

@keyframes countingPulse {
    0% { transform: scale(1); color: var(--color-primary); }
    50% { transform: scale(1.3); color: var(--color-secondary); }
    100% { transform: scale(1); color: var(--color-primary); }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
