/* Trivia Poker - Casino Theme Styles */

:root {
    --felt-green: #1a472a;
    --felt-green-light: #2d5a3d;
    --felt-green-dark: #0f2d1a;
    --gold: #d4af37;
    --gold-light: #f0d77c;
    --gold-dark: #a08520;
    --cream: #f5f5dc;
    --cream-dark: #e8e8c8;
    --red: #8b0000;
    --red-light: #b22222;
    --white: #ffffff;
    --black: #1a1a1a;
    --shadow: rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--felt-green-dark) 0%, var(--felt-green) 50%, var(--felt-green-light) 100%);
    min-height: 100vh;
    color: var(--cream);
}

#app {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Screen management */
.screen {
    display: none;
    width: 100%;
    max-width: 900px;
    padding: 20px;
}

.screen.active {
    display: block;
}

#game-screen {
    max-width: 100%;
    padding: 10px;
}

#game-screen.active {
    display: flex;
    justify-content: center;
}

/* Game Layout - 3 column */
.game-layout {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    align-items: stretch;
}

.side-panel {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.left-panel {
    /* History console */
}

.right-panel {
    /* Action panel */
}

/* Betting History Console */
.console-panel {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--gold-dark);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--gold-dark);
    color: var(--gold);
    font-weight: bold;
    font-size: 0.9rem;
}

.console-clear-btn {
    background: transparent;
    border: 1px solid var(--gold-dark);
    color: var(--gold-dark);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.console-clear-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.console-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

.console-content::-webkit-scrollbar {
    width: 6px;
}

.console-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.console-content::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

.history-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-entry:last-child {
    border-bottom: none;
}

.chat-message-entry {
    background: rgba(201, 162, 39, 0.15);
    padding: 6px 8px;
    margin: 5px 0;
    border-radius: 5px;
    border-left: 3px solid #c9a227;
    border-bottom: none !important;
}

.history-round {
    color: var(--gold);
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
}

.history-round:first-child {
    margin-top: 0;
}

.history-action {
    color: var(--cream);
    padding-left: 10px;
}

.history-action .player-name {
    color: var(--gold-light);
    font-weight: bold;
}

.history-action .action {
    color: #88c0ff;
}

.history-action .amount {
    color: #4CAF50;
}

.history-action.fold .action {
    color: #ff6b6b;
}

.history-action.hint {
    color: #a0a0a0;
    font-style: italic;
}

.history-action.result {
    color: #4CAF50;
    font-weight: bold;
}

.history-action.allin .action {
    color: #ff6b00;
    font-weight: bold;
}

.history-action .action.allin {
    color: #ff6b00;
    font-weight: bold;
}

/* Typography */
h1, h2, h3 {
    font-family: Georgia, 'Times New Roman', serif;
}

.game-title {
    font-size: 4rem;
    text-align: center;
    color: var(--gold);
    text-shadow: 3px 3px 6px var(--shadow), 0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.tagline {
    text-align: center;
    font-size: 1.2rem;
    color: var(--cream);
    opacity: 0.8;
    margin-bottom: 3rem;
    font-style: italic;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    color: var(--black);
    border: 2px solid var(--gold-dark);
    box-shadow: 0 4px 8px var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow);
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--shadow);
}

.btn-secondary {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: var(--cream);
    border: 2px solid #222;
    box-shadow: 0 4px 8px var(--shadow);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #666 0%, #444 100%);
}

.btn-pirate {
    background: linear-gradient(180deg, #a0714a 0%, #8b5a3c 50%, #6b4423 100%);
    color: #f5deb3;
    border: 2px solid #4a3520;
    box-shadow: 0 4px 8px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-pirate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s;
}

.btn-pirate:hover::before {
    left: 100%;
}

.btn-pirate:hover {
    background: linear-gradient(180deg, #b88a5e 0%, #a0714a 50%, #8b5a3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: #d4a574;
}

.btn-pirate:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--shadow);
}

.btn-large {
    padding: 25px 50px;
    font-size: 1.4rem;
}

/* Menu container */
.menu-container {
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 350px;
    margin: 0 auto;
}

.menu-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.btn-icon {
    font-size: 1.5rem;
}

/* Panel (card-style container) */
.panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border: 3px solid var(--gold);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.1);
}

.panel h2 {
    text-align: center;
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 2rem;
}

