:root {
    --bg-dark: #0f172a;
    --table-green: #0a4d2e;
    --table-border: #d4af37;
    --table-glow: rgba(10, 77, 46, 0.6);
    --gold-primary: #f59e0b;
    --gold-hover: #d97706;
    --card-shadow: 0 8px 16px rgba(0,0,0,0.4);
    --glass-bg: rgba(30, 41, 59, 0.82);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --accent-red: #ef4444;
}

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

input, select, textarea {
    font-size: 16px;
}

body {
    font-family: 'Outfit', 'Fredoka', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 30%, #1e293b 0%, #0f172a 70%);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.app-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.logo {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

.logo-paw {
    color: var(--gold-primary);
    font-size: 2rem;
}

.logo-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
    background: rgba(255,255,255,0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
}

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

.btn-action {
    padding: 0.65rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
}

/* Variant & Stack Selector Bars */
.selectors-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.variant-selector-bar, .stack-selector-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.stack-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variant-pill, .stack-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-pill.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: #34d399;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stack-pill.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border-color: #fbbf24;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.variant-pill:hover:not(.active), .stack-pill:hover:not(.active) {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Status Banner */
.status-bar {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.45rem 1rem;
    margin-bottom: 0.65rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-text {
    font-size: 0.92rem;
    font-weight: 500;
    color: #e2e8f0;
}

.resume-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Poker Table Layout */
.poker-table-container {
    position: relative;
    width: 100%;
    min-height: 520px;
    background: radial-gradient(ellipse at center, #0f683d 0%, #06361e 75%, #021a0e 100%);
    border: 14px solid #1c150c;
    outline: 4px solid var(--table-border);
    border-radius: 200px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 40px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
}

/* Opponents & Players */
.opponents-row {
    display: flex;
    justify-content: space-around;
    width: 100%;
}

.player-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
}

.player-spot.current-turn .avatar-container {
    box-shadow: 0 0 20px var(--gold-primary);
    border-color: var(--gold-primary);
    animation: turnPulse 1.5s infinite alternate;
}

@keyframes turnPulse {
    from { transform: scale(1); box-shadow: 0 0 10px var(--gold-primary); }
    to { transform: scale(1.05); box-shadow: 0 0 25px var(--gold-primary); }
}

.avatar-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    background: #1e293b;
    position: relative;
    box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name-badge {
    margin-top: 0.4rem;
    background: rgba(0, 0, 0, 0.75);
    padding: 0.2rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.chips-count {
    color: var(--gold-primary);
}

.bet-badge {
    position: absolute;
    bottom: -22px;
    background: #dc2626;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    top: -55px;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    color: #fff;
    max-width: 170px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
    z-index: 20;
    pointer-events: none;
    animation: fadeIn 0.3s ease;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.92) transparent;
}

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

/* Center Table Area (Pot & Community Cards) */
.table-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.pot-container {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--gold-primary);
    padding: 0.4rem 1.5rem;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold-primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cards-container {
    display: flex;
    gap: 0.5rem;
    min-height: 110px;
    align-items: center;
    justify-content: center;
}

/* AI Mini Cards & Overlapping Fan Arc Layout */
.opponents-row .cards-container {
    gap: 0;
    min-height: 78px;
    position: relative;
    padding: 0 10px;
}

.opponents-row .card {
    width: 48px;
    height: 70px;
    border-radius: 6px;
    padding: 0.2rem 0.25rem;
    margin-left: -22px; /* Overlap cards so 5 or 7 cards fit comfortably */
    box-shadow: -3px 3px 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, margin 0.2s ease;
    transform-origin: bottom center;
}

.opponents-row .card:first-child {
    margin-left: 0;
}

.opponents-row .card .card-top {
    font-size: 0.72rem;
}

.opponents-row .card .card-bottom {
    font-size: 0.72rem;
}

.opponents-row .card .card-center-art {
    width: 26px;
    height: 26px;
}

.opponents-row .card .card-suit-large {
    font-size: 1.1rem;
}

/* User's Hand Layout */
.hand-row-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.hand-sort-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 12px;
    align-self: center;
    flex-shrink: 0;
}

.hand-sort-controls.hidden {
    display: none !important;
}

.sort-btn {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    line-height: 1.2;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.sort-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
    color: var(--gold-primary);
    transform: translateY(-1px);
}

.sort-btn.active {
    background: rgba(245, 158, 11, 0.28);
    border-color: var(--gold-primary);
    color: #fef08a;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

#cards-0 {
    gap: 0.35rem;
    flex-wrap: nowrap;
    padding: 0.25rem 0.5rem;
}

#cards-0.many-cards {
    gap: 0;
}

