/* Animation Keyframes - Premium Casino Effects */

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

/* Active player pulse */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(212, 175, 55, 0);
    }
}

/* Soft breathing pulse */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

/* Winner glow */
@keyframes winnerGlow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(212, 175, 55, 0.5),
            0 0 40px rgba(212, 175, 55, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 40px rgba(212, 175, 55, 0.8),
            0 0 80px rgba(212, 175, 55, 0.5);
        transform: scale(1.02);
    }
}

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

/* Message fade in/out */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Fade in */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Fade out */
@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

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

@keyframes slideInTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    60% {
        transform: scale(1.15);
    }
    80% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

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

@keyframes shakeSmall {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-3px); }
}

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

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    50% {
        transform: translateY(-15px);
        animation-timing-function: ease-in;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.bounce {
    animation: bounce 0.6s ease infinite;
}

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

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

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

.spinning {
    animation: spin 1s linear infinite;
}

/* ============================================
   CASINO-SPECIFIC ANIMATIONS
   ============================================ */

/* Confetti burst for big wins */
@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-300px) rotate(720deg) scale(0);
        opacity: 0;
    }
}

.confetti-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti 2s ease-out forwards;
}

/* Sparkle effect */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Number counter */
@keyframes countUp {
    0% {
        transform: scale(0.5) translateY(10px);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) translateY(-5px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.count-up {
    animation: countUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dealer button movement */
@keyframes moveDealerButton {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.4) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

.dealer-moving {
    animation: moveDealerButton 0.6s ease-in-out;
}

/* Flash for important events */
@keyframes flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.4;
    }
}

.flash {
    animation: flash 0.5s ease-in-out;
}

/* Glow pulse */
@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.8));
    }
}

.glow {
    animation: glowPulse 2s ease-in-out infinite;
}

/* ============================================
   TRANSITION HELPERS
   ============================================ */

.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

/* ============================================
   INTERACTIVE FEEDBACK
   ============================================ */

/* Button press effect */
.btn:active:not(:disabled) {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Card lift on hover */
.card-lift:hover {
    transform: translateY(-8px);
    transition: transform var(--transition-fast);
}

/* Ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.ripple:active::after {
    animation: ripple 0.6s ease-out;
}

/* Smooth number changes */
.smooth-number {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   AMBIENT EFFECTS
   ============================================ */

/* Floating particles */
@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-5px) translateX(-5px);
    }
    75% {
        transform: translateY(-15px) translateX(3px);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Subtle sway */
@keyframes sway {
    0%, 100% {
        transform: rotate(-1deg);
    }
    50% {
        transform: rotate(1deg);
    }
}

.sway {
    animation: sway 4s ease-in-out infinite;
}

/* Light flicker */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
    52% { opacity: 0.85; }
    54% { opacity: 0.95; }
}

.flicker {
    animation: flicker 4s ease-in-out infinite;
}

/* ============================================
   PHASE 1: VICTORY CELEBRATION
   Golden particles and chip rain
   ============================================ */

/* Victory overlay container */
.victory-celebration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

/* Golden particle burst */
@keyframes goldenParticleBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(-50% + var(--particle-x, 0px)),
            calc(-50% + var(--particle-y, -200px))
        ) scale(1);
        opacity: 0;
    }
}

.golden-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ffd700 0%, #ffaa00 50%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffaa00;
    animation: goldenParticleBurst 1.5s ease-out forwards;
}

/* Sparkle stars */
@keyframes sparkleStarBurst {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(
            calc(-50% + var(--star-x, 0px)),
            calc(-50% + var(--star-y, -100px))
        ) rotate(180deg) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(-50% + var(--star-x, 0px) * 1.5),
            calc(-50% + var(--star-y, -150px))
        ) rotate(360deg) scale(0);
        opacity: 0;
    }
}

