/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Think timer */
#think-timer {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    color: #ffd700;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 6px;
    transition: opacity 1s;
}

/* Game container */
#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Header */
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #16213e;
    border-bottom: 2px solid #0f3460;
}

#game-header h1 {
    font-size: 1.5rem;
    color: #e94560;
}

.beta-badge {
    display: inline-block;
    background: #e94560;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    vertical-align: super;
    margin-left: 5px;
    font-weight: bold;
    letter-spacing: 1px;
}

#game-info {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #aaa;
}

#header-buttons {
    display: flex;
    gap: 10px;
}

.header-btn {
    padding: 8px 16px;
    background: #0f3460;
    border: none;
    border-radius: 4px;
    color: #eee;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.header-btn:hover {
    background: #1a4a7a;
}

/* Main game area */
#game-main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Poker table */
#poker-table {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: clamp(280px, 50vw, 500px);
}

#table-felt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(280px, 85vw, 700px);
    height: clamp(140px, 42.5vw, 350px);
    background: linear-gradient(135deg, #1e5631 0%, #2d7a46 50%, #1e5631 100%);
    border-radius: clamp(70px, 21vw, 175px);
    border: clamp(6px, 1.5vw, 12px) solid #3d2817;
    box-shadow:
        inset 0 0 60px rgba(0,0,0,0.5),
        0 0 30px rgba(0,0,0,0.8),
        0 10px 40px rgba(0,0,0,0.6);
}

/* Table center - community cards and pot */
#table-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#community-cards {
    display: flex;
    gap: 8px;
    min-height: 84px;
}

#pot-display {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

#main-pot, #street-pot {
    display: flex;
    gap: 6px;
}

.pot-label {
    color: #aaa;
}

#pot-amount {
    color: #ffd700;
}

#street-pot-amount {
    color: #7fff7f;
}

/* Card styling */
.card {
    width: clamp(35px, 8vw, 50px);
    height: clamp(49px, 11.2vw, 70px);
    background: #fff;
    border-radius: clamp(3px, 0.8vw, 5px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    font-weight: bold;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    position: relative;
}

.card-rank {
    font-size: 1em;
}

.card-suit {
    font-size: 1.3em;
    line-height: 1;
}

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

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

.card.face-down {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #1a237e 100%);
    border: 2px solid #3949ab;
}

.card.face-down::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 40px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(255,255,255,0.1) 5px,
        rgba(255,255,255,0.1) 10px
    );
    border-radius: 3px;
}

/* Player seats positioning */
.player-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: clamp(80px, 18vw, 120px);
    transition: all 0.3s;
}

.player-seat.active {
    transform: scale(1.05);
}

.player-seat.active .player-info {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

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

.player-seat.folded .player-cards .card {
    filter: grayscale(100%);
}

.player-seat.winner .player-info {
    border-color: #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    animation: winnerPulse 1.5s ease-in-out infinite;
}

@keyframes winnerPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
        border-color: #4caf50;
    }
    50% {
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.9);
        border-color: #66bb6a;
    }
}

/* Position seats around the table (oval layout) */
/* Seat 0 - Human (bottom center) */
#seat-0 { bottom: clamp(-45px, -9vw, -60px); left: 50%; transform: translateX(-50%); }
/* Seat 1 - Bottom left */
#seat-1 { bottom: clamp(-25px, -5vw, -30px); left: 15%; }
/* Seat 2 - Left */
#seat-2 { top: 50%; left: clamp(-55px, -11vw, -70px); transform: translateY(-50%); }
/* Seat 3 - Top left */
#seat-3 { top: clamp(-45px, -9vw, -60px); left: 15%; }
/* Seat 4 - Top center */
#seat-4 { top: clamp(-45px, -9vw, -60px); left: 50%; transform: translateX(-50%); }
/* Seat 5 - Top right */
#seat-5 { top: clamp(-45px, -9vw, -60px); right: 15%; }
/* Seat 6 - Right */
#seat-6 { top: 50%; right: clamp(-55px, -11vw, -70px); transform: translateY(-50%); }
/* Seat 7 - Bottom right */
#seat-7 { bottom: clamp(-25px, -5vw, -30px); right: 15%; }

/* Player info box */
.player-info {
    background: rgba(0, 0, 0, 0.7);
    padding: clamp(5px, 1vw, 8px) clamp(8px, 1.5vw, 12px);
    border-radius: clamp(5px, 1vw, 8px);
    border: 2px solid #444;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: clamp(70px, 15vw, 100px);
}

