/* ═══════════════════════════════════════════════════════════════
   SolPoker — Main Design System
   Black & Metallic Gold Theme (matches cardback1.png)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ──────────────────────────────────────── */
:root {
    /* Layout */
    --lobby-header-height: 72px;
    --sidebar-width: clamp(260px, 18vw, 340px);

    /* Core Palette — true black base */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-elevated: #2e2e2e;
    --bg-hover: #383838;

    /* Accent Colors — metallic gold (sourced from cardback1.png) */
    --accent-gold: #d4af37;
    --accent-gold-dim: #a8862e;
    --accent-gold-bright: #f4d03f;
    /* Channel form for rgba(): rgba(var(--accent-gold-rgb), 0.3) */
    --accent-gold-rgb: 212, 175, 55;
    --accent-blue: #4a9eff;
    --accent-blue-dim: #3678c2;
    --accent-purple: #9b59b6;

    /* Text */
    --text-primary: #e4e4e4;
    --text-secondary: #a0a0a8;
    --text-muted: #6b6d73;
    --text-accent: var(--accent-gold);
    /* Dark text on gold buttons/chips — explicit token (not bg-primary) */
    --text-on-gold: #0a0a0a;

    /* Semantic */
    --success: #43b581;
    --success-dim: #2d7a57;
    --danger: #f04747;
    --danger-dim: #a83232;
    --warning: #faa61a;

    /* Poker Table — black + gold felt (matches cardback1.png) */
    --felt-green: #1a1410;
    --felt-green-light: #2a2118;
    --felt-border: #0d0a08;
    --felt-shadow: rgba(0, 0, 0, 0.6);

    /* Surfaces */
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.07);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-gold: 0 0 20px rgba(var(--accent-gold-rgb), 0.3);
    --shadow-glow-blue: 0 0 20px rgba(74, 158, 255, 0.3);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', var(--font-primary);
    --font-mono: 'JetBrains Mono', monospace;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ─── Lucide Icon baseline ──────────────────────────────── */
/* Icons inherit size from font-size, color from currentColor.
   Inline-flex so they align with text/buttons cleanly. */
.icon,
svg.icon {
    display: inline-flex;
    vertical-align: middle;
    flex-shrink: 0;
}
.btn .icon,
button .icon {
    margin-right: 6px;
}
h1 .icon,
h2 .icon,
h3 .icon {
    margin-right: 8px;
    vertical-align: -0.15em;
}

/* ─── Screens ────────────────────────────────────────────── */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
}
.screen.active {
    display: flex;
    flex-direction: column;
    animation: screenFadeIn 0.4s ease;
}

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

/* ─── Glass Panels ───────────────────────────────────────── */
.glass-panel {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
}

.glass-panel-sm {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 16px;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.15), transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.btn:hover::after { opacity: 1; }

.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
    color: var(--text-on-gold);
    box-shadow: var(--shadow-glow-gold);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(var(--accent-gold-rgb), 0.5);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dim));
    color: white;
    box-shadow: var(--shadow-glow-blue);
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.5);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}
.btn-ghost:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold-dim);
}
.btn-outline:hover { background: rgba(var(--accent-gold-rgb), 0.1); }

