/* ============================================
   ROYAL FLUSH - Texas Hold'em Poker
   Premium Casino Theme Styles
   ============================================ */

   :root {
    /* Color Palette - Rich Casino Theme */
    --gold: #d4af37;
    --gold-light: #f4d160;
    --gold-dark: #996515;
    --felt-green: #0d5c2e;
    --felt-dark: #0a4422;
    --felt-light: #157a3d;
    --wood-dark: #2a1810;
    --wood-medium: #4a2c1a;
    --wood-light: #6b4423;
    --card-white: #f8f6f0;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --red-suit: #c41e3a;
    --black-suit: #1a1a1a;
    --chip-red: #c41e3a;
    --chip-blue: #1e3a8a;
    --chip-green: #166534;
    --chip-black: #1a1a1a;
    --bg-dark: #0f0f12;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #0f0f12 50%, #1a1a2e 100%);
    --text-light: #f0e6d3;
    --text-gold: #d4af37;
}

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

body {
    font-family: 'Roboto Mono', monospace;
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-light);
}

/* ============================================
   SCREEN MANAGEMENT
   ============================================ */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ============================================
   START SCREEN
   ============================================ */

#start-screen {
    background: var(--bg-gradient);
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#start-screen::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.08) 0%, transparent 40%);
    animation: ambientGlow 10s ease-in-out infinite alternate;
}

@keyframes ambientGlow {
    0% { transform: translate(-5%, -5%); }
    100% { transform: translate(5%, 5%); }
}

.start-container {
    text-align: center;
    z-index: 1;
    padding: 40px;
}

.logo-container {
    margin-bottom: 50px;
}

.card-fan {
    display: flex;
    justify-content: center;
    gap: -20px;
    margin-bottom: 20px;
}

.fan-card {
    width: 60px;
    height: 85px;
    background: linear-gradient(145deg, var(--card-white) 0%, #e8e4d8 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: rotate(calc((var(--i) - 1.5) * 15deg)) translateY(calc(var(--i) * 2px));
    margin: 0 -10px;
    transition: transform 0.3s ease;
    animation: cardFloat 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.2s);
}

.fan-card:nth-child(1), .fan-card:nth-child(4) { color: var(--black-suit); }
.fan-card:nth-child(2), .fan-card:nth-child(3) { color: var(--red-suit); }

@keyframes cardFloat {
    0%, 100% { transform: rotate(calc((var(--i) - 1.5) * 15deg)) translateY(calc(var(--i) * 2px)); }
    50% { transform: rotate(calc((var(--i) - 1.5) * 15deg)) translateY(calc(var(--i) * 2px - 10px)); }
}

.game-title {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 30px rgba(212, 175, 55, 0.4);
    letter-spacing: 0.15em;
    margin-bottom: 10px;
}

.game-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--text-light);
    letter-spacing: 0.3em;
    opacity: 0.8;
}

.player-select {
    margin-bottom: 40px;
}

.player-select h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.player-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.player-btn {
    width: 55px;
    height: 55px;
    border: 2px solid var(--gold);
    background: transparent;
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.player-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gold);
    transform: scale(0);
    transition: transform 0.3s ease;
    border-radius: 50%;
    z-index: -1;
}

.player-btn:hover::before,
.player-btn.selected::before {
    transform: scale(1);
}

.player-btn:hover,
.player-btn.selected {
    color: var(--bg-dark);
}

.player-info {
    color: var(--text-light);
    opacity: 0.7;
    font-size: 0.9rem;
}

.multiplayer-section {
    margin: 30px 0 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.name-input-row {
    margin-bottom: 20px;
    text-align: center;
}

.name-input-row label,
.join-input-row label {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
    letter-spacing: 0.08em;
}

.name-input-row input,
.join-input-row input {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--gold);
    border-radius: 8px;
    color: var(--text-light);
}

.name-input-row input::placeholder,
.join-input-row input::placeholder {
    color: rgba(240, 230, 211, 0.5);
}