.player-details {
    flex: 1;
    text-align: center;
}

.player-name {
    display: block;
    font-weight: bold;
    font-size: clamp(0.65rem, 1.5vw, 0.85rem);
    margin-bottom: 2px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-chips {
    display: block;
    font-size: clamp(0.6rem, 1.3vw, 0.8rem);
    color: #ffd700;
}

/* Player cards */
.player-cards {
    display: flex;
    gap: 3px;
    margin-top: 5px;
}

.player-cards .card {
    width: clamp(28px, 6vw, 40px);
    height: clamp(39px, 8.4vw, 56px);
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
}

/* Player bet display */
.player-bet {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #ffd700;
    font-weight: bold;
    display: none;
}

.player-bet.visible {
    display: block;
}

/* Position bets towards center of table */
#seat-0 .player-bet { top: -25px; }
#seat-1 .player-bet { top: -25px; right: 0; }
#seat-2 .player-bet { right: -60px; }
#seat-3 .player-bet { bottom: -25px; right: 0; }
#seat-4 .player-bet { bottom: -25px; }
#seat-5 .player-bet { bottom: -25px; left: 0; }
#seat-6 .player-bet { left: -60px; }
#seat-7 .player-bet { top: -25px; left: 0; }

/* Dealer button - right side of player info box */
.dealer-btn {
    display: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: bold;
    color: #333;
    align-items: center;
    justify-content: center;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.dealer-btn[style*="display: inline"],
.dealer-btn[style*="display:inline"],
.dealer-btn[style*="display: flex"],
.dealer-btn[style*="display:flex"] {
    display: flex !important;
}

/* Player status (e.g., "All-in", "Sitting out") */
.player-status {
    font-size: 0.7rem;
    color: #e94560;
    font-weight: bold;
    margin-top: 3px;
    text-transform: uppercase;
}

/* Action panel */
#action-panel {
    margin-top: clamp(10px, 2vh, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 2vw, 15px);
    padding: clamp(12px, 3vw, 20px);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    width: 100%;
    max-width: 650px;
}

#action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(6px, 1.5vw, 10px);
}

.action-btn {
    padding: clamp(10px, 2vw, 12px) clamp(16px, 4vw, 24px);
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: clamp(60px, 15vw, 80px);
    min-height: 44px;
}

.action-btn:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
}

#btn-fold:not(:disabled) {
    background: #d32f2f;
    color: white;
}
#btn-fold:not(:disabled):hover {
    background: #b71c1c;
}

#btn-check:not(:disabled) {
    background: #388e3c;
    color: white;
}
#btn-check:not(:disabled):hover {
    background: #2e7d32;
}

#btn-call:not(:disabled) {
    background: #1976d2;
    color: white;
}
#btn-call:not(:disabled):hover {
    background: #1565c0;
}

#btn-bet:not(:disabled), #btn-raise:not(:disabled) {
    background: #f57c00;
    color: white;
}
#btn-bet:not(:disabled):hover, #btn-raise:not(:disabled):hover {
    background: #ef6c00;
}

/* Bet controls */
#bet-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2vw, 15px);
    padding: clamp(10px, 2vw, 15px);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

#bet-slider {
    width: clamp(140px, 35vw, 200px);
    height: 8px;
    -webkit-appearance: none;
    background: #444;
    border-radius: 4px;
    outline: none;
}

#bet-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
}

#bet-input {
    width: clamp(80px, 20vw, 100px);
    padding: 8px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    border: 2px solid #444;
    border-radius: 4px;
    background: #222;
    color: #ffd700;
    text-align: center;
    min-height: 44px;
}

.action-btn.confirm {
    background: #388e3c;
    color: white;
}
.action-btn.confirm:hover {
    background: #2e7d32;
}

.action-btn.cancel {
    background: #666;
    color: white;
}
.action-btn.cancel:hover {
    background: #555;
}

/* Game controls */
#game-controls {
    display: flex;
    gap: 10px;
}

.game-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: #6200ea;
    color: white;
}

.game-btn:hover {
    background: #7c4dff;
}

.game-btn:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
}

.game-btn.reset {
    background: #b71c1c;
    margin-left: auto;
}
.game-btn.reset:hover {
    background: #ef5350;
}

/* Message area */
#message-area {
    padding: 15px;
    text-align: center;
}

#message-text {
    font-size: 1.1rem;
    color: #aaa;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: inline-block;
}

#message-text.highlight {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a2e;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid #0f3460;
}

