:root {
    --accent: #FF6B00;
    --glass-bg: rgba(10, 10, 10, 0.75);
    --glass-border: rgba(255, 107, 0, 0.3);
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

/* ── Black-bar letterbox/pillarbox so 16:9 never breaks ─────────────── */
body {
    margin: 0; padding: 0;
    background: #000;               /* black bars */
    color: white;
    font-family: 'Inter', sans-serif;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── 16:9 locked container — always fits inside viewport ────────────── */
#game-container {
    /* Strict 16:9: take the largest 16:9 rect that fits the viewport */
    width:  min(100vw, calc(100vh * 16 / 9));
    height: min(100vh, calc(100vw *  9 / 16));
    position: relative;
    overflow: hidden;
    background: url('/assets/bg-and-table.png') center center / cover no-repeat;
}

/* Dark vignette at bottom for button readability */
#game-container::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 240px;
    background: linear-gradient(to top, rgba(0,0,0,0.68) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ── Table area — transparent, full viewport ────────────────────────── */
#table-area {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
}

#players-container {
    position: absolute;
    inset: 0;
}

/* ── Pot label ──────────────────────────────────────────────────────── */
#board-pot {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    font-weight: 800;
    color: #FFD700;
    background: rgba(0,0,0,0.72);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,215,0,0.35);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 10;
    white-space: nowrap;
}

/* ── Community cards ────────────────────────────────────────────────── */
#board-cards {
    position: absolute;
    top: 51%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

/* ── Card styles ────────────────────────────────────────────────────── */
.card {
    width: 68px;
    height: 98px;
    border-radius: 7px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.85);
    background-color: white;
    position: relative;
    user-select: none;
    transition: transform 0.3s;
}
#board-cards .card:nth-child(1) { transform: rotate(-3deg) translateY(2px); }
#board-cards .card:nth-child(2) { transform: rotate(2deg) translateY(-2px); }
#board-cards .card:nth-child(3) { transform: rotate(-1deg); }
#board-cards .card:nth-child(4) { transform: rotate(3deg) translateY(2px); }
#board-cards .card:nth-child(5) { transform: rotate(-2deg) translateY(-1px); }

