/* ========================================================================
   404 POKER - LUXURY CYBERPUNK 2D STYLESHEET
   Zero-Overflow Responsive Layout | High-Fashion Dark Aesthetics
   ======================================================================== */

:root {
    --bg-dark: #08090c;
    --bg-surface: #0e1117;
    --bg-surface-elevated: #151922;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(0, 255, 204, 0.3);
    
    --felt-base: #0f1c1a;
    --felt-inner: #152925;
    --felt-border: #1f3d37;
    --table-rail: #1c1f26;
    --table-rim: #2d3340;
    
    --neon-cyan: #00ffcc;
    --neon-blue: #00e5ff;
    --neon-crimson: #ff0055;
    --neon-gold: #ffd700;
    --text-primary: #f0f2f5;
    --text-secondary: #8a94a6;
    --text-dim: #4d5666;

    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', Consolas, 'Courier New', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ui);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 1. TOP NAVIGATION HEADER */
.poker-header {
    height: 64px;
    background: rgba(14, 17, 23, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    flex-shrink: 0;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.brand-logo .suit-mark {
    color: var(--neon-cyan);
    font-size: 1.3rem;
}

.badge-network {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--neon-blue);
    font-family: var(--font-mono);
}

.badge-network::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
}

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

.metric-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.82rem;
}

.metric-pill .label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-pill .value {
    color: var(--neon-gold);
    font-weight: 700;
    font-family: var(--font-mono);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header-tool {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-header-tool:hover {
    color: var(--text-primary);
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 204, 0.08);
}

.btn-wallet-connect {
    background: linear-gradient(135deg, #00ffcc, #00b386);
    color: #051410;
    border: none;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-wallet-connect:hover {
    box-shadow: 0 0 16px rgba(0, 255, 204, 0.4);
    transform: translateY(-1px);
}

/* 2. POKER ARENA (TABLE VIEWPORT) */
.poker-arena {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

/* Background Ambient Lighting */
.arena-ambient-glow {
    position: absolute;
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(0, 255, 204, 0.08) 0%, rgba(255, 0, 85, 0.03) 45%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 1;
}

/* 3. OVAL 2D POKER TABLE */
.poker-table-container {
    position: relative;
    width: 100%;
    max-width: 1020px;
    height: 520px;
    max-height: 85vh;
    z-index: 2;
}

.poker-table {
    position: absolute;
    inset: 40px 60px;
    background: radial-gradient(ellipse at center, var(--felt-inner) 0%, var(--felt-base) 75%, #08110f 100%);
    border-radius: 200px / 120px;
    border: 14px solid var(--table-rail);
    box-shadow: 
        inset 0 0 40px rgba(0, 0, 0, 0.8),
        0 0 0 2px var(--table-rim),
        0 0 30px rgba(0, 255, 204, 0.15),
        0 20px 50px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Table Watermark & Center Felt */
.table-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
}

.table-watermark {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.04);
    text-transform: uppercase;
    user-select: none;
    position: absolute;
    top: -38px;
}

.pot-badge {
    background: rgba(10, 15, 20, 0.88);
    border: 1px solid rgba(255, 215, 0, 0.35);
    padding: 6px 18px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.pot-badge .pot-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.pot-badge .pot-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--neon-gold);
    font-family: var(--font-mono);
}

/* Community Cards Container */
.community-cards {
    display: flex;
    gap: 10px;
    min-height: 84px;
    align-items: center;
}

.provably-fair-commit-pill {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--border-subtle);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.provably-fair-commit-pill:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}

/* 4. PLAYING CARDS (2D CRISP STYLES) */
.card-2d {
    width: 58px;
    height: 82px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #d5d9e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 6px;
    user-select: none;
    font-family: var(--font-ui);
    position: relative;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-2d:hover {
    transform: translateY(-4px);
}

.card-2d.red {
    color: #e51a4c;
}

.card-2d.black {
    color: #171b26;
}

.card-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.card-rank {
    font-size: 1rem;
    font-weight: 800;
}

.card-suit-small {
    font-size: 0.85rem;
}

.card-center-suit {
    align-self: center;
    font-size: 1.4rem;
    line-height: 1;
}

.card-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
    transform: rotate(180deg);
}

/* Card Back (Facedown - 404 Gothic Geometric Pattern) */
.card-2d.card-back {
    background: #0e1118;
    border: 1px solid #2a3142;
    padding: 4px;
}

.card-back-pattern {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 204, 0.25);
    background: 
        repeating-linear-gradient(45deg, rgba(0, 255, 204, 0.05) 0px, rgba(0, 255, 204, 0.05) 2px, transparent 2px, transparent 6px),
        #121620;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-cyan);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 1px;
}

/* 5. 6 SEAT PODS POSITIONING */
.seat-pod {
    position: absolute;
    width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Mathematical 6-Max Ring Coordinates */
.seat-0 { top: 0px; left: 160px; }         /* Top Left */
.seat-1 { top: -20px; left: 50%; transform: translateX(-50%); } /* Top Center */
.seat-2 { top: 0px; right: 160px; }        /* Top Right */
.seat-3 { bottom: 10px; right: 140px; }     /* Bottom Right */
.seat-4 { bottom: -28px; left: 50%; transform: translateX(-50%); } /* Bottom Center (Hero) */
.seat-5 { bottom: 10px; left: 140px; }      /* Bottom Left */

/* Empty Seat Button */
.seat-empty-btn {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: rgba(14, 17, 23, 0.6);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.68rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seat-empty-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 255, 204, 0.08);
    transform: scale(1.05);
}

/* Occupied Player Pod */
.player-avatar-wrapper {
    position: relative;
    width: 68px;
    height: 68px;
    margin-bottom: 6px;
}

.player-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-subtle);
    background: #000;
}