/* Action Buttons */
.btn-fold {
    background: linear-gradient(135deg, #8b3a3a, #6b2a2a);
    color: white;
    font-size: 1rem;
    padding: 14px 28px;
    min-width: 100px;
}
.btn-fold:hover { background: linear-gradient(135deg, #a04444, #7b3333); }

.btn-check {
    background: linear-gradient(135deg, #3a7d5c, #2a6b4c);
    color: white;
    font-size: 1rem;
    padding: 14px 28px;
    min-width: 100px;
}
.btn-check:hover { background: linear-gradient(135deg, #449966, #338855); }

.btn-call {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dim));
    color: white;
    font-size: 1rem;
    padding: 14px 28px;
    min-width: 120px;
}
.btn-call:hover { background: linear-gradient(135deg, #5aacff, #4688d0); }

.btn-raise {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
    color: var(--text-on-gold);
    font-size: 1rem;
    padding: 14px 28px;
    min-width: 100px;
}
.btn-raise:hover { transform: translateY(-2px); }

.btn-allin {
    background: linear-gradient(135deg, #e63946, #c82333);
    color: white;
    font-size: 1rem;
    padding: 14px 28px;
    min-width: 120px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-allin:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 30px rgba(230, 57, 70, 0.5);
}

.btn-raise-confirm {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
    color: var(--text-on-gold);
    font-size: 1rem;
    padding: 12px 24px;
    font-weight: 700;
}

.btn-preset {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 6px 12px;
    border: 1px solid var(--glass-border);
}
.btn-preset:hover {
    background: var(--bg-hover);
    color: var(--accent-gold);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ─── Inputs ─────────────────────────────────────────────── */
.input-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast);
    outline: none;
}
.input-field:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(var(--accent-gold-rgb), 0.15);
}

.input-field option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ─── Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }
.accent { color: var(--accent-gold); }
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}
.status-dot.pulse { animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(67, 181, 129, 0.7); }
    50% { box-shadow: 0 0 0 6px rgba(67, 181, 129, 0); }
}

.pulse-glow {
    animation: pulseGlow 2s infinite;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: var(--shadow-glow-gold); }
    50% { box-shadow: 0 0 35px rgba(var(--accent-gold-rgb), 0.6); }
}



/* ═══════════════════════════════════════════════════════════
   WALLET SCREEN
   ═══════════════════════════════════════════════════════════ */
#screen-wallet {
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.wallet-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(var(--accent-gold-rgb), 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(74, 158, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(155, 89, 182, 0.03) 0%, transparent 50%);
}

.wallet-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.wallet-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
}

.wallet-logo {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.logo-card {
    width: 50px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    animation: logoCardFloat 3s ease-in-out infinite;
    transition: transform var(--transition-spring);
}
.logo-card:hover { transform: translateY(-8px) rotate(5deg); }

.logo-card-1 { color: var(--text-on-gold); animation-delay: 0s; }
.logo-card-2 { color: var(--danger); animation-delay: 0.3s; }
.logo-card-3 { color: var(--danger); animation-delay: 0.6s; }
.logo-card-4 { color: var(--text-on-gold); animation-delay: 0.9s; }

@keyframes logoCardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.wallet-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.wallet-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: -8px;
}

.wallet-connect-box {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wallet-connect-box h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
}

.phantom-logo {
    display: flex;
    justify-content: center;
}

.wallet-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.wallet-status { text-align: center; }

.wallet-connected-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(67, 181, 129, 0.1);
    border: 1px solid rgba(67, 181, 129, 0.3);
    border-radius: var(--radius-full);
    color: var(--success);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.wallet-profile-setup {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.wallet-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--danger);
}

.wallet-features {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.feature-icon { font-size: 1.2rem; }

/* ═══════════════════════════════════════════════════════════
   LOBBY SCREEN
   ═══════════════════════════════════════════════════════════ */
#screen-lobby {
    background: var(--bg-primary);
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.lobby-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lobby-logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.online-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.lobby-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.player-avatar { font-size: 1.4rem; }

.player-info {
    display: flex;
    flex-direction: column;
}
.player-name { font-weight: 600; font-size: 0.9rem; }
.player-wallet {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lobby-content {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

.lobby-sidebar {
    position: sticky;
    top: var(--lobby-header-height, 72px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - var(--lobby-header-height, 72px) - 48px);
    overflow-y: auto;
}

/* Desktop two-column layout: sidebar + main */
@media (min-width: 900px) {
    .lobby-content {
        grid-template-columns: clamp(260px, 18vw, 340px) 1fr;
    }
}

.lobby-sidebar h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}

.sidebar-online-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.player-list-avatar {
    font-size: 1.2rem;
}

.player-list-name {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Create Table */
.lobby-create h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.create-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

/* Radio pill group (Free Play CPU/Live, Sol Cash format, Tourney format) */
.radio-group {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 4px;
}
.radio-pill {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 150ms;
}
.radio-pill input { display: none; }
.radio-pill.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.radio-pill:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* Buy-in slider */
.buyin-slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}
.buyin-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    background: linear-gradient(to right, var(--accent-gold-dim), var(--accent-gold));
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.buyin-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gold-bright);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.buyin-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gold-bright);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
}
.buyin-slider-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-gold);
    min-width: 70px;
    text-align: right;
    font-size: 1.05rem;
}

/* Readonly start chips display (sol-cash / sol-tourney modes) */
.start-chips-readonly {
    font-size: 1.05rem;
}