.subtitle {
    text-align: center;
    opacity: 0.8;
    margin-bottom: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label,
.form-group .form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--gold-light);
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    color: var(--cream);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.form-group select option {
    background: var(--felt-green-dark);
    color: var(--cream);
}

.avatar-selection {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold);
    background: rgba(0, 0, 0, 0.3);
}

.avatar-preview svg {
    width: 100%;
    height: 100%;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.button-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* AI Selection */
.ai-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.ai-checkbox:hover {
    background: rgba(0,0,0,0.3);
    border-color: var(--gold-dark);
}

.ai-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--gold);
}

.ai-checkbox input:checked + .ai-name {
    color: var(--gold);
}

.ai-name {
    font-weight: bold;
    min-width: 140px;
}

.ai-desc {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Player names list */
.player-names-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Online options */
.online-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.online-option {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.online-option h3 {
    color: var(--gold);
    margin-bottom: 15px;
    text-align: center;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--gold);
    opacity: 0.6;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gold-dark);
}

.divider span {
    padding: 0 15px;
}

/* Lobby */
.lobby-info {
    text-align: center;
    margin-bottom: 20px;
    opacity: 0.9;
}

.lobby-players {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.lobby-players h3 {
    color: var(--gold);
    margin-bottom: 10px;
}

.lobby-players ul {
    list-style: none;
}

.lobby-players li {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lobby-players li:last-child {
    border-bottom: none;
}

.lobby-players li.host::after {
    content: ' (Host)';
    color: var(--gold);
}

.ai-badge {
    display: inline-block;
    background: var(--gold);
    color: #1a1a2e;
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.btn-remove-ai {
    background: rgba(200, 50, 50, 0.6);
    color: #fff;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    margin-left: 10px;
}

.btn-remove-ai:hover {
    background: rgba(200, 50, 50, 0.9);
}

.lobby-ai-controls {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.lobby-ai-controls h3 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 0.95em;
}

.ai-add-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-ai {
    background: rgba(201, 162, 39, 0.2);
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.2s;
}

.btn-ai:hover {
    background: rgba(201, 162, 39, 0.4);
}

/* Rules content */
.rules-content {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.rules-content h3 {
    color: var(--gold);
    margin: 20px 0 10px;
}

.rules-content h3:first-child {
    margin-top: 0;
}

.rules-content p,
.rules-content li {
    line-height: 1.6;
    margin-bottom: 8px;
}

.rules-content ol,
.rules-content ul {
    padding-left: 25px;
}

/* Poker Table */
.poker-table {
    position: relative;
    flex: 1;
    min-width: 500px;
    max-width: 800px;
    height: 100%;
    background: radial-gradient(ellipse at center, var(--felt-green-light) 0%, var(--felt-green) 50%, var(--felt-green-dark) 100%);
    border-radius: 150px;
    border: 12px solid #5c3d2e;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5), 0 10px 40px rgba(0,0,0,0.6);
}

.poker-table::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 3px solid var(--gold-dark);
    border-radius: 140px;
    pointer-events: none;
}

/* Player positions */
#player-positions {
    position: absolute;
    inset: 0;
}

.player-seat {
    position: absolute;
    width: 140px;
    text-align: center;
    transform: translate(-50%, -50%);
}

.player-seat.position-0 { top: 85%; left: 50%; }
.player-seat.position-1 { top: 65%; left: 10%; }
.player-seat.position-2 { top: 25%; left: 15%; }
.player-seat.position-3 { top: 10%; left: 50%; }
.player-seat.position-4 { top: 25%; left: 85%; }
.player-seat.position-5 { top: 65%; left: 90%; }

.player-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 4px 10px var(--shadow);
}

.player-card.active {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.player-card.folded {
    opacity: 0.5;
    border-color: #666;
}

.player-card.correct {
    border-color: #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.player-card.wrong {
    border-color: var(--red);
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.5);
}

.player-card.allin {
    border-color: #ff6b00;
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.5);
}

.allin-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #ff6b00 0%, #cc5500 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    border: 2px solid #993300;
    white-space: nowrap;
}

.player-name {
    font-weight: bold;
    color: var(--cream);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-balance {
    color: var(--gold);
    font-size: 0.9rem;
}

.player-bet {
    background: var(--red);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-top: 5px;
    display: inline-block;
}

.player-bet:empty {
    display: none;
}

.dealer-chip {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: var(--gold);
    border-radius: 50%;
    color: var(--black);
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gold-dark);
}