.sparkle-star {
    position: absolute;
    width: 12px;
    height: 12px;
    background:
        linear-gradient(45deg, transparent 40%, #fff 45%, #fff 55%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, #fff 45%, #fff 55%, transparent 60%);
    animation: sparkleStarBurst 1.2s ease-out forwards;
}

/* Chip rain animation */
@keyframes chipRainFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 50px)) rotate(var(--chip-rotation, 720deg));
        opacity: 0.8;
    }
}

.rain-chip {
    position: absolute;
    top: -60px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    animation: chipRainFall var(--fall-duration, 2s) ease-in forwards;
    animation-delay: var(--fall-delay, 0s);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.rain-chip.gold {
    background: linear-gradient(145deg, #ffd700 0%, #daa520 50%, #b8860b 100%);
    border: 2px solid #fff;
}

.rain-chip.red {
    background: linear-gradient(145deg, #dc3545 0%, #c82333 50%, #a71d2a 100%);
    border: 2px solid #fff;
}

.rain-chip.blue {
    background: linear-gradient(145deg, #007bff 0%, #0056b3 50%, #004085 100%);
    border: 2px solid #fff;
}

.rain-chip.green {
    background: linear-gradient(145deg, #28a745 0%, #218838 50%, #1e7e34 100%);
    border: 2px solid #fff;
}

/* Screen flash on big win */
@keyframes victoryFlash {
    0% {
        background: rgba(255, 215, 0, 0);
    }
    15% {
        background: rgba(255, 215, 0, 0.3);
    }
    100% {
        background: rgba(255, 215, 0, 0);
    }
}

.victory-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    animation: victoryFlash 0.8s ease-out forwards;
    z-index: 999;
}

/* ============================================
   PHASE 1: CARD PEEK ANIMATION
   Lift corner on hover to peek
   ============================================ */

.human-seat .card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* Card peek - lift bottom-right corner */
.human-seat .card:not(.flipped):hover {
    transform: perspective(500px) rotateX(-5deg) rotateY(5deg) translateY(-3px);
}

.human-seat .card:not(.flipped):hover .card-back {
    transform-origin: top left;
    animation: cardPeekLift 0.3s ease-out forwards;
}

@keyframes cardPeekLift {
    0% {
        transform: rotateY(0deg);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    100% {
        transform: rotateY(-15deg);
        box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4);
    }
}

/* Peek hint glow */
.human-seat .card:not(.flipped)::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 25px;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 215, 0, 0.3) 100%);
    border-radius: 0 0 6px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.human-seat .card:not(.flipped):hover::after {
    opacity: 1;
}

/* Long press peek - shows card face briefly */
.human-seat .card.peeking .card-back {
    animation: peekReveal 0.4s ease-out forwards;
}

@keyframes peekReveal {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(-45deg);
    }
    100% {
        transform: rotateY(-45deg);
    }
}

/* ============================================
   PHASE 1: POT GROWTH VISUALIZATION
   Vignette deepens, glow intensifies
   ============================================ */

/* Pot size classes applied to game container */
#game-container.pot-small {
    --pot-intensity: 0;
}

#game-container.pot-medium {
    --pot-intensity: 1;
}

#game-container.pot-large {
    --pot-intensity: 2;
}

#game-container.pot-huge {
    --pot-intensity: 3;
}

/* Dynamic vignette based on pot size */
#game-container::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    transition: box-shadow 1s ease;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, calc(0.3 + var(--pot-intensity, 0) * 0.1));
}

/* Pot glow effect */
#pot-chips {
    transition: filter 0.5s ease, transform 0.3s ease;
}

#game-container.pot-medium #pot-chips {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

#game-container.pot-large #pot-chips {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    transform: scale(1.05);
}

#game-container.pot-huge #pot-chips {
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.7));
    transform: scale(1.1);
    animation: potPulse 1s ease-in-out infinite;
}

@keyframes potPulse {
    0%, 100% {
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.9));
    }
}

/* Pot amount text glow */
#pot-amount {
    transition: text-shadow 0.5s ease, transform 0.3s ease;
}

#game-container.pot-large #pot-amount {
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

#game-container.pot-huge #pot-amount {
    text-shadow: 0 0 30px rgba(255, 215, 0, 1);
    animation: potAmountPulse 0.8s ease-in-out infinite;
}

