/* ═══════════════════════════════════════════════════
   Three Card Poker – Dark Theme (matches Hold'em)
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    --felt-green: #0d5c2e;
    --felt-dark: #0a4422;
    --felt-border: #1a8c4e;
    --table-rim: #3a2010;
    --table-rim-light: #5a3820;
    --gold: #f0c040;
    --gold-dark: #c49a20;
    --chip-blue: #2196F3;
    --chip-red: #f44336;
    --chip-green: #4CAF50;
    --card-white: #fafafa;
    --card-shadow: rgba(0,0,0,0.4);
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-surface: #16213e;
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --accent: #00d4aa;
    --accent-glow: rgba(0,212,170,0.3);
    --danger: #ff4757;
    --warning: #ffa502;
}

/* ── Base & Wrapper ────────────────────────────── */
.three-card-poker-game {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-primary);
    background: var(--bg-dark);
    box-sizing: border-box;
}

.three-card-poker-game *, .three-card-poker-game *::before, .three-card-poker-game *::after {
    box-sizing: border-box;
}

/* ── Header ────────────────────────────────────── */
.poker-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.poker-header h2 {
    margin: 0 0 0.3rem 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

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

.game-info p {
    margin: 0.3rem 0;
}

.room-info {
    margin: 0.4rem 0;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--gold);
    background: rgba(240,192,64,0.1);
    border: 1px solid rgba(240,192,64,0.2);
    border-radius: 6px;
    display: inline-block;
}

/* ── Two Column Layout ─────────────────────────── */
.poker-container {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}

.poker-table-column {
    flex: 2;
}

.poker-sidebar-column {
    flex: 1;
    min-width: 260px;
}

/* ── Poker Table Felt ──────────────────────────── */
.poker-table {
    background: radial-gradient(ellipse at center, #1a7a42 0%, var(--felt-green) 40%, var(--felt-dark) 100%);
    border-radius: 20px;
    padding: 1.2rem;
    padding-top: 0.6rem;
    border: 8px solid var(--table-rim);
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.3),
        0 0 0 3px var(--table-rim-light),
        0 0 0 6px rgba(0,0,0,0.4),
        0 12px 40px rgba(0,0,0,0.5);
    position: relative;
}

/* ── Table Title Overlay ──────────────────────── */
.table-title-overlay {
    text-align: center;
    margin-bottom: 0.4rem;
    padding: 0.3rem 1rem;
    position: relative;
}

.table-title-overlay::before,
.table-title-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.5;
}

.table-title-overlay::before { right: calc(50% + 140px); }
.table-title-overlay::after  { left:  calc(50% + 140px); }

.table-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(240,192,64,0.35), 0 2px 4px rgba(0,0,0,0.5);
}