/* Table center */
.table-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.pot-display {
    background: rgba(0,0,0,0.4);
    padding: 15px 30px;
    border-radius: 10px;
    border: 2px solid var(--gold);
    margin-bottom: 15px;
}

.pot-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gold);
    letter-spacing: 0.2em;
}

.pot-amount {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold-light);
}

.game-info {
    color: var(--cream);
}

.game-nav-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    justify-content: center;
}

.game-nav-buttons .btn {
    font-size: 0.75rem;
    padding: 5px 10px;
}

.round-info {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.phase-info {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Action panel - Right side */
.action-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 8px;
    min-height: 0;
}

.action-panel > div {
    background: rgba(0,0,0,0.7);
    border: 2px solid var(--gold-dark);
    border-radius: 10px;
    padding: 12px;
}

.action-panel > div.hidden {
    display: none;
}

.controls {
    background: rgba(0,0,0,0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--gold-dark);
}

.controls.hidden {
    display: none;
}

.current-player-info {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1rem;
}

.current-player-name {
    color: var(--gold);
    font-weight: bold;
}

.to-call {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 5px;
}

.betting-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-fold {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    color: var(--cream);
    border: 2px solid #333;
}

.btn-check {
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: 2px solid #2E7D32;
}

.btn-raise {
    background: linear-gradient(180deg, var(--red-light) 0%, var(--red) 100%);
    color: white;
    border: 2px solid #5c0000;
}

.raise-controls {
    display: flex;
    gap: 5px;
}

.raise-controls input {
    width: 80px;
    padding: 10px;
    font-size: 0.9rem;
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    color: var(--cream);
    text-align: center;
}

.btn-fold, .btn-check, .btn-raise, .btn-allin {
    padding: 10px 15px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-fold:hover {
    background: linear-gradient(180deg, #b33c3c 0%, #8b0000 100%);
    border-color: #ff6b6b;
}

.btn-check:hover {
    background: linear-gradient(180deg, #f0c14b 0%, #d4a027 100%);
    border-color: #f0d66b;
}

.btn-raise:hover {
    background: linear-gradient(180deg, #f0c14b 0%, #d4a027 100%);
    border-color: #f0d66b;
}

.btn-allin {
    background: linear-gradient(180deg, #ff6b00 0%, #cc5500 100%);
    color: white;
    border: 2px solid #993300;
    font-weight: bold;
    text-transform: uppercase;
}

.btn-allin:hover {
    background: linear-gradient(180deg, #ff8533 0%, #ff6b00 100%);
    border-color: #ff9955;
}

.your-balance {
    display: block;
    font-size: 0.8rem;
    color: var(--gold-light);
    margin-top: 3px;
}

.cant-call-message {
    font-size: 0.85rem;
    color: #ff6b6b;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 6px;
    text-align: center;
}

/* Hint display */
.hint-display {
    background: rgba(0,0,0,0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--gold);
    text-align: center;
}

.hint-display.hidden {
    display: none;
}

.hint-label {
    font-size: 0.8rem;
    color: var(--gold);
    letter-spacing: 0.2em;
    margin-bottom: 8px;
}

.hint-text {
    font-size: 1rem;
    color: var(--cream);
    line-height: 1.4;
    margin-bottom: 15px;
    font-style: italic;
}

/* Question display */
.question-display {
    background: rgba(0,0,0,0.7);
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--gold);
    text-align: center;
    flex: 0 0 auto;
    overflow-y: auto;
    max-height: 50vh;
    margin-bottom: 10px;
}

.question-display.hidden {
    display: none;
}

.question-category {
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    margin-bottom: 6px;
}

.question-text {
    font-size: 1rem;
    color: var(--cream);
    margin-bottom: 10px;
    line-height: 1.3;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.answer-option {
    background: rgba(255,255,255,0.1);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.answer-option:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--gold);
}

.answer-option.selected {
    background: rgba(212, 175, 55, 0.3);
    border-color: var(--gold);
}

.answer-option.correct {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
}

.answer-option.incorrect {
    background: rgba(139, 0, 0, 0.3);
    border-color: var(--red);
}

.answer-letter {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: var(--gold);
    color: var(--black);
    border-radius: 50%;
    font-weight: bold;
    margin-right: 10px;
}

/* Pass device screen */
.pass-device {
    background: rgba(0,0,0,0.8);
    padding: 50px;
    border-radius: 15px;
    text-align: center;
}

.pass-device.hidden {
    display: none;
}

.pass-device h2 {
    color: var(--gold);
    margin-bottom: 15px;
}

.pass-device p {
    margin-bottom: 30px;
    opacity: 0.8;
}

/* Answer input */
.answer-input {
    background: rgba(0,0,0,0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--gold);
    text-align: center;
    flex: 1;
    overflow-y: auto;
}

.answer-input.hidden {
    display: none;
}

.answer-input h3 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1rem;
}

.answer-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.answer-btn {
    padding: 12px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    color: var(--cream);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.answer-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: var(--gold);
}

/* Question display in answer input */
.answer-question-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
}

.question-category-small {
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.question-text-small {
    font-size: 0.95rem;
    color: var(--cream);
    line-height: 1.3;
}

/* Results display */
.results-display {
    background: rgba(0,0,0,0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--gold);
    text-align: center;
    flex: 1;
    overflow-y: auto;
}

.results-display.hidden {
    display: none;
}

.results-display h2 {
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.correct-answer {
    font-size: 1rem;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 8px;
    border: 2px solid #4CAF50;
}

.correct-answer span {
    color: #4CAF50;
    font-weight: bold;
}

.winners-list {
    margin-bottom: 15px;
}

.winner-item {
    padding: 8px;
    margin: 4px 0;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.9rem;
}

.winner-item.winner {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--gold);
}

/* Side pot distribution styles */
.pot-distribution-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gold-dark);
    text-align: left;
    font-size: 0.9rem;
}

.pot-distribution-item {
    padding: 8px 10px;
    margin: 4px 0;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: left;
    border-left: 3px solid #ff6b00;
}

.pot-distribution-item .pot-name {
    color: var(--gold);
    font-weight: bold;
}

.results-spacer {
    height: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.balances-header {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--gold-dark);
    text-align: left;
    font-size: 0.9rem;
}

.balance-item {
    padding: 5px 10px;
    margin: 3px 0;
    font-size: 0.85rem;
    text-align: left;
    color: var(--cream);
}

/* ================================
   AVATAR SYSTEM STYLES
   ================================ */

/* Player avatar on card */
.player-avatar {
    width: 50px;
    height: 50px;
    margin: 0 auto 5px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold-dark);
    background: #1a1a2e;
}

.player-avatar svg {
    width: 100%;
    height: 100%;
}

.player-card.active .player-avatar {
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.player-card.folded .player-avatar {
    opacity: 0.5;
    filter: grayscale(100%);
}

.player-card.allin .player-avatar {
    border-color: #ff6b00;
}

/* Avatar selection in setup */
.player-setup-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.player-avatar-select {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--gold-dark);
    background: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    flex-shrink: 0;
}

.player-avatar-select:hover {
    border-color: var(--gold);
    transform: scale(1.05);
}

.player-avatar-select svg {
    width: 100%;
    height: 100%;
}

.player-name-input {
    flex: 1;
}

.player-name-input label {
    display: block;
    margin-bottom: 5px;
    color: var(--gold-light);
    font-weight: bold;
    font-size: 0.9rem;
}

.player-name-input input {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    color: var(--cream);
}

/* Avatar picker modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, var(--felt-green-dark) 0%, #0a1f12 100%);
    border: 3px solid var(--gold);
    border-radius: 15px;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold-dark);
}

.modal-header h3 {
    color: var(--gold);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--cream);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.modal-close:hover {
    color: var(--gold);
}

.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.avatar-picker-item {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--gold-dark);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-picker-item:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.avatar-picker-item.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.avatar-picker-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
}

.avatar-picker-svg svg {
    width: 100%;
    height: 100%;
}

.avatar-picker-name {
    font-size: 0.8rem;
    color: var(--cream);
    font-weight: bold;
}

/* ================================
   SIDE POTS DISPLAY
   ================================ */

.side-pots-display {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--gold-dark);
    border-radius: 8px;
    padding: 8px;
    max-width: 200px;
}

.side-pots-display.hidden {
    display: none;
}

.side-pots-label {
    font-size: 0.7rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
    text-align: center;
}

.side-pot-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    margin: 3px 0;
    background: rgba(255, 107, 0, 0.15);
    border-radius: 4px;
    font-size: 0.75rem;
    border-left: 3px solid #ff6b00;
}

