/* =============================================================
   BLITZ 31 - CASINO FELT TABLE, SEAT GEOMETRY & CENTER CARDS
   ============================================================= */

#table-container {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    padding: 6px 0;
    box-sizing: border-box;
}

/* OVAL TABLE FELT */
#table-oval-container {
    position: relative;
    width: 92vw;
    max-width: 480px;
    height: 56vh;
    max-height: 480px;
    margin: 0 auto;
    background: radial-gradient(ellipse at center, #115e3b 0%, #06311d 70%, #031c10 100%);
    border: 8px solid #0f2d1d;
    outline: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 170px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8), inset 0 0 40px rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* =============================================================
   CENTER POTS & DECK LAYOUT
   ============================================================= */
.pots-container {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    z-index: 5;
    pointer-events: none;
}

.pot-total-display {
    background: rgba(3, 20, 12, 0.88);
    border: 1.5px solid #d4af37;
    color: #f6e05e;
    padding: 2px 12px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.side-pot-total-display {
    background: rgba(3, 20, 12, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #cbd5e1;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
}

.deck-center, .table-center-area {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    z-index: 10;
    width: auto;
}

.card-slot {
    width: 52px;
    height: 74px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    position: relative;
    user-select: none;
    transition: transform 0.1s ease;
}

.card-slot:active {
    transform: scale(0.96);
}

.card-slot.back {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    border: 2px solid #ffffff;
}

.card-back-inner {
    width: 82%;
    height: 82%;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

.deck-counter-badge {
    position: absolute;
    bottom: -8px;
    background: #020c06;
    color: #e2e8f0;
    border: 1px solid #d4af37;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.62rem;
    font-weight: 800;
    white-space: nowrap;
}

.card-slot.empty-slot {
    border: 2px dashed #ca8a04;
    color: #ca8a04;
    font-size: 0.62rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.25);
    text-transform: uppercase;
}

/* =============================================================
   SEAT POSITIONS & COMPACT PLAYER BADGES
   ============================================================= */
.seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    z-index: 20;
}

/* Exact Coordinates Around Oval Rim */
.seat-0 { top: 92%; left: 50%; }
.seat-1 { top: 72%; left: 10%; }
.seat-2 { top: 28%; left: 10%; }
.seat-3 { top: 8%;  left: 50%; }
.seat-4 { top: 28%; left: 90%; }
.seat-5 { top: 72%; left: 90%; }

/* Compact Player Name Pods */
.seat-name-area {
    background: rgba(2, 14, 8, 0.94);
    border: 1.5px solid rgba(212, 175, 55, 0.5);
    color: #f8fafc;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.62rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
    white-space: nowrap;
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    transition: border-color 0.15s ease;
}

.seat-name-area b {
    font-size: 0.65rem;
    color: #f8fafc;
}

.current-turn-seat .seat-name-area {
    border-color: #f6e05e !important;
    box-shadow: 0 0 10px rgba(246, 224, 94, 0.8) !important;
}

.dealer-badge {
    background: #d97706;
    color: #fff;
    font-size: 0.56rem;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 50%;
    margin-left: 2px;
}

.seat-cards {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

/* =============================================================
   PLAYING CARDS RENDERING (Hand & Reveal Graphics)
   ============================================================= */
.playing-card {
    position: relative;
    width: 50px;
    height: 72px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px 3px;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease;
}

.card-slot.playing-card {
    width: 52px;
    height: 74px;
}

.playing-card.red-suit { color: #dc2626; }
.playing-card.black-suit { color: #0f172a; }

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

.corner-val {
    font-size: 0.72rem;
    font-weight: 900;
}

.corner-suit {
    font-size: 0.62rem;
}

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

.card-center-pip {
    font-size: 1.15rem;
    align-self: center;
    line-height: 1;
}

.mini-card {
    width: 20px;
    height: 28px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.52rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.mini-card.red-suit { color: #dc2626; }
.mini-card.black-suit { color: #0f172a; }

/* Responsive adjustments for narrow phones */
@media (max-width: 480px) {
    #table-oval-container {
        width: 95vw;
        height: 52vh;
        border-width: 6px;
        border-radius: 140px;
    }

    .seat-name-area {
        max-width: 72px;
        font-size: 0.58rem;
    }

    .seat-name-area b {
        font-size: 0.62rem;
    }

    .card-slot {
        width: 46px;
        height: 66px;
    }

    .playing-card {
        width: 46px;
        height: 66px;
    }
}

/* ============================================================
   ENLARGED DECK, DISCARD, AND PLAYER HAND CARDS
   ============================================================ */

/* 1. Center Area: Deck & Discard Piles */
.table-center-area {
    gap: 18px !important;
}

#deck-pile,
#discard-pile,
.deck-pile,
.discard-pile {
    width: 90px !important;
    height: 126px !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45) !important;
}

#deck-pile .card-back-pattern {
    font-size: 2.2rem !important;
}

#discard-pile .card-placeholder,
#discard-top-card {
    font-size: 1.1rem !important;
}

.pile-label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
}

/* 2. Docked Bottom Container & Player Cards */
.player-hand-container {
    min-height: 155px !important;
    padding-top: 6px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
}

#my-cards-container {
    gap: 10px !important;
}

#my-cards-container .card,
#my-cards-container .player-card,
.player-hand-container .card {
    width: 95px !important;
    height: 133px !important;
    border-radius: 9px !important;
    font-size: 1.25rem !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5) !important;
}