.multiplayer-actions {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.host-column,
.join-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.game-code-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    border-radius: 8px;
}

.game-code-display span:first-child {
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.8;
}

.game-code-display span:last-child {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--gold);
}

.join-input-row {
    margin-bottom: 10px;
    min-width: 180px;
}

.start-btn.small {
    padding: 14px 36px;
    font-size: 1.1rem;
}

.start-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 18px 50px;
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--bg-dark);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 20px rgba(212, 175, 55, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    letter-spacing: 0.1em;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 30px rgba(212, 175, 55, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.chip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.chip:nth-child(1) { animation-delay: 0s; }
.chip:nth-child(2) { animation-delay: 0.2s; }
.chip:nth-child(3) { animation-delay: 0.4s; }
.chip:nth-child(4) { animation-delay: 0.6s; }

@keyframes chipBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.chip-red { background: linear-gradient(145deg, #e63946 0%, #a4161a 100%); }
.chip-blue { background: linear-gradient(145deg, #3b82f6 0%, #1e40af 100%); }
.chip-green { background: linear-gradient(145deg, #22c55e 0%, #15803d 100%); }
.chip-black { background: linear-gradient(145deg, #404040 0%, #1a1a1a 100%); }
.chip-orange { background: linear-gradient(145deg, #fb923c 0%, #ea580c 100%); }
.chip-purple { background: linear-gradient(145deg, #a855f7 0%, #6b21a8 100%); }

/* ============================================
   POKER CHIP STACKS
   ============================================ */

.chip-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    align-items: center;
    min-height: 28px;
}

.chip-stack-small .chip {
    width: 20px;
    height: 20px;
    font-size: 8px;
}

.chip-stack-medium .chip {
    width: 26px;
    height: 26px;
    font-size: 10px;
}

.chip-stack-large .chip {
    width: 32px;
    height: 32px;
    font-size: 11px;
}

.chip {
    position: relative;
    border-radius: 50%;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.chip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.chip-more {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
}

.chip-stack .chip {
    transform: translateY(calc(var(--stack-i, 0) * -1px));
}

/* Opponent chips: multiple lines, even rows, in outer space left/right of table */
.chip-stack-multiline {
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    gap: 4px;
    max-width: 140px;
}

.chip-stack-multiline .chip {
    transform: none;
}

.player-chip-stack .chip-stack-multiline {
    max-width: 140px;
}

.user-chip-stack,
.player-chip-stack {
    margin: 4px 0;
}

.user-chip-stack {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
    order: 1;
}

.user-hand-container .user-hand {
    order: 2;
}

/* Chip animation layer for flying chips */
.chip-animation-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 500;
}

.chip-flying {
    position: absolute;
    width: 28px;
    height: 28px;
    margin-left: -14px;
    margin-top: -14px;
    border-radius: 50%;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.3);
    animation: chipFlyToPot 0.6s ease-out forwards;
}

.chip-flying.chip-orange { border: 2px solid rgba(0, 0, 0, 0.25); }

@keyframes chipFlyToPot {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x, 0), var(--end-y, 0)) scale(0.6);
        opacity: 0.3;
    }
}

/* ============================================
   GAME SCREEN
   ============================================ */

#game-screen {
    background: var(--bg-gradient);
    flex-direction: column;
    padding: 20px;
}

.game-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* ============================================
   POKER TABLE
   ============================================ */

.poker-table {
    position: relative;
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 2 / 1;
    margin: 0 auto;
    flex-shrink: 0;
    transition: max-width 0.3s ease;
}

/* 5+ players: larger table; size scales slightly per extra player (6, 7, 8...) so everyone fits */
.poker-table.table-expanded {
    max-width: min(var(--table-expanded-max-width, 1520px), var(--table-expanded-max-width-vh, 120vh));
    max-height: var(--table-expanded-max-height, 60vh);
    flex-shrink: 1;
    min-height: 0;
}

.table-felt {
    position: absolute;
    top: 10%;
    left: 5%;
    width: 90%;
    height: 80%;
    background: 
        radial-gradient(ellipse at center, var(--felt-light) 0%, var(--felt-green) 50%, var(--felt-dark) 100%);
    border-radius: 50%;
    box-shadow: 
        inset 0 0 60px rgba(0, 0, 0, 0.5),
        0 0 0 15px var(--wood-medium),
        0 0 0 20px var(--wood-dark),
        0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.table-felt::before {
    content: '';
    position: absolute;
    top: 3%;
    left: 3%;
    width: 94%;
    height: 94%;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    pointer-events: none;
}

.table-logo {
    position: absolute;
    top: 15%;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: rgba(212, 175, 55, 0.2);
    letter-spacing: 0.3em;
    pointer-events: none;
}

/* ============================================
   COMMUNITY CARDS
   ============================================ */

/* When a player is at the top, push center content and pot down to avoid cramping (accounts for Bet text under player info) */
.table-felt.has-top-player .community-cards {
    margin-top: 18%;
}

/* Bigger table (5+ players): keep community cards and pot toward center */
.poker-table.table-expanded .table-felt .community-cards {
    margin-top: 6%;
}
.poker-table.table-expanded .table-felt.has-top-player .community-cards {
    margin-top: 10%;
}

/* 6+ players: move card outline and pot a little down (like 4-player layout) */
.poker-table.table-expanded .table-felt.six-or-more-players .community-cards {
    margin-top: 12%;
}
.poker-table.table-expanded .table-felt.six-or-more-players.has-top-player .community-cards {
    margin-top: 14%;
}

.community-cards {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    z-index: 10;
}

.card-slot {
    width: 65px;
    height: 91px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(212, 175, 55, 0.3);
    border-radius: 8px;
}

.card-slot:has(.card) {
    border: none;
    background: transparent;
}

/* ============================================
   PLAYING CARDS
   ============================================ */

.card {
    width: 65px;
    height: 91px;
    background: linear-gradient(145deg, var(--card-white) 0%, #e8e4d8 100%);
    border-radius: 8px;
    position: relative;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    font-family: 'Roboto Mono', monospace;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.card.face-down {
    background: 
        repeating-linear-gradient(
            45deg,
            #1e3a8a,
            #1e3a8a 5px,
            #1e40af 5px,
            #1e40af 10px
        ),
        linear-gradient(145deg, #1e3a8a 0%, #1e40af 100%);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card.face-down::before {
    content: '♠♥♦♣';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
}

.card-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.card-corner.top {
    top: 5px;
    left: 6px;
}

.card-corner.bottom {
    bottom: 5px;
    right: 6px;
    transform: rotate(180deg);
}

.card-rank {
    font-size: 14px;
    font-weight: bold;
}

.card-suit {
    font-size: 14px;
}

.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
}

.card.red .card-rank,
.card.red .card-suit,
.card.red .card-center {
    color: var(--red-suit);
}

.card.black .card-rank,
.card.black .card-suit,
.card.black .card-center {
    color: var(--black-suit);
}

/* Card Deal Animation */
.card.dealing {
    animation: dealCard 0.5s ease-out forwards;
}

@keyframes dealCard {
    0% {
        transform: translate(400px, -200px) rotate(180deg) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(0, 0) rotate(0) scale(1);
        opacity: 1;
    }
}

/* Card Flip Animation */
.card.flipping {
    animation: flipCard 0.6s ease-in-out;
}

@keyframes flipCard {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

/* ============================================
   POT DISPLAY
   ============================================ */

.pot-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.pot-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.pot-amount {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 20px;
    border-radius: 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    color: var(--gold);
    font-weight: 500;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ============================================
   PLAYERS CONTAINER
   ============================================ */

.players-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.player-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.player-seat.folded {
    opacity: 0.4;
    filter: grayscale(0.5);
}

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

.player-seat.current-turn .player-info-box {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    border-color: var(--gold);
}

.player-cards {
    display: flex;
    gap: 5px;
}

.player-cards .card {
    width: 45px;
    height: 63px;
}

.player-cards .card .card-rank {
    font-size: 10px;
}

.player-cards .card .card-suit {
    font-size: 10px;
}

/* Miniature cards for all-in runout showdown (fit in player box) */
.allin-runout-active .player-seat .player-cards {
    gap: 5px;
    justify-content: center;
    min-height: 60px;
}

.allin-runout-active .player-seat .player-cards .card {
    width: 42px;
    height: 58px;
    flex-shrink: 0;
}

.allin-runout-active .player-seat .player-cards .card .card-corner.bottom {
    transform: rotate(180deg);
}

.allin-runout-active .player-seat .player-cards .card .card-rank,
.allin-runout-active .player-seat .player-cards .card .card-suit {
    font-size: 10px;
}

.allin-runout-active .player-seat .player-cards .card .card-corner.top {
    top: 4px;
    left: 5px;
}

.allin-runout-active .player-seat .player-cards .card .card-corner.bottom {
    bottom: 4px;
    right: 5px;
}

.allin-runout-active .player-seat .player-cards .card .card-center {
    font-size: 20px;
}

.player-info-box {
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 15px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-width: 100px;
}

/* 5+ players: smaller cards and tighter spacing to prevent cards overlapping info box */
.table-felt.many-players .player-seat {
    gap: 4px;
}

.table-felt.many-players .player-cards .card {
    width: 36px;
    height: 50px;
}

.table-felt.many-players .player-cards .card .card-rank,
.table-felt.many-players .player-cards .card .card-suit {
    font-size: 8px;
}

.table-felt.many-players .player-cards .card .card-center {
    font-size: 18px;
}

.table-felt.many-players .player-cards .card .card-corner.top {
    top: 3px;
    left: 4px;
}

.table-felt.many-players .player-cards .card .card-corner.bottom {
    bottom: 3px;
    right: 4px;
}

.table-felt.many-players .player-info-box {
    padding: 5px 10px;
    min-width: 80px;
    margin-top: 2px;
}

.table-felt.many-players .player-name {
    font-size: 0.7rem;
}

.table-felt.many-players .player-chips {
    font-size: 0.8rem;
}

.table-felt.many-players .player-bet,
.table-felt.many-players .player-action {
    font-size: 0.65rem;
}

.table-felt.many-players .player-chip-stack .chip {
    width: 16px;
    height: 16px;
}

.player-name {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 3px;
    font-weight: 500;
}

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

.player-bet {
    font-size: 0.75rem;
    color: #22c55e;
    margin-top: 3px;
}

.player-action {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 2px;
    font-style: italic;
}

.dealer-chip {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 25px;
    height: 25px;
    background: linear-gradient(145deg, var(--gold-light) 0%, var(--gold) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: var(--bg-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   USER HAND
   ============================================ */

.user-hand-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    margin-top: auto;
}

.user-hand {
    display: flex;
    gap: 15px;
    perspective: 1000px;
}

.user-hand .card {
    width: 90px;
    height: 126px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.user-hand .card:hover {
    transform: translateY(-15px);
}

.user-hand .card .card-rank {
    font-size: 18px;
}

.user-hand .card .card-suit {
    font-size: 18px;
}


/* ============================================
   ACTION PANEL
   ============================================ */

.action-panel {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px 30px;
    border-radius: 20px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-panel.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    min-width: 100px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--gold);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-icon {
    display: none;
}

.btn-text {
    font-size: inherit;
    font-weight: inherit;
}

.fold-btn {
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.fold-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.check-btn {
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.check-btn:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

.call-btn {
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.call-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.raise-btn {
    border-color: rgba(212, 175, 55, 0.4);
    color: var(--gold);
}

.raise-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

/* Raise Slider */
.raise-slider-container {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

#raise-slider {
    width: 200px;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
}

#raise-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
}

.raise-amount {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--gold);
    font-weight: 500;
}

#raise-input {
    width: 80px;
    background: transparent;
    border: none;
    color: var(--gold);
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    outline: none;
}

.confirm-raise-btn {
    padding: 10px 20px;
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--bg-dark);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    transition: all 0.3s ease;
}

.confirm-raise-btn:hover {
    background: linear-gradient(145deg, var(--gold-light) 0%, var(--gold) 100%);
}

/* ============================================
   GAME INFO
   ============================================ */

.game-info {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 100;
}

.round-info {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1rem;
    letter-spacing: 0.1em;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.user-chips {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'Roboto Mono', monospace;
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 500;
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chips-icon {
    font-size: 1.3rem;
}

/* Chip value key */
.chip-key {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: var(--gold);
}

.chip-key-label {
    display: block;
    margin-bottom: 6px;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.chip-key-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.chip-key-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip-key-sample {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    flex-shrink: 0;
}

/* ============================================
   MESSAGE OVERLAY
   ============================================ */

.message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.message-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.message-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #0f0f12 100%);
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--gold);
    box-shadow: 
        0 0 40px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: popIn 0.4s ease;
}

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

#message-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

#message-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.6;
    white-space: pre-line;
}

.continue-btn {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    padding: 12px 35px;
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--bg-dark);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

/* ============================================
   BLINDS CONFIG OVERLAY
   ============================================ */

.blinds-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1600;
}

.blinds-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.blinds-content {
    width: min(520px, calc(100vw - 32px));
    background: linear-gradient(145deg, #1a1a2e 0%, #0f0f12 100%);
    border-radius: 20px;
    border: 2px solid var(--gold);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.25);
    padding: 28px 30px;
}

.blinds-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--gold);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.blinds-subtitle {
    font-family: 'Playfair Display', serif;
    color: var(--text-light);
    opacity: 0.85;
    margin-bottom: 18px;
    line-height: 1.4;
}

.blinds-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.blinds-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    user-select: none;
}

.blinds-option input {
    accent-color: var(--gold);
}

.blinds-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 520px) {
    .blinds-fields {
        grid-template-columns: 1fr;
    }
}

.blinds-field label {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-light);
    opacity: 0.9;
    letter-spacing: 0.05em;
}

.blinds-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid rgba(212, 175, 55, 0.45);
    background: rgba(255, 255, 255, 0.06);
    color: var(--gold);
    font-family: 'Roboto Mono', monospace;
}

.blinds-input-wrap input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
}

.blinds-input-wrap input:disabled {
    opacity: 0.5;
}

.blinds-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.blinds-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.05em;
    font-weight: 700;
}

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

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

.blinds-btn.primary {
    background: linear-gradient(145deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--bg-dark);
}

.blinds-btn.primary:hover {
    background: linear-gradient(145deg, var(--gold-light) 0%, var(--gold) 100%);
}

/* ============================================
   WAITING FOR PLAYERS OVERLAY
   ============================================ */

.waiting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 16px 18px;
    z-index: 1500;
    pointer-events: none;
}

.waiting-overlay.active {
    display: flex;
}

.waiting-content {
    background: linear-gradient(145deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 14px 22px;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.waiting-text {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0;
}

.waiting-text #waiting-names {
    color: var(--gold);
    font-weight: 600;
}

/* ============================================
   ALL-IN RUNOUT OVERLAY
   ============================================ */

.allin-runout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1200;
    pointer-events: none;
}

.allin-runout-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.allin-runout-overlay.active.undimmed {
    background: transparent;
    transition: background 0.6s ease;
}

.allin-runout-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #0f0f12 100%);
    padding: 28px 48px;
    border-radius: 16px;
    text-align: center;
    border: 2px solid var(--gold);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.25);
    transition: opacity 0.6s ease;
}

.allin-runout-content.faded {
    opacity: 0;
    pointer-events: none;
}

.allin-runout-title {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    color: var(--gold);
    margin: 0 0 8px 0;
    letter-spacing: 0.05em;
}

.allin-runout-text {
    font-size: 1rem;
    color: var(--text-light);
    margin: 0;
    opacity: 0.9;
}

/* ============================================
   SITTING OUT (LATE JOINER) MESSAGE
   ============================================ */

.sitting-out-message {
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 32px;
    background: linear-gradient(145deg, var(--wood-medium) 0%, var(--wood-dark) 100%);
    border: 2px solid var(--gold);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    color: var(--text-light);
}

.sitting-out-message.active {
    display: flex;
}

/* ============================================
   SHUFFLE OVERLAY
   ============================================ */

.shuffle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: auto;
}

.shuffle-overlay.active {
    display: flex;
}

.shuffle-cards {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.shuffle-card {
    width: 60px;
    height: 84px;
    background: linear-gradient(145deg, #1e3a8a 0%, #1e40af 100%);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    animation: shuffleAnim 1.5s ease-in-out infinite;
}

.shuffle-card:nth-child(1) { animation-delay: 0s; }
.shuffle-card:nth-child(2) { animation-delay: 0.1s; }
.shuffle-card:nth-child(3) { animation-delay: 0.2s; }
.shuffle-card:nth-child(4) { animation-delay: 0.3s; }
.shuffle-card:nth-child(5) { animation-delay: 0.4s; }

@keyframes shuffleAnim {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-30px) rotate(-15deg); 
    }
    50% { 
        transform: translateY(0) rotate(0deg); 
    }
    75% { 
        transform: translateY(-30px) rotate(15deg); 
    }
}

.shuffle-text {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--gold);
    letter-spacing: 0.2em;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   GAME OVER SCREEN
   ============================================ */

#gameover-screen {
    background: var(--bg-gradient);
    justify-content: center;
    align-items: center;
}

.gameover-container {
    text-align: center;
    padding: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 30px;
    border: 2px solid var(--gold);
}

#gameover-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    letter-spacing: 0.1em;
}

#gameover-message {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.6;
    white-space: pre-line;
}