#cards-0.many-cards .card {
    margin-left: -12px; /* Slight overlap for 7 cards so user's hand never overflows */
}

#cards-0.many-cards .card:first-child {
    margin-left: 0;
}

/* Concealed Cards in 7-Card Stud */
.card.concealed-card {
    border: 2px dashed #f59e0b !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
    position: relative;
}

.card.concealed-card::before {
    content: '🔒 Private';
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #f59e0b;
    border: 1px solid #f59e0b;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0px 4px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Card Visual Component */
.card {
    width: 72px;
    height: 104px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.3rem 0.4rem;
    position: relative;
    user-select: none;
    transition: transform 0.2s ease;
}

.card.selectable {
    cursor: pointer;
}

.card.selected {
    transform: translateY(-14px);
    outline: 3px solid var(--gold-primary);
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.5);
}

.card.hidden-card {
    background-image: url('/static/img/card_back.png');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.card-top {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.card-center-art {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-center-art img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-suit-large {
    font-size: 1.8rem;
}

.card-bottom {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    align-self: flex-end;
    transform: rotate(180deg);
}

.suit-red { color: #dc2626; }
.suit-black { color: #1e293b; }

/* Action Controls Panel */
.controls-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    margin-bottom: 0.85rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
}

#btn-fold {
    grid-column: 1;
    justify-self: start;
}

#btn-check-call {
    grid-column: 2;
    justify-self: center;
}

#btn-raise {
    grid-column: 3;
    justify-self: end;
}

#btn-draw-swap {
    grid-column: 1 / -1;
    justify-self: center;
}

.raise-control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.4rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    touch-action: manipulation;
}

.raise-slider-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.raise-inputs-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    touch-action: manipulation;
}

.raise-slider {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
    accent-color: var(--gold-primary);
    cursor: pointer;
    touch-action: manipulation;
}

.raise-stepper-group {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 8px;
    padding: 2px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
    gap: 2px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.btn-stepper {
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold-primary);
    border: 1px solid transparent;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    padding: 0;
}

.btn-stepper:hover:not(:disabled) {
    background: var(--gold-primary);
    color: #0f172a;
    border-color: var(--gold-hover);
}

.btn-stepper:active:not(:disabled) {
    transform: scale(0.92);
}

.btn-stepper:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03);
    color: #64748b;
}

.raise-input-wrapper {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
}

.raise-input-wrapper .currency-prefix {
    color: var(--gold-primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 1px;
}

.raise-number-input {
    width: 62px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    text-align: left;
    outline: none;
    touch-action: manipulation;
    -moz-appearance: textfield;
}

.raise-number-input::-webkit-outer-spin-button,
.raise-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.raise-number-input:focus {
    color: #fde68a;
}

.raise-val-display {
    font-weight: 700;
    color: var(--gold-primary);
    font-size: 0.88rem;
    min-width: 60px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}

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

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
}

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

.game-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    list-style: none;
    padding: 0;
}

.game-list-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.game-list-item a:hover {
    background: rgba(255,255,255,0.12);
}

.game-favicon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.hidden {
    display: none !important;
}

/* Poker Hands Guide Modal Styles */
.poker-hands-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hand-rank-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hand-rank-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gold-primary);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.hand-rank-badge.rank-1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
}

.hand-rank-badge.rank-10 {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.hand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
}

.hand-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.hand-cards-example {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.mini-card {
    width: 38px;
    height: 54px;
    background: #ffffff;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    font-weight: 800;
    line-height: 1.1;
    user-select: none;
}

.mini-card .m-rank {
    font-size: 0.85rem;
}

.mini-card .m-suit {
    font-size: 0.95rem;
}

.mini-card.suit-spades, .mini-card.suit-clubs {
    color: #1e293b;
}

.mini-card.suit-hearts, .mini-card.suit-diamonds {
    color: #dc2626;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Scrollable Game Log Panel */
.game-log-panel {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.85rem;
    display: flex;
    flex-direction: column;
    max-height: 150px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}

.game-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.game-log-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold-primary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0 0.4rem;
}

.btn-text:hover {
    color: #fff;
}

.game-log-messages {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.35;
    padding-right: 0.3rem;
}

.log-entry {
    padding: 0.15rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    word-break: break-word;
}

.log-entry.log-highlight {
    color: var(--gold-primary);
    font-weight: 600;
}

/* Beginner Tip Banner */
.beginner-tip {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    margin-bottom: 0.85rem;
    font-size: 0.82rem;
    color: #fde68a;
    line-height: 1.4;
}

.bet-badge-check {
    background: rgba(56, 189, 248, 0.25) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
    color: #7dd3fc !important;
}

.bet-badge-folded {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fca5a5 !important;
}

/* Loading Overlay */
.table-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    transition: opacity 0.2s ease;
}