/* 3. Small Mobile Devices (Maintains fit when holding 4 cards) */
@media (max-width: 390px) {
    #deck-pile,
    #discard-pile,
    .deck-pile,
    .discard-pile {
        width: 74px !important;
        height: 106px !important;
    }

    #my-cards-container .card,
    #my-cards-container .player-card,
    .player-hand-container .card {
        width: 80px !important;
        height: 114px !important;
        font-size: 1.1rem !important;
    }
}

/* ============================================================
   ENLARGED HAND CARDS, DISCARD PILE & PLAYER SEAT STATUS BARS
   ============================================================ */

/* 1. CARDS IN HAND (Drawn Hand Container) */
.player-hand-container {
    min-height: 180px !important;
    padding-top: 8px !important;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
}

#my-cards-container {
    gap: 12px !important;
    padding: 4px 10px !important;
}

#my-cards-container .my-card,
#my-cards-container .playing-card,
.player-hand-container .card {
    width: 96px !important;
    height: 140px !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6) !important;
}

/* Enlarge Corner Values & Center Pip on Hand Cards */
#my-cards-container .my-card .corner-val {
    font-size: 1.25rem !important;
    font-weight: 900 !important;
}

#my-cards-container .my-card .corner-suit {
    font-size: 1.15rem !important;
}

#my-cards-container .my-card .card-center-pip {
    font-size: 2.4rem !important;
}


/* 2. DISCARD PILE (Center Table) */
.deck-center,
.table-center-area {
    gap: 22px !important;
}

/* Targets both the dynamic render and the initial HTML shell */
#discard-pile,
#deck-pile,
.deck-center .card-slot,
.table-center-area .card-slot,
.card-slot.playing-card,
.card-slot.empty-slot {
    width: 92px !important;
    height: 134px !important;
    border-radius: 9px !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55) !important;
}

/* Enlarge details inside the discard pile top card */
.deck-center .card-slot.playing-card .corner-val,
#discard-pile .corner-val {
    font-size: 1.2rem !important;
    font-weight: 900 !important;
}

.deck-center .card-slot.playing-card .corner-suit,
#discard-pile .corner-suit {
    font-size: 1.1rem !important;
}

.deck-center .card-slot.playing-card .card-center-pip {
    font-size: 2.2rem !important;
}

#deck-pile .card-back-pattern,
#deck-pile .card-back-inner {
    font-size: 2.6rem !important;
}

.deck-counter-badge {
    font-size: 0.72rem !important;
    padding: 3px 6px !important;
    bottom: -10px !important;
}


/* 3. PLAYER SEAT STATUS BARS (Expanded to fit names, icons, & lives/wager) */
.seat,
.player-seat {
    min-width: 130px !important;
    max-width: 175px !important;
    z-index: 100 !important;
}

.seat-name-area,
.seat-info {
    min-width: 120px !important;
    padding: 7px 10px !important;
    font-size: 0.84rem !important;
    line-height: 1.4 !important;
    border-radius: 8px !important;
    background: rgba(4, 18, 12, 0.92) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.6) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65) !important;
    white-space: normal !important;
    word-break: break-word !important;
}

/* Dealer Badge & Status Icons spacing */
.dealer-badge {
    font-size: 0.7rem !important;
    padding: 1px 5px !important;
    margin-left: 4px !important;
    vertical-align: middle !important;
}

.seat-name-area b {
    font-size: 0.88rem !important;
    letter-spacing: 0.3px !important;
}

/* Small mobile responsiveness (keeps 4-card hands and seats on-screen) */
@media (max-width: 410px) {
    #my-cards-container .my-card,
    #my-cards-container .playing-card {
        width: 82px !important;
        height: 120px !important;
    }

    #my-cards-container .my-card .card-center-pip {
        font-size: 1.9rem !important;
    }

    #discard-pile,
    #deck-pile,
    .deck-center .card-slot {
        width: 80px !important;
        height: 116px !important;
    }

    .seat,
    .player-seat {
        min-width: 110px !important;
    }

    .seat-name-area {
        font-size: 0.78rem !important;
        padding: 5px 8px !important;
    }
}

