/* ==========================================================================
   DrinkDuel — Keyframes & Dynamic Micro-Animations
   Juice, screen-shake, pulse, bounce & haptic visual feedback
   ========================================================================== */

/* Screen Shakes */
.shake-subtle {
    animation: anim-shake-subtle 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.shake-heavy {
    animation: anim-shake-heavy 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes anim-shake-subtle {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes anim-shake-heavy {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    15% { transform: translate3d(-8px, 6px, 0) scale(1.02); }
    30% { transform: translate3d(9px, -7px, 0) scale(0.99); }
    45% { transform: translate3d(-9px, -5px, 0) scale(1.02); }
    60% { transform: translate3d(7px, 6px, 0) scale(1); }
    75% { transform: translate3d(-4px, 2px, 0) scale(1.01); }
    100% { transform: translate3d(0, 0, 0) scale(1); }
}

/* Pulses */
@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 24px 8px rgba(231, 76, 60, 0);
    }
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(231, 76, 60, 0.4); }
    50% { border-color: rgba(231, 76, 60, 1); }
}

.pulse-alarm {
    animation: anim-alarm-strobe 0.22s infinite alternate ease-in-out;
}

@keyframes anim-alarm-strobe {
    0% {
        background-color: #8b0000;
        box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
    }
    50% {
        background-color: #e74c3c;
        box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.5), 0 0 50px rgba(255, 0, 0, 0.8);
    }
    100% {
        background-color: #ff1e1e;
        box-shadow: inset 0 0 120px rgba(255, 255, 0, 0.6), 0 0 80px rgba(255, 50, 0, 0.9);
    }
}

.anim-shot-pulse {
    animation: anim-shot-grow 0.5s infinite alternate ease-in-out;
}

@keyframes anim-shot-grow {
    0% { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 20px #ff0000); }
    100% { transform: scale(1.18) rotate(3deg); filter: drop-shadow(0 0 45px #ffd166); }
}

/* Bounces */
.bounce-in {
    animation: anim-bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes anim-bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Countdown Pop */
.countdown-pop {
    animation: anim-countdown 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes anim-countdown {
    0% {
        opacity: 0;
        transform: scale(2.2);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
    85% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.7);
    }
}

/* Shimmer on progress bars */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Card 3D Flip */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Fuse sizzle for timebomb */
@keyframes fuse-burn {
    0% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 4px #ffbe0b); }
    50% { transform: scale(1.18) rotate(15deg); filter: drop-shadow(0 0 12px #ff0055); }
    100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 4px #ffbe0b); }
}

.fuse-active {
    animation: fuse-burn 0.2s infinite ease-in-out;
}
