/* Game Poker Table Container - Complete with all table sizes and proper sub-element positioning */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.poker-table-container {
    display: flex;
    padding: 30px 25px;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.poker-table {
    position: relative;
    width: calc(100dvw - 90px);
    max-width: 350px;
    height: calc(100dvh - 250px);
    border-radius: calc(0.5 * (100dvh - 250px));
    padding: 5px;

    background:
        radial-gradient(circle at 50% 40%,
            #333 0%,
            #1a1a1a 45%,
            #000 100%
        ) padding-box,
        linear-gradient(135deg, #3c2415, #2a1a10) border-box,
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0.07) 0px,
            rgba(255,255,255,0.07) 2px,
            rgba(0,0,0,0.15) 2px,
            rgba(0,0,0,0.15) 4px
        ) border-box;

    border: 5px solid transparent;
    box-shadow:
        inset 0 0 25px rgba(0,0,0,0.3),
        0 0 20px rgba(0,0,0,0.4);
}

.poker-table-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: grayscale(1);
    width: 70px;
    height: 70px;
    opacity: 0.15;
    pointer-events: none;
    user-select: none;
}

.scenario-title {
    position: absolute;
    transform: translate(-50%, -50%);
    left: 50%;
    top: calc(50% - 70px);
    font-size: 14px;
    font-weight: 300;
    font-family: 'Montserrat', sans-serif;
    text-wrap: nowrap;
}
/* ========================================
   SEAT CONTAINER
   ======================================== */

.player-position {
    position: absolute;
    width: 45px;
    height: 45px;
    transform: translate(-50%, -50%);
    display: none;
}

.player-seat {
    width: 100%;
    height: 100%;
    background: #333;
    border: 1px solid #666;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    padding: 4px;
    position: relative;
    z-index: 15;
    overflow: hidden;
}

.player-seat.active-player {
    border: 2px solid #fbbf24;
    box-shadow:
        0 0 10px rgba(251, 191, 36, 0.6),
        0 0 20px rgba(251, 191, 36, 0.4),
        inset 0 0 10px rgba(251, 191, 36, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow:
            0 0 10px rgba(251, 191, 36, 0.6),
            0 0 20px rgba(251, 191, 36, 0.4),
            inset 0 0 10px rgba(251, 191, 36, 0.2);
    }
    50% {
        box-shadow:
            0 0 15px rgba(251, 191, 36, 0.8),
            0 0 30px rgba(251, 191, 36, 0.6),
            inset 0 0 15px rgba(251, 191, 36, 0.3);
    }
}

.seat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.flip-horizontal {
    transform: scaleX(-1);
}

.player-seat-nameplate {
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #444;
    border-radius: 4px;
    min-width: 35px;
    white-space: nowrap;
    z-index: 20;
}