/* ============================================================
   BOTTOM DOCKED REVEAL MODALS (NO OVERLAP + ACCURATE CARD COLORS)
   ============================================================ */

/* 1. Base Container: Capped to Half Screen Width */
#discard-pickup-topleft-modal,
#fed-card-topright-modal,
.corner-modal {
    position: fixed !important;
    top: auto !important;
    bottom: 8px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    background: rgba(4, 20, 13, 0.96) !important;
    border: 1.5px solid #d4af37 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75) !important;
    z-index: 500 !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    max-width: calc(50vw - 12px) !important;
}

/* 2. Positioning */
#discard-pickup-topleft-modal,
.top-left-corner {
    left: 6px !important;
    right: auto !important;
}

#fed-card-topright-modal,
.top-right-corner {
    right: 6px !important;
    left: auto !important;
}

/* 3. Text & Name Labels (Only targets non-card text) */
.corner-modal .modal-label,
#discard-pickup-topleft-modal > span,
#discard-pickup-card-content > span,
#fed-card-label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    word-break: break-word !important;
    flex: 1 1 auto !important;
}

#discard-pickup-card-content,
#fed-card-content {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}

/* 4. Mini Card Structure */
.corner-modal .mini-card {
    width: 28px !important;
    height: 40px !important;
    background: #ffffff !important;
    border-radius: 4px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

/* 5. Strict Card Suit Colors (Red vs Black) */
.corner-modal .mini-card.red-suit,
.corner-modal .mini-card.red-suit span,
.corner-modal .mini-card.card-red,
.corner-modal .mini-card.card-red span {
    color: #dc2626 !important;
}

.corner-modal .mini-card.black-suit,
.corner-modal .mini-card.black-suit span,
.corner-modal .mini-card.card-black,
.corner-modal .mini-card.card-black span {
    color: #111827 !important;
}

.corner-modal .mini-card .mini-val {
    font-size: 0.82rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.corner-modal .mini-card .mini-suit {
    font-size: 0.82rem !important;
    line-height: 1 !important;
}


/* ============================================================
   DEALER DRAW: 2 ROWS X 3 COLUMNS RESULTS GRID
   ============================================================ */
#draw-order-sequence {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 6px !important;
}

.dealer-draw-grid-results {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 380px !important;
    margin: 0 auto 10px auto !important;
}

.draw-showcase-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 2px !important;
    margin: 0 !important;
    border-radius: 6px !important;
    background: rgba(4, 20, 13, 0.95) !important;
    min-height: 82px !important;
    box-sizing: border-box !important;
}

.draw-showcase-item .draw-picker-badge {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 95% !important;
    text-align: center !important;
    margin-bottom: 4px !important;
}

/* Scales the revealed card so 3 columns fit mobile viewports */
.draw-showcase-item .playing-card {
    width: 44px !important;
    height: 62px !important;
    border-radius: 4px !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6) !important;
}

.draw-showcase-item .playing-card .corner-val {
    font-size: 0.78rem !important;
}

.draw-showcase-item .playing-card .corner-suit {
    font-size: 0.74rem !important;
}

.draw-showcase-item .playing-card .card-center-pip {
    font-size: 1.25rem !important;
}

.draw-showcase-item .draw-card-waiting {
    width: 44px !important;
    height: 62px !important;
    border-radius: 4px !important;
}

/* --- HOST CONFIG & BOT BUTTON BAR --- */
#lobby-config-bar {
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    position: relative;
    z-index: 600;
    margin: 6px 0;
    font-size: 0.8rem;
    color: #e2e8f0;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.bot-actions button {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* ============================================================
   COMPACT CENTER-DECK NEXT HAND POPUP (OVERRIDES MAIN.CSS)
   ============================================================ */
#next-hand-overlay,
.next-hand-banner,
.next-hand-center-popup {
    display: none !important;
}

#deck-center #deck-next-hand-popup,
#deck-next-hand-popup {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: max-content !important;
    max-width: 240px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 6px 10px !important;
    margin: 0 !important;
    background: rgba(4, 28, 18, 0.96) !important;
    border: 2px solid #fbbf24 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 250 !important;
    pointer-events: auto !important;
}

#next-hand-btn {
    width: auto !important;
    height: auto !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    font-size: 0.8rem !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    border-radius: 7px !important;
}