.modal-content.modal-wide {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #0f3460;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: #e94560;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

/* Setup modal */
.setup-group {
    margin-bottom: 25px;
}

.setup-group label {
    display: block;
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setup-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.setup-option {
    padding: 10px 18px;
    background: #0f3460;
    border: 2px solid #0f3460;
    border-radius: 6px;
    color: #eee;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.setup-option:hover {
    background: #1a4a7a;
    border-color: #1a4a7a;
}

.setup-option.selected {
    background: #6200ea;
    border-color: #7c4dff;
}

.setup-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.setup-custom span {
    color: #666;
    font-size: 1.2rem;
}

.setup-custom input {
    width: 100px;
    padding: 8px 12px;
    background: #222;
    border: 2px solid #444;
    border-radius: 4px;
    color: #ffd700;
    font-size: 0.95rem;
    text-align: center;
}

.setup-custom input:focus {
    outline: none;
    border-color: #6200ea;
}

.setup-custom input::placeholder {
    color: #666;
}

/* Bot mode selection */
.bot-modes-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bot-modes-header span {
    flex: 1;
}

.bot-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #333;
}

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

.bot-mode-name {
    color: #ccc;
    font-size: 0.9rem;
    min-width: 60px;
}

.bot-mode-toggle {
    display: flex;
    gap: 6px;
}

.bot-mode-toggle .setup-option,
.bot-mode-all {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.setup-actions {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.game-btn.primary {
    background: #4caf50;
    padding: 14px 40px;
    font-size: 1.1rem;
}

.game-btn.primary:hover {
    background: #66bb6a;
}

/* Stats table */
.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th, .stats-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.stats-table th {
    color: #aaa;
    font-weight: normal;
    font-size: 0.85rem;
}

.stats-table td {
    font-size: 0.95rem;
}

.stats-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.stat-positive {
    color: #4caf50;
}

.stat-negative {
    color: #f44336;
}

/* Hand history */
.hand-entry {
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid #0f3460;
}

.hand-entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #aaa;
}

.hand-entry-cards {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.hand-entry-cards .card {
    width: 35px;
    height: 49px;
    font-size: 0.75rem;
}

.hand-entry-winner {
    color: #4caf50;
    font-weight: bold;
}

.hand-entry-toggle {
    cursor: pointer;
    color: #0f3460;
    font-size: 1.1rem;
    font-weight: bold;
    user-select: none;
    padding: 0 6px;
    border-radius: 3px;
    transition: color 0.15s;
}

.hand-entry-toggle:hover {
    color: #7fdbff;
}

.hand-entry-actions {
    padding: 8px 0 4px 0;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
}

.hand-entry-showdown-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.hand-entry-showdown-row .hand-entry-cards {
    margin-bottom: 0;
}

/* Winner overlay */
#winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

#winner-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 40px 60px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#winner-content h3 {
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 15px;
}

#winner-content p {
    font-size: 1.1rem;
    color: #eee;
    margin-bottom: 10px;
}

#winner-content .winner-amount {
    font-size: 2rem;
    font-weight: bold;
    color: #4caf50;
}

/* Game body - flex row for sidebar + main content */
#game-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Action Log Pane (desktop only) */
#action-log-pane {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    background: #16213e;
    border-right: 2px solid #0f3460;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    flex-grow: 0;
    min-height: 0;
    overflow: hidden;
}

.action-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #0f3460;
    background: rgba(0, 0, 0, 0.2);
}

.action-log-header h3 {
    font-size: 0.9rem;
    color: #e94560;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-control-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 6px;
    line-height: 1;
}

.log-control-btn:hover {
    color: #aaa;
}

#action-log-content {
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 10px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
}

/* Street header in action log */
.action-log-street {
    color: #ffd700;
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 6px;
    padding: 4px 8px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 3px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.action-log-street:first-child {
    margin-top: 0;
}

/* Hand separator */
.action-log-hand-separator {
    border-top: 1px dashed #444;
    margin: 15px 0 10px 0;
    padding-top: 10px;
    color: #888;
    font-size: 0.75rem;
    text-align: center;
}

/* Individual action entry */
.action-log-entry {
    padding: 3px 0;
    color: #ccc;
}

.action-log-entry .player-name {
    color: #7fdbff;
}

.action-log-entry .player-name.human {
    color: #4caf50;
    font-weight: bold;
}

.action-log-entry .action-fold {
    color: #d32f2f;
}

.action-log-entry .action-check {
    color: #888;
}

.action-log-entry .action-call {
    color: #1976d2;
}

.action-log-entry .action-bet,
.action-log-entry .action-raise {
    color: #f57c00;
}

/* Scrollbar styling for action log */
#action-log-content::-webkit-scrollbar {
    width: 6px;
}

