/* ==========================================
   Design System & Variable Declarations
   ========================================== */
:root {
    --bg-main: #0a0e14;
    --bg-panel: rgba(22, 28, 38, 0.65);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-active: rgba(0, 240, 255, 0.4);
    
    --text-primary: #f0f3f8;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --color-player: #00f0ff;
    --color-ai: #ffb830;
    --color-red-suit: #ff5252;
    --color-black-suit: #121620;
    
    --shadow-neon-cyan: 0 0 15px rgba(0, 240, 255, 0.35);
    --shadow-neon-gold: 0 0 15px rgba(255, 184, 48, 0.35);
    --shadow-panel: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

/* ==========================================
   Core Layout & Global Styles
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 20%, rgba(0, 240, 255, 0.05) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(255, 184, 48, 0.04) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#game-container {
    width: 100vw;
    height: 100vh;
    max-width: 1600px;
    max-height: 1000px;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    overflow-y: auto;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: var(--shadow-panel);
    padding: 15px;
    transition: border-color 0.3s ease;
}

/* ==========================================
   Header Styling
   ========================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 15px;
    background: rgba(16, 22, 32, 0.5);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
}

header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

header .subtitle {
    font-size: 14px;
    color: var(--color-ai);
    font-weight: 400;
    margin-left: 8px;
}

.header-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#stage-banner {
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.stage-DEAL { background: rgba(0, 240, 255, 0.2); border: 1px solid var(--color-player); color: var(--color-player); }
.stage-DISCARD { background: rgba(165, 55, 253, 0.2); border: 1px solid #a537fd; color: #a537fd; }
.stage-PLAY { background: rgba(255, 184, 48, 0.2); border: 1px solid var(--color-ai); color: var(--color-ai); }
.stage-SHOW_PREPARE { background: rgba(52, 152, 219, 0.2); border: 1px solid #3498db; color: #3498db; }
.stage-SHOW_NON_DEALER { background: rgba(46, 204, 113, 0.2); border: 1px solid #2ecc71; color: #2ecc71; }
.stage-SHOW_DEALER { background: rgba(39, 174, 96, 0.2); border: 1px solid #27ae60; color: #27ae60; }
.stage-REVEAL_CRIB { background: rgba(230, 126, 34, 0.2); border: 1px solid #e67e22; color: #e67e22; }
.stage-GAME_OVER { background: rgba(231, 76, 60, 0.2); border: 1px solid #e74c3c; color: #e74c3c; animation: flash 1s infinite alternate; }

button {
    font-family: var(--font-sans);
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* ==========================================
   Main Grid Layout
   ========================================== */
#board-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 15px;
    min-height: 480px;
}

/* ==========================================
   Left Panel: Scoreboard & Pegboard
   ========================================== */
.board-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel-header h2, .panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
}

.score-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.score-card {
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.player-card {
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.12);
}

.ai-card {
    background: rgba(255, 184, 48, 0.04);
    border: 1px solid rgba(255, 184, 48, 0.12);
}

.score-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.score-num {
    font-family: var(--font-mono);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    margin: 4px 0;
}

.player-card .score-num { color: var(--color-player); text-shadow: 0 0 10px rgba(0, 240, 255, 0.2); }
.ai-card .score-num { color: var(--color-ai); text-shadow: 0 0 10px rgba(255, 184, 48, 0.2); }

.score-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
}
.player-badge { background: rgba(0, 240, 255, 0.15); color: var(--color-player); }
.ai-badge { background: rgba(255, 184, 48, 0.15); color: var(--color-ai); }

/* SVG Pegboard Container */
.pegboard-container {
    flex: 1;
    border-radius: 12px;
    background: rgba(10, 14, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 380px;
}

#pegboard {
    width: 100%;
    height: auto;
}

/* SVG tracks and holes */
.track-line {
    fill: none;
    stroke-width: 3.5;
    opacity: 0.45;
    stroke-linecap: round;
}
.track-player { stroke: var(--color-player); }
.track-ai { stroke: var(--color-ai); }

.hole {
    fill: #222c3d;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 0.75;
    transition: fill 0.3s, stroke 0.3s;
}

.hole-active-player { fill: rgba(0, 240, 255, 0.45); }
.hole-active-ai { fill: rgba(255, 184, 48, 0.45); }

/* Peg styles */
.peg-player {
    fill: var(--color-player);
    stroke: #0a0e14;
    stroke-width: 1.2;
    filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.8));
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.peg-ai {
    fill: var(--color-ai);
    stroke: #0a0e14;
    stroke-width: 1.2;
    filter: drop-shadow(0 0 3px rgba(255, 184, 48, 0.8));
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================
   Right Panel: Play Field Table
   ========================================== */
.table-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    position: relative;
}

