/* Poker Game - Professional UI  v10.0
 *
 * Extends platform.css design system for poker-specific components.
 * Card styles (.bj-card) come from blackjack.css (shared).
 *
 * Layout: Table lobby → Game table with 6 seats in oval arrangement
 * Mobile-first: Cards and seats scale fluidly down to 280px viewports
 */

/* ========== Scroll Lock During Gameplay ========== */
@media (max-width: 768px) {
    body.poker-playing,
    body.poker-acting {
        overscroll-behavior: none;
    }
    body.poker-acting {
        overflow: hidden;
        touch-action: none;
    }
}

/* Hide promo banner on poker — vertical space is precious */
.poker-page .pm-promo-banner {
    display: none;
}

/* Hide site footer on poker at mobile — full-screen game experience */
@media (max-width: 768px) {
    .poker-page .site-footer {
        display: none;
    }
}

/* ========== LOBBY: Hero Section ========== */
.poker-lobby {
    max-width: 100%;
    width: 100%;
}

.lobby-hero {
    margin-bottom: 1rem;
}

.lobby-hero-felt {
    background: linear-gradient(135deg, #0a2818 0%, #153d24 30%, #1a472a 60%, #0f2d1a 100%);
    border-radius: 16px;
    border: 1px solid rgba(247, 147, 26, 0.15);
    padding: 2rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Felt texture + spotlight effect */
.lobby-hero-felt::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(34, 197, 94, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 60%, rgba(247, 147, 26, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(0, 0, 0, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

/* Subtle table edge */
.lobby-hero-felt::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

/* Decorative hero cards */
.lobby-hero-cards {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5));
}

.lobby-card {
    width: 82px;
    height: 118px;
    background: linear-gradient(165deg, #ffffff 0%, #fafafa 40%, #f3f3f3 70%, #ededed 100%);
    border-radius: 7px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        inset 0 0 0 3px #fff,
        inset 0 0 0 4px rgba(0, 0, 0, 0.06);
}

.lobby-card.lc-1 {
    transform: rotate(-14deg) translateX(6px);
    z-index: 2;
}

.lobby-card.lc-2 {
    transform: rotate(10deg) translateX(-6px);
    margin-left: -22px;
    z-index: 1;
}

/* Corner indices */
.lc-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    gap: 0;
}

.lc-top-left {
    top: 6px;
    left: 7px;
}

.lc-bottom-right {
    bottom: 6px;
    right: 7px;
    transform: rotate(180deg);
}

.lc-corner-rank {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
}

.lc-corner-suit {
    font-size: 0.7rem;
    line-height: 1;
    margin-top: -1px;
}

/* Center pip */
.lc-center-pip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.6rem;
    line-height: 1;
}

/* Suit colors */
.lobby-card.hearts .lc-corner-rank,
.lobby-card.hearts .lc-corner-suit,
.lobby-card.hearts .lc-center-pip {
    color: #c0392b;
}

.lobby-card.spades .lc-corner-rank,
.lobby-card.spades .lc-corner-suit,
.lobby-card.spades .lc-center-pip {
    color: #1a1a2e;
}

.lobby-card.diamonds .lc-corner-rank,
.lobby-card.diamonds .lc-corner-suit,
.lobby-card.diamonds .lc-center-pip {
    color: #c0392b;
}

.lobby-card.clubs .lc-corner-rank,
.lobby-card.clubs .lc-corner-suit,
.lobby-card.clubs .lc-center-pip {
    color: #1a1a2e;
}

.lobby-hero-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.lobby-hero-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.3rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.01em;
}

.lobby-hero-sub {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 1rem;
}

.quick-seat-btn {
    background: linear-gradient(135deg, #f7931a 0%, #e8850f 100%);
    color: rgba(255, 255, 255, 0.97);
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 16px rgba(247, 147, 26, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    min-height: 44px;
}

.quick-seat-btn:hover {
    background: linear-gradient(135deg, #e8850f, #d47a0e);
    box-shadow: 0 6px 20px rgba(247, 147, 26, 0.45);
    transform: translateY(-2px);
}

.quick-seat-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.3);
}

/* ========== LOBBY: Info Bar ========== */
.lobby-info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.65rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.lobby-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 1px;
}

.lobby-info-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.lobby-info-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lobby-info-sep {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

/* ========== LOBBY: Filter Bar ========== */
.lobby-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.filter-pills {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.filter-pill:hover {
    border-color: rgba(247, 147, 26, 0.4);
    color: var(--text-primary);
}

.filter-pill.active {
    background: linear-gradient(135deg, #f7931a, #cc7a15);
    color: rgba(255, 255, 255, 0.92);
    border-color: transparent;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #f7931a;
    cursor: pointer;
    margin: 0;
}

/* ========== LOBBY: Table List ========== */
.table-list-header {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1.8fr 1fr 1fr 0.8fr;
    padding: 0.4rem 1rem;
    gap: 0 0.75rem;
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.tlh-stakes,
.tlh-avgpot,
.tlh-hands {
    text-align: right;
}

.tlh-stakes small,
.tlh-avgpot small,
.tlh-hands small {
    opacity: 0.5;
    font-weight: 400;
}

.table-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
}

.table-card {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1.8fr 1fr 1fr 0.8fr;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
    cursor: pointer;
}

.table-card:last-child {
    border-bottom: none;
}

.table-card:hover {
    background: rgba(247, 147, 26, 0.04);
}

.table-info {
    min-width: 0;
}

.table-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-id-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
    flex-shrink: 0;
}

.table-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: statusPulse 2s ease infinite;
}

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

.table-stakes {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: right;
}

.table-avgpot,
.table-hands {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: right;
}

/* Player dots + count */
.table-players-col {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.table-seats {
    display: flex;
    gap: 3px;
    align-items: center;
}

.seat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.seat-dot.occupied {
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.3);
}

.table-player-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.join-table-btn {
    background: rgba(247, 147, 26, 0.12);
    color: #f7931a;
    border: 1px solid rgba(247, 147, 26, 0.25);
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
    text-align: center;
    min-height: 36px;
}

.join-table-btn:hover {
    background: rgba(247, 147, 26, 0.22);
    border-color: rgba(247, 147, 26, 0.45);
}

.join-table-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.join-table-btn.full {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-color: var(--border);
}

.join-table-btn.watch-btn {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.25);
}

.join-table-btn.watch-btn:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.45);
}

/* Tournament lobby */
.tournament-lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.06) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.tournament-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tournament-badge-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.18);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.08em;
}

.tournament-header-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tournament-header-stats {
    display: flex;
    gap: 12px;
}

.tournament-stat {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.table-card.tournament-table {
    border-left: 2px solid rgba(139, 92, 246, 0.4);
}

.table-tournament-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Tournament Info Panel (spectator mode) */
.tournament-info-panel {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.tournament-info-summary {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    padding-bottom: 0.4rem;
}

.tournament-info-stat {
    text-align: center;
}

.tournament-info-label {
    display: block;
    font-size: 0.62rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tournament-info-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a78bfa;
}

.tournament-details {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    margin-top: 0.35rem;
    overflow: hidden;
}

.tournament-details summary {
    font-size: 0.72rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tournament-details summary::-webkit-details-marker { display: none; }

.tournament-details summary::after {
    content: '\25B8'; /* right triangle */
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.15s ease;
}

.tournament-details[open] summary::after {
    transform: rotate(90deg);
}

.tournament-details summary:hover {
    color: #c4b5fd;
}

.tournament-details[open] summary {
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.tournament-details > div {
    padding: 0.25rem 0.5rem 0.4rem;
}

.tournament-standing-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.2rem 0.15rem;
    font-size: 0.72rem;
    border-radius: 4px;
}

.tournament-standing-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.tournament-standing-row.at-this-table {
    background: rgba(139, 92, 246, 0.08);
    color: #c4b5fd;
}

.tournament-rank {
    width: 28px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.tournament-standing-row:nth-child(-n+3) .tournament-rank {
    color: #c4b5fd;
}

.tournament-player-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.75);
}

.tournament-player-chips {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.tournament-elim-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.15rem;
    font-size: 0.72rem;
}

.tournament-elim-row + .tournament-elim-row {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.tournament-elim-name {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: line-through;
}

.tournament-elim-pos {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Loading state */
.lobby-loading,
.lobby-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.lobby-retry-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: rgba(247, 147, 26, 0.15);
    color: #f7931a;
    border: 1px solid rgba(247, 147, 26, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.lobby-retry-btn:hover { background: rgba(247, 147, 26, 0.25); }

.lobby-loading-dots {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.lobby-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: loadingDot 1.2s ease infinite;
}

.lobby-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.lobby-loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes loadingDot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* ========== Buy-in Modal ========== */
.buyin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: var(--z-modal-backdrop, 9998);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    backdrop-filter: blur(6px);
}

.buyin-overlay.open {
    opacity: 1;
    visibility: visible;
}

.buyin-modal {
    background: linear-gradient(170deg, rgba(22, 22, 32, 0.98) 0%, rgba(14, 14, 22, 0.99) 100%);
    border: 1px solid rgba(247, 147, 26, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    position: relative;
}

.buyin-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s ease;
}

.buyin-close:hover {
    color: rgba(255, 255, 255, 0.7);
}

.buyin-modal-header {
    text-align: center;
    margin-bottom: 1rem;
}

.buyin-modal h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: var(--text-primary);
}

.buyin-table-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* Balance Breakdown */
.buyin-balances {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.buyin-bal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.buyin-bal-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.buyin-bal-amount {
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.buyin-bal-cash .buyin-bal-amount {
    color: var(--primary);
    font-size: 0.95rem;
}

.buyin-bal-bonus .buyin-bal-amount {
    color: rgba(255, 255, 255, 0.3);
}

.buyin-bal-bonus .buyin-bal-label {
    color: rgba(255, 255, 255, 0.3);
}

.buyin-bal-bonus .buyin-bal-label svg {
    opacity: 0.5;
}

.buyin-bal-tooltip {
    display: block;
    width: 100%;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.38);
    margin-top: -2px;
}

.buyin-bal-inplay .buyin-bal-amount {
    color: rgba(255, 255, 255, 0.4);
}

/* Slider */
.buyin-range {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0.4rem;
}

.buyin-slider-wrap {
    padding: 0 2px;
    margin-bottom: 0.6rem;
}

.buyin-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.buyin-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7931a, #e8851a);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.35);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.buyin-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 12px rgba(247, 147, 26, 0.5);
    transform: scale(1.08);
}

.buyin-slider::-webkit-slider-thumb:active {
    transform: scale(0.96);
}

.buyin-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7931a, #e8851a);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.35);
    cursor: pointer;
}

/* Amount Row */
.buyin-amount-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.buyin-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}

.buyin-input-wrap input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: inherit;
    text-align: center;
    font-weight: 600;
    -moz-appearance: textfield;
    transition: border-color 0.15s ease;
    font-variant-numeric: tabular-nums;
}