.side-pot-name {
    color: var(--gold-light);
    font-weight: bold;
    margin-right: 5px;
}

.side-pot-amount {
    color: #4CAF50;
    font-weight: bold;
}

.side-pot-eligible {
    width: 100%;
    font-size: 0.65rem;
    color: var(--cream);
    opacity: 0.7;
    margin-top: 2px;
}

/* Game over */
.game-over {
    background: rgba(0,0,0,0.8);
    padding: 20px;
    border-radius: 10px;
    border: 3px solid var(--gold);
    text-align: center;
    flex: 1;
    overflow-y: auto;
}

.game-over.hidden {
    display: none;
}

.game-over h2 {
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.final-standings {
    margin-bottom: 15px;
}

.standing-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    margin: 8px 0;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.standing-item:first-child {
    background: rgba(212, 175, 55, 0.3);
    border: 2px solid var(--gold);
}

.standing-item:first-child .standing-name {
    color: var(--gold);
}

.standing-rank {
    font-weight: bold;
    margin-right: 15px;
}

.standing-name {
    flex: 1;
    text-align: left;
}

.standing-balance {
    color: var(--gold);
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.player-card.active {
    animation: pulse 1.5s infinite;
}

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

.action-panel > div:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 1200px) {
    .game-layout {
        flex-direction: column;
        height: auto;
    }

    .side-panel {
        width: 100%;
        max-height: 200px;
    }

    .left-panel {
        order: 2;
    }

    .poker-table {
        order: 1;
        min-width: auto;
        width: 100%;
        height: 50vh;
        min-height: 400px;
        border-radius: 80px;
    }

    .poker-table::before {
        border-radius: 70px;
    }

    .right-panel {
        order: 3;
    }

    .console-panel {
        max-height: 150px;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }

    .poker-table {
        border-radius: 50px;
        height: 45vh;
        min-height: 350px;
    }

    .poker-table::before {
        border-radius: 45px;
    }

    .player-seat {
        width: 90px;
    }

    .player-card {
        padding: 6px;
    }

    .player-name {
        font-size: 0.8rem;
    }

    .player-balance {
        font-size: 0.7rem;
    }

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

    .answer-options {
        grid-template-columns: 1fr;
    }

    .betting-buttons {
        flex-direction: column;
    }

    .raise-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .panel {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .player-seat {
        width: 70px;
    }

    .player-name {
        font-size: 0.7rem;
    }

    .player-balance {
        font-size: 0.65rem;
    }
}

/* ===========================
   CHAT SYSTEM
   =========================== */

.chat-panel {
    background: rgba(26, 26, 46, 0.95);
    border: 2px solid #c9a227;
    border-radius: 8px;
    overflow: hidden;
    max-height: 250px;
    width: 100%;
    max-width: 280px;
    margin: 8px auto 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    flex: 0 0 auto;
}

.right-panel {
    overflow-y: auto;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #c9a227;
}

.chat-header h3 {
    margin: 0;
    color: #c9a227;
    font-size: 1rem;
}

.chat-toggle {
    background: none;
    border: none;
    color: #c9a227;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.chat-toggle:hover {
    color: #ffd700;
}

.chat-content {
    padding: 8px;
}

.chat-content.collapsed {
    display: none;
}

.chat-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}

.chat-tab {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: #8a9ba8;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.chat-tab:hover {
    background: rgba(201, 162, 39, 0.2);
    color: #c9a227;
}

.chat-tab.active {
    background: rgba(201, 162, 39, 0.3);
    color: #ffd700;
    border-bottom: 2px solid #c9a227;
}

.chat-tab-content {
    display: none;
}

.chat-tab-content.active {
    display: block;
}

.chat-input-area {
    display: flex;
    gap: 5px;
}

#chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(201, 162, 39, 0.3);
    color: #f5f5f5;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
}