.table-row {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.character-box {
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.avatar-wrapper {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-glass);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.ai-row .avatar-wrapper {
    border-color: var(--color-ai);
    box-shadow: 0 0 10px rgba(255, 184, 48, 0.15);
}

.player-row .avatar-wrapper {
    border-color: var(--color-player);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.avatar-image-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0f131a;
}

.avatar-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.human-avatar {
    font-size: 28px;
}

.dealer-token {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #e74c3c;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: 800;
    border: 2px solid var(--bg-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.character-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.speech-bubble-container {
    flex: 1;
    position: relative;
    padding-left: 20px;
}

.speech-bubble {
    background: rgba(255, 184, 48, 0.08);
    border: 1px solid rgba(255, 184, 48, 0.25);
    border-radius: 12px;
    padding: 10px 15px;
    max-width: 400px;
    position: relative;
    animation: popBubble 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--bg-panel);
    border-left: 1px solid rgba(255, 184, 48, 0.25);
    border-bottom: 1px solid rgba(255, 184, 48, 0.25);
}

.speech-bubble p {
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.4;
    font-style: italic;
}

.hand-row {
    display: flex;
    gap: 8px;
    min-height: 110px;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
}

.player-row .hand-row {
    justify-content: flex-start;
    padding-left: 20px;
}

/* ==========================================
   Center Table Area (Crib, Starter, Peg Pile)
   ========================================== */
.table-center {
    flex: 1;
    display: grid;
    grid-template-columns: 200px 1fr;
    background: rgba(0,0,0,0.15);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.02);
    padding: 15px;
    min-height: 160px;
}

.starter-crib-section {
    display: flex;
    gap: 15px;
    border-right: 1px solid rgba(255,255,255,0.05);
    padding-right: 15px;
}

.starter-card-box, .crib-card-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.box-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-slot {
    width: 72px;
    height: 108px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.card-stack {
    perspective: 1000px;
}

/* Pegging section */
.pegging-pile-section {
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    gap: 10px;
}

.pegging-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pegging-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.pegging-count {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: var(--color-player);
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.pegging-cards {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 10px;
    min-height: 80px;
}

/* ==========================================
   Card Component Design
   ========================================== */
.card {
    width: 72px;
    height: 108px;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Card interactions */
.player-cards-container .card:hover {
    transform: translateY(-12px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.2);
    z-index: 100;
}

.card.selected {
    transform: translateY(-20px);
    box-shadow: 0 0 12px var(--color-player);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
}

/* Card Back */
.card-back-style {
    background-image: url('/static/img/card_back.png');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Card Front */
.card-front-style {
    background-color: #ffffff;
    border: 1px solid #d3d9e2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px;
}

/* Custom GCS suit background */
.card-suit-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    opacity: 1.0;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

.card-center-art {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
}

.card-center-art.rank-j,
.card-center-art.rank-q {
    filter: brightness(0.8) contrast(1.15);
}

/* Corner Ranks */
.card-corner {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.0;
    z-index: 3;
    gap: 2px;
}

.card-corner.top-left {
    align-self: flex-start;
}

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

/* Suit colors */
.suit-red { color: var(--color-red-suit); }
.suit-black { color: var(--color-black-suit); }

/* ==========================================
   Footer Panel: Controls & Log
   ========================================== */
footer {
    height: 180px;
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 15px;
    min-height: 0;
}

/* Action Controls Panel */
.controls-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    text-align: center;
}

#instruction-msg {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 600;
    max-width: 500px;
}

.button-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #00d2ff 0%, #00a8ff 100%);
    color: #050505;
    border: none;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #00f0ff 0%, #00c0ff 100%);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.btn-ai {
    background: linear-gradient(135deg, #ffc048 0%, #ff9f1a 100%);
    color: #050505;
    border: none;
    box-shadow: 0 0 10px rgba(255, 184, 48, 0.2);
}
.btn-ai:hover {
    background: linear-gradient(135deg, #ffca60 0%, #ffa520 100%);
    box-shadow: 0 0 15px rgba(255, 184, 48, 0.4);
}

/* Game Log Panel */
.log-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 190px;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    max-height: 155px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    padding: 10px 5px 0 5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card.starter-card {
    border: 2px dashed var(--color-ai) !important;
    box-shadow: 0 0 10px rgba(255, 184, 48, 0.4) !important;
}

.log-entry {
    animation: slideIn 0.25s ease-out;
    line-height: 1.4;
    word-break: break-word;
    border-left: 2px solid rgba(255,255,255,0.03);
    padding-left: 8px;
}

/* Custom log entries */
.log-entry.score-player { border-left-color: var(--color-player); color: var(--color-player); }
.log-entry.score-ai { border-left-color: var(--color-ai); color: var(--color-ai); }
.log-entry.stage-change { border-left-color: #a537fd; color: #d6a2e8; font-weight: bold; }
.log-entry.heading { color: #f0f3f8; font-weight: bold; border-left: none; padding-left: 0; margin-top: 5px; border-bottom: 1px solid rgba(255,255,255,0.03); }

/* ==========================================
   Modals & Overlays
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 10, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-content {
    max-width: 450px;
    width: 90%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-color: rgba(255, 255, 255, 0.12);
}

.points-select {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

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

.btn-confirm { background: var(--color-player); color: #000; border: none; }
.btn-cancel { background: rgba(255, 255, 255, 0.05); }

/* Loader overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 2000;
}

.loader-spinner {
    font-size: 40px;
    animation: rotate 1s infinite linear;
}

#loader-text {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-ai);
}

/* ==========================================
   Animations
   ========================================== */
@keyframes popBubble {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideIn {
    0% { transform: translateX(-10px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes flash {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ==========================================
   Responsiveness
   ========================================== */
@media (max-width: 1200px) {
    #board-layout {
        grid-template-columns: 380px 1fr;
    }
    #game-container {
        padding: 5px;
        gap: 8px;
    }
    footer {
        grid-template-columns: 1fr 380px;
        height: 180px;
    }
}

@media (max-width: 900px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    #game-container {
        height: auto;
        max-height: none;
        padding: 8px;
        gap: 10px;
    }
    #board-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
    }
    .board-panel {
        min-height: 0;
        gap: 10px;
    }
    .table-panel {
        padding: 10px !important;
        gap: 10px !important;
    }
    
    /* Stack character blocks vertically so they fit screen width */
    .table-row.ai-row, .table-row.player-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100%;
    }
    .speech-bubble-container {
        padding-left: 0 !important;
        display: flex;
        justify-content: center;
        width: 100%;
    }
    .speech-bubble {
        max-width: 90%;
        text-align: center;
        padding: 8px 12px;
    }
    .speech-bubble::before {
        display: none !important;
    }
    .ai-cards-container, .player-cards-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    /* Make cards smaller on mobile so they don't cause horizontal overflow */
    .card {
        width: 52px !important;
        height: 78px !important;
    }
    .card-suit-bg {
        width: 52px !important;
        height: 52px !important;
    }
    .card-center-art {
        width: 28px !important;
        height: 28px !important;
    }
    .card-corner {
        font-size: 13px !important;
        font-weight: 900 !important;
    }
    .card-corner span {
        font-size: 13px !important;
        font-weight: 900 !important;
    }
    
    /* Layout table center vertically */
    .table-center {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100%;
    }
    .starter-crib-section {
        border-right: none !important;
        border-bottom: none !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 20px !important;
        width: 100%;
    }
    .pegging-pile-section {
        width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hand-row {
        gap: 4px !important;
        padding-right: 0 !important;
        justify-content: center !important;
        min-height: 85px !important;
    }
    .player-row .hand-row {
        justify-content: center !important;
        padding: 0 !important;
    }
    
    footer {
        grid-template-columns: 1fr;
        height: auto;
        gap: 10px;
    }
    .log-panel {
        height: 140px;
    }

    /* Header: keep buttons in a single row on mobile */
    header {
        height: auto;
        min-height: 48px;
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 6px;
    }
    header h1 {
        font-size: 18px;
    }
    header .subtitle {
        font-size: 11px;
    }
    #stage-banner {
        padding: 4px 10px;
        font-size: 11px;
    }
    .header-buttons {
        gap: 5px;
    }
    .header-buttons button {
        padding: 5px 10px;
        font-size: 12px;
    }
}
.hidden {
    display: none !important;
}

/* Rules Modal Styling */
.rules-modal-content {
    max-width: 600px !important;
    max-height: 80vh;
    text-align: left !important;
    overflow-y: auto;
    padding: 30px !important;
    border-radius: 12px;
}
.rules-modal-content h2 {
    color: var(--color-player);
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 10px;
}
.rules-modal-content h3 {
    color: var(--color-ai);
    font-size: 16px;
    margin: 15px 0 8px 0;
}
.rules-modal-content p, .rules-modal-content ul {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.rules-modal-content ul {
    padding-left: 20px;
}
.rules-modal-content li {
    margin-bottom: 5px;
}

/* More Games Modal Styling */
.more-modal-content {
    max-width: 480px !important;
    text-align: left !important;
    padding: 30px !important;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.1);
}
.more-modal-content h2 {
    color: var(--color-player);
    font-size: 24px;
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 10px;
    font-weight: 800;
}
.more-modal-intro {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}
.games-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.games-list li {
    margin: 0;
}
.game-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease-in-out;
}
.game-link:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 240, 255, 0.05);
}
.game-favicon {
    width: 28px;
    height: 28px;
    margin-right: 14px;
    object-fit: contain;
    border-radius: 4px;
    background: transparent;
}
.close-modal-x {
    position: absolute;
    top: 15px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s ease, transform 0.2s ease;
}
.close-modal-x:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