/* ============================================
   WINNER HIGHLIGHT
   ============================================ */

.player-seat.winner {
    animation: winnerGlow 1s ease-in-out infinite;
}

@keyframes winnerGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.8));
    }
}

.winning-hand {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: var(--bg-dark);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .poker-table {
        max-width: 800px;
    }
    
    .community-cards .card-slot,
    .community-cards .card {
        width: 55px;
        height: 77px;
    }
    
    .player-cards .card {
        width: 35px;
        height: 49px;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .poker-table {
        max-width: 100%;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .action-btn {
        padding: 12px 18px;
        min-width: 75px;
    }
    
    .user-hand .card {
        width: 70px;
        height: 98px;
    }
    
    .community-cards {
        gap: 5px;
    }
    
    .community-cards .card-slot,
    .community-cards .card {
        width: 45px;
        height: 63px;
    }
}

/* ============================================
   CHIP ANIMATIONS
   ============================================ */

.chip-to-pot {
    animation: chipToPot 0.5s ease-out forwards;
}

@keyframes chipToPot {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--target-x), var(--target-y)) scale(0.5);
        opacity: 0;
    }
}

/* Card reveal animation */
.card.revealing {
    animation: revealCard 0.8s ease forwards;
}

@keyframes revealCard {
    0% {
        transform: rotateY(180deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

/* Fold animation */
.card.folding {
    animation: foldCard 0.5s ease-out forwards;
}

@keyframes foldCard {
    0% {
        transform: translateY(0) rotate(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) rotate(-20deg) scale(0.8);
        opacity: 0;
    }
}

/* Win animation for cards */
.card.winning {
    animation: winCard 0.5s ease-out infinite alternate;
}

@keyframes winCard {
    0% {
        transform: translateY(0);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(212, 175, 55, 0.5);
    }
}

/* Winning hand highlight – the 5 cards that make the best hand */
.card.winning-hand-card {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(212, 175, 55, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: scale(1.08);
    z-index: 2;
    animation: winningHandPulse 1.2s ease-in-out infinite;
}

@keyframes winningHandPulse {
    0%, 100% {
        box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(212, 175, 55, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    50% {
        box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.3),
            0 0 28px rgba(212, 175, 55, 0.85),
            0 0 40px rgba(212, 175, 55, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
}

