:root {
    --bg-main: #06150c;
    --bg-felt: radial-gradient(circle at 50% 40%, #0d4223 0%, #062413 70%, #031209 100%);
    --gold-primary: #f59e0b;
    --gold-hover: #fbbf24;
    --gold-glow: rgba(245, 158, 11, 0.4);
    --border-gold: rgba(245, 158, 11, 0.5);
    --border-glass: rgba(255, 255, 255, 0.12);
    --bg-glass: rgba(10, 30, 18, 0.75);
    --bg-card-board: rgba(4, 20, 11, 0.85);
    --text-light: #f8fafc;
    --text-sub: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-title: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--bg-main);
    color: var(--text-light);
    font-family: var(--font-body);
    overflow-x: hidden;
}

body {
    background: var(--bg-felt);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1150px;
    height: 95vh;
    max-height: 920px;
    margin: 0 auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

/* HEADER */
.header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--gold-primary);
    border-color: var(--border-gold);
    background: rgba(245, 158, 11, 0.1);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

.scrolling-title {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #ffffff 0%, var(--gold-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mode-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-cyan);
    padding: 6px 14px;
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 100px;
    background: rgba(6, 182, 212, 0.12);
}

/* LOBBY MODAL & MODES */
.lobby-overlay {
    position: absolute;
    inset: 0;
    z-index: 200;
    background: rgba(4, 15, 9, 0.92);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.lobby-box {
    width: 100%;
    max-width: 500px;
    background: var(--bg-glass);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--gold-glow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.lobby-title {
    font-family: var(--font-title);
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--gold-hover);
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-mode {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-mode:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--gold-primary);
    color: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--gold-glow);
}

/* LOBBY ROOM FORMS */
.room-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    transition: border 0.2s ease;
}

.form-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px var(--gold-glow);
}

.room-code-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px dashed var(--border-gold);
    border-radius: var(--radius-md);
}

.code-text {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--gold-hover);
    letter-spacing: 0.1em;
}

.btn-copy {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--gold-primary);
    color: #000;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-copy:hover {
    transform: scale(1.05);
}

.player-list-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 8px;
}

.host-tag {
    font-size: 0.75rem;
    color: var(--gold-primary);
    border: 1px solid var(--border-gold);
    padding: 2px 8px;
    border-radius: 100px;
}

/* CASINO POKER TABLE */
.tableBoard {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 1rem;
    background: var(--bg-card-board);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), 0 15px 35px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* MULTI-SEAT GRID */
.seats-container {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.seat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    position: relative;
}

.seat-box.active-turn {
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px var(--gold-glow);
    background: rgba(245, 158, 11, 0.12);
    transform: scale(1.03);
}

.seat-box.folded {
    opacity: 0.4;
}

.seat-name {
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.seat-chips {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-hover);
}

.seat-action {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-cyan);
    height: 16px;
}

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

.mini-card {
    width: 38px;
    height: 54px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: -2px 3px 8px rgba(0, 0, 0, 0.5);
}

/* COMMUNITY CARDS AREA */
.community-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin: auto;
    z-index: 10;
}

.pot-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 100px;
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-green);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.community-cards {
    display: flex;
    gap: 10px;
    min-height: 115px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
}

.hand-eval-tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 4px 14px;
    border-radius: 100px;
}

.card, .card-back {
    width: 76px;
    height: 108px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: -3px 5px 12px rgba(0, 0, 0, 0.6);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ACTION CONTROLS PANEL */
.gamerBoard {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-poker {
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 95px;
}

.btn-check {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(14, 116, 144, 0.35) 100%);
    border-color: rgba(6, 182, 212, 0.5);
    color: #67e8f9;
}

.btn-check:hover:not(:disabled) {
    background: rgba(6, 182, 212, 0.45);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-call {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.35) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.btn-call:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.45);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-bet {
    background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold-primary) 100%);
    color: #0d1710;
    border: none;
    font-weight: 800;
}

.btn-bet:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px var(--gold-glow);
    background: linear-gradient(135deg, #ffe066 0%, var(--gold-hover) 100%);
}

.btn-fold {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(185, 28, 28, 0.35) 100%);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.btn-fold:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.45);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-poker:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
}

/* MODAL POPUP */
.modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 150;
    width: 90%;
    max-width: 440px;
    background: rgba(10, 24, 15, 0.95);
    border: 2px solid var(--gold-primary);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
    text-align: center;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--gold-glow);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-title {
    font-family: var(--font-title);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.result-sub {
    font-size: 0.95rem;
    color: var(--text-sub);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.resetGame {
    display: inline-block;
    padding: 12px 32px;
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: #0d1710;
    background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold-primary) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.resetGame:hover {
    transform: scale(1.05);
    background: #ffffff;
}

@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .container {
        padding: 0.5rem;
        height: 100vh;
    }
    .scrolling-title {
        font-size: 1.2rem;
    }
    .seats-container {
        grid-template-columns: repeat(3, 1fr);
    }
    .mini-card {
        width: 30px;
        height: 44px;
    }
    .card, .card-back {
        width: 58px;
        height: 84px;
    }
    .btn-poker {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 70px;
    }
}