.table-loading-overlay.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.spinner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--gold-primary);
}

.paw-spinner {
    font-size: 2.5rem;
    animation: pulse-spin 1.2s infinite ease-in-out;
}

@keyframes pulse-spin {
    0% { transform: scale(0.9) rotate(0deg); opacity: 0.7; }
    50% { transform: scale(1.15) rotate(180deg); opacity: 1; }
    100% { transform: scale(0.9) rotate(360deg); opacity: 0.7; }
}

.loading-text {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 0.5px;
}

/* Showdown Results Panel */
.showdown-panel {
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid var(--gold-primary);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1rem auto;
    max-width: 650px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: popup-fade 0.3s ease-out;
}

.showdown-panel.hidden {
    display: none !important;
}

.showdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    padding-bottom: 0.6rem;
    margin-bottom: 0.85rem;
}

.showdown-title {
    font-family: 'Fredoka', cursive, sans-serif;
    font-size: 1.25rem;
    color: var(--gold-primary);
    font-weight: 700;
}

.showdown-pot-badge {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--gold-primary);
    color: #fef08a;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
}

.showdown-winner-announce {
    font-size: 1.05rem;
    font-weight: 600;
    color: #38bdf8;
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    background: rgba(56, 189, 248, 0.12);
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    line-height: 1.4;
}

.showdown-hands-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.showdown-player-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    gap: 0.45rem;
    width: 100%;
}

.showdown-player-row.is-winner {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.6);
}

.showdown-player-row.is-folded {
    opacity: 0.72;
    border-style: dashed;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

.folded-tag {
    display: inline-block;
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #fca5a5;
    font-size: 0.72rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 0.35rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.showdown-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0.6rem 0 0.3rem 0;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.showdown-divider::before,
.showdown-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}

.showdown-divider span {
    padding: 0.15rem 0.65rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    color: #fca5a5;
}

.showdown-player-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    width: 100%;
    flex-wrap: wrap;
}

.showdown-hand-desc {
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 400;
}

.showdown-cards-mini {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
    align-self: flex-start;
}