.buyin-input-wrap input:focus {
    border-color: var(--primary);
    outline: none;
}

.buyin-input-wrap input::-webkit-inner-spin-button,
.buyin-input-wrap input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.buyin-input-wrap .unit {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.buyin-bb-equiv {
    font-size: 0.75rem;
    color: rgba(247, 147, 26, 0.7);
    font-weight: 600;
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Presets — built dynamically by JS */
.buyin-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.buyin-preset-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 0.35rem 0;
    color: var(--text-secondary);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    font-weight: 500;
    text-align: center;
    min-height: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    line-height: 1.2;
}

.buyin-preset-btn .preset-bb {
    font-size: 0.6rem;
    opacity: 0.5;
}

.buyin-preset-btn:hover {
    background: rgba(247, 147, 26, 0.1);
    border-color: rgba(247, 147, 26, 0.25);
    color: #f7931a;
}

.buyin-preset-btn.active {
    background: rgba(247, 147, 26, 0.14);
    border-color: rgba(247, 147, 26, 0.4);
    color: #f7931a;
}

.buyin-preset-btn.active .preset-bb {
    opacity: 0.7;
}

/* Fine print */
.buyin-fine-print {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* Actions */
.buyin-actions {
    display: flex;
    gap: 0.5rem;
}

.buyin-actions button {
    flex: 1;
    padding: 0.65rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all 0.15s ease;
}

.buyin-confirm {
    background: linear-gradient(135deg, #f7931a, #cc7a15);
    color: rgba(255, 255, 255, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.25);
}

.buyin-confirm:hover {
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.4);
    transform: translateY(-1px);
}

.buyin-confirm:active {
    transform: translateY(0);
}

.buyin-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.buyin-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.buyin-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Insufficient Balance State */
.buyin-insuf-msg {
    text-align: center;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 0.5rem;
    line-height: 1.5;
}

.buyin-insuf-msg strong {
    color: var(--primary);
    font-weight: 700;
}

.buyin-insuf-bonus {
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    padding: 0 0.5rem 0.75rem;
    line-height: 1.4;
}

.buyin-insuf-actions {
    margin-bottom: 0.5rem;
}

.buyin-deposit-btn {
    background: linear-gradient(135deg, #f7931a, #cc7a15) !important;
}

.buyin-lower-stakes {
    text-align: center;
    padding-top: 0.25rem;
}

.buyin-lower-stakes a {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.buyin-lower-stakes a:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* Mobile adjustments for buy-in modal */
@media (max-width: 480px) {
    .buyin-modal {
        padding: 1.25rem;
        max-width: none;
        margin: 0 0.25rem;
    }

    .buyin-presets {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }

    .buyin-preset-btn {
        min-height: 40px;
        font-size: 0.7rem;
    }

    .buyin-slider::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }

    .buyin-slider::-moz-range-thumb {
        width: 30px;
        height: 30px;
    }
}

/* ========== Poker Table Container ========== */
.poker-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 0 1 auto;
}

.poker-table {
    background: radial-gradient(ellipse at 50% 40%, #2d6b44 0%, #1a472a 50%, #0f2d1a 100%);
    border-radius: 50% / 35%;
    padding: 1.5rem 1rem;
    position: relative;
    overflow: visible;
    border: 8px solid #3d2610;
    box-sizing: border-box;
    box-shadow:
        inset 0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 60px rgba(0, 0, 0, 0.2),
        0 0 0 2px rgba(90, 60, 30, 0.6),
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(0, 0, 0, 0.3);
    min-height: 320px;
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Green felt texture overlay — subtle noise + spotlight */
.poker-table::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 20% 30%, rgba(34, 197, 94, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(34, 197, 94, 0.08) 0%, transparent 40%);
    border-radius: inherit;
    pointer-events: none;
}

/* Inner felt edge — subtle recessed line inside the rail */
.poker-table::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: inherit;
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

/* ========== Community Cards ========== */
.community-area {
    text-align: center;
    position: relative;
    z-index: 2;
    margin: 0.5rem 0;
}

.community-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.community-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(2px, 0.5vmin, 5px);
    min-height: calc(clamp(64px, 10vmin, 90px) + 0.5rem);
}

/* Community card placeholders */
.card-placeholder {
    width: clamp(46px, 7.5vmin, 68px);
    height: clamp(64px, 10.5vmin, 95px);
    border-radius: clamp(3px, 0.8vmin, 6px);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

/* Card deal animation — stagger flop cards */
.community-cards .bj-card {
    animation: cardDeal 0.35s ease-out both;
    box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 0, 0, 0.15);
}

.community-cards .bj-card:nth-child(1) { animation-delay: 0s; }
.community-cards .bj-card:nth-child(2) { animation-delay: 0.1s; }
.community-cards .bj-card:nth-child(3) { animation-delay: 0.2s; }

@keyframes cardDeal {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.85);
    }
    60% {
        transform: translateY(2px) scale(1.02);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== Pot Display ========== */
.pot-display {
    text-align: center;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 20px;
    padding: 2px 18px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.pot-chips {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 2px;
}

.pot-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
    font-variant-numeric: tabular-nums;
}

.pot-label {
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* ========== Seat Layout ========== */
/*
 * 6-max oval seating:
 *      [2]   [3]
 *   [1]         [4]
 *      [0]   [5]
 *
 * Seat 0 = "hero" (bottom-center-left)
 */
.seats-container {
    position: absolute;
    inset: -10px;
    pointer-events: none;
    z-index: 3;
}

.seat {
    position: absolute;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: opacity 0.3s ease;
    min-width: 0;
}

/* Seat positions — oval around table (6-max) */
.seat[data-seat="0"] { bottom: -32px; left: 25%; transform: translateX(-50%); }
.seat[data-seat="1"] { top: 50%; left: 2px; transform: translateY(-50%); }
.seat[data-seat="2"] { top: -18px; left: 25%; transform: translateX(-50%); }
.seat[data-seat="3"] { top: -18px; right: 25%; transform: translateX(50%); }
.seat[data-seat="4"] { top: 50%; right: 2px; transform: translateY(-50%); }
.seat[data-seat="5"] { bottom: -32px; right: 25%; transform: translateX(50%); }
/* Additional seats for 9-max (Full Ring) */
.seat[data-seat="6"] { bottom: -32px; left: 50%; transform: translateX(-50%); }
.seat[data-seat="7"] { top: -18px; left: 50%; transform: translateX(-50%); }
.seat[data-seat="8"] { top: 20%; right: 2px; transform: translateY(-50%); }

/* 9-max: taller table and spread seats wider to prevent collisions */
.seats-9 { min-height: 380px; }

/* Right side: spread seats 4 and 8 apart */
.seats-9 .seat[data-seat="4"] { top: 70%; }
.seats-9 .seat[data-seat="8"] { top: 12%; }
/* Left side: match for symmetry */
.seats-9 .seat[data-seat="1"] { top: 70%; }

/* Oval distribution: center seats at extremes, flanking seats curve inward */
.seats-9 .seat[data-seat="7"] { top: -28px; }       /* top center — furthest up */
.seats-9 .seat[data-seat="2"] { top: -12px; }        /* top-left — curves inward */
.seats-9 .seat[data-seat="3"] { top: -12px; }        /* top-right — curves inward */

.seats-9 .seat[data-seat="6"] { bottom: -42px; }     /* bottom center — furthest down */
.seats-9 .seat[data-seat="0"] { bottom: -28px; }     /* bottom-left — curves inward */
.seats-9 .seat[data-seat="5"] { bottom: -28px; }     /* bottom-right — curves inward */

/* Heads-up (2-seat): hero bottom-center, opponent top-center — push far apart for pot/bet clearance */
.seats-2 .seat[data-seat="0"] { bottom: -42px; left: 50%; transform: translateX(-50%); }
.seats-2 .seat[data-seat="1"] { top: -38px; left: 50%; transform: translateX(-50%); }

/* HU bet chips & action flashes — positioned by PokerLayout engine */

/* Seat info card — colored left border for identity */
.seat-info {
    position: relative;
    z-index: 6; /* sit above bet chips (auto) and hand rank (5) if they overlap */
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 3px 8px;
    text-align: center;
    min-width: 70px;
    max-width: 110px;
    backdrop-filter: blur(8px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.seat.active-turn .seat-info {
    border-color: rgba(247, 147, 26, 0.6);
    box-shadow: 0 0 16px rgba(247, 147, 26, 0.5), 0 0 40px rgba(247, 147, 26, 0.15);
    animation: turnPulse 1.5s ease infinite;
}

/* Spotlight glow behind active seat */
.seat.active-turn::before {
    content: '';
    position: absolute;
    inset: -12px;
    background: radial-gradient(ellipse at center, rgba(247, 147, 26, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    animation: turnSpotlight 1.5s ease infinite;
}

@keyframes turnPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(247, 147, 26, 0.5), 0 0 40px rgba(247, 147, 26, 0.15); }
    50% { box-shadow: 0 0 24px rgba(247, 147, 26, 0.7), 0 0 50px rgba(247, 147, 26, 0.25); }
}

@keyframes turnSpotlight {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.seat.folded {
    opacity: 0.35;
    transition: opacity 0.4s ease;
}

.seat.folded .seat-cards {
    animation: foldCards 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes foldCards {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-6px) scale(0.85) rotate(-4deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-14px) scale(0.6) rotate(-8deg);
    }
}

.seat.winner .seat-info {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.5), 0 0 32px rgba(255, 215, 0, 0.2);
    animation: winnerGlow 0.8s ease-out;
}

@keyframes winnerGlow {
    0% { box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
    40% { box-shadow: 0 0 24px rgba(255, 215, 0, 0.7), 0 0 48px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.5), 0 0 32px rgba(255, 215, 0, 0.2); }
}

/* ========== Win Chip Animation ========== */
.win-chip-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffe066, #f7931a 50%, #cc7a15);
    border: 1px solid rgba(255, 215, 0, 0.7);
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.6), 0 1px 2px rgba(0, 0, 0, 0.4);
    z-index: 100;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(1);
    will-change: transform, opacity;
    animation: chipFlyToWinner var(--fly-duration, 600ms) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.win-chip-particle.fast {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 4px rgba(251, 191, 36, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
    animation-duration: var(--fly-duration, 350ms);
}

@keyframes chipFlyToWinner {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    85% {
        opacity: 1;
        transform: translate(calc(-50% + var(--dx) * 0.95), calc(-50% + var(--dy) * 0.95)) scale(0.7);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3);
    }
}

/* Winner stack glow — seat info lights up gold when chips arrive */
.seat-info.stack-win-glow {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.25);
    border-color: rgba(255, 215, 0, 0.4);
    animation: stackGlow 0.8s ease-out forwards;
}

@keyframes stackGlow {
    0% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.7), 0 0 24px rgba(255, 215, 0, 0.35); }
    100% { box-shadow: none; }
}

