/**
 * Celebration & Animation Effects
 *
 * - Win flash overlay
 * - Pot celebrate animation
 * - All-in player indicator
 * - Confetti particle system
 */

/* ============ WIN CELEBRATION EFFECTS ============ */

/* Confetti Canvas */
.confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-flying-chips);
}

/* Teal Win Flash Overlay (Alpha v0.5 style) */
.win-flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(74, 157, 122, 0.35) 0%, rgba(127, 224, 180, 0.15) 40%, rgba(74, 157, 122, 0) 70%);
    opacity: 0;
    pointer-events: none;
    z-index: calc(var(--z-flying-chips) - 1);
}

.win-flash-overlay.active {
    animation: winFlash 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Pot celebration animation - Subtle & Elegant */
.pot-display.celebrating {
    animation: potCelebrate 0.5s var(--ease-bounce);
}

.pot-display.celebrating .pot-label,
.pot-display.celebrating #pot-amount {
    text-shadow: 0 0 12px rgba(74, 157, 122, 0.6), 0 0 24px rgba(74, 157, 122, 0.3);
}

/* ============ ALL-IN PLAYER INDICATOR ============ */

.player-box.all-in-active {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4), 0 0 40px rgba(239, 68, 68, 0.2);
    /* Use opacity animation instead of box-shadow for GPU acceleration */
    animation: allInPlayerPulse 1.5s ease-in-out infinite;
    will-change: opacity;
}

.player-box.all-in-active::before {
    content: 'ALL IN';
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.65em;
    font-weight: var(--font-weight-extrabold);
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
    z-index: var(--z-modal);
    animation: allInLabelPulse 1.5s ease-in-out infinite;
    will-change: transform;
}

/* Calm mode keeps all-in indication present but restrained. */
body.calm-mode .player-box.all-in-active {
    border-color: rgba(239, 68, 68, 0.45) !important;
    box-shadow: none;
    animation: none;
}

body.calm-mode .player-box.all-in-active::before {
    display: none;
}

/* ============ CONFETTI SYSTEM ============ */

.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: var(--z-max);
}

.confetti-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall var(--fall-duration, 2.5s) var(--ease-out-smooth) forwards;
    animation-delay: var(--delay, 0s);
    transform-origin: center;
}

/* Tier-specific confetti colors */
.confetti-particle--bronze {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
}

.confetti-particle--silver {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
}

.confetti-particle--gold {
    background: linear-gradient(135deg, #ffd700, #ffec8b);
}

@media (prefers-reduced-motion: reduce) {
    .confetti-particle {
        display: none;
    }
}