.player-seat-name {
    font-family: "Oswald", sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.player-seat-current-stack {
    font-size: 9px;
    font-family: "Oswald", sans-serif;
    color: #4ade80;
    font-weight: 600;
    line-height: 1.2;
}

/* Action Popup */
.player-seat-action-popup {
    position: absolute;
    font-family: "Oswald", sans-serif;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none; /* Changed from hide class */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Remove the .hide class rule entirely */

/* Action-specific colors */
.action-fold {
    background: var(--fold-color);
    color: white;
}

.action-check {
    background: var(--check-color);
    color: white;
}

.action-call {
    background: var(--call-color);
    color: white;
}

.action-raise {
    background: var(--raise-1-color);
    color: white;
}

.action-all-in {
    background: var(--all-in-color);
    color: white;
}

/* Action popup text */
.action-popup-text {
    font-size: 10px;
}

.action-popup-amount {
    font-size: 10px;
}

.player-cards-group {
    display: flex;
    position: absolute;
    transform: translate(-50%, -50%);
    top: 0;
    left: 50%;
}

.player-cards-group .seat-card-left {
    transform: rotate(-10deg);
    transform-origin: bottom center;
}

.player-cards-group .seat-card-right {
    transform: rotate(10deg);
    transform-origin: bottom center;
    margin-left: -12px;
    z-index: 1;
}

/* ========================================
   SUB-ELEMENT BASE STYLES
   ======================================== */

.player-bet {
    width: 15px;
    height: 15px;
    position: absolute;
    background: #0369a1;
    border: 2px solid #0c4a6e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 8px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 2;
    transition: all 0.3s ease;
    font-family: "Oswald", sans-serif;
}

.dealer-button {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border: 2px solid #333;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 8px;
    color: #333;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.3s ease;
}

.all-in-chip {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #EA0700, #691F17);
    border: 2px solid #333;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 7px;
    color: #f1f1f1;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.3s ease;
    font-family: "Oswald", sans-serif;
}

.all-in-chip-text {
    line-height: 6px;
    font-family: "Oswald", sans-serif;
}

.call-all-in-chip {
    background: linear-gradient(145deg, #27ae60, #106316);
}

/* ========================================
   2-PLAYER LAYOUT (HEADS-UP)
   ======================================== */

.poker-table[data-players="2"] .seat-1,
.poker-table[data-players="2"] .seat-2 {
    display: block;
}

.poker-table[data-players="2"] .seat-1 { top: 100%; left: 50%; }
.poker-table[data-players="2"] .seat-2 { top: 0%; left: 50%; }

.poker-table[data-players="2"] .seat-1 .player-bet { bottom: 0px; left: -13px; }
.poker-table[data-players="2"] .seat-1 .dealer-button { bottom: -13px; left: -11px; }
.poker-table[data-players="2"] .seat-1 .all-in-chip { bottom: -40px; left: -10px; }

.poker-table[data-players="2"] .seat-2 .player-bet { bottom: 2px; left: -13px; }
.poker-table[data-players="2"] .seat-2 .dealer-button { bottom: 18px; left: -13px; }
.poker-table[data-players="2"] .seat-2 .all-in-chip { bottom: -10px; left: -32px; }

/* ========================================
   6-PLAYER LAYOUT
   ======================================== */

.poker-table[data-players="6"] .seat-1,
.poker-table[data-players="6"] .seat-2,
.poker-table[data-players="6"] .seat-3,
.poker-table[data-players="6"] .seat-4,
.poker-table[data-players="6"] .seat-5,
.poker-table[data-players="6"] .seat-6 {
    display: block;
}

.poker-table[data-players="6"] .seat-1 { top: 100%; left: 50%; }
.poker-table[data-players="6"] .seat-2 { top: 0%; left: 50%; }
.poker-table[data-players="6"] .seat-3 { top: 30%; left: 0%; }
.poker-table[data-players="6"] .seat-4 { top: 70%; left: 0%; }
.poker-table[data-players="6"] .seat-5 { top: 30%; left: 100%; }
.poker-table[data-players="6"] .seat-6 { top: 70%; left: 100%; }

.poker-table[data-players="6"] .seat-1 .player-bet { bottom: 0px; left: -13px; }
.poker-table[data-players="6"] .seat-1 .dealer-button { bottom: -13px; left: -11px; }
.poker-table[data-players="6"] .seat-1 .all-in-chip { bottom: -40px; left: -10px; }

.poker-table[data-players="6"] .seat-2 .player-bet { bottom: 2px; left: -13px; }
.poker-table[data-players="6"] .seat-2 .dealer-button { bottom: 18px; left: -13px; }
.poker-table[data-players="6"] .seat-2 .all-in-chip { bottom: -10px; left: -32px; }

.poker-table[data-players="6"] .seat-3 .player-bet { bottom: 23px; left: -15px; }
.poker-table[data-players="6"] .seat-3 .dealer-button { top: -3px; left: -6px; }
.poker-table[data-players="6"] .seat-3 .all-in-chip { bottom: 25px; left: -36px; }

.poker-table[data-players="6"] .seat-4 .player-bet { top: -5px; left: -12px; }
.poker-table[data-players="6"] .seat-4 .dealer-button { top: 11px; left: -15px; }
.poker-table[data-players="6"] .seat-4 .all-in-chip { top: -26px; left: -20px; }

.poker-table[data-players="6"] .seat-5 .player-bet { top: -32px; left: calc(100% - 23px); }
.poker-table[data-players="6"] .seat-5 .dealer-button { top: -3px; right: -7px; }
.poker-table[data-players="6"] .seat-5 .all-in-chip { top: -37px; right: calc(100% - 20px); }

.poker-table[data-players="6"] .seat-6 .player-bet { top: -5px; right: -12px; }
.poker-table[data-players="6"] .seat-6 .dealer-button { top: 11px; right: -15px; }
.poker-table[data-players="6"] .seat-6 .all-in-chip { top: -26px; right: -20px; }


/* ========================================
   9-PLAYER LAYOUT (FULL)
   ======================================== */

.poker-table[data-players="9"] .seat-1,
.poker-table[data-players="9"] .seat-2,
.poker-table[data-players="9"] .seat-3,
.poker-table[data-players="9"] .seat-4,
.poker-table[data-players="9"] .seat-5,
.poker-table[data-players="9"] .seat-6,
.poker-table[data-players="9"] .seat-7,
.poker-table[data-players="9"] .seat-8,
.poker-table[data-players="9"] .seat-9 {
    display: block;
}

.poker-table[data-players="9"] .seat-1 { top: 3%; left: 73%; }
.poker-table[data-players="9"] .seat-2 { top: 25%; left: 99%; }
.poker-table[data-players="9"] .seat-3 { top: 58%; left: 100%; }
.poker-table[data-players="9"] .seat-4 { top: 90%; left: 88%; }
.poker-table[data-players="9"] .seat-5 { top: 100%; left: 50%; }
.poker-table[data-players="9"] .seat-6 { top: 90%; left: 12%; }
.poker-table[data-players="9"] .seat-7 { top: 58%; left: 0%; }
.poker-table[data-players="9"] .seat-8 { top: 25%; left: 1%; }
.poker-table[data-players="9"] .seat-9 { top: 3%; left: 27%; }

.poker-table[data-players="9"] .seat-1 .player-bet { bottom: 0px; left: -13px; }
.poker-table[data-players="9"] .seat-1 .dealer-button { bottom: -13px; left: -11px; }
.poker-table[data-players="9"] .seat-1 .all-in-chip { bottom: -40px; left: -10px; }

.poker-table[data-players="9"] .seat-2 .player-bet { bottom: 2px; left: -13px; }
.poker-table[data-players="9"] .seat-2 .dealer-button { bottom: 18px; left: -13px; }
.poker-table[data-players="9"] .seat-2 .all-in-chip { bottom: -10px; left: -32px; }

.poker-table[data-players="9"] .seat-3 .player-bet { bottom: 23px; left: -15px; }
.poker-table[data-players="9"] .seat-3 .dealer-button { top: -3px; left: -6px; }
.poker-table[data-players="9"] .seat-3 .all-in-chip { bottom: 25px; left: -36px; }

.poker-table[data-players="9"] .seat-4 .player-bet { top: -5px; left: -12px; }
.poker-table[data-players="9"] .seat-4 .dealer-button { top: 11px; left: -15px; }
.poker-table[data-players="9"] .seat-4 .all-in-chip { top: -26px; left: -20px; }

.poker-table[data-players="9"] .seat-5 .player-bet { top: -32px; left: calc(100% - 23px); }
.poker-table[data-players="9"] .seat-5 .dealer-button { top: -3px; right: -7px; }
.poker-table[data-players="9"] .seat-5 .all-in-chip { top: -37px; right: calc(100% - 20px); }

.poker-table[data-players="9"] .seat-6 .player-bet { top: -5px; right: -12px; }
.poker-table[data-players="9"] .seat-6 .dealer-button { top: 11px; right: -15px; }
.poker-table[data-players="9"] .seat-6 .all-in-chip { top: -26px; right: -20px; }

.poker-table[data-players="9"] .seat-7 .player-bet { bottom: 23px; right: -15px; }
.poker-table[data-players="9"] .seat-7 .dealer-button { top: -3px; right: -6px; }
.poker-table[data-players="9"] .seat-7 .all-in-chip { bottom: 24px; right: -36px; }

.poker-table[data-players="9"] .seat-8 .player-bet { bottom: 2px; right: -13px; }
.poker-table[data-players="9"] .seat-8 .dealer-button { bottom: 18px; right: -13px; }
.poker-table[data-players="9"] .seat-8 .all-in-chip { bottom: -10px; right: -32px; }

.poker-table[data-players="9"] .seat-9 .player-bet { bottom: 0px; right: -13px; }
.poker-table[data-players="9"] .seat-9 .dealer-button { bottom: -13px; right: -11px; }
.poker-table[data-players="9"] .seat-9 .all-in-chip { bottom: -40px; right: -10px; }

/* ========================================
   UTILITY CLASSES
   ======================================== */


.player-seat.folded {
    opacity: 0.4;
    filter: grayscale(0.7);
}

.action-order-element.folded {
    opacity: 0.4;
    filter: grayscale(0.7);
}

@media (max-width: 700px) {
    .game-container {
        flex-direction: column;
        justify-content: space-between;
    }
}