#action-log-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#action-log-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

#action-log-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Desktop - ensure action buttons fit in one row */
@media (min-width: 601px) {
    #action-buttons {
        flex-wrap: nowrap;
    }

    /* Put pot to the right of community cards */
    #table-center {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    #pot-display {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* Hide message area on desktop only (devices with mouse, not touch) */
@media (min-width: 601px) and (hover: hover) and (pointer: fine) {
    #message-area {
        display: none;
    }
}

/* System message in action log (desktop only) */
.action-log-message {
    padding: 6px 8px;
    margin: 6px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    color: #aaa;
    font-size: 0.75rem;
    font-style: italic;
}

.action-log-message.highlight {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

/* Responsive adjustments - small screens */
@media (max-width: 600px) {
    #action-log-pane {
        display: none;
    }

    /* Position message area in upper right on mobile */
    #message-area {
        position: absolute;
        top: 60px;
        right: 10px;
        z-index: 100;
        padding: 0;
    }

    #message-text {
        font-size: 0.85rem;
        padding: 6px 12px;
        max-width: 200px;
    }

    #game-main {
        padding: 10px;
    }

    #community-cards {
        gap: 4px;
        min-height: 60px;
    }

    #table-center {
        gap: 8px;
    }

    #pot-display {
        padding: 5px 12px;
        font-size: 0.85rem;
    }

    .dealer-btn {
        width: 16px;
        height: 16px;
        font-size: 0.55rem;
        line-height: 12px;
    }

    .player-bet {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* Landscape touch devices - position message area (any height) */
@media (orientation: landscape) and (pointer: coarse) {
    #action-log-pane {
        display: none;
    }

    #message-area {
        position: absolute;
        top: 50px;
        right: 10px;
        z-index: 100;
        padding: 0;
    }

    #message-text {
        font-size: 0.8rem;
        padding: 5px 10px;
        max-width: 200px;
    }
}

/* Landscape mobile - minimize vertical space (short screens) */
@media (orientation: landscape) and (max-height: 500px) {
    #action-log-pane {
        display: none;
    }

    /* Compact header */
    #game-header {
        padding: 4px 12px;
        border-bottom-width: 1px;
    }

    #game-header h1 {
        font-size: 1rem;
    }

    .beta-badge {
        font-size: 0.5rem;
        padding: 1px 4px;
    }

    #game-info {
        font-size: 0.75rem;
        gap: 12px;
    }

    .header-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    #header-buttons {
        gap: 5px;
    }

    #game-main {
        padding: 5px 10px;
    }

    #poker-table {
        height: clamp(220px, 58vh, 320px);
    }

    #table-felt {
        height: clamp(160px, 50vh, 280px);
    }

    /* Wider action panel for buttons to fit on one line */
    #action-panel {
        margin-top: 5px;
        padding: 6px 10px;
        gap: 6px;
        max-width: 100%;
    }

    #action-buttons {
        flex-wrap: nowrap;
    }

    .action-btn {
        padding: 8px 12px;
        min-width: auto;
        font-size: 0.8rem;
    }

    /* Position message area in upper right on landscape mobile */
    #message-area {
        position: absolute;
        top: 35px;
        right: 10px;
        z-index: 100;
        padding: 0;
    }

    #message-text {
        font-size: 0.75rem;
        padding: 4px 10px;
        max-width: 180px;
    }

    #community-cards {
        min-height: 40px;
        gap: 3px;
    }

    /* Smaller card rectangles but same text size */
    #community-cards .card {
        width: 32px;
        height: 40px;
        padding: 2px;
    }

    #table-center {
        flex-direction: row;  /* Put pot to the side of cards */
        gap: 8px;
        top: 42%;  /* Move up slightly to avoid overlap with human */
    }

    #pot-display {
        padding: 4px 6px;
        font-size: 0.6rem;
        flex-direction: column;
    }

    /* All player hole cards - smaller rectangles, same text */
    .player-cards .card {
        width: 26px;
        height: 36px;
    }

    /* Dealer button - smaller for landscape */
    .dealer-btn {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
        line-height: 12px;
    }

    /* Adjust human player seat for landscape table */
    #seat-0 {
        bottom: -50px;
    }
}

/* Production version badge */
.version-badge {
    position: fixed;
    bottom: 8px;
    right: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    font-family: monospace;
    pointer-events: none;
    user-select: none;
    z-index: 9999;
}