.table-subtitle {
    margin: 0.1rem 0 0 0;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* ── Card Areas ────────────────────────────────── */
.dealer-section,
.player-section {
    margin-bottom: 1rem;
}

.dealer-section h3,
.player-section h3 {
    color: rgba(255,255,255,0.8);
    text-align: center;
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.betting-section {
    margin-bottom: 0.8rem;
}

.player-section {
    margin-bottom: 0.6rem;
}

.card-area {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 100px;
    align-items: center;
}

/* ── Playing Cards ─────────────────────────────── */
.card {
    width: 70px;
    height: 98px;
    border-radius: 6px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    position: relative;
    transition: transform 0.3s;
    box-shadow: 0 2px 8px var(--card-shadow);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
}

.card-back {
    background: linear-gradient(135deg, #1a3a6a, #0d2440);
    border: 2px solid #2a5a9a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.card-back::before {
    content: '♠';
    font-size: 1.4rem;
    color: rgba(255,255,255,0.15);
    border: none;
    width: auto;
    height: auto;
}

.playing-card {
    width: 70px;
    height: 98px;
    border-radius: 6px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    position: relative;
    transition: transform 0.3s;
    box-shadow: 0 2px 8px var(--card-shadow);
    animation: dealCard 0.4s ease-out;
}

.playing-card:hover {
    transform: translateY(-5px);
}

.playing-card.face-up {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    color: #222;
    border: 1px solid #ddd;
}

.playing-card .card-rank {
    font-size: 1rem;
    line-height: 1;
}

.playing-card .card-suit {
    font-size: 1.1rem;
    line-height: 1;
}

.playing-card.suit-hearts, .playing-card.suit-diamonds {
    color: #d32f2f;
}

.playing-card.suit-clubs, .playing-card.suit-spades {
    color: #222;
}

@keyframes dealCard {
    from { opacity: 0; transform: translateY(-40px) scale(0.8) rotate(-10deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

.card-placeholder {
    color: rgba(255,255,255,0.4);
    font-size: 0.9rem;
    text-align: center;
    padding: 2.5rem 1.2rem;
}

.hand-type {
    text-align: center;
    color: var(--gold);
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

/* ── Chip Selector ─────────────────────────────── */
.chip-selector-container {
    margin: 0.4rem 0 0 0;
}

.chip-selector {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
}

.chip-selector h3 {
    margin: 0 0 0.4rem 0;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.chip-tray-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.chip-tray {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chip-selector .chip-tray-row > .chip {
    display: flex;
}

.chip {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    box-shadow:
        0 3px 8px rgba(0,0,0,0.5),
        inset 0 2px 3px rgba(255,255,255,0.2),
        inset 0 -2px 3px rgba(0,0,0,0.2);
}

.chip:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}

.chip.selected {
    transform: translateY(-5px) scale(1.15);
    box-shadow: 0 0 20px currentColor;
    animation: chipPulse 0.5s ease-in-out infinite;
}

@keyframes chipPulse {
    0%, 100% { box-shadow: 0 0 16px currentColor; }
    50% { box-shadow: 0 0 24px currentColor; }
}

.chip-1 {
    background: linear-gradient(135deg, #f0f0f0, #d0d0d0);
    color: #333;
    border-color: #aaa;
}
.chip-5 {
    background: linear-gradient(135deg, #e53935, #c62828);
    color: white;
    border-color: rgba(255,255,255,0.4);
}
.chip-10 {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: white;
    border-color: rgba(255,255,255,0.4);
}
.chip-25 {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    color: white;
    border-color: rgba(255,255,255,0.4);
}
.chip-50 {
    background: linear-gradient(135deg, #fb8c00, #e65100);
    color: white;
    border-color: rgba(255,255,255,0.4);
}
.chip-100 {
    background: linear-gradient(135deg, #1a1a2e, #333);
    color: var(--gold);
    border-color: var(--gold);
}

.selected-chips-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

#selected-chips {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
}

.clear-selected-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.clear-selected-btn:hover {
    background: rgba(255,255,255,0.15);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.25);
}

/* ── Betting Area ──────────────────────────────── */
.betting-area {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin: 0.4rem 0;
    justify-content: center;
}

.bet-spot {
    background: rgba(0,0,0,0.4);
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    min-width: 100px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.bet-spot:hover:not(.betting-disabled) {
    background: rgba(0,212,170,0.1);
    border-color: var(--accent);
    transform: scale(1.03);
}

.bet-spot.betting-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.bet-spot label {
    display: block;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.15rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bet-amount-display {
    color: var(--gold);
    font-size: 1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.15rem;
    margin-bottom: 0.15rem;
    min-height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-amount {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.15rem;
}

.bet-chips {
    min-height: 24px;
    margin-top: 0.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    align-items: flex-start;
}

.placed-chip {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.4),
        inset 0 1px 2px rgba(255,255,255,0.2);
    position: relative;
    margin: -8px 0 0 0;
    transition: transform 0.2s;
}

.placed-chip:hover {
    transform: translateY(-2px);
    z-index: 10;
}

.placed-chip:nth-child(1) { z-index: 6; }
.placed-chip:nth-child(2) { z-index: 5; margin-top: -10px; }
.placed-chip:nth-child(3) { z-index: 4; margin-top: -14px; }
.placed-chip:nth-child(4) { z-index: 3; margin-top: -18px; }
.placed-chip:nth-child(5) { z-index: 2; margin-top: -22px; }
.placed-chip:nth-child(6) { z-index: 1; margin-top: -26px; }

.clear-bet-btn {
    width: 100%;
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid rgba(255,71,87,0.3);
    border-radius: 6px;
    cursor: pointer;
    background: rgba(255,71,87,0.15);
    color: var(--danger);
    transition: all 0.2s;
    margin-top: 0.25rem;
}

.clear-bet-btn:hover {
    background: rgba(255,71,87,0.3);
}

.bet-helper-btn {
    width: 100%;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-top: 0.3rem;
}

.bet-helper-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Game Controls ─────────────────────────────── */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin: 0.8rem 0;
    flex-wrap: wrap;
}

.poker-btn {
    padding: 0.7rem 1.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.poker-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.poker-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.deal-btn {
    background: linear-gradient(135deg, var(--accent), #00b894);
    color: #000;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.deal-btn:hover:not(:disabled) {
    box-shadow: 0 6px 30px var(--accent-glow);
}

.play-btn {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    box-shadow: 0 4px 16px rgba(41,128,185,0.3);
}

.play-btn:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(41,128,185,0.4);
}

.fold-btn {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    box-shadow: 0 4px 16px rgba(192,57,43,0.3);
}

.fold-btn:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(192,57,43,0.4);
}

.new-hand-btn {
    background: linear-gradient(135deg, var(--accent), #00b894);
    color: #000;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.new-hand-btn:hover:not(:disabled) {
    box-shadow: 0 6px 30px var(--accent-glow);
}

.new-game-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    box-shadow: 0 4px 16px rgba(240,192,64,0.3);
}

.new-game-btn:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(240,192,64,0.4);
}

/* ── Result Message ────────────────────────────── */
.result-message-inline {
    text-align: center;
    margin-top: 0.6rem;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.08);
}

.result-win {
    color: var(--accent);
}

.result-lose {
    color: var(--danger);
}

.result-push {
    color: var(--warning);
}

/* ── Payout Details ────────────────────────────── */
.payout-details {
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    padding: 0.8rem;
    margin-top: 0.6rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.payout-breakdown {
    background: rgba(255,255,255,0.05);
    padding: 0.6rem;
    border-radius: 8px;
}

.payout-line {
    color: var(--text-primary);
    padding: 0.2rem 0;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.payout-total {
    color: var(--gold);
    font-size: 1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(240,192,64,0.3);
}

/* ── Sidebar: Balance Display ──────────────────── */
.balance-display {
    background: linear-gradient(145deg, var(--bg-surface), var(--bg-card));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.balance-display h3 {
    color: var(--text-secondary);
    margin: 0 0 0.8rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}

.balance-amount {
    color: var(--accent);
    font-weight: 700;
    font-size: 2.2rem;
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
}

/* ── Sidebar: Paytables ────────────────────────── */
.paytable {
    background: linear-gradient(145deg, var(--bg-surface), var(--bg-card));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.paytable h4 {
    text-align: center;
    color: var(--accent);
    margin: 0 0 0.6rem 0;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0,212,170,0.2);
}

.paytable table {
    width: 100%;
    border-collapse: collapse;
}

.paytable td {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.paytable tr:last-child td {
    border-bottom: none;
}

.paytable td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.paytable td:last-child {
    text-align: right;
    color: var(--gold);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

/* ── Tutorial ──────────────────────────────────── */
.tutorial-header {
    margin-bottom: 1rem;
    text-align: center;
}

.tutorial-btn {
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.tutorial-btn:hover {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-surface));
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.tutorial-content {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
}

.tutorial-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/assets/a_contemporary_looking_image_o_Nano_Banana_Pro_93155.jpg') center/cover no-repeat;
    opacity: 0.07;
    border-radius: 16px;
    pointer-events: none;
    z-index: 0;
}

.tutorial-content > * { position: relative; z-index: 1; }

.tutorial-header-bar {
    background: linear-gradient(to right, rgba(30,30,50,0.95), rgba(30,30,50,0.75)),
                url('/assets/a_contemporary_looking_image_o_Nano_Banana_Pro_93155.jpg') center/cover no-repeat;
    color: var(--text-primary);
    padding: 1.2rem 1.5rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.tutorial-header-bar h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 700;
}

.close-tutorial-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-tutorial-btn:hover {
    background: rgba(255,255,255,0.15);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.25);
}

.tutorial-body {
    padding: 1.5rem;
}

.tutorial-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tutorial-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tutorial-section h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin: 0 0 0.8rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0,212,170,0.2);
}

.tutorial-section h4 {
    color: var(--gold);
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem 0;
}

.tutorial-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0.6rem 0;
    font-size: 0.9rem;
}

.tutorial-section ul {
    margin: 0.6rem 0;
    padding-left: 1.5rem;
}

.tutorial-section li {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0.4rem 0;
    font-size: 0.9rem;
}

.tutorial-section strong {
    color: var(--accent);
}

/* ── Responsive: Tablet ────────────────────────── */
@media (max-width: 992px) {
    .poker-container {
        flex-direction: column;
    }

    .poker-table-column,
    .poker-sidebar-column {
        width: 100%;
    }

    .poker-sidebar-column {
        margin-top: 1rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .balance-display {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .tutorial-header {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }
}

/* ── Responsive: Phone ─────────────────────────── */
@media (max-width: 768px) {
    .three-card-poker-game {
        padding: 0.8rem 0.5rem;
    }

    .poker-table {
        padding: 0.8rem;
        padding-top: 0.4rem;
        border-width: 5px;
        border-radius: 14px;
    }

    .table-title { font-size: 1rem; }
    .table-subtitle { font-size: 0.6rem; }
    .table-title-overlay::before,
    .table-title-overlay::after { width: 30px; }

    .betting-area {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.4rem;
    }

    .bet-spot {
        min-width: 80px;
        padding: 0.4rem;
        flex: 0 0 calc(50% - 0.2rem);
        max-width: calc(50% - 0.2rem);
    }

    .chip-tray-row {
        flex-direction: row;
        gap: 6px;
        margin-bottom: 0.4rem;
        flex-wrap: nowrap;
        justify-content: center;
    }

    .chip-tray {
        display: none;
    }

    .chip-selector .chip-tray-row > .chip {
        display: flex;
    }

    .chip {
        width: 46px;
        height: 46px;
        font-size: 0.75rem;
        flex-shrink: 0;
    }

    .card-area {
        gap: 5px;
        min-height: 85px;
    }

    .card, .playing-card {
        width: 58px;
        height: 82px;
    }

    .playing-card .card-rank { font-size: 0.85rem; }
    .playing-card .card-suit { font-size: 0.95rem; }

    .game-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .poker-btn {
        width: 100%;
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }

    .balance-amount {
        font-size: 1.6rem;
    }

    .balance-display {
        padding: 1rem;
    }

    .paytable {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
    }

    .poker-sidebar-column {
        grid-template-columns: 1fr;
    }

    .tutorial-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .tutorial-body {
        padding: 1rem;
    }

    .tutorial-header-bar h2 {
        font-size: 1rem;
    }
}