/* Turn Timer Ring (SVG circle) */
.turn-timer-svg {
    position: absolute;
    inset: -4px;
    width: 76px;
    height: 76px;
    transform: rotate(-90deg);
    pointer-events: none;
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.timer-circle-active {
    fill: none;
    stroke: var(--neon-cyan);
    stroke-width: 3;
    stroke-dasharray: 226;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.2s linear;
}

/* Dealer Button Badge */
.dealer-button-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    color: #111;
    font-weight: 900;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    border: 1px solid #ccc;
    z-index: 15;
}

/* Player Info Box */
.player-info-card {
    background: rgba(14, 17, 23, 0.92);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 4px 8px;
    width: 110px;
    text-align: center;
    backdrop-filter: blur(8px);
}

.player-name {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-stack {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--neon-gold);
    font-family: var(--font-mono);
}

.player-action-bubble {
    font-size: 0.66rem;
    color: var(--neon-cyan);
    font-weight: 600;
    min-height: 14px;
}

/* Player Hand Cards */
.player-hole-cards {
    display: flex;
    gap: 4px;
    margin-top: -12px;
    margin-bottom: 4px;
    z-index: 12;
}

.player-hole-cards .card-2d {
    width: 38px;
    height: 54px;
    padding: 2px 4px;
    font-size: 0.8rem;
}

.player-hole-cards .card-rank { font-size: 0.78rem; }
.player-hole-cards .card-suit-small { font-size: 0.68rem; }
.player-hole-cards .card-center-suit { font-size: 1rem; }

/* Active Actor Glow */
.seat-pod.active-actor .player-avatar {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0, 255, 204, 0.6);
}

.seat-pod.folded {
    opacity: 0.45;
    filter: grayscale(0.8);
}

/* 6. BOTTOM HERO CONTROL DOCK */
.hero-controls-dock {
    height: 100px;
    background: rgba(11, 14, 20, 0.95);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    gap: 20px;
    z-index: 100;
    flex-shrink: 0;
}

.hero-controls-dock.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.raise-slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 280px;
}

.raise-slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.raise-slider-header .target-val {
    color: var(--neon-gold);
    font-weight: 800;
    font-family: var(--font-mono);
}

.slider-presets {
    display: flex;
    gap: 6px;
}

.btn-preset {
    flex: 1;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-preset:hover {
    color: var(--text-primary);
    border-color: var(--neon-cyan);
}

.action-buttons-group {
    display: flex;
    gap: 12px;
}

.btn-poker-action {
    min-width: 110px;
    height: 48px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    transition: all 0.2s ease;
}

.btn-poker-action .sub-amount {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.85;
    font-family: var(--font-mono);
}

.btn-action-fold {
    background: #252833;
    color: #e0e5ee;
}
.btn-action-fold:hover {
    background: #ff0055;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
}

.btn-action-check-call {
    background: #1b3d35;
    color: #00ffcc;
    border: 1px solid rgba(0, 255, 204, 0.3);
}
.btn-action-check-call:hover {
    background: #00ffcc;
    color: #051410;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.4);
}

.btn-action-raise {
    background: #473210;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}
.btn-action-raise:hover {
    background: #ffd700;
    color: #1a1400;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Stand up button */
.btn-stand-table {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    font-size: 0.72rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.btn-stand-table:hover {
    color: var(--neon-crimson);
    border-color: var(--neon-crimson);
}

/* Mobile responsiveness */
@media (max-width: 900px) {
    .poker-header {
        padding: 0 10px;
        height: 56px;
    }
    .brand-section .brand-logo span { display: none; }
    .metric-pill:nth-child(2) { display: none; }
    
    .poker-table-container {
        max-height: 70vh;
    }
    .poker-table {
        inset: 20px 20px;
    }
    .card-2d {
        width: 44px;
        height: 64px;
    }
    .card-rank { font-size: 0.85rem; }
    .card-center-suit { font-size: 1rem; }
    
    .seat-0 { top: -10px; left: 40px; }
    .seat-2 { top: -10px; right: 40px; }
    .seat-3 { bottom: 0px; right: 30px; }
    .seat-5 { bottom: 0px; left: 30px; }
    
    .hero-controls-dock {
        height: auto;
        padding: 12px;
        flex-direction: column;
        gap: 10px;
    }
    .raise-slider-group {
        width: 100%;
    }
    .action-buttons-group {
        width: 100%;
    }
    .btn-poker-action {
        flex: 1;
        min-width: 0;
    }
}