/* Winner stack number — brief scale bump */
.seat-stack.stack-increment {
    animation: stackBounce 0.5s ease-out forwards;
    color: #ffd700;
}

@keyframes stackBounce {
    0% { transform: scale(1); color: #ffd700; }
    20% { transform: scale(1.2); color: #ffe066; text-shadow: 0 0 6px rgba(255, 215, 0, 0.6); }
    100% { transform: scale(1); color: rgba(255, 255, 255, 0.7); text-shadow: none; }
}

/* Medium pot */
.seat-info.stack-win-glow.medium-win {
    animation: stackGlowMedium 1.2s ease-out forwards;
}

@keyframes stackGlowMedium {
    0% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.8), 0 0 28px rgba(255, 215, 0, 0.4); }
    100% { box-shadow: none; }
}

.seat-stack.stack-increment.medium-win {
    animation: stackBounceMedium 0.7s ease-out forwards;
}

@keyframes stackBounceMedium {
    0% { transform: scale(1); color: #ffd700; }
    18% { transform: scale(1.3); color: #ffe066; text-shadow: 0 0 8px rgba(255, 215, 0, 0.7); }
    100% { transform: scale(1); color: rgba(255, 255, 255, 0.7); text-shadow: none; }
}

/* Big pot */
.seat-info.stack-win-glow.big-win {
    animation: stackGlowBig 1.6s ease-out forwards;
}

@keyframes stackGlowBig {
    0% { box-shadow: 0 0 18px rgba(255, 215, 0, 1), 0 0 36px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: none; }
}

.seat-stack.stack-increment.big-win {
    animation: stackBounceBig 0.9s ease-out forwards;
}

@keyframes stackBounceBig {
    0% { transform: scale(1); color: #ffd700; }
    15% { transform: scale(1.4); color: #fff5b3; text-shadow: 0 0 10px rgba(255, 215, 0, 0.9); }
    100% { transform: scale(1); color: rgba(255, 255, 255, 0.7); text-shadow: none; }
}

/* Huge pot */
.seat-info.stack-win-glow.huge-win {
    animation: stackGlowHuge 2s ease-out forwards;
}

@keyframes stackGlowHuge {
    0% { box-shadow: 0 0 22px rgba(255, 215, 0, 1), 0 0 44px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 180, 0, 0.2); }
    100% { box-shadow: none; }
}

.seat-stack.stack-increment.huge-win {
    animation: stackBounceHuge 1.2s ease-out forwards;
}

@keyframes stackBounceHuge {
    0% { transform: scale(1); color: #ffd700; }
    12% { transform: scale(1.5); color: #fffbe6; text-shadow: 0 0 14px rgba(255, 215, 0, 1); }
    100% { transform: scale(1); color: rgba(255, 255, 255, 0.7); text-shadow: none; }
}

/* Bigger chip particles for big pots */
.win-chip-particle.big-pot {
    width: 12px;
    height: 12px;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.7), 0 0 16px rgba(255, 215, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ========== Net Change Indicator ========== */
.net-change {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 15;
    animation: netChangeAppear 0.4s ease-out;
}
.net-change.positive {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.15);
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}
.net-change.negative {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}
.net-change.fade-out {
    animation: netChangeFade 0.6s ease-in forwards;
}
@keyframes netChangeAppear {
    0% { opacity: 0; transform: translateX(-50%) translateY(6px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes netChangeFade {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ========== Showdown Card Reveal ========== */
/* Cards briefly enlarge when revealed at showdown, then settle to normal size */
.seat-cards.showdown-reveal .seat-minicard.face-up {
    animation: cardReveal 1.8s ease-out forwards;
}

@-webkit-keyframes cardReveal {
    0% { -webkit-transform: scale(0.7) rotateY(90deg); transform: scale(0.7) rotateY(90deg); opacity: 0; }
    20% { -webkit-transform: scale(1.35) rotateY(0deg); transform: scale(1.35) rotateY(0deg); opacity: 1; }
    50% { -webkit-transform: scale(1.25); transform: scale(1.25); }
    100% { -webkit-transform: scale(1); transform: scale(1); }
}
@keyframes cardReveal {
    0% { -webkit-transform: scale(0.7) rotateY(90deg); transform: scale(0.7) rotateY(90deg); opacity: 0; }
    20% { -webkit-transform: scale(1.35) rotateY(0deg); transform: scale(1.35) rotateY(0deg); opacity: 1; }
    50% { -webkit-transform: scale(1.25); transform: scale(1.25); }
    100% { -webkit-transform: scale(1); transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .win-chip-particle {
        animation: none;
        display: none;
    }
    .seat-info.stack-win-glow, .seat-info.stack-win-glow.medium-win, .seat-info.stack-win-glow.big-win, .seat-info.stack-win-glow.huge-win { animation: none; }
    .seat-stack.stack-increment, .seat-stack.stack-increment.medium-win, .seat-stack.stack-increment.big-win, .seat-stack.stack-increment.huge-win { animation: none; }
    .seat-cards.showdown-reveal .seat-minicard.face-up { animation: none; }
    .net-change { animation: none; }
    .net-change.fade-out { animation: none; display: none; }
}

.seat-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
}

.seat-name.is-me {
    color: var(--primary);
}

.you-tag {
    font-size: 0.58rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.01em;
}

.seat-stack {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Floating action flash label — per-seat directional positioning */
.seat-action-flash {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    padding: 4px 12px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 15;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    animation: flashDrift 2.5s ease-out forwards;
}

/* Per-seat action flash positions — computed by PokerLayout engine */

/* Single directional flash — engine sets --flash-start-x/y and --flash-dx/dy per seat angle */
@keyframes flashDrift {
    0%   { opacity: 0; transform: translate(calc(-50% + var(--flash-start-x, 0px)), calc(-50% + var(--flash-start-y, 0px))) scale(0.9); }
    8%   { opacity: 1; transform: translate(calc(-50% + var(--flash-start-x, 0px)), calc(-50% + var(--flash-start-y, 0px))) scale(1.05); }
    15%  { opacity: 1; transform: translate(calc(-50% + var(--flash-start-x, 0px)), calc(-50% + var(--flash-start-y, 0px))) scale(1); }
    75%  { opacity: 1; transform: translate(calc(-50% + var(--flash-start-x, 0px)), calc(-50% + var(--flash-start-y, 0px))); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--flash-start-x, 0px) + var(--flash-dx, 0px)), calc(-50% + var(--flash-start-y, 0px) + var(--flash-dy, -14px))); }
}

.seat-action-flash.action-fold {
    color: #f87171;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
}
.seat-action-flash.action-check {
    color: #93c5fd;
    background: rgba(96, 165, 250, 0.25);
    border: 1px solid rgba(96, 165, 250, 0.5);
}
.seat-action-flash.action-call {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.25);
    border: 1px solid rgba(34, 197, 94, 0.5);
}
.seat-action-flash.action-raise, .seat-action-flash.action-bet {
    color: #fbbf24;
    background: rgba(247, 147, 26, 0.25);
    border: 1px solid rgba(247, 147, 26, 0.5);
}
.seat-action-flash.action-all-in {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.6);
    font-weight: 800;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.seat-action-flash.action-ante {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.25);
    border: 1px solid rgba(168, 85, 247, 0.5);
}

/* Timer bar on active seat — visible to all players */
.seat-timer-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

/* Placeholder: same dimensions, invisible background */
.seat-timer-bar.seat-timer-placeholder {
    background: transparent;
}

.seat-timer-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s linear, background 0.3s ease;
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

.seat-timer-fill.warning {
    background: #f59e0b;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}

.seat-timer-fill.urgent {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
    animation: seatTimerPulse 0.5s ease infinite;
}

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

.seat-bet {
    font-size: 0.6rem;
    color: #22c55e;
    font-weight: 600;
    min-height: 0.7rem;
}

/* Seat bet chip pill */
.seat-bet-chip {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3; /* below seat-info (z:6) and hand rank (z:5) */
    font-size: 0.6rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 6px 2px 4px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
    font-variant-numeric: tabular-nums;
}
.seat-bet-chip::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fde68a, #f59e0b);
    border: 1px solid rgba(180, 120, 0, 0.5);
    flex-shrink: 0;
}

/* Bet chip positions — computed by PokerLayout engine via transform: translate() */

/* Empty seat — clickable to sit */
.seat.empty .seat-info {
    border-style: dashed;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

.seat.empty:hover .seat-info {
    opacity: 0.75;
    border-color: rgba(247, 147, 26, 0.4);
}

/* Seat hole cards (mini) — shown face-down for opponents, face-up for hero */
.seat-cards {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.seat-minicard {
    width: clamp(22px, 3.5vmin, 32px);
    height: clamp(31px, 4.9vmin, 45px);
    border-radius: clamp(2px, 0.5vmin, 4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: clamp(9px, 1.4vmin, 13px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
    animation: miniCardDeal 0.2s ease-out;
}

@keyframes miniCardDeal {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

.seat-minicard.face-down {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #1e3a8a 100%);
    border-color: #3b82f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.seat-minicard.face-up {
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.seat-minicard.face-up.red {
    color: #dc2626;
}

.seat-minicard.face-up.black {
    color: #1f2937;
}

/* ========== Hero Cards (Your Hole Cards) ========== */
/* Hero area: only shown on small screens where seat cards are too tiny to read */
.hero-area {
    display: none;
    text-align: center;
    position: relative;
    z-index: 5;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

@media (max-width: 480px) {
    .hero-area.has-cards { display: block; }
}

.hero-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.hero-cards {
    display: flex;
    justify-content: center;
    gap: 6px;
    min-height: calc(clamp(70px, 11.2vmin, 112px));
}

.hero-cards .bj-card {
    animation: heroCardDeal 0.5s ease-out;
    box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hero-cards .bj-card:first-child {
    transform: rotate(-3deg);
}

.hero-cards .bj-card:last-child {
    transform: rotate(3deg);
    animation-delay: 0.1s;
}

@keyframes heroCardDeal {
    from {
        opacity: 0;
        transform: translateY(30px) rotateY(90deg) scale(0.85);
    }
    40% {
        transform: translateY(-4px) rotateY(30deg) scale(1.02);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateY(0) scale(1);
    }
}

.hero-hand-rank {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.35rem;
    min-height: 1.2rem;
    text-shadow: 0 0 8px rgba(247, 147, 26, 0.2);
}

/* ========== Action Timer ========== */
.action-timer {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.35rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.action-timer-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #fbbf24);
    border-radius: 3px;
    transition: width 1s linear;
    width: 0%;
    box-shadow: 0 0 6px rgba(247, 147, 26, 0.4);
}

.action-timer-bar.urgent {
    background: #ef4444;
    animation: timerPulse 0.5s ease infinite;
}

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

.time-bank-indicator {
    position: absolute;
    right: 0;
    top: -1.2rem;
    font-size: 10px;
    font-weight: 600;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: timerPulse 1s ease infinite;
}

/* ========== Poker Controls ========== */
.poker-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0 0;
}

.poker-action-row {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

.poker-action-btn {
    flex: 1;
    max-width: 140px;
    min-height: 48px;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    border: 2px solid transparent;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.poker-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.poker-action-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-fold {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-fold:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-check {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

.btn-check:hover:not(:disabled) {
    background: rgba(96, 165, 250, 0.25);
    border-color: rgba(96, 165, 250, 0.5);
}

.btn-call {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.btn-call:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
}

.btn-raise {
    background: rgba(247, 147, 26, 0.15);
    color: #f7931a;
    border-color: rgba(247, 147, 26, 0.3);
}

.btn-raise:hover:not(:disabled) {
    background: rgba(247, 147, 26, 0.25);
    border-color: rgba(247, 147, 26, 0.5);
}

.btn-allin {
    background: linear-gradient(135deg, #f7931a, #cc7a15);
    color: rgba(255, 255, 255, 0.95);
    border-color: transparent;
}

/* Raise row */
.raise-row {
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border);
    animation: raiseSlideIn 0.15s ease-out;
}

.raise-header {
    display: none;
}

.raise-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.raise-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes raiseSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.raise-row.visible {
    display: flex;
}

.raise-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3rem;
}

.raise-preset {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s ease;
}

.raise-preset:hover {
    background: rgba(247, 147, 26, 0.12);
    border-color: rgba(247, 147, 26, 0.3);
    color: #f7931a;
}

.raise-slider-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.raise-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.raise-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.raise-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.raise-amount-display {
    min-width: 50px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

.raise-amount-input {
    width: 70px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    font-family: inherit;
    text-align: center;
    -moz-appearance: textfield;
}
.raise-amount-input::-webkit-inner-spin-button,
.raise-amount-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}
.raise-amount-input:focus {
    border-color: var(--primary);
    outline: none;
}

.raise-confirm-btn {
    background: linear-gradient(135deg, #f7931a, #cc7a15);
    color: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: all 0.12s ease;
}

.raise-confirm-btn:hover {
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.3);
}

/* Mobile touch target for raise confirm */
@media (max-width: 768px) {
    .raise-confirm-btn {
        min-height: 44px;
    }
}

/* ========== Leave / Cash Out ========== */
.table-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
    font-size: 0.78rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-info-bar .table-blinds {
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.hand-number-label {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.72rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Tournament blind strip — below table info bar */
.tournament-blind-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 6px;
    margin-bottom: 0.15rem;
}

.tbs-level {
    font-weight: 600;
    color: #a78bfa;
}

.tbs-blinds,
.tbs-ante {
    color: rgba(255, 255, 255, 0.6);
}

.tbs-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.tbs-players {
    font-weight: 600;
    color: #fbbf24;
}

.tbs-final-table {
    font-weight: 800;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: #fbbf24;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.12));
    border: 1px solid rgba(251, 191, 36, 0.35);
    padding: 1px 8px;
    border-radius: 4px;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.tbs-final-table.tbs-final-reveal {
    animation: finalTableReveal 1.5s ease-out;
}

@keyframes finalTableReveal {
    0% { opacity: 0; transform: scale(0.8); box-shadow: 0 0 20px rgba(251, 191, 36, 0.8); }
    30% { opacity: 1; transform: scale(1.05); box-shadow: 0 0 16px rgba(251, 191, 36, 0.6); }
    100% { opacity: 1; transform: scale(1); box-shadow: none; }
}

.tbs-prize {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
}

.tbs-timer {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.65rem;
}

/* Table name label in info bar — second line */
.table-name-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.65rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-name-label:empty {
    display: none;
}

/* Connection indicator dot in table info bar */
.conn-indicator {
    display: flex;
    align-items: center;
    padding: 2px;
}

.conn-indicator .conn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.conn-dot.conn-live {
    background: #22c55e;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.6);
}

.conn-dot.conn-polling {
    background: #f59e0b;
    box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}

.conn-dot.conn-reconnecting {
    background: #f59e0b;
    animation: connPulse 1.2s ease-in-out infinite;
}

.conn-dot.conn-disconnected {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

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

/* Stack display hidden — redundant with the chip count shown in the player seat */
.table-info-bar .your-stack {
    display: none;
}

/* ========== Hotkeys Overlay ========== */
.hotkeys-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: hotkeysFadeIn 0.15s ease;
}

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

.hotkeys-content {
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.hotkeys-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
    text-align: center;
}

.hotkeys-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
}

.hotkeys-row + .hotkeys-row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hotkeys-row kbd {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    padding: 0.15rem 0.5rem;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    min-width: 28px;
    text-align: center;
    line-height: 1.4;
}

.hotkeys-note {
    margin-top: 0.65rem;
    text-align: center;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
}

/* ========== Session P&L ========== */
.seat-session-pl {
    font-size: 0.6rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    margin-top: 1px;
}

.seat-session-pl.positive {
    color: #4ade80;
}

.seat-session-pl.negative {
    color: #f87171;
}

/* ========== Tournament Break Overlay ========== */
.tournament-break-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(5, 10, 5, 0.85);
    border-radius: inherit;
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.break-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 1.5rem 3rem;
    border-radius: 12px;
    border: 1px solid rgba(196, 181, 253, 0.2);
}

.break-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #c4b5fd;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(196, 181, 253, 0.3);
}

.break-timer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
    font-variant-numeric: tabular-nums;
}

/* Table merge overlay — shown when a tournament table is closing */
.table-merge-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    border-radius: inherit;
    z-index: 50;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: mergeOverlayIn 0.4s ease-out;
}

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

.merge-content {
    text-align: center;
    padding: 1.5rem 2rem;
}

.merge-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f7931a;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.merge-message {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.merge-countdown {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
}

/* ========== In-the-Money Seat ========== */
.seat.in-the-money .seat-info {
    border: 1px solid rgba(250, 204, 21, 0.35);
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.15);
}

/* ========== Late Registration Badge ========== */
.tournament-late-reg {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}

.tournament-late-reg.open {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.tournament-late-reg.closed {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== Tournament Payouts ========== */
.tournament-payout-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

.tournament-payout-row + .tournament-payout-row {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tournament-payout-pos {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.tournament-payout-amount {
    color: #facc15;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ========== Tournament Details Section (below provably fair) ========== */
.tournament-details-section {
    margin-top: 0.5rem;
}

/* ========== Tournament Level Rows ========== */
.tournament-level-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.tournament-level-row + .tournament-level-row {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.tournament-level-row.current-level {
    background: rgba(139, 92, 246, 0.12);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.tournament-level-num {
    font-weight: 600;
    min-width: 52px;
    color: inherit;
}

.tournament-level-row.current-level .tournament-level-num {
    color: #c4b5fd;
}

.tournament-level-blinds {
    font-variant-numeric: tabular-nums;
    min-width: 48px;
}

.tournament-level-ante {
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    color: rgba(255, 255, 255, 0.35);
}

.tournament-level-row.current-level .tournament-level-ante {
    color: rgba(255, 255, 255, 0.6);
}

.tournament-level-duration {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    min-width: 36px;
    text-align: right;
}

.tournament-level-duration.countdown {
    font-weight: 600;
    color: #c4b5fd;
}

.tournament-level-row.past-level {
    opacity: 0.35;
}

.tournament-level-row.past-level .tournament-level-num {
    text-decoration: line-through;
}

/* ========== Auto Top-Up Toggle ========== */
/* Hidden: confusing as a standalone bar — will be moved to settings in future */
.auto-topup-toggle {
    display: none !important;
}

.auto-topup-toggle:hover {
    border-color: rgba(247, 147, 26, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.auto-topup-toggle.active {
    background: rgba(247, 147, 26, 0.12);
    border-color: rgba(247, 147, 26, 0.3);
    color: #f7931a;
}

.auto-topup-label {
    font-weight: 500;
}

/* ========== Spectator Bar ========== */
.spectator-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.spectator-label {
    font-size: 0.8rem;
    color: #a78bfa;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.spectator-back-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.spectator-back-btn:hover {
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.25);
}

.spectator-sit-btn {
    background: var(--primary, #f7931a);
    color: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 6px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(247, 147, 26, 0.3);
}

.spectator-sit-btn:hover {
    background: #e8850f;
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.4);
    transform: translateY(-1px);
}

/* ========== Connection Status ========== */
.connection-status {
    position: fixed;
    top: 60px;
    right: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}
.conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.conn-dot.conn-connected { background: #22c55e; }
.conn-dot.conn-reconnecting { background: #f59e0b; animation: connPulse 1s ease-in-out infinite; }
.conn-dot.conn-disconnected { background: #ef4444; }
.conn-text { color: rgba(255, 255, 255, 0.8); }

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

/* ========== Sit Out Button ========== */
.sitout-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.sitout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}
.sitout-btn.sitting-out {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

/* ========== Seat Badges ========== */
.seat-disconnected {
    font-size: 0.5rem;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    animation: connPulse 2s ease-in-out infinite;
}
.seat-sitout {
    font-size: 0.5rem;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.leave-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
}

.leave-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ========== Hand Result Overlay ========== */
/* Hand result — subtle inline toast instead of full overlay */
.hand-result-overlay {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    padding: 0.5rem 1.25rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 280px;
}

.hand-result-overlay.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.hand-result-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
    text-wrap: balance;
    text-align: center;
    animation: resultPop 0.3s ease-out;
}

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

.hand-result-text.win {
    color: #ffd700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.hand-result-text.lose {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.hand-result-detail {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
    text-align: center;
}

.hand-result-amount {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

/* ========== Hand History Sidebar ========== */
/* ========== Hand History Items ========== */
.hand-history-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.78rem;
}

.hand-history-item:last-child {
    border-bottom: none;
}

.hand-history-item.hh-fold {
    opacity: 0.6;
}

.hand-history-item.hh-new {
    animation: hhSlideIn 0.3s ease-out;
}

@keyframes hhSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Line 1: "#75 — 255 sat pot" or "+50" for hero */
.hh-top-row {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.4;
}

.hh-hand-num {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.hh-pot {
    color: var(--text-secondary);
    font-size: 0.72rem;
    flex-shrink: 0;
}

.hh-result {
    margin-left: auto;
    font-weight: 600;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.hh-result.win {
    color: #22c55e;
}

.hh-result.lose {
    color: #ef4444;
}

/* Line 2: "FrostBear wins (others folded)" */
.hh-winner-row {
    margin-top: 2px;
    line-height: 1.4;
    text-wrap: balance;
}

.hh-winner {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
}

.hh-result.spectator {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.72rem;
}

.hh-winner-cards .hh-board-label { color: rgba(34, 197, 94, 0.5); }
.hh-winner-cards .hh-mini-card { border-color: rgba(34, 197, 94, 0.3); }

/* Line 3+: Board + hole cards */
.hh-community {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
    white-space: nowrap;
}

.hh-mini-card {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    padding: 1px 3px;
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.hh-mini-card.red {
    color: #ef4444;
}

.hh-mini-card.club, .hh-mini-card.spade {
    color: rgba(255, 255, 255, 0.85);
}

.hh-board-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    align-self: center;
    margin-right: 2px;
    flex-shrink: 0;
}

/* ========== Waiting State ========== */
.waiting-message {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.waiting-message .dots {
    animation: dotPulse 1.5s infinite;
}

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

/* ========== Street Labels ========== */
.street-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    font-weight: 600;
}

/* ========== Dealer Button (Legacy floating — hidden, replaced by seat badge) ========== */
.dealer-chip {
    display: none !important;
}

/* Dealer badge — attached to the upper-right corner of the dealer's seat info */
.seat.is-dealer .seat-info {
    position: relative;
}

/* Dealer badge — anchored to seat-info element (not engine-positioned) */
.dealer-badge {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: 2px solid #fff;
    font-size: 9px;
    font-weight: 800;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 3px rgba(251, 191, 36, 0.3);
    pointer-events: none;
    z-index: 5;
    line-height: 1;
}
/* Hide legacy ::after dealer badge — .dealer-badge element replaces it */
.seat.is-dealer .seat-info::after {
    display: none;
}

/* ========== Pre-Action Checkboxes ========== */
.pre-action-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.35rem 0;
}

.pre-action-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.pre-action-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.pre-action-label:hover {
    color: var(--text-primary);
}

.pre-action-label.pre-action-sitout {
    color: rgba(239, 68, 68, 0.6);
    font-size: 0.72rem;
}

.pre-action-label.pre-action-sitout input[type="checkbox"] {
    accent-color: #ef4444;
}

/* ========== Pot Odds Display ========== */
.pot-odds-display {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0.15rem 0;
}
.pot-odds-value {
    color: var(--primary);
    font-weight: 600;
}

/* ========== All-In Visual Effect ========== */
.seat.all-in .seat-info {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

/* ========== Four-Color Deck Toggle ========== */
.four-color-toggle {
    position: fixed;
    top: 60px;
    right: 50px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.four-color-toggle:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}
.four-color-toggle.active {
    background: rgba(247, 147, 26, 0.2);
    border-color: rgba(247, 147, 26, 0.4);
    color: #f7931a;
}

/* ========== Four-Color Deck Variants ========== */
body.four-color-deck .bj-card.diamonds .card-rank,
body.four-color-deck .bj-card.diamonds .card-suit-small,
body.four-color-deck .bj-card.diamonds .card-suit-large {
    color: #2563eb;
}
body.four-color-deck .bj-card.clubs .card-rank,
body.four-color-deck .bj-card.clubs .card-suit-small,
body.four-color-deck .bj-card.clubs .card-suit-large {
    color: #16a34a;
}
body.four-color-deck .seat-minicard.face-up.diamonds {
    color: #2563eb;
}
body.four-color-deck .seat-minicard.face-up.clubs {
    color: #16a34a;
}

/* ========== Controls Stack Override ========== */
.poker-container .controls-stack {
    display: flex;
    flex-direction: column;
}

.poker-container .controls-stack > * {
    grid-row: unset;
    grid-column: unset;
}

/* ========== My Stats Panel ========== */
.poker-stats-card .card-header {
    margin-bottom: 0.5rem;
}

.pstat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
}

.pstat-row:last-child {
    border-bottom: none;
}

.pstat-label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pstat-value {
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.pstat-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.6rem;
    cursor: help;
    margin-left: 2px;
}

.stat-positive .pstat-value {
    color: #22c55e;
}

.stat-negative .pstat-value {
    color: #ef4444;
}

.stat-rakeback .pstat-value {
    color: #f7931a;
}

.poker-stats-advanced-toggle {
    text-align: center;
    padding: 0.4rem 0 0.2rem;
}

.poker-stats-advanced-toggle a {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.poker-stats-advanced-toggle a:hover {
    opacity: 1;
    color: #f7931a;
}

.poker-stats-advanced {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 0.3rem;
    padding-top: 0.3rem;
}

/* ========== Add Chips Button ========== */
.add-chips-btn {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.add-chips-btn:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .poker-table {
        min-height: 260px;
        padding: 1.25rem 0.75rem;
        border-radius: 45% / 30%;
    }

    .seat-info {
        padding: 2px 6px;
        min-width: 52px;
        max-width: 75px;
        border-radius: 6px;
    }

    .seat-name {
        font-size: 0.62rem;
        max-width: 65px;
    }

    .seat-stack {
        font-size: 0.58rem;
    }

    .seat-bet {
        font-size: 0.58rem;
    }

    .pot-amount {
        font-size: 0.95rem;
    }

    .poker-action-btn {
        padding: 0.75rem 0.4rem;
        font-size: 0.82rem;
        min-height: 52px;
    }

    .hero-cards .bj-card {
        width: clamp(44px, 7vmin, 65px);
        height: clamp(62px, 9.8vmin, 91px);
    }

    /* Adjust seat positions for smaller screens */
    .seat[data-seat="0"] { bottom: -10px; left: 30%; }
    .seat[data-seat="1"] { left: -8px; top: 58%; }
    .seat[data-seat="2"] { top: -10px; left: 30%; }
    .seat[data-seat="3"] { top: -10px; right: 30%; }
    .seat[data-seat="4"] { right: -8px; top: 58%; }
    .seat[data-seat="5"] { bottom: -10px; right: 30%; }
    .seat[data-seat="6"] { bottom: -10px; left: 50%; }
    .seat[data-seat="7"] { top: -10px; left: 50%; }
    .seat[data-seat="8"] { top: 25%; right: -8px; }

    /* 9-max oval distribution at 768px */
    .seats-9 { min-height: 340px; }
    .seats-9 .seat[data-seat="7"] { top: -16px; }
    .seats-9 .seat[data-seat="2"] { top: -4px; }
    .seats-9 .seat[data-seat="3"] { top: -4px; }
    .seats-9 .seat[data-seat="6"] { bottom: -18px; }
    .seats-9 .seat[data-seat="0"] { bottom: -8px; }
    .seats-9 .seat[data-seat="5"] { bottom: -8px; }
    .seats-9 .seat[data-seat="1"] { top: 65%; }
    .seats-9 .seat[data-seat="4"] { top: 65%; }
    .seats-9 .seat[data-seat="8"] { top: 14%; }

    /* Per-seat bet chip, action flash, dealer badge positions — computed by PokerLayout engine */

    /* Lobby responsive */
    .lobby-hero-felt {
        padding: 1.25rem 1rem;
        gap: 1.25rem;
    }

    .lobby-card {
        width: 62px;
        height: 90px;
    }

    .lc-center-pip { font-size: 1.8rem; }
    .lc-corner-rank { font-size: 0.8rem; }
    .lc-corner-suit { font-size: 0.55rem; }

    .lobby-hero-content h2 {
        font-size: 1.15rem;
    }

    .lobby-filter-bar {
        padding: 0.4rem 0.75rem;
        gap: 0.5rem;
    }

    .filter-pills {
        gap: 0.25rem;
        flex-wrap: wrap;
    }

    .filter-pill {
        padding: 0.3rem 0.55rem;
        font-size: 0.7rem;
        min-height: 28px;
    }

    .filter-checkbox {
        font-size: 0.68rem;
    }

    .table-list-header {
        display: none;
    }

    .table-card {
        grid-template-columns: 1fr auto auto;
        gap: 0.5rem;
    }

    .table-stakes,
    .table-avgpot,
    .table-hands,
    .tlh-avgpot,
    .tlh-hands {
        display: none;
    }

    /* Tournament lobby mobile */
    .tournament-lobby-header {
        flex-direction: column;
        gap: 4px;
        padding: 0.5rem 0.75rem;
    }

    .tournament-header-stats {
        gap: 8px;
        font-size: 0.68rem;
    }

    /* Tournament info panel mobile */
    .tournament-info-panel {
        padding: 0.4rem 0.6rem;
    }

    .tournament-info-summary {
        gap: 4px;
    }

    .tournament-info-value {
        font-size: 0.78rem;
    }

    .spectator-back-btn {
        min-height: 36px;
    }

    .spectator-sit-btn {
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    .poker-container {
        padding: 0.5rem;
        border-radius: 12px;
    }

    /* Phase 1A: Taller table for portrait phones */
    .poker-table {
        min-height: 280px;
        padding: 1.25rem 0.5rem;
        border-width: 5px;
        border-radius: 42% / 28%;
    }

    /* Phase 5: Community card gap tightened */
    .community-cards {
        gap: 2px;
    }

    .card-placeholder {
        width: clamp(40px, 6.5vmin, 54px);
        height: clamp(56px, 9.1vmin, 76px);
    }

    .seat-minicard {
        width: clamp(18px, 4vw, 26px);
        height: clamp(25px, 5.6vw, 37px);
        font-size: clamp(9px, 2.2vw, 11px);
    }

    /* Phase 1B: Fix text readability — minimum ~11px */
    .seat-info {
        padding: 3px 6px;
        min-width: 56px;
        max-width: 80px;
    }

    .seat-name {
        font-size: 0.7rem;
        max-width: 70px;
    }

    .seat-stack {
        font-size: 0.62rem;
    }

    .seat-bet-chip {
        font-size: 0.62rem;
        padding: 1px 5px 1px 3px;
        gap: 1px;
    }
    .seat-bet-chip::before {
        width: 7px;
        height: 7px;
    }

    /* LF-137: Reduce flash label size on narrow viewports to minimize spatial collision */
    .seat-action-flash {
        font-size: 0.72rem;
        padding: 3px 8px;
    }

    /* Phase 1C: Seat repositioning for portrait phones */
    .seat[data-seat="0"] { bottom: -16px; left: 28%; }
    .seat[data-seat="1"] { left: -2px; top: 52%; }
    .seat[data-seat="2"] { top: -8px; left: 20%; }
    .seat[data-seat="3"] { top: -8px; right: 20%; }
    .seat[data-seat="4"] { right: -2px; top: 52%; }
    .seat[data-seat="5"] { bottom: -16px; right: 28%; }
    .seat[data-seat="6"] { bottom: -16px; left: 50%; }
    .seat[data-seat="7"] { top: -8px; left: 50%; }
    .seat[data-seat="8"] { top: 26%; right: -2px; }

    /* 9-max oval distribution at 480px */
    .seats-9 { min-height: 300px; }
    .seats-9 .seat[data-seat="7"] { top: -14px; }
    .seats-9 .seat[data-seat="2"] { top: -2px; left: 14%; }
    .seats-9 .seat[data-seat="3"] { top: -2px; right: 14%; }
    .seats-9 .seat[data-seat="6"] { bottom: -18px; }
    .seats-9 .seat[data-seat="0"] { bottom: -10px; }
    .seats-9 .seat[data-seat="5"] { bottom: -10px; }
    .seats-9 .seat[data-seat="1"] { top: 58%; }
    .seats-9 .seat[data-seat="4"] { top: 62%; }
    .seats-9 .seat[data-seat="8"] { top: 22%; }

    /* Per-seat bet chip & dealer badge positions — computed by PokerLayout engine */

    /* Dealer badge responsive sizing at 480px */
    .dealer-badge {
        width: 16px;
        height: 16px;
        font-size: 8px;
        right: -10px;
    }

    /* Phase 1G: Action button spacing */
    .poker-action-row {
        gap: 0.5rem;
    }

    .poker-action-btn {
        padding: 0.6rem 0.35rem;
        font-size: 0.8rem;
        border-radius: 8px;
        border-width: 2px;
        min-height: 52px;
    }

    /* Raise header: visible on mobile only */
    .raise-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.25rem;
    }

    /* Raise row: fixed bottom sheet on mobile */
    .raise-row {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        border-radius: 14px 14px 0 0;
        background: var(--bg-card, #1a1d26);
        border: 1px solid var(--border);
        border-bottom: none;
        padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
        animation: raiseSheetUp 0.2s ease-out;
    }

    @keyframes raiseSheetUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Phase 1E: Raise presets 3-column at 480px */
    .raise-presets {
        grid-template-columns: repeat(3, 1fr);
    }

    .raise-preset {
        min-height: 40px;
        font-size: 0.75rem;
    }

    /* Phase 1F: Bigger slider thumb */
    .raise-slider {
        height: 8px;
    }

    .raise-slider::-webkit-slider-thumb {
        width: 36px;
        height: 36px;
    }

    .raise-slider::-moz-range-thumb {
        width: 36px;
        height: 36px;
    }

    /* Phase 2B: Hero seat emphasis */
    .seat.is-hero .seat-info {
        min-width: 68px;
        max-width: 90px;
    }

    .seat.is-hero .seat-name {
        font-size: 0.78rem;
    }

    .seat.is-hero .seat-stack {
        font-size: 0.68rem;
    }

    /* Far seats (top of table) — slightly smaller */
    .seat[data-seat="2"] .seat-info,
    .seat[data-seat="3"] .seat-info,
    .seat[data-seat="7"] .seat-info {
        max-width: 72px;
    }

    /* Phase 3B: Spectator mode — bigger table + text */
    .poker-container.spectating .poker-table {
        min-height: 320px;
    }

    .poker-container.spectating .seat-name {
        font-size: 0.75rem;
    }

    .poker-container.spectating .seat-stack {
        font-size: 0.66rem;
    }

    /* Dealer chip — smaller on mobile */
    .dealer-chip {
        width: 18px;
        height: 18px;
        font-size: 9px;
        border-width: 1.5px;
        z-index: 3;
    }

    /* Action flash labels — readable on mobile, below community cards z-index */
    .seat-action-flash {
        font-size: 0.78rem;
        padding: 4px 10px;
        z-index: 4; /* Below community cards (z-index: 6) to prevent overlap */
    }

    /* Community cards above action flashes */
    .community-cards {
        position: relative;
        z-index: 6;
    }

    /* Per-seat action flash positions — computed by PokerLayout engine */

    /* Phase 3C: Compact spectator bar on mobile */
    .spectator-bar {
        padding: 0.35rem 0.75rem;
    }

    .spectator-label {
        font-size: 0.7rem;
    }

    .spectator-back-btn {
        padding: 8px 12px;
        min-height: 38px;
    }

    .spectator-sit-btn {
        padding: 8px 18px;
        min-height: 38px;
    }

    /* Hero cards now shown as minicards on the seat — hide hero-area on mobile */
    .hero-area {
        display: none !important;
    }

    /* Phase 4: Pot display compact */
    .pot-display {
        padding: 3px 10px;
    }

    .pot-amount {
        font-size: 0.88rem;
    }

    /* Phase 5: Compact table info bar — with margin to clear top seats */
    .table-info-bar {
        padding: 0.35rem 0.15rem;
        font-size: 0.68rem;
        gap: 0.3rem;
        margin-bottom: 2px;
    }

    .table-info-bar .table-blinds {
        white-space: nowrap;
        font-size: 0.72rem;
    }

    .table-info-bar .your-stack {
        font-size: 0.72rem;
    }

    /* Stronger active turn glow on mobile */
    .seat.active-turn .seat-info {
        border-color: rgba(247, 147, 26, 0.8);
        box-shadow: 0 0 12px rgba(247, 147, 26, 0.6), 0 0 28px rgba(247, 147, 26, 0.25);
    }
    .seat.active-turn::before {
        background: radial-gradient(ellipse at center, rgba(247, 147, 26, 0.2) 0%, transparent 70%);
    }

    /* Phase 5: Fix sound/4C toggle positioning */
    .four-color-toggle {
        right: 16px;
    }

    /* Lobby responsive */
    .lobby-hero-felt {
        padding: 1rem 0.75rem;
        gap: 1rem;
    }

    .lobby-card {
        width: 52px;
        height: 75px;
        border-radius: 5px;
    }

    .lc-center-pip { font-size: 1.5rem; }
    .lc-corner-rank { font-size: 0.7rem; }
    .lc-corner-suit { font-size: 0.5rem; }
    .lc-top-left { top: 4px; left: 5px; }
    .lc-bottom-right { bottom: 4px; right: 5px; }

    .lobby-hero-content h2 {
        font-size: 1rem;
    }

    .lobby-hero-sub {
        font-size: 0.75rem;
        margin-bottom: 0.7rem;
    }

    .quick-seat-btn {
        padding: 0.55rem 1rem;
        font-size: 0.82rem;
    }

    .lobby-info-bar {
        padding: 0.5rem 0.75rem;
    }
}

/* LF-89: At ≤375px, keep right-side seats inside the viewport (override the 768px -8px rule) */
@media (max-width: 375px) {
    .seat[data-seat="4"] { right: 2px; }
    .seat[data-seat="8"] { right: 2px; }
}

@media (max-width: 360px) {
    .poker-table {
        min-height: 250px;
        padding: 0.75rem 0.4rem;
        border-radius: 40% / 25%;
    }

    .seat-info {
        padding: 2px 4px;
        min-width: 46px;
        max-width: 72px;
        border-radius: 5px;
    }

    .seat-name {
        font-size: 0.62rem;
        max-width: 64px;
    }

    .seat-stack {
        font-size: 0.58rem;
    }

    .seat-hand-rank {
        max-width: 48px !important;
        font-size: 0.56rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Per-seat hand rank positions — computed by PokerLayout engine */

    /* Spread seats apart to prevent overlap */
    .seat[data-seat="0"] { left: 30%; }
    .seat[data-seat="1"] { left: -2px; top: 65%; }
    .seat[data-seat="2"] { top: -10px; left: 30%; }
    .seat[data-seat="3"] { top: -10px; right: 30%; }
    .seat[data-seat="4"] { right: 2px; top: 62%; }
    .seat[data-seat="5"] { right: 8%; }
    .seat[data-seat="6"] { bottom: -16px; left: 54%; }
    .seat[data-seat="7"] { top: -10px; left: 50%; }
    .seat[data-seat="8"] { top: 24%; right: 2px; }

    /* 9-max oval distribution at 360px */
    .seats-9 { min-height: 270px; }
    .seats-9 .seat[data-seat="7"] { top: -14px; }
    .seats-9 .seat[data-seat="2"] { top: -2px; left: 22%; }
    .seats-9 .seat[data-seat="3"] { top: -2px; right: 22%; }
    .seats-9 .seat[data-seat="6"] { bottom: -18px; }
    .seats-9 .seat[data-seat="0"] { bottom: -10px; }
    .seats-9 .seat[data-seat="5"] { bottom: -10px; }
    .seats-9 .seat[data-seat="1"] { top: 60%; }
    .seats-9 .seat[data-seat="4"] { top: 54%; }
    .seats-9 .seat[data-seat="8"] { top: 28%; }

    /* Per-seat bet chip positions — computed by PokerLayout engine */

    .poker-action-btn {
        font-size: 0.7rem;
        padding: 0.55rem 0.25rem;
        min-height: 48px;
    }

    .hero-cards {
        gap: 4px;
    }

    .raise-presets {
        grid-template-columns: repeat(3, 1fr);
    }

    .raise-preset {
        padding: 0.45rem 0.5rem;
        font-size: 0.7rem;
        min-height: 44px;
    }

    /* Stack four-color toggle below sound toggle */
    .four-color-toggle {
        top: 90px;
        right: 16px;
    }
}

/* ========== Leave Confirmation Modal ========== */
.leave-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.leave-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.leave-modal {
    background: linear-gradient(165deg, #1a1d26, #12141a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.75rem 2rem;
    max-width: 320px;
    width: 90%;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.leave-overlay.visible .leave-modal {
    transform: scale(1);
}

.leave-modal h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.leave-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.4;
}

.leave-chips {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.leave-actions {
    display: flex;
    gap: 0.75rem;
}

.leave-cancel,
.leave-confirm {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

.leave-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leave-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
}

.leave-confirm {
    background: linear-gradient(135deg, #f7931a, #cc7a15);
    color: rgba(255, 255, 255, 0.92);
}

.leave-confirm:hover {
    filter: brightness(1.1);
}

.leave-confirm:active,
.leave-cancel:active {
    transform: scale(0.97);
}

/* ========== Seat Hand Rank Labels (Showdown) ========== */
.seat-hand-rank {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 5;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.seat-hand-rank.winner {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.4);
}

/* ========== Win Amount Badge (+sats near winner) ========== */
.seat-win-amount {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    color: #4ade80;
    background: rgba(0, 0, 0, 0.85);
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    animation: winAmountPop 0.4s ease-out forwards;
}

@keyframes winAmountPop {
    0% { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.7); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ========== Showdown Loser Dim ========== */
.seat-info.showdown-loser {
    opacity: 0.45;
    transition: opacity 0.3s ease;
}

/* ========== Winner Banner (All Viewers) ========== */
.winner-banner {
    display: none !important;  /* Disabled — info available in Recent Hands */
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.92), rgba(20, 18, 10, 0.92));
    border: 1px solid rgba(255, 215, 0, 0.45);
    border-radius: 10px;
    padding: 10px 24px;
    color: #ffd700;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    text-shadow: 0 1px 6px rgba(255, 215, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 215, 0, 0.08);
    letter-spacing: 0.02em;
}

.winner-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

@media (max-width: 768px) {
    .seat-hand-rank {
        font-size: 0.58rem;
        padding: 1px 4px;
    }

    .winner-banner {
        font-size: 0.75rem;
        padding: 6px 14px;
        max-width: 90vw;
        white-space: normal;
        text-align: center;
        text-wrap: balance;
    }
}

@media (max-width: 480px) {
    .seat-hand-rank {
        font-size: 0.62rem;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .winner-banner {
        font-size: 0.7rem;
        padding: 5px 10px;
        bottom: 4px;
    }
}

/* ========== Lobby Stats Grid ========== */
.lobby-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    text-align: center;
    padding: 4px 0;
}

.lobby-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lobby-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    font-variant-numeric: tabular-nums;
}

.lobby-stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ========== Opponent Stats Popup ========== */
.seat-stats-popup {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 110px;
    z-index: 120;
    backdrop-filter: blur(12px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.seat-stats-popup.visible {
    opacity: 1;
    pointer-events: auto;
}

.seat-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.65rem;
    line-height: 1.6;
}

.seat-stats-label {
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.seat-stats-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.seat-stats-name {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    margin-bottom: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 3px;
}

/* Top-row seats: popup goes below instead */
.seat[data-seat="2"] .seat-stats-popup,
.seat[data-seat="3"] .seat-stats-popup,
.seat[data-seat="7"] .seat-stats-popup {
    bottom: auto;
    top: calc(100% + 6px);
}

/* ========== Side Pots Display ========== */
.side-pots-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 2px;
}

.side-pot-pill {
    font-size: 0.55rem;
    font-weight: 600;
    color: rgba(251, 191, 36, 0.8);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 8px;
    padding: 1px 6px;
    white-space: nowrap;
}

.side-pot-pill .sp-label {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.5rem;
    margin-right: 2px;
}

/* ========== Card Deal Animation ========== */
.community-cards .bj-card {
    animation: cardDealIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes cardDealIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hero card deal — slide up from below */
.hero-cards .bj-card {
    animation: heroDealIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@-webkit-keyframes heroDealIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(16px) scale(0.8) rotateX(20deg);
        transform: translateY(16px) scale(0.8) rotateX(20deg);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0) scale(1) rotateX(0deg);
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}
@keyframes heroDealIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(16px) scale(0.8) rotateX(20deg);
        transform: translateY(16px) scale(0.8) rotateX(20deg);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0) scale(1) rotateX(0deg);
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

/* Seat mini-cards deal — brief pop-in */
.seat-cards .seat-minicard {
    animation: miniCardDeal 0.25s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.seat-cards .seat-minicard:nth-child(2) {
    animation-delay: 0.06s;
}

@keyframes miniCardDeal {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== Time Bank on Seat ========== */
/* Time bank uses action flash positioning — just style the colors, no float-away */
.seat-action-flash.action-time-bank {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.25);
    border: 1px solid rgba(251, 191, 36, 0.5);
    animation: timeBankPulse 1s ease infinite;
}

@keyframes timeBankPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(251, 191, 36, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
    .seat-info,
    .bj-card,
    .seat-minicard,
    .community-cards .bj-card,
    .hero-cards .bj-card,
    .hand-result-overlay,
    .hand-result-text,
    .raise-row,
    .dealer-chip,
    .seat.folded .seat-cards {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
    .seat.active-turn .seat-info {
        animation: none !important;
    }
    .seat-action-flash {
        animation-duration: 0.01ms !important;
    }
    .seat-timer-fill {
        animation: none !important;
    }
    .table-status-dot {
        animation: none !important;
    }
    .winner-banner {
        transition-duration: 0.01ms !important;
    }
    .seat.active-turn::before {
        animation: none !important;
    }
    .community-cards .bj-card,
    .hero-cards .bj-card,
    .seat-cards .seat-minicard {
        animation: none !important;
    }
    .seat-timebank-badge {
        animation: none !important;
    }
}

/* ============ CLICKABLE RECENT HANDS ============ */
.hand-history-item.hh-clickable {
    cursor: pointer;
    transition: background 0.15s;
}
.hand-history-item.hh-clickable:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* ============ HAND REPLAY MODAL ============ */
.hand-replay-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.hand-replay-panel {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.hand-replay-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #2a2a4a;
}
.hand-replay-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #eee;
}
.hand-replay-close {
    background: none;
    border: none;
    color: #666;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.hand-replay-close:hover {
    color: #ccc;
}
.hand-replay-body {
    padding: 16px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #ccc;
}

/* Replay content */
.replay-loading, .replay-error {
    text-align: center;
    padding: 24px 0;
    color: #888;
}
.replay-error { color: #ef4444; }

.replay-header {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}
.replay-meta {
    font-size: 0.78rem;
    color: #f7931a;
    margin-bottom: 14px;
}
.replay-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    margin-bottom: 6px;
    font-weight: 600;
}

/* ── Players section ── */
.replay-players {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.replay-player-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.82rem;
}
.replay-position {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 3px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.replay-pos-btn {
    color: #f7931a;
    background: rgba(247, 147, 26, 0.12);
}
.replay-player-name {
    color: #eee;
    font-weight: 500;
    min-width: 70px;
}
.replay-player-cards {
    display: inline-flex;
    gap: 2px;
}
.replay-player-stack {
    margin-left: auto;
    color: #666;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ── Streets ── */
.replay-street {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.replay-street-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.replay-action {
    padding: 2px 0 2px 12px;
    font-size: 0.82rem;
    color: #bbb;
}
.replay-fold { color: #555; }
.replay-bet { color: #f7931a; }
.replay-allin { color: #ef4444; font-weight: 600; }
.replay-blind { color: #666; font-size: 0.78rem; }
.replay-street-pot {
    font-size: 0.75rem;
    color: #888;
    text-align: right;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255, 255, 255, 0.04);
}

/* ── Winners / Result ── */
.replay-winners {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 255, 136, 0.04);
    border: 1px solid rgba(0, 255, 136, 0.1);
}
.replay-board {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    justify-content: center;
}
.replay-board .hh-mini-card {
    font-size: 0.85rem;
    padding: 3px 5px;
}
.replay-winner-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    flex-wrap: wrap;
}
.replay-winner-row + .replay-winner-row {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.replay-winner-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}
.replay-winner-cards {
    display: inline-flex;
    gap: 2px;
}
.replay-winner-hand {
    font-size: 0.78rem;
    font-weight: 600;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    padding: 1px 8px;
    border-radius: 10px;
}
.replay-winner-fold {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}
.replay-winner-amount {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f7931a;
    flex-shrink: 0;
}

/* ── Provably Fair ── */
.replay-fairness {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.replay-seed {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #666;
    word-break: break-all;
    padding: 2px 0;
}

/* Mobile replay */
@media (max-width: 480px) {
    .hand-replay-panel {
        max-height: 85vh;
    }
    .hand-replay-body {
        padding: 12px;
        font-size: 0.82rem;
    }
    .replay-winner-row {
        gap: 4px;
    }
    .replay-position {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
}

/* ========== TOURNAMENT HISTORY ========== */

.tournament-history {
    margin-top: 1.5rem;
}

.tournament-history-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    list-style: none;
}

.tournament-history-header::-webkit-details-marker { display: none; }

.tournament-history-header::after {
    content: '\25B6';
    font-size: 0.55rem;
    color: var(--text-secondary);
    margin-left: auto;
    transition: transform 0.2s;
}

.tournament-history[open] > .tournament-history-header::after {
    transform: rotate(90deg);
}

.tournament-history-header:hover {
    color: var(--text-primary);
}

.tournament-history-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tournament-history-header h3 svg {
    opacity: 0.6;
}

.tournament-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

/* Individual tournament card */
.th-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}

.th-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.th-card.th-participated {
    border-left: 3px solid var(--primary);
}

.th-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.th-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.th-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.th-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.th-stat {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.th-winner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.th-trophy {
    font-size: 0.65rem;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.th-winner-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* User's own result */
.th-my-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(247, 147, 26, 0.06);
    border: 1px solid rgba(247, 147, 26, 0.15);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

.th-my-pos {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.th-my-prize {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
}

/* Expandable standings */
.th-details {
    margin-top: 0.3rem;
}

.th-details summary {
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.th-details summary::-webkit-details-marker { display: none; }

.th-details summary::after {
    content: '\25B6';
    font-size: 0.55rem;
    transition: transform 0.2s;
}

.th-details[open] summary::after {
    transform: rotate(90deg);
}

.th-details summary:hover {
    color: var(--text-primary);
}

.th-standings {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.th-standing-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
}

.th-standing-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.th-standing-row.th-standing-me {
    background: rgba(247, 147, 26, 0.08);
    border: 1px solid rgba(247, 147, 26, 0.15);
}

.th-standing-rank {
    width: 28px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.th-standing-row:nth-child(-n+3) .th-standing-rank {
    color: #f59e0b;
}

.th-standing-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.th-standing-payout {
    font-weight: 600;
    color: var(--success);
    flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .th-stats {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .th-card {
        padding: 0.6rem 0.75rem;
    }
}