@keyframes potAmountPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ============================================
   PHASE 1: CHIP ARC ANIMATION
   Chips fly from pot to winner
   ============================================ */

@keyframes chipArcToWinner {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translate(
            calc(var(--arc-x, 0px) * 0.5),
            calc(var(--arc-y, 0px) * 0.5 - 80px)
        ) scale(1.3) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--arc-x, 0px), var(--arc-y, 0px)) scale(0.8) rotate(360deg);
        opacity: 0;
    }
}

.chip-arc {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    animation: chipArcToWinner var(--arc-duration, 0.8s) ease-out forwards;
    animation-delay: var(--arc-delay, 0s);
    z-index: 100;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.4);
}

.chip-arc.gold {
    background: linear-gradient(145deg, #ffd700 0%, #daa520 50%, #b8860b 100%);
    border: 2px solid #fff;
}

.chip-arc.black {
    background: linear-gradient(145deg, #333 0%, #1a1a1a 50%, #000 100%);
    border: 2px solid #888;
}

.chip-arc.purple {
    background: linear-gradient(145deg, #9b59b6 0%, #8e44ad 50%, #6c3483 100%);
    border: 2px solid #fff;
}

.chip-arc.green {
    background: linear-gradient(145deg, #2ecc71 0%, #27ae60 50%, #1e8449 100%);
    border: 2px solid #fff;
}

.chip-arc.blue {
    background: linear-gradient(145deg, #3498db 0%, #2980b9 50%, #1a5276 100%);
    border: 2px solid #fff;
}

.chip-arc.red {
    background: linear-gradient(145deg, #e74c3c 0%, #c0392b 50%, #922b21 100%);
    border: 2px solid #fff;
}

/* Winner highlight intensification during chip collection */
.player-seat.collecting-chips {
    animation: collectingPulse 0.5s ease-in-out infinite;
}

@keyframes collectingPulse {
    0%, 100% {
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.5),
            0 0 40px rgba(255, 215, 0, 0.6);
    }
    50% {
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.5),
            0 0 60px rgba(255, 215, 0, 0.9);
    }
}

/* ============================================
   PHASE 2: WIN/LOSS STREAK DISPLAY
   Shows hot/cold streak indicator
   ============================================ */

.streak-display {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 30, 0.9) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.streak-display.visible {
    opacity: 1;
}

.streak-display.hot {
    border-color: rgba(255, 100, 50, 0.6);
    box-shadow: 0 0 15px rgba(255, 100, 50, 0.4);
}

.streak-display.cold {
    border-color: rgba(100, 150, 255, 0.6);
    box-shadow: 0 0 15px rgba(100, 150, 255, 0.3);
}

.streak-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.streak-indicator.win {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.streak-indicator.loss {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* Hot streak fire animation */
@keyframes hotStreakFlame {
    0%, 100% {
        text-shadow: 0 0 10px #ff6b35, 0 0 20px #ff4500;
    }
    50% {
        text-shadow: 0 0 20px #ff6b35, 0 0 40px #ff4500, 0 0 60px #ff0000;
    }
}

.streak-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

.streak-label.hot {
    color: #ff6b35;
    animation: hotStreakFlame 1s ease-in-out infinite;
}

.streak-label.cold {
    color: #60a5fa;
}

/* ============================================
   PHASE 2: BLINDNESS INDICATOR WITH COUNTDOWN
   Visual countdown for blind rounds remaining
   ============================================ */

.blind-countdown {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.5);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 15;
}

.blind-countdown.visible {
    opacity: 1;
    transform: scale(1);
}

.blind-countdown.warning {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
    animation: blindWarningPulse 0.8s ease-in-out infinite;
}

@keyframes blindWarningPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 2px 16px rgba(239, 68, 68, 0.9);
    }
}

/* Blind progress ring */
.blind-progress-ring {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    z-index: 14;
}

.blind-progress-ring svg {
    transform: rotate(-90deg);
}

.blind-progress-ring .progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 3;
}

.blind-progress-ring .progress-bar {
    fill: none;
    stroke: #fbbf24;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.blind-progress-ring.warning .progress-bar {
    stroke: #ef4444;
}

/* ============================================
   PHASE 2: ALL-IN DRAMATIC SPOTLIGHT
   Dramatic lighting effect when going all-in
   ============================================ */

/* All-in spotlight overlay */
.all-in-spotlight {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    background: radial-gradient(
        ellipse 40% 60% at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
        transparent 0%,
        rgba(0, 0, 0, 0.7) 100%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
}

.all-in-spotlight.active {
    opacity: 1;
    animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
    0%, 100% {
        background: radial-gradient(
            ellipse 40% 60% at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
            transparent 0%,
            rgba(0, 0, 0, 0.7) 100%
        );
    }
    50% {
        background: radial-gradient(
            ellipse 45% 65% at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
            transparent 0%,
            rgba(0, 0, 0, 0.75) 100%
        );
    }
}

/* All-in player seat highlight */
.player-seat.all-in {
    animation: allInGlow 1.5s ease-in-out infinite;
}

@keyframes allInGlow {
    0%, 100% {
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.5),
            0 0 30px rgba(255, 0, 0, 0.4),
            0 0 60px rgba(255, 0, 0, 0.2);
    }
    50% {
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.5),
            0 0 50px rgba(255, 0, 0, 0.6),
            0 0 100px rgba(255, 0, 0, 0.3);
    }
}

/* All-in badge */
.all-in-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    padding: 4px 12px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    border: 2px solid #fca5a5;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.5);
    animation: allInBadgeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    z-index: 20;
}

