/**
 * Turn States & Bot States
 * Active turn indicators, glow rings, critical decision,
 * bot thinking/pressure, tank timer, overbet pressure,
 * bot mood, and player action text.
 *
 * Extracted from components/seat-layouts.css for single-responsibility.
 *
 * NOTE: Every .player-nameplate element also carries .player-box,
 * so .player-box selectors are sufficient — no .player-nameplate
 * variants needed.
 */

/* ============ ACTIVE TURN STATES ============ */
/* Active turn — higher specificity to override seat-specific base styles */
.player-seat .player-box.active,
.player-seat.hero .player-box.active,
.player-seat.opponent .player-box.active {
    border: 2px solid rgba(var(--turn-gold-rgb), 1);
    background: rgba(40, 35, 15, 0.95);
    box-shadow: 0 0 12px rgba(var(--turn-gold-rgb), 0.6);
}

/* Animated outer glow ring for active turn - dramatic visual feedback */
.player-box.active::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 26px;
    border: 2px solid transparent;
    background: linear-gradient(90deg,
        rgba(var(--turn-gold-rgb), 0.8),
        rgba(255, 220, 80, 1),
        rgba(var(--turn-gold-rgb), 0.8),
        rgba(255, 165, 0, 1),
        rgba(var(--turn-gold-rgb), 0.8)
    ) border-box;
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    /* Pulse only — hue-rotate filter animation removed (causes repaints) */
    animation: glowRingPulse 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Glow ring pulse animation - synced with pulseSeat */
@keyframes glowRingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

/* "TO ACT" label - shows above the portrait */
.player-box.active::after {
    content: 'TO ACT';
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #ffc107 0%, #e0a800 100%);
    color: #1a1500;
    padding: 3px 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 8px rgba(0,0,0,0.4), 0 0 8px rgba(255, 193, 7, 0.5);
    z-index: var(--z-modal);
    animation: toActBounce 2s ease-in-out infinite, toActGlow 2s ease-in-out infinite;
    will-change: transform;
}

/* Hide TO ACT for hero - portrait glow is enough */
.player-seat.hero .player-box.active::after {
    display: none;
    content: none;
}

.player-box.active .player-stack {
    color: var(--accent-light);
}

/* ============ VISUAL HIERARCHY: ACTIVE PLAYER SPOTLIGHT ============ */

/* Active player gets elevated z-index */
.player-seat:has(.player-box.active) {
    z-index: calc(var(--z-seat-base) + 50);
}

/* Active player box gets subtle scale up */
.player-box.active {
    transform: scale(1.02);
    transition: transform 0.3s var(--ease-bounce);
}

/* ============ BOT TURN INDICATOR ============ */
/* Subtle silver-blue spotlight when a bot seat is acting.
   Distinct from hero gold — cool-toned, flash-in entrance, smooth fade-out. */

.player-seat .player-box.bot-turn,
.player-seat.opponent .player-box.bot-turn,
.player-seat.cpu-seat .player-box.bot-turn {
    border-color: rgba(170, 200, 240, 0.55);
    box-shadow: 0 0 10px rgba(160, 190, 235, 0.35);
    animation: botTurnFlash 0.3s ease-out;
    transition: border-color 0.25s ease-out, box-shadow 0.25s ease-out;
}

/* Bot-turn overrides thinking's gray border when both active */
.player-seat .player-box.bot-turn.thinking,
.player-seat.opponent .player-box.bot-turn.thinking {
    border-color: rgba(170, 200, 240, 0.55);
    box-shadow: 0 0 10px rgba(160, 190, 235, 0.35), inset 0 0 15px var(--alpha-black-30);
}

/* Elevate acting bot's seat (less than hero's +50) */
.player-seat:has(.player-box.bot-turn) {
    z-index: calc(var(--z-seat-base) + 20);
}

/* Quick flash entrance — draws the eye then settles */
@keyframes botTurnFlash {
    0%   { border-color: rgba(170, 200, 240, 0); box-shadow: 0 0 0 rgba(160, 190, 235, 0); }
    20%  { border-color: rgba(200, 225, 255, 1); box-shadow: 0 0 20px rgba(180, 210, 255, 0.6); }
    100% { border-color: rgba(170, 200, 240, 0.55); box-shadow: 0 0 10px rgba(160, 190, 235, 0.35); }
}

@keyframes toActGlow {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 8px rgba(255, 193, 7, 0.5); }
    50%      { box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 14px rgba(255, 193, 7, 0.8); }
}

/* Critical decision state - red border pulse (synced to 1.5s) */
/* Higher specificity to override active state border */
.player-seat .player-box.active.critical-decision,
.player-seat.hero .player-box.active.critical-decision {
    border-color: rgba(var(--color-danger-rgb), 0.8);
    animation: criticalPulse 1.5s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% { border-color: rgba(var(--color-danger-rgb), 0.6); }
    50% { border-color: rgba(var(--color-danger-rgb), 1); }
}

/* Bot Thinking/Tank Timer - The Watchful State */
/* Not processing. Observing. Weighing. */
.player-box.thinking {
    border-color: rgba(180, 180, 190, 0.4);
    box-shadow: 0 0 30px var(--alpha-black-50), inset 0 0 20px var(--alpha-black-30);
    transition: border-color 1s ease-out, box-shadow 1s ease-out;
}

/* Pressure levels - The weight of being read */
.player-box.thinking.pressure-1 {
    border-color: rgba(200, 180, 160, 0.5);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.55), inset 0 0 25px rgba(0, 0, 0, 0.35);
}

.player-box.thinking.pressure-2 {
    border-color: rgba(180, 140, 120, 0.6);
    box-shadow: 0 0 40px var(--alpha-black-60), inset 0 0 30px rgba(80, 40, 30, 0.2);
}

.player-box.thinking.pressure-3 {
    border-color: rgba(160, 100, 90, 0.7);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.65), inset 0 0 35px rgba(120, 50, 40, 0.25);
}

/* Flying chip styles are in arena/arena-betting.css */

/* ============ Tank Timer Container ============ */
/* Dot visibility and colors are controlled entirely by TankTimerManager (JS). */
/* CSS only handles container positioning and box pressure effects. */

.tank-timer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-in-out);
    z-index: var(--z-toast);
    pointer-events: none;
}

.tank-timer.active {
    opacity: 1;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    /* Default hidden - JS sets opacity, background, box-shadow inline */
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--duration-quick) var(--ease-in-out), transform var(--duration-quick) var(--ease-in-out);
}

/* ============ vsOverbet Pressure - Box effects only ============ */

.player-box.overbet-pressure {
    border-color: rgba(200, 80, 80, 0.6);
    box-shadow: 0 0 40px var(--alpha-black-60), inset 0 0 25px rgba(150, 50, 50, 0.3);
    transition: border-color 0.5s ease-out, box-shadow 0.5s ease-out;
}

.player-box.overbet-pressure.overbet-pressure-1 {
    border-color: rgba(220, 70, 70, 0.7);
    box-shadow: 0 0 45px rgba(0, 0, 0, 0.65), inset 0 0 30px rgba(180, 50, 50, 0.35);
}

.player-box.overbet-pressure.overbet-pressure-2 {
    border-color: rgba(240, 60, 60, 0.8);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7), inset 0 0 35px rgba(200, 40, 40, 0.4);
}

.player-box.overbet-pressure.overbet-pressure-3 {
    border-color: rgba(255, 50, 50, 0.9);
    box-shadow: 0 0 55px rgba(0, 0, 0, 0.75), inset 0 0 40px rgba(220, 30, 30, 0.45);
}