#chat-input:focus {
    outline: none;
    border-color: #c9a227;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.emote-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.emote-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(201, 162, 39, 0.3);
    color: #f5f5f5;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.emote-btn:hover {
    background: rgba(201, 162, 39, 0.2);
    border-color: #c9a227;
    transform: translateY(-2px);
}

.chat-history {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 10px;
}

.chat-message {
    margin-bottom: 8px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    font-size: 0.85rem;
}

.chat-message-player {
    color: #c9a227;
    font-weight: bold;
    margin-right: 5px;
}

.chat-message-text {
    color: #e0e0e0;
}

.chat-message-time {
    color: #666;
    font-size: 0.75rem;
    margin-left: 5px;
}

/* ===========================
   THOUGHT BUBBLES
   =========================== */

.thought-bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.thought-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    max-width: 150px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: bubbleFadeIn 0.3s ease-out, bubbleFadeOut 0.3s ease-in 2.7s forwards;
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.thought-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(255, 255, 255, 0.95);
}

.thought-bubble.position-top::after {
    bottom: auto;
    top: -8px;
    border-top: none;
    border-bottom: 8px solid rgba(255, 255, 255, 0.95);
}

/* Action Bubble - Different style from chat */
.action-bubble {
    position: absolute;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.95) 0%, rgba(212, 175, 55, 0.95) 100%);
    color: #1a1a2e;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    max-width: 120px;
    box-shadow: 0 3px 10px rgba(201, 162, 39, 0.5);
    animation: actionBubbleFadeIn 0.2s ease-out, actionBubbleFadeOut 0.2s ease-in 1.8s forwards;
    pointer-events: none;
    border: 2px solid rgba(255, 215, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(212, 175, 55, 0.95);
}

