:root {
    --primary: #4ade80;
    --bg: #0f172a;
    --bg-dark: #020617;
    --text: #f8fafc;
    --text-muted: #94a3b8;

    /* Mapping Legacy Variables to New Theme */
    --table-green: #0f172a;
    --table-dark: #020617;
    --text-white: #f8fafc;
    --accent-yellow: #4ade80;
    --chip-white: #e2e8f0;
    --chip-red: #ef4444;
    --chip-blue: #3b82f6;
    --chip-black: #1e293b;
    --btn-color: #1e293b;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
}

/* Header */
.top-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    z-index: 200;
    color: white;
    background: rgba(0, 0, 0, 0.3);
}

.username {
    color: white;
    font-weight: bold;
}



.balance-wrapper {
    color: var(--primary);
    font-weight: bold;
}

.header-btn {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 5px 10px;
    margin-left: 10px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    /* Enforce specific height */
    box-sizing: border-box;
    /* Include padding/border in height */
    line-height: normal;
    /* Reset line-height */
    vertical-align: middle;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.logout-btn {
    border-color: #e74c3c;
    color: #e74c3c;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #222;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #f1c40f;
    min-width: 300px;
    color: white;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
    max-width: 500px;
}

.close-modal {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#leaderboard-table th,
#leaderboard-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #444;
}

#leaderboard-table th {
    color: #f1c40f;
}

/* Felt Table Background Pattern */
/* body block moved to top */

.game-container {
    width: 100vw;
    max-width: none;
    height: 100%;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    /* Remove padding for perfect centering */
    box-sizing: border-box;
}

.game-board {
    position: relative;
    width: 95%;
    max-width: 1100px;
    height: 80vh;
    min-height: 650px;
    max-height: 1000px;
    background-color: #27ae60;
    border-radius: 160px;
    /* More rounded */
    border: 20px solid #5d4037;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.6), 0 30px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px 80px;
    /* More side padding to clear corners */
    padding-top: 60px;
    transition: all 0.3s ease;
    margin: auto;
}

/* Decorations */
.table-logo-img {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    /* Adjust size as needed */
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

.dealer-rules {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

/* Hand Areas */
.hand-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* Take up available space */
    position: relative;
    width: 100%;
}

/* Hand Areas */
.hand-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    width: 100%;
}

/* Center Controls - Flex item instead of absolute */
/* Center Controls - Container for everything in the middle */
.center-controls {
    position: relative;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 120px;
    /* Reserve space */
    margin: 10px 0;
    width: 100%;
    pointer-events: auto;
    /* Ensure clicks pass through if needed, but buttons need events */
}

/* Betting Area (New Center) */
.betting-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeIn 0.4s ease-out;
}

.bet-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.cards-track {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

/* Card Container - 3D Perspective */
.card {
    width: 120px;
    height: 175px;
    background: transparent;
    perspective: 1000px;
    position: relative;
    margin: 0 10px;
    /* Restored margin for spacing */
}

/* Inner Container - Holds Front and Back */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    /* Restored radius */
}

/* Flipped State */
.card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Front and Back Faces */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    /* Restored radius */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    box-sizing: border-box;
    background-color: white;
    border: 1px solid #ccc;
}

/* Front Face (Default content) */
.card-front {
    color: black;
    font-family: 'Oswald', sans-serif;
    /* Restored font */
}

/* Back Face */
.card-back {
    /* Red Card Back - Combined Pattern & Gradient */
    background: repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.1) 0px,
            rgba(255, 255, 255, 0.1) 10px,
            transparent 10px,
            transparent 20px),
        radial-gradient(#e74c3c, #c0392b);
    border: 2px solid white;
    transform: rotateY(180deg);
}

/* Red/Black text logic applies to front */
.card.red .card-front {
    color: #c0392b;
    /* Original red */
}

.card.black .card-front {
    color: #2c3e50;
    /* Original dark blue/black */
}