/* Table card header with mode badge */
.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}
.lobby-tables h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.table-card {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.table-card:hover {
    border-color: var(--accent-gold-dim);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.table-card:hover::before { opacity: 1; }

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.table-card-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.table-card-status {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
}
.table-card-status.waiting { background: rgba(250, 166, 26, 0.15); color: var(--warning); }
.table-card-status.running { background: rgba(67, 181, 129, 0.15); color: var(--success); }

/* Mode badge pill on table cards */
.mode-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}
.mode-badge-fp { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.mode-badge-sc { background: rgba(var(--accent-gold-rgb), 0.18); color: var(--accent-gold-bright); }
.mode-badge-st { background: rgba(155, 89, 182, 0.18); color: var(--accent-purple); }

/* Status line inside table card */
.table-card-status-line {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}
.table-card-status-line.waiting      { background: rgba(67, 181, 129, 0.1); color: var(--success); }
.table-card-status-line.running      { background: rgba(74, 158, 255, 0.1); color: var(--accent-blue); }
.table-card-status-line.registration { background: rgba(var(--accent-gold-rgb), 0.1); color: var(--accent-gold); }
.table-card-status-line.countdown    { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.table-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.table-card-detail {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-card-detail span:first-child {
    color: var(--text-muted);
}

.table-card-join {
    margin-top: 16px;
}

.table-card-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

.table-card-actions .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Withdraw Panel (winner's UI) ─── */
.withdraw-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(var(--accent-gold-rgb), 0.15), rgba(var(--accent-gold-rgb), 0.05));
    border: 1px solid var(--accent-gold);
    border-radius: 10px;
    padding: 8px 14px;
    box-shadow: 0 2px 12px rgba(var(--accent-gold-rgb), 0.2);
}

.withdraw-panel-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.withdraw-panel-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    font-weight: 600;
}

.withdraw-panel-amount {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.withdraw-panel-status {
    margin-top: 2px;
}

.withdraw-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.withdraw-status-pending  { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.withdraw-status-approved { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.withdraw-status-paid     { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.withdraw-status-rejected { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* ─── Spectator Badge ─── */
.spectator-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ─── Player History Tab ─── */
.history-aggregates {
    margin-bottom: 20px;
}

.history-agg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.history-agg {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.history-agg-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.history-agg-value.positive { color: #22c55e; }
.history-agg-value.negative { color: #ef4444; }

.history-agg-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.history-table .mono {
    font-family: var(--font-mono);
}

.history-table .positive { color: #22c55e; font-weight: 600; }

.history-result {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.history-result-won    { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.history-result-lost   { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.history-result-played { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

.history-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 32px;
    font-style: italic;
}

/* ─── Replay Modal ─── */
.replay-modal {
    max-width: 720px !important;
    max-height: 85vh;
    overflow-y: auto;
}

.replay-hand-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.replay-hand-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.replay-hand-btn:hover {
    background: rgba(var(--accent-gold-rgb), 0.15);
    border-color: var(--accent-gold);
}

.replay-hand-time {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.replay-container {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.replay-section {
    margin-bottom: 16px;
}

.replay-section h4 {
    margin: 0 0 8px 0;
    color: var(--accent-gold);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.replay-board {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.replay-card {
    display: inline-block;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    margin: 2px;
    min-width: 28px;
    text-align: center;
}

.replay-card-red   { color: #dc2626; }
.replay-card-black { color: #1f2937; }

.replay-players {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.replay-player {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
}

.replay-player.folded {
    opacity: 0.5;
}

.replay-player-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.replay-folded, .replay-allin {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 4px;
}

.replay-folded { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.replay-allin  { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.replay-player-cards {
    margin: 4px 0;
}

.replay-player-chips {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.replay-winner {
    background: rgba(var(--accent-gold-rgb), 0.1);
    border-left: 3px solid var(--accent-gold);
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.replay-actions {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 8px;
}

.replay-action {
    display: grid;
    grid-template-columns: 70px 1fr 80px 60px;
    gap: 8px;
    padding: 3px 0;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.replay-action-state {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
}

.replay-action-player {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.replay-action-type {
    color: var(--accent-gold);
    font-weight: 600;
}

.replay-action-amount {
    font-family: var(--font-mono);
    color: var(--text-primary);
    text-align: right;
}

/* ─── Deposit Modal ─── */
.deposit-modal {
    max-width: 480px !important;
}

.deposit-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.deposit-info-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.deposit-info-value {
    color: var(--text-primary);
    font-weight: 600;
}

.deposit-info-mono {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    word-break: break-all;
    max-width: 280px;
    color: var(--accent-gold);
}

/* Escrow wallet row + copy button */
.deposit-escrow-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-copy-escrow {
    background: rgba(var(--accent-gold-rgb), 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(var(--accent-gold-rgb), 0.3);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease;
    flex-shrink: 0;
}
.btn-copy-escrow:hover {
    background: rgba(var(--accent-gold-rgb), 0.22);
}
.btn-copy-escrow.copied {
    background: rgba(67, 181, 129, 0.15);
    color: var(--success);
    border-color: rgba(67, 181, 129, 0.4);
}

/* Primary Phantom pay button */
.btn-pay-phantom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(135deg, #551BF9 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(85, 27, 249, 0.35);
}
.btn-pay-phantom:hover:not(:disabled) {
    background: linear-gradient(135deg, #6824ff 0%, #8b46f5 100%);
    box-shadow: 0 6px 20px rgba(85, 27, 249, 0.5);
}
.btn-pay-phantom:disabled {
    opacity: 0.6;
    cursor: wait;
}
.btn-pay-phantom .phantom-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Status line — shown during pay → verify cycle */
.deposit-status {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid transparent;
}
.deposit-status.pending {
    background: rgba(var(--accent-gold-rgb), 0.08);
    border-color: rgba(var(--accent-gold-rgb), 0.25);
    color: var(--accent-gold);
}
.deposit-status.success {
    background: rgba(67, 181, 129, 0.08);
    border-color: rgba(67, 181, 129, 0.3);
    color: var(--success);
}
.deposit-status.error {
    background: rgba(240, 71, 71, 0.08);
    border-color: rgba(240, 71, 71, 0.3);
    color: var(--danger);
}

/* Deposit tabs */
.deposit-tabs {
    display: flex;
    gap: 0;
    margin-top: 18px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
}
.deposit-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 10px 0 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 150ms, border-color 150ms;
}
.deposit-tab:hover { color: var(--text-primary); }
.deposit-tab.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}
.deposit-tab-panel {
    display: none;
    padding: 16px 0 0;
}
.deposit-tab-panel.active { display: block; }

.deposit-manual-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin: 0 0 14px;
    line-height: 1.5;
}
#deposit-tab-manual .input-field { margin-bottom: 14px; }

.table-card-reserved {
    font-size: 0.72rem;
    color: var(--warning);
    font-weight: 500;
}

.table-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

.empty-icon { font-size: 3rem; display: block; margin-bottom: 12px; }

/* ═══════════════════════════════════════════════════════════
   GAME SCREEN
   ═══════════════════════════════════════════════════════════ */
#screen-game {
    background: var(--bg-primary);
    height: 100vh;
    flex-direction: column;
}

/* Top Bar */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    z-index: 5;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.game-table-name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.game-blinds, .game-hand-num {
    font-family: var(--font-mono);
}

/* Turn Timer */
.game-timer {
    position: relative;
    width: 40px;
    height: 40px;
}

.timer-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 2;
}

.timer-ring-fill {
    fill: none;
    stroke: var(--accent-gold);
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke-dasharray 1s linear;
}

.timer-ring-fill.urgent { stroke: var(--danger); }

.timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Poker Table Container */
.poker-table-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.poker-table {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    position: relative;
}

.poker-felt {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, var(--felt-green-light), var(--felt-green), var(--felt-border));
    border-radius: 50% / 40%;
    border: 6px solid var(--accent-gold-dim);
    box-shadow:
        inset 0 0 60px rgba(0, 0, 0, 0.4),
        0 0 0 8px #1a1410,
        0 0 0 12px var(--accent-gold),
        inset 0 0 80px rgba(var(--accent-gold-rgb), 0.04),
        var(--shadow-lg);
    overflow: visible;
}

.felt-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.15;
    pointer-events: none;
    user-select: none;
}
.felt-chip-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
}
.felt-logo-text {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 4px;
}
.felt-logo span { color: rgba(var(--accent-gold-rgb), 0.08); }

/* Player Seats — Positioned around the oval table */
.player-seats {
    position: absolute;
    inset: 0;
}

.player-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: all var(--transition-base);
}

/* 6-player seat positions (percentage of table) */
.player-seat[data-seat="0"] { bottom: -18%; left: 50%; transform: translate(-50%, 0); }
.player-seat[data-seat="1"] { bottom: 0%; left: 10%; transform: translate(-50%, 50%); }
.player-seat[data-seat="2"] { top: 15%; left: 5%; transform: translate(-50%, -50%); }
.player-seat[data-seat="3"] { top: -18%; left: 50%; transform: translate(-50%, 0); }
.player-seat[data-seat="4"] { top: 15%; right: 5%; transform: translate(50%, -50%); left: auto; }
.player-seat[data-seat="5"] { bottom: 0%; right: 10%; transform: translate(50%, 50%); left: auto; }

/* 9-player seat positions */
.seats-9 .player-seat[data-seat="0"] { bottom: -18%; left: 50%; }
.seats-9 .player-seat[data-seat="1"] { bottom: -5%; left: 15%; }
.seats-9 .player-seat[data-seat="2"] { top: 25%; left: 2%; }
.seats-9 .player-seat[data-seat="3"] { top: -5%; left: 20%; }
.seats-9 .player-seat[data-seat="4"] { top: -18%; left: 50%; }
.seats-9 .player-seat[data-seat="5"] { top: -5%; right: 20%; left: auto; }
.seats-9 .player-seat[data-seat="6"] { top: 25%; right: 2%; left: auto; }
.seats-9 .player-seat[data-seat="7"] { bottom: -5%; right: 15%; left: auto; }
.seats-9 .player-seat[data-seat="8"] { bottom: -18%; left: 65%; }

.seat-box {
    background: var(--bg-secondary);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    min-width: 120px;
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
}

.seat-box.is-current {
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow-gold);
    animation: currentPlayerGlow 1.5s ease-in-out infinite;
}

@keyframes currentPlayerGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(var(--accent-gold-rgb), 0.3); }
    50% { box-shadow: 0 0 30px rgba(var(--accent-gold-rgb), 0.6); }
}

.seat-box.is-folded { opacity: 0.4; }
.seat-box.is-winner {
    border-color: var(--accent-gold-bright);
    box-shadow: 0 0 25px rgba(var(--accent-gold-rgb), 0.5);
}
.seat-box.is-self {
    border-color: var(--accent-blue);
}

.seat-name {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.seat-chips {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-gold);
}

.seat-action {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    min-height: 16px;
}
.seat-action.fold { color: var(--danger); }
.seat-action.check { color: var(--success); }
.seat-action.call { color: var(--accent-blue); }
.seat-action.raise, .seat-action.bet { color: var(--accent-gold); }
.seat-action.allIn { color: var(--danger); font-weight: 800; }
.seat-action.pending {
    color: var(--warning);
    font-weight: 700;
    animation: pending-pulse 1.5s ease-in-out infinite;
}
@keyframes pending-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.seat-box.is-pending {
    border-color: var(--warning);
    background: rgba(250, 166, 26, 0.06);
}
.seat-pending-notice {
    font-size: 0.68rem;
    color: var(--warning);
    text-align: center;
    padding: 4px 6px;
    font-style: italic;
    max-width: 80px;
}

.seat-cards {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 4px;
}

.seat-bet {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-gold);
    background: rgba(0,0,0,0.6);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* Bet position relative to seat */
.player-seat[data-seat="0"] .seat-bet { top: -24px; }
.player-seat[data-seat="1"] .seat-bet { top: -24px; right: -10px; }
.player-seat[data-seat="2"] .seat-bet { top: 50%; right: -60px; transform: translateY(-50%); }
.player-seat[data-seat="3"] .seat-bet { bottom: -24px; }
.player-seat[data-seat="4"] .seat-bet { top: 50%; left: -60px; transform: translateY(-50%); }
.player-seat[data-seat="5"] .seat-bet { top: -24px; left: -10px; }

/* Dealer Button */
.dealer-button {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, #ddd);
    color: var(--text-on-gold);
    font-weight: 900;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 3;
    transition: all var(--transition-base);
}

/* Community Cards */
.community-cards {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

/* Pot Display */
.pot-display {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.pot-chips {
    display: flex;
    gap: 2px;
}

.chip-stack {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dim));
    border: 2px solid var(--accent-gold-bright);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pot-amount {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold-bright);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Action Bar */
.action-bar {
    padding: 12px 16px;
    flex-shrink: 0;
    z-index: 5;
}

.action-bar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.action-player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.action-player-cards {
    display: flex;
    gap: 4px;
}

.action-player-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-gold);
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

/* Raise Controls */
.raise-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.raise-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.raise-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
}
.raise-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    box-shadow: var(--shadow-glow-gold);
}

.raise-amount-input {
    width: 90px;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--accent-gold-dim);
    border-radius: var(--radius-md);
    color: var(--accent-gold);
    outline: none;
}

.raise-presets {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.raise-confirm {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

/* Celebration Overlay */
.celebration-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: celebrationIn 0.5s ease;
}

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

.celebration-content {
    text-align: center;
    animation: celebrationBounce 0.6s var(--transition-spring);
}

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

.celebration-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.celebration-amount {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-gold-bright);
    text-shadow: 0 0 30px rgba(var(--accent-gold-rgb), 0.5);
}

.celebration-hand {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 3s forwards;
    max-width: 360px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent-blue); }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

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

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .wallet-title { font-size: 2.2rem; }
    .wallet-features { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .lobby-header { flex-direction: column; gap: 12px; }
    .lobby-header-right { flex-wrap: wrap; justify-content: center; }
    .action-bar-inner { flex-direction: column; }
    .action-buttons { flex-wrap: wrap; }
    .poker-table { aspect-ratio: 4 / 3; }
    .seat-box { min-width: 90px; padding: 6px 8px; }
    .seat-name { font-size: 0.7rem; max-width: 70px; }
}

/* Gradients */
.sol-gradient {
    background: linear-gradient(135deg, #14F195, #9945FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Profile Modal Details */
.modal-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}
.tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1rem;
    font-family: var(--font-display);
    cursor: pointer;
    padding: 4px 8px;
}
.tab-btn.active {
    color: var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
}
.profile-tab {
    display: none;
}
.profile-tab.active {
    display: block;
}
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}
.avatar-option {
    font-size: 2.5rem;
    text-align: center;
    background: var(--bg-secondary);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.avatar-option:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   LANDING SCREEN
   ═══════════════════════════════════════════════════════════ */
/* ─── Landing Screen (desktop-first, logo as background + slide-in panel) ─── */
.landing-screen {
    background: #000;
    min-height: 100vh;
    display: none;
    position: relative;
    overflow: hidden;
}
.landing-screen.active {
    display: block;
}

/* Logo fills the entire viewport, fit (contain) so the whole spade is visible.
   Black bars fill whatever space the square logo doesn't cover. */
.landing-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("/img/logo.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Landing — Floating Flip Card
   A single face-down card floats center-stage over the logo and
   tilts toward the cursor. Click flips it to reveal the Phantom
   connect button. On successful connect the card "deals in"
   off-screen and the lobby takes over.
   ═══════════════════════════════════════════════════════════════ */

.landing-stage {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 2;
    perspective: 1400px;
}

.landing-card {
    width: 220px;
    height: 308px;
    position: relative;
    cursor: pointer;
    /* Only tilt + float live on the outer element. The flip lives on
       .landing-card-inner so the two transforms never share a stack
       (which previously caused the back image to appear mirrored
       mid-flip and the connect UI to be hidden behind the back face). */
    transform-style: preserve-3d;
    transform:
        rotateX(var(--tilt-y, 0deg))
        rotateY(var(--tilt-x, 0deg))
        translateY(var(--float, 0px));
    transition:
        transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 300ms ease;
    will-change: transform;
    animation: landing-float 5s ease-in-out infinite;
}

/* Inner wrapper owns the flip rotation. Mirrors the .playing-card-inner
   pattern used by in-game cards. */
.landing-card-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.landing-card.is-flipped .landing-card-inner {
    transform: rotateY(180deg);
}

/* When the user is dragging / hovering we let JS take over tilt and
   pause the idle float so the two transforms don't fight. */
.landing-card.is-tilting {
    animation-play-state: paused;
}

.landing-card:hover {
    filter: drop-shadow(0 24px 40px rgba(var(--accent-gold-rgb), 0.25));
}

.landing-card:focus-visible {
    outline: 2px solid var(--accent-gold-bright);
    outline-offset: 8px;
    border-radius: 14px;
}

.landing-card-face {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.55),
        0 2px 8px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* ── Face-down back — uses cardback1.png (matches in-game card backs) ── */
.landing-card-back {
    background: url('/img/cardback1.png') center / cover no-repeat;
    background-color: #0a0a0a;
    border: 4px solid var(--accent-gold);
}

/* ── Face-up front (reveals connect UI) ── */
.landing-card-front {
    background:
        linear-gradient(160deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid rgba(var(--accent-gold-rgb), 0.4);
    transform: rotateY(180deg);
    display: flex;
    align-items: stretch;
    padding: 0;
}

.landing-card-inner-scroll {
    width: 100%;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    justify-content: center;
    box-sizing: border-box;
}

.landing-connect {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.landing-phantom-glyph {
    margin-bottom: 2px;
    filter: drop-shadow(0 4px 12px rgba(85, 27, 249, 0.4));
}

.landing-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.landing-card-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 8px;
    line-height: 1.4;
}

.landing-connect .btn,
.landing-profile .btn {
    width: 100%;
}

/* ── Profile step (after wallet is connected) ── */
.landing-profile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}
.landing-profile .input-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0 0 -4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.landing-profile .input-field {
    width: 100%;
    box-sizing: border-box;
}

/* ── Connected badge (reused from old .wallet-connected-badge) ── */
.wallet-connected-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: center;
    padding: 6px 12px;
    background: rgba(67, 181, 129, 0.1);
    border: 1px solid rgba(67, 181, 129, 0.3);
    border-radius: var(--radius-full);
    color: var(--success);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

/* ── Error state ── */
.landing-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--danger);
    font-size: 0.82rem;
    text-align: center;
    margin-top: 4px;
}
.landing-error p { margin: 0; }

/* The flip transform lives on .landing-card-inner (see above). The
   is-flipped class on the outer card is just a state flag that
   drives the inner rotation + locks tilt off (handled in JS). */

/* ── Hint text under the card ── */
.landing-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.65;
    animation: landing-hint-pulse 2.4s ease-in-out infinite;
    transition: opacity 300ms;
}
.landing-card.is-flipped ~ .landing-hint {
    opacity: 0;
    pointer-events: none;
}

/* ── Deal-in exit animation ──
   Slides the whole card off to the right. The flip rotation lives on
   .landing-card-inner, so this keyframe only handles the slide. */
.landing-card.is-dealt {
    animation: landing-deal-out 700ms cubic-bezier(0.6, 0, 0.4, 1) forwards;
}

/* Idle gentle float; overridden by is-tilting / is-dealt */
@keyframes landing-float {
    0%, 100% { --float: 0px; }
    50%      { --float: -8px; }
}
/* Float needs to register as a @property so keyframes can interpolate it */
@property --float {
    syntax: '<length>';
    inherits: false;
    initial-value: 0px;
}

@keyframes landing-hint-pulse {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 0.85; }
}

@keyframes landing-deal-out {
    0%   { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
    40%  { transform: translateX(-12px) rotate(-2deg) scale(1.02); opacity: 1; }
    100% { transform: translateX(120vw) rotate(18deg) scale(0.9); opacity: 0; }
}

/* Reduced motion: kill float + deal animations */
@media (prefers-reduced-motion: reduce) {
    .landing-card { animation: none; }
    .landing-hint { animation: none; }
    .landing-card.is-dealt { animation: none; opacity: 0; }
}

/* Mobile: smaller card */
@media (max-width: 600px) {
    .landing-card {
        width: 180px;
        height: 252px;
    }
    .landing-card-title { font-size: 1.1rem; }
}

/* Legacy elements no longer rendered on this screen */
.landing-content,
.landing-hero,
.landing-logo,
.landing-features,
.landing-feature-card,
.wallet-container,
.wallet-bg,
.wallet-particles,
.wallet-logo,
.logo-card,
.wallet-features,
.feature-item,
.wallet-title,
.wallet-subtitle,
.welcome-panel,
.welcome-panel-content,
.welcome-header,
.welcome-tagline,
.welcome-pitch,
.welcome-features,
.welcome-feature-icon,
.wallet-connect-box,
.phantom-logo,
.wallet-info,
.wallet-status,
.wallet-error {
    display: none !important;
}

/* Avatar on Table Seats */
.seat-avatar {
    font-size: 1.6rem;
    margin-bottom: 4px;
    display: block;
}

/* Dealer Button Marker inside Seat Box */
.dealer-button-marker {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff, #dddddd);
    color: var(--text-on-gold);
    border: 2px solid var(--accent-gold);
    font-weight: 900;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
}

/* Game History Log Sidebar */
.game-history-sidebar {
    position: absolute;
    top: 60px;
    right: 16px;
    width: 260px;
    height: calc(100% - 220px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--transition-spring), opacity var(--transition-base);
    transform: translateX(0);
    opacity: 1;
}

.game-history-sidebar.collapsed {
    transform: translateX(320px);
    opacity: 0;
    pointer-events: none;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}

.history-header h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.history-logs {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    font-size: 0.8rem;
    font-family: var(--font-primary);
}

.history-log-item {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--text-muted);
    line-height: 1.4;
}

.history-log-item.bet, 
.history-log-item.raise { border-left-color: var(--accent-gold); }
.history-log-item.call { border-left-color: var(--accent-blue); }
.history-log-item.check { border-left-color: var(--success); }
.history-log-item.fold { border-left-color: var(--danger); }
.history-log-item.win { border-left-color: var(--accent-purple); background: rgba(155, 89, 182, 0.05); }

.history-toggle-btn {
    position: absolute;
    top: 60px;
    right: 16px;
    z-index: 9;
}



/* ═══════════════════════════════════════════════════════════════
   Responsive Game Table Layout
   Mobile-first breakpoints for the poker table view.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tablet (≤1024px) ──────────────────────────────────── */
@media (max-width: 1024px) {
    .player-seats {
        transform: scale(0.85);
        transform-origin: center center;
    }
    .playing-card.lg { width: 56px; height: 80px; }
    .playing-card.lg .card-top-left,
    .playing-card.lg .card-bottom-right { font-size: 0.7rem; }
    .playing-card.lg .card-center { font-size: 1rem; }
    .seat-box { padding: 8px 12px; }
    .seat-name { font-size: 0.75rem; }
    .seat-chips { font-size: 0.8rem; }
    .seat-bet { font-size: 0.7rem; }
    #action-bar { padding: 10px 16px; font-size: 0.85rem; }
    .game-top-bar { padding: 8px 16px; }
}

/* ─── Mobile (≤768px) ──────────────────────────────────── */
@media (max-width: 768px) {
    .game-screen {
        flex-direction: column;
    }
    #game-table-area {
        flex: 1;
        min-height: 50vh;
        padding: 8px;
    }
    .player-seats {
        transform: scale(0.7);
        transform-origin: center top;
    }
    .playing-card.lg { width: 44px; height: 64px; }
    .playing-card.lg .card-top-left,
    .playing-card.lg .card-bottom-right { font-size: 0.6rem; }
    .playing-card.lg .card-center { font-size: 0.8rem; }
    .playing-card.sm { width: 32px; height: 46px; }
    .seat-box {
        padding: 6px 8px;
        min-width: 100px;
    }
    .seat-name { font-size: 0.7rem; max-width: 80px; }
    .seat-chips { font-size: 0.7rem; }
    .seat-bet { font-size: 0.65rem; }
    .seat-action { font-size: 0.6rem; }

    #action-bar {
        flex-direction: column;
        padding: 8px 12px;
        gap: 8px;
    }
    #action-buttons { gap: 4px; }
    #action-buttons .btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    #community-cards {
        gap: 4px;
        padding: 6px;
    }
    #pot-display { font-size: 0.9rem; padding: 4px 12px; }
    #game-history-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 40vh;
        border-radius: 18px 18px 0 0;
        z-index: 100;
    }
    .game-top-bar {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .game-top-bar h2 { font-size: 0.9rem; }
    #raise-controls { padding: 8px; }
    #raise-controls input,
    #raise-controls .raise-presets { max-width: 100%; }
    #celebration-overlay > div { padding: 20px; }
    .hand-complete-overlay > div {
        padding: 24px !important;
        max-width: 90vw !important;
    }
}

/* ─── Small Mobile (≤480px) ─────────────────────────────── */
@media (max-width: 480px) {
    .player-seats {
        transform: scale(0.55);
        transform-origin: center top;
    }
    .playing-card.lg { width: 36px; height: 52px; }
    .playing-card.lg .card-center { font-size: 0.65rem; }
    .playing-card.sm { width: 26px; height: 38px; }
    .seat-box {
        padding: 4px 6px;
        min-width: 70px;
    }
    .seat-name { font-size: 0.6rem; max-width: 60px; }
    .seat-chips { font-size: 0.6rem; }
    #action-buttons .btn {
        padding: 6px 8px;
        font-size: 0.65rem;
        border-radius: 6px;
    }
    #community-cards { gap: 2px; padding: 4px; }
    .game-top-bar h2 { font-size: 0.8rem; }
    #timer-ring { width: 30px; height: 30px; }
    #timer-text { font-size: 0.65rem; }
}