.card-face { padding: 4px; border: 1px solid #ccc; border-radius: 7px; }
.card-back {
    background: repeating-linear-gradient(45deg, #111, #111 5px, #222 5px, #222 10px);
    border: 2px solid var(--accent);
    border-radius: 7px;
}
.card-top { position: absolute; top: 5px; left: 7px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.card-rank { font-size: 22px; font-weight: 800; font-family: 'Inter', sans-serif; }
.card-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 42px; }

/* ── Winning & Dimmed Card Styles ─────────────────────────────────── */
.card.winning-card {
    border: 2.5px solid #FFD700 !important;
    box-shadow: 0 0 18px #FFD700, 0 0 32px rgba(255, 215, 0, 0.8), 0 4px 14px rgba(0,0,0,0.9) !important;
    animation: winnerCardPulse 1.6s ease-in-out infinite alternate !important;
    z-index: 55 !important;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
}

#board-cards .card.winning-card {
    transform: translateY(-10px) scale(1.1) !important;
}

.player-cards .card.winning-card {
    transform: translateY(-6px) scale(1.12) !important;
}

@keyframes winnerCardPulse {
    0% {
        box-shadow: 0 0 14px #FFD700, 0 0 24px rgba(255, 215, 0, 0.6);
        border-color: #FFD700;
    }
    100% {
        box-shadow: 0 0 24px #FFD700, 0 0 40px rgba(255, 215, 0, 0.95);
        border-color: #FFF275;
    }
}

.card.dimmed-card {
    opacity: 0.35 !important;
    filter: grayscale(60%) brightness(0.65) !important;
    transition: all 0.4s ease;
}

/* Card flip reveal animation */
.anim-card-flip {
    animation: cardFlipReveal 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardFlipReveal {
    0% { transform: scale(0.8) rotateY(90deg); opacity: 0; }
    50% { transform: scale(1.1) rotateY(0deg); opacity: 1; }
    100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

/* ── Player node — flex column by default ───────────────────────────── */
.player-node {
    position: absolute;
    width: 120px;
    text-align: center;
    transition: all 0.3s ease;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.player-node.active-turn { transform: scale(1.08); }
.player-node.active-turn .player-avatar {
    box-shadow: 0 0 24px var(--accent), 0 0 6px var(--accent);
    border-color: var(--accent);
}
.player-node.winner .player-avatar {
    box-shadow: 0 0 30px #FFD700, 0 0 10px #FFD700;
    border-color: #FFD700;
}
.player-node.folded { opacity: 0.28; filter: grayscale(100%); }

.player-avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 2px solid #666;
    object-fit: cover;
    background: #1a1a1a;
    box-shadow: 0 4px 10px rgba(0,0,0,0.8);
    flex-shrink: 0;
}
.player-info-box {
    background: rgba(0,0,0,0.72);
    border-radius: 7px;
    padding: 3px 6px;
    border: 1px solid rgba(255,107,0,0.22);
    backdrop-filter: blur(8px);
    width: 100%;
}
.player-name  { font-weight: 800; font-size: 11px; color: #fff; }
.player-stack { font-size: 10px; color: #aaa; }

.player-action-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #fff;
    background: #2b7cff;
    padding: 2px 9px;
    border-radius: 11px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0,0,0,0.65);
    z-index: 40;
    animation: badgePop 0.22s ease;
}
@keyframes badgePop {
    from { transform: translateX(-50%) translateY(4px) scale(0.6); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0)   scale(1);   opacity: 1; }
}
.player-action-badge.action-call  { background: #2b7cff; }
.player-action-badge.action-raise { background: #ff8c1a; box-shadow: 0 0 10px rgba(255,140,26,0.7); }
.player-action-badge.action-allin {
    background: #e23b3b;
    box-shadow: 0 0 12px rgba(226,59,59,0.9);
    animation: badgePop 0.22s ease, allinPulse 1s ease-in-out infinite 0.3s;
}
@keyframes allinPulse { 0%,100% { box-shadow: 0 0 12px rgba(226,59,59,0.9); } 50% { box-shadow: 0 0 22px rgba(226,59,59,1); } }
.player-action-badge.action-fold {
    background: #555;
    box-shadow: none;
    color: #ccc;
}
.player-action-badge.action-show {
    background: #FFD700;
    color: #000;
    box-shadow: 0 0 8px #FFD700;
}

/* ── Position Badges (D, SB, BB buttons) ────────────────────────────── */
.pos-badge-container {
    position: absolute;
    top: 36px;
    right: 16px;
    display: flex;
    gap: 3px;
    z-index: 35;
    pointer-events: auto;
}

.pos-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    line-height: 1;
    cursor: default;
    user-select: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75), inset 0 1px 1.5px rgba(255, 255, 255, 0.8), inset 0 -1.5px 2px rgba(0, 0, 0, 0.5);
    animation: posBadgePop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: transform 0.15s ease;
}

.pos-badge:hover {
    transform: scale(1.18);
}

@keyframes posBadgePop {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* Dealer button (D) - Classic Ivory / White dealer puck with bold black letter */
.pos-badge-d {
    background: radial-gradient(circle at 35% 30%, #ffffff 0%, #ececec 55%, #b5b5b5 100%);
    color: #111111;
    border: 1.5px solid #ffffff;
    font-size: 11px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.7), 0 0 10px rgba(255,255,255,0.4), inset 0 1px 1px #fff, inset 0 -1.5px 2px rgba(0,0,0,0.4);
    text-shadow: 0 1px 0 rgba(255,255,255,0.9);
}

/* Small Blind (SB) - Sky Blue puck */
.pos-badge-sb {
    background: radial-gradient(circle at 35% 30%, #38bdf8 0%, #0284c7 60%, #0369a1 100%);
    color: #ffffff;
    border: 1.5px solid #7dd3fc;
    font-size: 8.5px;
    letter-spacing: -0.2px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.7), 0 0 10px rgba(56,189,248,0.5), inset 0 1px 1.5px rgba(255,255,255,0.8), inset 0 -1.5px 2px rgba(0,0,0,0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Big Blind (BB) - Amber / Orange puck */
.pos-badge-bb {
    background: radial-gradient(circle at 35% 30%, #fb923c 0%, #ea580c 60%, #9a3412 100%);
    color: #ffffff;
    border: 1.5px solid #fdba74;
    font-size: 8.5px;
    letter-spacing: -0.2px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.7), 0 0 10px rgba(251,146,60,0.5), inset 0 1px 1.5px rgba(255,255,255,0.8), inset 0 -1.5px 2px rgba(0,0,0,0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ── Dealer deck (croupier) ─────────────────────────────────────────── */
#dealer-deck {
    position: absolute;
    width: 46px; height: 64px;
    transform: translate(-50%, -50%);
    z-index: 16;
}
#dealer-deck .deck-card {
    position: absolute;
    width: 46px; height: 64px;
    border-radius: 5px;
    background: repeating-linear-gradient(45deg, #111, #111 5px, #222 5px, #222 10px);
    border: 1px solid var(--accent);
    box-shadow: 0 3px 9px rgba(0,0,0,0.85);
}
#dealer-deck .deck-card:nth-child(1) { transform: translate(-3px, -3px) rotate(-5deg); }
#dealer-deck .deck-card:nth-child(2) { transform: translate(-1px, -1px) rotate(-1deg); }
#dealer-deck .deck-card:nth-child(3) { transform: translate( 2px,  2px) rotate( 4deg); }
#dealer-deck .deck-label {
    position: absolute;
    bottom: -17px; left: 50%;
    transform: translateX(-50%);
    font-size: 8px; font-weight: 800; letter-spacing: 1px;
    color: var(--accent);
    background: rgba(0,0,0,0.72);
    padding: 1px 6px; border-radius: 6px;
    white-space: nowrap;
    border: 1px solid rgba(255,107,0,0.3);
}

.flying-card {
    position: fixed;
    width: 44px; height: 64px;
    border-radius: 4px;
    background: repeating-linear-gradient(45deg, #111, #111 5px, #222 5px, #222 10px);
    border: 1px solid var(--accent);
    box-shadow: 0 5px 16px rgba(0,0,0,0.85);
    z-index: 1200;
    pointer-events: none;
    transition: left 0.45s cubic-bezier(0.25,1,0.5,1),
                top 0.45s cubic-bezier(0.25,1,0.5,1),
                transform 0.45s cubic-bezier(0.25,1,0.5,1),
                opacity 0.45s ease;
}

/* ── Hole cards ─────────────────────────────────────────────────────── */
.player-cards {
    display: flex;
    justify-content: center;
    gap: 3px;
    /* Each .player-cards is independently positioned via inline style:
       left: X%; top: Y%; transform: translate(-50%, -50%);
       These % values come from SEAT_COORDS in script.js (debug-measured). */
}
.player-cards { transition: transform 0.45s cubic-bezier(0.2,1.3,0.4,1), filter 0.45s ease; }
.player-cards .card { width: 44px; height: 64px; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.9); }

/* Winning hand — hole cards rise and glow gold */
.player-cards.winner-cards {
    transform: translate(-50%, calc(-50% - 16px)) rotate(var(--rot, 0deg)) scale(1.12);
    filter: drop-shadow(0 0 10px #FFD700) drop-shadow(0 0 20px rgba(255,215,0,0.5));
    z-index: 60 !important;
}
.player-cards .card-rank   { font-size: 14px; }
.player-cards .card-center { font-size: 22px; }
/* Normal (top/bottom) players — fan with slight rotation */
.player-cards .card:nth-child(1) { transform: rotate(-8deg) translateY(4px); z-index: 1; }
.player-cards .card:nth-child(2) { transform: rotate(8deg); z-index: 2; }
/* Side players (Shark/Solid) — fan along the rotated axis using translateX */
.side-cards .card:nth-child(1) { transform: translateX(-5px) rotate(-4deg); z-index: 1; }
.side-cards .card:nth-child(2) { transform: translateX(5px)  rotate(4deg);  z-index: 2; }

/* ── Bet chip — positioned independently via inline style from SEAT_COORDS ─ */
.player-bet {
    position: absolute;   /* inline style sets exact left/top/transform */
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: white;
    font-weight: 800;
    text-shadow: 1px 1px 2px #000;
    z-index: 22;
    background: rgba(0,0,0,0.6);
    border-radius: 12px;
    padding: 3px 8px;
    white-space: nowrap;
    pointer-events: none;
}
.chip-icon {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid #222;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.8), inset 0 0 4px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.chip-0 { background: repeating-conic-gradient(#FF6B00 0% 15%, #fff 15% 33%); }
.chip-1 { background: repeating-conic-gradient(#007BFF 0% 15%, #fff 15% 33%); }
.chip-2 { background: repeating-conic-gradient(#28A745 0% 15%, #fff 15% 33%); }
.chip-3 { background: repeating-conic-gradient(#DC3545 0% 15%, #fff 15% 33%); }
.chip-4 { background: repeating-conic-gradient(#343A40 0% 15%, #fff 15% 33%); }
.chip-5 { background: repeating-conic-gradient(#6F42C1 0% 15%, #fff 15% 33%); }

/* ── Animations ─────────────────────────────────────────────────────── */
.flying-chip { position: fixed; z-index: 1000; pointer-events: none; transition: transform 0.4s cubic-bezier(0.25,1,0.5,1), opacity 0.4s ease; }
.anim-card   { transition: transform 0.5s cubic-bezier(0.25,1,0.5,1), opacity 0.5s ease !important; }
.folding-card { transform: translate(0,-80px) scale(0.5) rotate(180deg) !important; opacity: 0 !important; }

/* ───────────────────────────────────────────────────────────────────────
   SEAT POSITIONS
   All positioned via inline style from SEAT_COORDS in script.js.
   Avatar positions: left = (avatar_x - 60) / 1700, top = (avatar_y - 30) / 956
   Cards positions:  left = cards_x / 1700,          top = cards_y / 956
   Both measured live with the 📍 debug mode.
   ─────────────────────────────────────────────────────────────────────── */

/* ── Menu ────────────────────────────────────────────────────────────── */
.menu-container { position: absolute; top: 16px; left: 16px; z-index: 100; }
#menu-btn { font-size: 13px; padding: 8px 18px; }

/* ── Top-right icon buttons (log + debug) ────────────────────────────── */
.top-icons {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 100;
    display: flex;
    gap: 8px;
}
.icon-btn {
    background: rgba(255,107,0,0.1);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: 17px;
    width: 38px; height: 38px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.icon-btn:hover        { background: var(--accent); color: #000; }
.icon-btn.active       { background: var(--accent); color: #000; box-shadow: 0 0 14px rgba(255,107,0,0.7); }

.dropdown-content {
    display: flex; flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px; margin-top: 8px;
    backdrop-filter: blur(12px);
    padding: 8px; gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}
.dropdown-content.hidden { display: none; }
.dropdown-content a { color: white; text-decoration: none; padding: 9px 12px; border-radius: 5px; font-weight: 600; font-size: 14px; }
.dropdown-content a:hover { background: var(--accent); color: #000; }

/* ── Floating log panel ─────────────────────────────────────────────── */
.floating-log {
    position: absolute;
    bottom: 180px; right: 20px;
    width: 260px; max-height: 180px;
    background: rgba(0,0,0,0.82);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: monospace;
    font-size: 11px;
    color: #888;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}
.floating-log.hidden { display: none; }

/* ── Controls — BOTTOM LEFT, no background panel ────────────────────── */
.bottom-panel {
    position: absolute;
    bottom: 16px;
    left: 20px;          /* ← BOTTOM LEFT */
    right: auto;
    width: 460px;
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 10;
    pointer-events: none;
}

#controls-container {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    opacity: 0.3;
    transition: opacity 0.3s;
    width: 100%;
}
#controls-container.active { opacity: 1; }

.button-group { display: flex; gap: 10px; }

/* Glassmorphism buttons */
.wood-btn {
    background: rgba(255,107,0,0.12);
    border: 1px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(255,107,0,0.25), inset 0 0 8px rgba(255,107,0,0.08);
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    padding: 9px 26px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.wood-btn:hover { background: var(--accent); color: #000; box-shadow: 0 0 18px rgba(255,107,0,0.6); }
.wood-btn:active { transform: translateY(2px); }

#btn-fold { border-color: #555; color: #aaa; background: rgba(0,0,0,0.4); box-shadow: none; }
#btn-fold:hover { background: #333; color: #fff; }

/* Slider */
.slider-group {
    display: flex; align-items: center;
    width: 100%;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,107,0,0.2);
    border-radius: 10px;
    padding: 8px 14px; gap: 14px;
    backdrop-filter: blur(10px);
}
.horseshoe-slider {
    flex: 1; display: flex; align-items: center;
    position: relative;
    background: rgba(255,255,255,0.08);
    height: 8px; border-radius: 4px;
}
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; position: absolute; height: 100%; z-index: 2; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px; width: 20px;
    background: var(--accent); border: 2px solid #fff;
    border-radius: 50%; cursor: pointer;
    box-shadow: 0 0 8px var(--accent);
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider-amount { color: white; font-size: 16px; font-weight: 800; min-width: 62px; text-align: right; }
.slider-amount span:first-child { color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────────────
   DEBUG MODE — cursor coordinate overlay
   ──────────────────────────────────────────────────────────────────────────── */

/* Crosshair lines */
.dbg-crosshair {
    position: absolute;
    pointer-events: none;
    z-index: 9990;
}
.dbg-h {
    left: 0; right: 0;
    height: 1px;
    background: rgba(0, 255, 120, 0.45);
}
.dbg-v {
    top: 0; bottom: 0;
    width: 1px;
    background: rgba(0, 255, 120, 0.45);
}
.dbg-crosshair.hidden { display: none; }

/* Coordinate tooltip */
.dbg-tip {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    color: #00ff88;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #00ff88;
    white-space: nowrap;
    line-height: 1.6;
    box-shadow: 0 4px 16px rgba(0,0,0,0.7);
    transform: translate(14px, 14px);  /* offset so it doesn't cover the cursor */
}
.dbg-tip.hidden { display: none; }

/* Timer Wrapper & SVG */
.avatar-wrapper {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 60px;
}
.timer-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    transform: rotate(-90deg);
}
.timer-circle {
    fill: transparent;
    stroke: var(--accent, #c7a36c);
    stroke-width: 4;
    stroke-dasharray: 195;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}
.timer-circle.timer-danger {
    stroke: #ff4c4c;
}

/* ─────────────────────────────────────────────────────────────────────────────
   SHOWDOWN BANNER & HAND RANK BADGES
   ──────────────────────────────────────────────────────────────────────────── */

/* Player Hand Rank Badge (shown beneath avatar / cards) */
.player-hand-rank-badge {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: rgba(10, 10, 10, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 2px 8px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
    z-index: 45;
    animation: rankBadgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

@keyframes rankBadgePop {
    from { transform: translateX(-50%) scale(0.6); opacity: 0; }
    to   { transform: translateX(-50%) scale(1);   opacity: 1; }
}

.player-hand-rank-badge.winner-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: 900;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.9), 0 3px 8px rgba(0,0,0,0.8);
    animation: rankBadgePop 0.3s ease, winnerBadgePulse 1.8s ease-in-out infinite;
}

@keyframes winnerBadgePulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.8); transform: translateX(-50%) scale(1); }
    50%      { box-shadow: 0 0 22px rgba(255, 215, 0, 1);   transform: translateX(-50%) scale(1.06); }
}

/* Showdown Center Banner */
.showdown-banner {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: radial-gradient(circle at center, rgba(28, 20, 6, 0.94) 0%, rgba(12, 10, 5, 0.97) 100%);
    border: 2px solid rgba(255, 215, 0, 0.85);
    border-radius: 18px;
    padding: 12px 32px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 215, 0, 0.45);
    z-index: 100;
    backdrop-filter: blur(14px);
    animation: bannerDrop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    text-align: center;
    min-width: 280px;
}

@keyframes bannerDrop {
    0%   { transform: translate(-50%, -65%) scale(0.7); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

.banner-crown {
    font-size: 28px;
    line-height: 1;
    animation: crownBounce 1.5s ease-in-out infinite alternate;
}

@keyframes crownBounce {
    0%   { transform: translateY(0) rotate(-4deg); }
    100% { transform: translateY(-5px) rotate(4deg) scale(1.1); }
}

.banner-title {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    text-transform: uppercase;
}

.banner-rank {
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.banner-amount {
    font-size: 16px;
    font-weight: 900;
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.7);
    margin-top: 2px;
}

/* Next Hand Floating Button */
.next-hand-container {
    position: absolute;
    bottom: 24px;
    right: 28px;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: btnFadeIn 0.35s ease;
}

@keyframes btnFadeIn {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.next-hand-btn {
    background: linear-gradient(135deg, #FF9900 0%, #FF6B00 100%);
    border: 2px solid #FFD700;
    border-radius: 12px;
    color: #000;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 14px;
    padding: 11px 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 6px 22px rgba(255, 107, 0, 0.55), 0 0 18px rgba(255, 215, 0, 0.45);
    transition: all 0.2s ease;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.next-hand-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 28px rgba(255, 107, 0, 0.75), 0 0 25px rgba(255, 215, 0, 0.7);
    background: linear-gradient(135deg, #FFAE19 0%, #FF7700 100%);
}

.next-hand-btn:active {
    transform: translateY(1px) scale(0.98);
}

.next-hand-timer {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    color: #FFF;
    font-weight: 800;
    min-width: 24px;
    text-align: center;
}

.next-hand-arrow {
    font-size: 12px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MODALS & OVERLAYS (Pause, Settings, Confirmation)
   ──────────────────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-card {
    background: radial-gradient(circle at 50% 0%, rgba(30, 22, 12, 0.96) 0%, rgba(12, 10, 8, 0.98) 100%);
    border: 1.5px solid rgba(255, 107, 0, 0.45);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.95), 0 0 30px rgba(255, 107, 0, 0.25);
    width: 460px;
    max-width: 90%;
    color: #fff;
    overflow: hidden;
    animation: scaleModal 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleModal {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Pause Card */
.pause-card {
    background: radial-gradient(circle at 50% 0%, rgba(32, 22, 10, 0.96) 0%, rgba(10, 8, 6, 0.98) 100%);
    border: 2px solid rgba(255, 107, 0, 0.6);
    border-radius: 20px;
    padding: 30px 36px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 107, 0, 0.35);
    animation: scaleModal 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 380px;
}

.pause-icon {
    font-size: 38px;
    color: var(--accent);
    animation: pausePulse 1.8s ease-in-out infinite alternate;
}

@keyframes pausePulse {
    0%   { transform: scale(1);   filter: drop-shadow(0 0 4px var(--accent)); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 16px var(--accent)); }
}

.pause-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1.2px;
    color: #FFD700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

.pause-desc {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 12px;
    line-height: 1.4;
}

.vertical-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.vertical-actions button {
    width: 100%;
    text-align: center;
    padding: 11px 18px;
    font-size: 13px;
}

/* Settings Modal */
.settings-card {
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 107, 0, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.modal-title {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #FFD700;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 420px;
    overflow-y: auto;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-info {
    flex: 1;
}

.setting-label {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.setting-desc {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.setting-select {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 107, 0, 0.4);
    border-radius: 8px;
    color: #FFD700;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
    outline: none;
}

.setting-control-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.setting-control-slider input[type=range] {
    position: static;
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.setting-val-badge {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    min-width: 36px;
    text-align: right;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #333;
    border-radius: 24px;
    transition: 0.25s ease;
    border: 1px solid #555;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #aaa;
    border-radius: 50%;
    transition: 0.25s ease;
}

input:checked + .slider-toggle {
    background-color: var(--accent);
    border-color: #FF9900;
}

input:checked + .slider-toggle:before {
    transform: translateX(20px);
    background-color: #fff;
}

.modal-footer {
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 107, 0, 0.2);
    display: flex;
    justify-content: flex-end;
}

.modal-footer button {
    padding: 9px 20px;
    font-size: 12px;
}

/* Confirm Card */
.confirm-card {
    padding: 26px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 420px;
}

.confirm-icon {
    font-size: 36px;
    color: #fbbf24;
}

.confirm-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.confirm-desc {
    font-size: 13px;
    color: #aaa;
    line-height: 1.45;
    margin-bottom: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.modal-actions button {
    flex: 1;
    font-size: 12px;
    padding: 10px 14px;
}

/* Button Variants */
.danger-btn {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.12) !important;
}

.danger-btn:hover {
    background: #ef4444 !important;
    color: #fff !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
}

.highlight-btn {
    background: linear-gradient(135deg, #FF9900 0%, #FF6B00 100%) !important;
    color: #000 !important;
    font-weight: 900 !important;
    border-color: #FFD700 !important;
}

.highlight-btn:hover {
    background: linear-gradient(135deg, #FFAE19 0%, #FF7700 100%) !important;
    box-shadow: 0 0 18px rgba(255, 107, 0, 0.8) !important;
}