/* Override old hidden-card style */
.hidden-card {
    /* No longer needed if we use physical flip, but keep for fallback */
    background: radial-gradient(#2c3e50, #1a252f) !important;
}

.card-corner {
    display: flex;
    flex-direction: column;
    font-size: 1.5rem;
    /* Restored larger size */
    font-weight: bold;
    line-height: 1;
}

.card-top {
    align-self: flex-start;
    margin-left: 5px;
}

.card-bottom {
    align-self: flex-end;
    margin-right: 5px;
    transform: rotate(180deg);
}

.card-center {
    font-size: 3.5rem;
    /* Restored larger size */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.card.hidden-card {
    background: radial-gradient(#2c3e50, #1a252f);
    border: 2px solid white;
}

.card.hidden-card>* {
    display: none;
}

/* Removed Bottom Bar & Balance Box Styles */

/* Chips adjusted for center display */
.chips-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.current-bet-display {
    color: #f1c40f;
    /* Gold text */
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 5px;
    background: linear-gradient(145deg, #2c3e50, #000);
    padding: 10px 30px;
    border-radius: 8px;
    border: 2px solid #5d4037;
    /* Wood/Frame darker border */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 2px 5px rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
    min-width: 150px;
    text-align: center;
}

.clear-btn {
    background: linear-gradient(to bottom, #c0392b, #8e2319);
    border: 1px solid #922b21;
    color: white;
    padding: 10px 25px;
    border-radius: 5px;
    /* Less rounded for a button feel */
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.clear-btn:hover {
    background: linear-gradient(to bottom, #d6483a, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.reset-btn {
    background-color: #e74c3c;
    color: white;
    padding: 15px 40px;
    font-size: 1.5rem;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    font-family: 'Oswald', sans-serif;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.center-controls {
    /* Ensure no overlap */
    z-index: 50;
}

.hidden {
    display: none !important;
}

/* --- New Polish & Animations --- */

/* Premium Buttons */
.action-btn,
.deal-btn,
.new-game-btn,
.hit-btn,
.stand-btn,
.double-btn,
.reset-btn {
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    /* Unified border style */
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3), 0 5px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.1s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    font-size: 1rem;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    /* Default text color */
}

.action-btn:active,
.deal-btn:active,
.new-game-btn:active,
.reset-btn:active,
.hit-btn:active,
.stand-btn:active,
.double-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
}

.hit-btn {
    background: linear-gradient(to bottom, #3498db, #2980b9);
    border-color: #2573a7;
}

.hit-btn:hover {
    background: linear-gradient(to bottom, #5dade2, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.stand-btn {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    border-color: #922b21;
}

.stand-btn:hover {
    background: linear-gradient(to bottom, #ec7063, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.double-btn {
    background: linear-gradient(to bottom, #9b59b6, #8e44ad);
    border-color: #71368a;
}

.double-btn:hover {
    background: linear-gradient(to bottom, #af7ac5, #9b59b6);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.split-btn {
    background: linear-gradient(to bottom, #16a085, #1abc9c);
    border-color: #117a65;
}

.split-btn:hover {
    background: linear-gradient(to bottom, #1abc9c, #16a085);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

.deal-btn,
.new-game-btn {
    background: linear-gradient(to bottom, #f1c40f, #d35400);
    color: #2c3e50;
    /* Dark text for Gold */
    border: 1px solid #d35400;
    text-shadow: none;
}

.deal-btn:hover,
.new-game-btn:hover {
    background: linear-gradient(to bottom, #f39c12, #e67e22);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
}

/* Win Effect Animation */
.win-effect {
    position: absolute;
    top: 25%;
    /* Moved up to avoid overlapping center controls */
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    color: #f1c40f;
    -webkit-text-stroke: 2px #000;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 1000;
    text-align: center;
    white-space: nowrap;
}

.animate-win {
    animation: slam-wobble-fade 3s forwards;
}

@keyframes slam-wobble-fade {
    0% {
        opacity: 0;
        transform: translate(-50%, -200%) scale(3);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    18% {
        transform: translate(-52%, -50%) rotate(-5deg);
    }

    21% {
        transform: translate(-48%, -50%) rotate(5deg);
    }

    24% {
        transform: translate(-52%, -50%) rotate(-5deg);
    }

    27% {
        transform: translate(-48%, -50%) rotate(5deg);
    }

    30% {
        transform: translate(-50%, -50%) rotate(0);
    }

    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Bet Deduction Effect */
/* Bet Deduction Effect (Targeting Header) */
.bet-effect {
    position: fixed;
    /* Fixed to screen to overlay everything */
    z-index: 2000;
    color: #e74c3c;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Oswald', sans-serif;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

@keyframes float-fade-out {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
        /* Float DOWN for deduction feels intuitive or UP? Standard uses UP. Let's Float DOWN since it's "dropping" money? actually UP is fading away. */
        transform: translateY(20px);
    }
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    /* Ensure above all else */
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.2);
}

#vol-slider {
    width: 80px;
    cursor: pointer;
    accent-color: #4ade80;
}

/* --- Level & Profile Styles --- */
.level-indicator {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    vertical-align: middle;
}

.level-badge {
    background: #ffaa00;
    color: #000;
    padding: 2px 8px;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 5px;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
    min-width: 20px;
    text-align: center;
}

/* =========================================
   Authentic Casino Chip Styling
   ========================================= */

/* Chip Base - Geometry & Shadow */
.chip {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    /* Outer rim border (thin) */
    border: 1px solid rgba(0, 0, 0, 0.2);

    /* 3D Depth Shadow */
    box-shadow:
        0 6px 0 rgba(0, 0, 0, 0.4),
        /* Thickness */
        0 10px 10px rgba(0, 0, 0, 0.5),
        /* Drop shadow */
        inset 0 0 10px rgba(0, 0, 0, 0.3);
    /* Inner depth */

    display: flex;
    justify-content: center;
    align-items: center;

    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s, box-shadow 0.1s;
    margin: 10px;

    /* Variables for colors, defaulted to gray */
    --chip-color: #95a5a6;
    --chip-accent: #ffffff;
    --text-color: #2c3e50;

    color: var(--text-color);
    text-shadow: none;

    /* The Composite Pattern */
    background-image:
        /* 1. Center Circle (White label area) */
        radial-gradient(circle, white 42%, transparent 43%),
        /* 2. Inner Ring (Main Color) - masks the inner part of stripes */
        radial-gradient(circle, transparent 43%, var(--chip-color) 43%, var(--chip-color) 68%, transparent 69%),
        /* 3. Edge Stripes (The Spots) */
        repeating-conic-gradient(var(--chip-color) 0deg 15deg,
            var(--chip-accent) 15deg 30deg);
}

/* Hover & Active States */
.chip:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 0 rgba(0, 0, 0, 0.3),
        0 15px 20px rgba(0, 0, 0, 0.4),
        inset 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.chip:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 rgba(0, 0, 0, 0.4),
        0 4px 5px rgba(0, 0, 0, 0.5);
}

/* Dashed Inner Border Detail (via Pseudo-element) */
.chip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 66%;
    height: 66%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.6);
    pointer-events: none;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

/* --- Specific Denominations --- */

/* $10 - White & Blue (Primary White) */
.chip-10 {
    --chip-color: #ecf0f1;
    /* White-ish Base */
    --chip-accent: #3498db;
    /* Blue Spots */
    --text-color: #2c3e50;

    /* Override for White Chip: Light Gray Inner Ring helps separate */
    background-image:
        radial-gradient(circle, white 42%, transparent 43%),
        radial-gradient(circle, transparent 43%, #bdc3c7 43%, #bdc3c7 68%, transparent 69%),
        repeating-conic-gradient(#ecf0f1 0deg 15deg,
            #3498db 15deg 30deg);
}

.chip-10::after {
    border-color: rgba(0, 0, 0, 0.2);
}


/* $50 - Red & White (Primary Red) */
.chip-50 {
    --chip-color: #c0392b;
    /* Deep Red */
    --chip-accent: #ffffff;
    /* White Spots */
    --text-color: #c0392b;
    /* Red Text */
}


/* $100 - Blue & White (Primary Blue) */
.chip-100 {
    --chip-color: #2980b9;
    /* Deep Blue */
    --chip-accent: #ffffff;
    /* White Spots */
    --text-color: #2980b9;
    /* Blue Text */
}

/* =========================================
   Visual Deck Stack
   ========================================= */
.deck-stack {
    position: absolute;
    top: 80px;
    right: 120px;
    /* Moved inwards */
    width: 100px;
    height: 145px;
    z-index: 5;
    transform: rotate(-5deg);
}

.deck-card {
    position: absolute;
    width: 100%;
    height: 100%;
    /* Red Card Back - Combined */
    background: repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.1) 0px,
            rgba(255, 255, 255, 0.1) 10px,
            transparent 10px,
            transparent 20px),
        radial-gradient(#e74c3c, #c0392b);
    border: 2px solid white;
    border-radius: 8px;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.deck-card:nth-child(1) {
    top: 0;
    left: 0;
}

.deck-card:nth-child(2) {
    top: -2px;
    left: -2px;
}

.deck-card:nth-child(3) {
    top: -4px;
    left: -4px;
}

.deck-card:nth-child(4) {
    top: -6px;
    left: -6px;
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.3);
}


/* $500 - Black & White (Primary Black) */
.chip-500 {
    --chip-color: #2c3e50;
    /* Charcoal */
    --chip-accent: #ffffff;
    --text-color: #000000;
    /* Black Text for contrast on white center */
}

/* $1k - Orange/Gold */
.chip-1k {
    --chip-color: #d35400;
    /* Pumpkin Orange */
    --chip-accent: #f1c40f;
    /* Gold Spots */
    --text-color: #f39c12;
    /* Lighter Orange Text */
}

/* $5k - Purple */
.chip-5k {
    --chip-color: #8e44ad;
    /* Wisteria Purple */
    --chip-accent: #ecf0f1;
    /* White spots */
    --text-color: #9b59b6;
    /* Lighter Purple Text */
}

/* $25k - Teal/Cyan */
.chip-25k {
    --chip-color: #16a085;
    /* Green Sea */
    --chip-accent: #1abc9c;
    /* Turquoise spots */
    --text-color: #1abc9c;
    /* Cyan Text */
}

.xp-bar-container {
    width: 100px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-left: 5px;
    border: 1px solid #444;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffaa00, #ffea00);
    width: 0%;
    transition: width 0.5s ease-out;
}

/* Main Cards Container */
.cards-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* Take up remaining vertical space in game board */
    width: 100%;
    position: relative;
    /* Ensure it has height */
    min-height: 500px;
    gap: 50px;
    /* Gap between dealer and player sections */
}

/* Individual Hand Sections (Dealer/Player) */
.hand-section {
    width: 100%;
    margin: 10px 0;
    min-height: 180px;
    /* valid card height space */
    position: relative;
    /* For absolute positioning of old style elements if needed */
}

.hand-section#dealer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hand-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
    /* Spacing between split hands */
    min-width: 120px;
}

.cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    /* Ensure height for cards */
    min-width: 100px;
}

.hand-section#player-section {
    justify-content: flex-end;
    flex-direction: row;
    /* Allow hands to sit side-by-side */
    align-items: flex-end;
}

#player-hands-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.hand-score-display {
    margin-top: 10px;
    /* Styling similar to old bubbles or integrated */
}

/* Reuse score bubble style if desired, or new */
/* Hand Score Bubble (Yellow Circle) */
.hand-score-bubble {
    background: #f1c40f;
    color: #000;
    border: 2px solid #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    font-family: 'Oswald', sans-serif;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
    margin: 0 auto;
}

/* Update Dealer Score Container to use new bubble style if needed */


/* Cards Container helper */
.cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 145px;
    /* Card height */
}

/* Standardize icons */
.material-symbols-outlined {
    font-size: 24px;
    vertical-align: middle;
    margin-right: 5px;
}

/* Split Hands Layout */
#player-hands-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    width: 100%;
}

.hand-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.hand-column.active-hand {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(241, 196, 15, 0.5));
}

.hand-column.inactive-hand {
    opacity: 0.6;
}

.hand-score {
    /* This will be the container for the score bubble */
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

#dealer-section .hand-score {
    margin-top: 30px;
    /* Push dealer bubble down more */
}


/* Profile Tabs */
.profile-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #444;
}

.tab-btn {
    background: none;
    border: none;
    color: #888;
    padding: 10px 20px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1em;
    cursor: pointer;
    transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 2px solid transparent;
}

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

.tab-btn.active {
    color: #f1c40f;
    border-bottom: 2px solid #f1c40f;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

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

/* Modal Styles */
.modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #ffaa00;
    width: 90%;
    max-width: 500px;
    text-align: center;
    color: #fff;
    box-shadow: 0 0 50px rgba(255, 170, 0, 0.2);
    position: relative;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.theme-btn {
    padding: 15px;
    border: 2px solid #444;
    background: #222;
    color: #888;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-btn.active {
    border-color: #ffaa00;
    background: #333;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.3);
}

.theme-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.theme-btn:hover:not(:disabled) {
    border-color: #fff;
    transform: translateY(-2px);
}

/* Table Themes */
.table-green body {
    background-color: #2e7d32;
}

.table-blue body {
    background-color: #1a237e;
}

.table-red body {
    background-color: #880e4f;
}

.table-gold body {
    background-color: #ffd700;
}

.table-green .poker-table {
    background-color: #35654d;
}

.table-blue .poker-table {
    background-color: #152550;
}

.table-red .poker-table {
    background-color: #4a1015;
}

.table-gold .poker-table {
    background-color: #504010;
}

/* Stats Grid */
.profile-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

/* --- Ad Placeholders --- */
.ad-container {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 100;
    /* Behind modals but above background? No, usually distinct. */
    pointer-events: none;
    /* Allow clicks to pass through container padding if any */
}

.ad-left {
    left: 20px;
}

.ad-right {
    right: 20px;
}

.ad-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-weight: bold;
    font-size: 1.2rem;
    pointer-events: auto;
    /* Clickable content */
    backdrop-filter: blur(2px);
}

/* Hide Ads on smaller screens to prevent overlap */
@media (max-width: 1400px) {
    .ad-container {
        display: none;
    }
}

.hidden {
    display: none !important;
}