@keyframes allInBadgeIn {
    0% {
        transform: translateX(-50%) scale(0) rotate(-10deg);
    }
    70% {
        transform: translateX(-50%) scale(1.2) rotate(5deg);
    }
    100% {
        transform: translateX(-50%) scale(1) rotate(0deg);
    }
}

/* ============================================
   PHASE 2: CHIP TOSS ANIMATION
   Chips flying from player to pot when betting
   ============================================ */

@keyframes chipTossToPot {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: translate(
            calc(var(--toss-x, 0px) * 0.3),
            calc(var(--toss-y, 0px) * 0.3 - 50px)
        ) scale(1.2) rotate(180deg);
    }
    100% {
        transform: translate(var(--toss-x, 0px), var(--toss-y, 0px)) scale(0.9) rotate(720deg);
        opacity: 1;
    }
}

.chip-toss {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    animation: chipTossToPot var(--toss-duration, 0.5s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--toss-delay, 0s);
    z-index: 100;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* Chip color variations for toss */
.chip-toss.gold { background: linear-gradient(145deg, #ffd700 0%, #daa520 50%, #b8860b 100%); border: 2px solid #fff; }
.chip-toss.black { background: linear-gradient(145deg, #333 0%, #1a1a1a 50%, #000 100%); border: 2px solid #888; }
.chip-toss.purple { background: linear-gradient(145deg, #9b59b6 0%, #8e44ad 50%, #6c3483 100%); border: 2px solid #fff; }
.chip-toss.green { background: linear-gradient(145deg, #2ecc71 0%, #27ae60 50%, #1e8449 100%); border: 2px solid #fff; }
.chip-toss.blue { background: linear-gradient(145deg, #3498db 0%, #2980b9 50%, #1a5276 100%); border: 2px solid #fff; }
.chip-toss.red { background: linear-gradient(145deg, #e74c3c 0%, #c0392b 50%, #922b21 100%); border: 2px solid #fff; }
.chip-toss.white { background: linear-gradient(145deg, #f5f5f5 0%, #e0e0e0 50%, #bdbdbd 100%); border: 2px solid #999; }

/* Chip landing splash effect */
@keyframes chipLandingSplash {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.chip-splash {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    animation: chipLandingSplash 0.4s ease-out forwards;
    pointer-events: none;
}

/* ============================================
   PHASE 2: SHOWDOWN ANTICIPATION
   Dramatic reveal animation
   ============================================ */

.showdown-active .player-seat:not(.folded) .card {
    animation: showdownCardGlow 1s ease-in-out infinite;
}

@keyframes showdownCardGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

/* Showdown reveal sequence */
@keyframes showdownReveal {
    0% {
        transform: rotateY(180deg) scale(1);
    }
    50% {
        transform: rotateY(90deg) scale(1.1);
    }
    100% {
        transform: rotateY(0deg) scale(1);
    }
}

.card.showdown-reveal .card-inner {
    animation: showdownReveal 0.6s ease-out forwards;
}

/* Tension overlay for showdown */
.showdown-tension {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.showdown-tension.active {
    opacity: 1;
}

/* ============================================
   PHASE 3: DYNAMIC TENSION LIGHTING
   Room lighting changes based on game tension
   ============================================ */

/* Tension levels applied to game container */
#game-container {
    --tension-level: 0;
    transition: all 1s ease;
}

#game-container.tension-calm {
    --tension-level: 0;
}

#game-container.tension-medium {
    --tension-level: 1;
}

#game-container.tension-high {
    --tension-level: 2;
}

/* Dynamic ambient lighting overlay */
.tension-lighting {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    transition: all 1.5s ease;
    mix-blend-mode: overlay;
}

/* Calm - warm amber glow */
#game-container.tension-calm .tension-lighting {
    background: radial-gradient(
        ellipse 80% 60% at 50% 30%,
        rgba(255, 200, 100, 0.05) 0%,
        transparent 70%
    );
}

/* Medium - cooler, more focused */
#game-container.tension-medium .tension-lighting {
    background:
        radial-gradient(
            ellipse 60% 50% at 50% 40%,
            rgba(255, 180, 80, 0.08) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse 100% 100% at 50% 100%,
            rgba(100, 50, 150, 0.1) 0%,
            transparent 50%
        );
}

/* High - dramatic red/purple tint, darker edges */
#game-container.tension-high .tension-lighting {
    background:
        radial-gradient(
            ellipse 50% 40% at 50% 40%,
            rgba(255, 100, 50, 0.12) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse 100% 100% at 50% 100%,
            rgba(150, 30, 80, 0.15) 0%,
            transparent 60%
        ),
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.1) 0%,
            transparent 30%,
            transparent 70%,
            rgba(0, 0, 0, 0.2) 100%
        );
    animation: tensionPulse 3s ease-in-out infinite;
}

@keyframes tensionPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* Table felt color shift with tension */
#game-table {
    transition: filter 1s ease, box-shadow 1s ease;
}

#game-container.tension-medium #game-table {
    filter: saturate(1.1) brightness(0.95);
}

#game-container.tension-high #game-table {
    filter: saturate(1.2) brightness(0.9) hue-rotate(-5deg);
    box-shadow:
        0 0 80px rgba(255, 50, 50, 0.15),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
}

/* Flickering effect for high tension */
#game-container.tension-high .game-table::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 100, 50, 0.03);
    animation: tensionFlicker 0.1s infinite;
    pointer-events: none;
}

@keyframes tensionFlicker {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ============================================
   PHASE 3: CROWD REACTIONS
   Visual crowd feedback for big moments
   ============================================ */

.crowd-reaction {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 30px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(30, 30, 50, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 30px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 200;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.crowd-reaction.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.crowd-reaction.cheer {
    border-color: rgba(34, 197, 94, 0.6);
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
}

.crowd-reaction.gasp {
    border-color: rgba(239, 68, 68, 0.6);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
}

.crowd-reaction.ooh {
    border-color: rgba(59, 130, 246, 0.6);
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
}

.crowd-reaction.wow {
    border-color: rgba(251, 191, 36, 0.6);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
    animation: wowPulse 0.5s ease-in-out infinite;
}

@keyframes wowPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

/* Crowd murmur visual - subtle moving shapes */
.crowd-murmur {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.crowd-murmur.active {
    opacity: 1;
}

.crowd-murmur::before,
.crowd-murmur::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 40px;
    background:
        radial-gradient(ellipse 10px 8px at 50% 100%, rgba(100, 100, 120, 0.3) 0%, transparent 100%),
        radial-gradient(ellipse 8px 6px at 30% 100%, rgba(80, 80, 100, 0.25) 0%, transparent 100%),
        radial-gradient(ellipse 12px 10px at 70% 100%, rgba(90, 90, 110, 0.28) 0%, transparent 100%);
    background-size: 100px 100%, 80px 100%, 120px 100%;
}

.crowd-murmur::before {
    animation: crowdWave 8s linear infinite;
}

.crowd-murmur::after {
    animation: crowdWave 12s linear infinite reverse;
    opacity: 0.7;
}

@keyframes crowdWave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   PHASE 3: SWIPE GESTURE INDICATORS
   Visual feedback for swipe actions
   ============================================ */

.swipe-indicator {
    position: fixed;
    pointer-events: none;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.swipe-indicator.active {
    opacity: 1;
}

.swipe-trail {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: swipeTrailFade 0.5s ease-out forwards;
}

@keyframes swipeTrailFade {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Swipe direction arrows */
.swipe-arrow {
    position: fixed;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 250;
}

.swipe-arrow.visible {
    opacity: 1;
    transform: scale(1);
}

.swipe-arrow.left { left: 20px; top: 50%; }
.swipe-arrow.right { right: 20px; top: 50%; }
.swipe-arrow.up { top: 20px; left: 50%; }
.swipe-arrow.down { bottom: 80px; left: 50%; }

/* Swipe action labels */
.swipe-label {
    position: fixed;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 251;
}

.swipe-label.visible {
    opacity: 1;
    transform: translateY(0);
}

.swipe-label.fold { background: linear-gradient(135deg, #dc2626, #991b1b); }
.swipe-label.call { background: linear-gradient(135deg, #16a34a, #15803d); }
.swipe-label.raise { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.swipe-label.see { background: linear-gradient(135deg, #d97706, #b45309); }

/* ============================================
   PHASE 3: HAPTIC PULSE VISUAL
   Visual feedback synchronized with haptics
   ============================================ */

.haptic-pulse {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 500;
    opacity: 0;
}

.haptic-pulse.light {
    animation: hapticLight 0.1s ease-out;
}

.haptic-pulse.medium {
    animation: hapticMedium 0.15s ease-out;
}

.haptic-pulse.heavy {
    animation: hapticHeavy 0.2s ease-out;
}

/* ============================================
   AI THINKING SPINNER
   Shows when AI player is thinking
   ============================================ */

.thinking-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    pointer-events: none;
    z-index: 25;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thinking-spinner.active {
    opacity: 1;
}

.thinking-spinner .spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spinnerRotate 1s linear infinite;
}

.thinking-spinner .spinner-ring:nth-child(2) {
    inset: 6px;
    border-top-color: #f5d67a;
    animation-duration: 0.8s;
    animation-direction: reverse;
}

.thinking-spinner .spinner-ring:nth-child(3) {
    inset: 12px;
    border-top-color: #fff;
    animation-duration: 1.2s;
}

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

/* Thinking text label */
.thinking-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #d4af37;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    animation: thinkingPulse 1.5s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Dim the seat slightly when thinking */
.player-seat.thinking {
    filter: brightness(0.85);
}

.player-seat.thinking .player-cards {
    filter: brightness(0.7);
}

@keyframes hapticLight {
    0% {
        opacity: 1;
        background: rgba(255, 255, 255, 0.05);
    }
    100% {
        opacity: 0;
        background: transparent;
    }
}

@keyframes hapticMedium {
    0% {
        opacity: 1;
        background: rgba(255, 255, 255, 0.1);
    }
    100% {
        opacity: 0;
        background: transparent;
    }
}

@keyframes hapticHeavy {
    0% {
        opacity: 1;
        background: rgba(255, 255, 255, 0.15);
        box-shadow: inset 0 0 50px rgba(255, 215, 0, 0.2);
    }
    100% {
        opacity: 0;
        background: transparent;
    }
}