.action-bubble.position-top::after {
    bottom: auto;
    top: -6px;
    border-top: none;
    border-bottom: 6px solid rgba(212, 175, 55, 0.95);
}

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

@keyframes actionBubbleFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-5px) scale(0.9);
    }
}

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

@keyframes bubbleFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ===================================================================
   Hold'em Trivia mode - playing cards
   =================================================================== */

.community-board {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.playing-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 48px;
    background: var(--cream);
    color: var(--black);
    border-radius: 5px;
    border: 1px solid var(--gold-dark);
    box-shadow: 0 2px 4px var(--shadow);
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.playing-card .card-rank { font-size: 15px; }
.playing-card .card-suit { font-size: 15px; }
.playing-card.red { color: var(--red-light); }

.playing-card.card-back {
    background: repeating-linear-gradient(45deg, var(--felt-green) 0 6px, var(--felt-green-light) 6px 12px);
    border-color: var(--gold);
}

.playing-card.card-placeholder {
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(212, 175, 55, 0.4);
    box-shadow: none;
}

/* Cards shown at each player's seat (smaller) */
.player-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: flex-end;
    margin-top: 6px;
    flex-wrap: wrap;
}

/* Original (hole) vs gained (board) card groups, clearly separated */
.player-cards .card-group {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.player-cards .card-group .card-group-label {
    font-size: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold-light);
    opacity: 0.75;
}

.player-cards .card-group .cards {
    display: inline-flex;
    gap: 2px;
}

.player-cards .community-group {
    padding-left: 8px;
    border-left: 1px dashed rgba(212, 175, 55, 0.5);
}

.player-cards .no-cards {
    color: rgba(245, 245, 220, 0.4);
    font-size: 14px;
    padding: 0 6px;
}

.player-cards .playing-card {
    width: 24px;
    height: 34px;
}
.player-cards .playing-card .card-rank,
.player-cards .playing-card .card-suit { font-size: 11px; }

/* Trivia-earned community cards stand out from the free flop */
.playing-card.earned {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 2px 4px var(--shadow);
}

.player-best-hand {
    margin-top: 4px;
    font-size: 11px;
    color: var(--gold-light);
    font-weight: 600;
    text-align: center;
}

.player-answer-result {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    border-radius: 4px;
    padding: 1px 4px;
    display: inline-block;
}
.player-answer-result.correct { color: #7CFC7C; background: rgba(46, 160, 67, 0.18); }
.player-answer-result.wrong { color: #ff8a8a; background: rgba(178, 34, 34, 0.22); }
.player-answer-result.skip { color: var(--cream-dark); background: rgba(255, 255, 255, 0.08); }

/* Trivia stakes note + skip button */
.holdem-stakes-note {
    font-size: 12px;
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 6px;
    padding: 6px 8px;
    margin: 8px 0;
    text-align: center;
}

.answer-btn.answer-skip,
.answer-option.answer-skip {
    opacity: 0.85;
    font-style: italic;
}

.answer-btn.answer-reveal,
.answer-option.answer-reveal {
    border-color: var(--gold);
    color: var(--gold-light);
    font-weight: 700;
}

.showdown-cards {
    color: var(--gold-light);
    font-weight: 600;
    margin-left: 4px;
}