.showdown-cards-mini .card {
    width: 2.2rem;
    height: 3.1rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Scale down center art so images don't overlap corner rank/suit labels */
.showdown-cards-mini .card .card-center-art {
    width: 22px;
    height: 22px;
}

.showdown-cards-mini .card .card-center-art img {
    max-width: 100%;
    max-height: 100%;
}

.showdown-cards-mini .card .card-suit-large {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: center;
        gap: 0.45rem;
        padding: 0.45rem 0.75rem;
        margin-bottom: 0.45rem;
    }
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
        width: 100%;
    }
    .header-actions .btn:not(.sound-toggle-btn) {
        padding: 0.25rem 0.5rem;
        font-size: 0.74rem;
        flex: 1 1 auto;
        justify-content: center;
    }
    .header-actions .sound-toggle-btn {
        flex: 0 0 28px !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        font-size: 0.72rem !important;
    }
    .selectors-container {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.4rem;
    }
    .variant-selector-bar, .stack-selector-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    .variant-pill, .stack-pill {
        padding: 0.2rem 0.45rem;
        font-size: 0.7rem;
        border-radius: 12px;
    }
    .stack-label {
        font-size: 0.68rem;
    }
    .status-bar {
        padding: 0.25rem 0.6rem;
        margin-bottom: 0.4rem;
    }
    .status-text {
        font-size: 0.76rem;
    }
    .app-container {
        padding: 0.4rem;
    }
    .poker-table-container {
        border: 6px solid #1c150c;
        outline: 3px solid var(--table-border);
        border-radius: 24px;
        min-height: auto;
        padding: 0.65rem 0.55rem;
        margin-bottom: 0.45rem;
    }

    /* Stack AI players vertically on mobile screens */
    .opponents-row {
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        width: 100%;
        margin-top: 0.1rem;
    }

    .opponents-row .player-spot {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        max-width: 380px;
        background: rgba(15, 23, 42, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        padding: 0.15rem 0.4rem;
        position: relative;
        gap: 0.25rem;
    }

    .opponents-row .avatar-container {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .opponents-row .player-name-badge {
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
        font-size: 0.68rem;
        padding: 0.1rem 0.35rem;
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
        min-width: 54px;
        flex-shrink: 0;
        z-index: 5;
    }

    .opponents-row .player-name-badge span:first-child {
        color: #e2e8f0;
        font-size: 0.68rem;
        font-weight: 600;
    }

    .opponents-row .chips-count {
        font-size: 0.68rem;
        font-weight: 700;
        color: var(--gold-primary);
    }

    .opponents-row .cards-container {
        min-height: 40px;
        padding: 0 2px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .opponents-row .card {
        width: 28px;
        height: 40px;
        margin-left: -14px;
        border-radius: 3px;
        padding: 0.08rem;
    }

    .opponents-row .card .card-top, .opponents-row .card .card-bottom {
        font-size: 0.52rem;
    }

    .opponents-row .card .card-center-art {
        width: 14px;
        height: 14px;
    }

    .opponents-row .card .card-suit-large {
        font-size: 0.7rem;
    }

    .opponents-row .bet-badge {
        bottom: -6px;
        font-size: 0.62rem;
        padding: 0.08rem 0.35rem;
    }

    /* Speech bubble in-line on mobile between names and cards */
    .opponents-row .speech-bubble {
        position: relative;
        top: auto;
        left: auto;
        bottom: auto;
        right: auto;
        transform: none;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 140px;
        margin: 0 2px;
        font-size: 0.6rem;
        line-height: 1.2;
        padding: 0.15rem 0.35rem;
        background: rgba(15, 23, 42, 0.95);
        border: 1px solid var(--gold-primary);
        border-radius: 6px;
        color: #fef08a;
        text-align: center;
        z-index: 10;
        box-shadow: 0 2px 6px rgba(0,0,0,0.5);
        pointer-events: none;
        animation: fadeIn 0.3s ease;
    }

    .opponents-row .speech-bubble::after {
        content: '';
        position: absolute;
        left: -4px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        border-width: 4px 4px 4px 0;
        border-style: solid;
        border-color: transparent rgba(15, 23, 42, 0.95) transparent transparent;
    }

    .opponents-row .speech-bubble.hidden {
        display: none !important;
    }

    /* Center Table Area (Pot & Community Cards) on Mobile */
    .table-center {
        margin: 0.25rem 0;
    }

    .pot-container {
        padding: 0.15rem 0.65rem;
        font-size: 0.88rem;
        margin-bottom: 0.25rem;
        border-radius: 12px;
    }

    #community-cards {
        min-height: 44px;
        gap: 0.2rem;
    }

    #community-cards .card {
        width: 30px;
        height: 44px;
        border-radius: 3px;
        padding: 0.08rem;
    }

    #community-cards .card .card-top, #community-cards .card .card-bottom {
        font-size: 0.52rem;
    }

    #community-cards .card .card-center-art {
        width: 14px;
        height: 14px;
    }

    #community-cards .card .card-suit-large {
        font-size: 0.7rem;
    }

    /* Human player adjustments */
    #player-spot-0 {
        margin-top: 0.1rem;
    }

    .hand-row-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .hand-sort-controls {
        flex-direction: row;
        margin-left: 0;
        margin-top: 4px;
        gap: 4px;
    }

    .sort-btn {
        font-size: 9px;
        padding: 2px 5px;
    }

    #player-spot-0 .player-name-badge {
        font-size: 0.7rem;
        padding: 0.1rem 0.45rem;
        margin-top: 0.2rem;
    }

    #player-spot-0 .chips-count {
        font-size: 0.7rem;
        font-weight: 700;
    }

    #cards-0 {
        min-height: 72px;
        gap: 0.35rem;
    }

    #cards-0 .card {
        width: 48px;
        height: 72px;
        border-radius: 5px;
        padding: 0.15rem;
    }
    #cards-0 .card .card-top, #cards-0 .card .card-bottom {
        font-size: 0.7rem;
    }
    #cards-0 .card .card-center-art {
        width: 28px;
        height: 28px;
    }
    #cards-0 .card .card-suit-large {
        font-size: 1.1rem;
    }

    /* Mobile Controls Panel */
    .controls-panel {
        padding: 0.45rem 0.6rem;
        gap: 0.35rem;
        border-radius: 12px;
        margin-bottom: 0.45rem;
    }

    .action-buttons {
        gap: 0.35rem;
    }

    .action-buttons .btn-action {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }

    .raise-control-group {
        padding: 0.2rem 0.45rem;
        gap: 0.35rem;
    }

    .raise-slider-label {
        font-size: 0.75rem;
    }

    .raise-slider {
        min-width: 60px;
        max-width: 90px;
    }

    .btn-stepper {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }

    .raise-number-input {
        width: 50px;
        font-size: 16px;
    }

    .raise-val-display {
        font-size: 0.78rem;
        min-width: 40px;
    }
}


/* Sound / Mute Toggle Button */
.sound-toggle-btn, #sound-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .sound-toggle-btn, #sound-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 0.85rem;
  }
}

/* Clear visual distinction for Muted state */
.sound-toggle-btn.muted, #sound-btn.muted {
  opacity: 0.55 !important;
  background: rgba(20, 20, 25, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}
