/* Game-specific styles (Shared tokens moved to serene-core.css) */
/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
    background: rgba(255, 255, 255, 0.78);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 12px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.brand-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent-dark);
    text-transform: uppercase;
}

/* Condensed Single-Row Stats Ribbon */
.stat-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.92);
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    white-space: nowrap;
    overflow-x: auto;
}

.stat-pill {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-pill strong {
    color: var(--accent-dark);
    font-weight: 700;
}

.stat-pill.stat-elo {
    background: rgba(217, 119, 6, 0.08);
    padding: 2px 8px;
    border-radius: 9999px;
    color: var(--gold-dark);
    font-weight: 600;
}

.stat-pill.stat-elo strong {
    color: var(--gold-dark);
}

.stat-sep {
    color: rgba(0, 0, 0, 0.2);
    font-size: 10px;
}

/* Hamburger Trigger Button */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.hamburger-btn:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.hamburger-line {
    width: 16px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.25s ease-in-out;
}

.hamburger-btn.open .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger-btn.open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.open .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}



.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.drawer-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    color: var(--accent-dark);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.drawer-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 9999px;
    transition: all 0.2s;
}

.drawer-close:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

.drawer-section {
    margin-bottom: 26px;
}

.drawer-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.drawer-btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ecosystem-group {
    gap: 14px;
    margin-top: 4px;
}

/* Pill-Style Drawer Buttons */
.drawer-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 11px 16px;
    border-radius: 9999px;
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-main);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.drawer-btn:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.drawer-btn.active {
    background: var(--accent-dark);
    color: #ffffff;
    border-color: var(--accent-dark);
}

.drawer-btn.btn-new-game {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.drawer-btn.btn-new-game:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
}

.drawer-link {
    font-weight: 600;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.15);
}

.drawer-link:hover {
    background: rgba(37, 99, 235, 0.12);
}

/* Difficulty Selector in Drawer */
.diff-selector {
    display: flex;
    gap: 4px;
    background: rgba(241, 245, 249, 0.85);
    padding: 4px;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.diff-btn {
    flex: 1;
    padding: 7px 10px;
    border: none;
    border-radius: 9999px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.diff-btn.active {
    background: var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

/* ==========================================================================
   Main Game Layout & Arena
   ========================================================================== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 16px 90px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.game-status-tag {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
}

.game-arena {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Players Strip */
.players-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.25s ease;
}

.player-card.active-turn {
    border-color: var(--accent-dark);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
    background: #ffffff;
}

.player-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.checker-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.checker-badge.white {
    background: #ffffff;
    border: 2px solid #cbd5e1;
}
.checker-badge.black {
    background: #1e293b;
    border: 2px solid #0f172a;
}

.player-title-col {
    min-width: 0;
    overflow: hidden;
}

.player-title-col h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-title-col span {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.player-counts-chip {
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.count-label {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 10px;
}

.count-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}

.bar-value {
    font-weight: 700;
    color: var(--danger);
    font-size: 11px;
}

/* Dice Box */
.dice-container {
    display: flex;
    gap: 4px;
    align-items: center;
    min-width: 48px;
    justify-content: flex-end;
}

.dice-cube {
    width: 26px;
    height: 26px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: var(--text-main);
}

.dice-cube.used {
    opacity: 0.35;
    background: #f1f5f9;
}

/* Board Container */
.board-container {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.canvas-viewport {
    width: 100%;
    max-width: 620px;
    aspect-ratio: 620 / 480;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.canvas-viewport canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

/* ==========================================================================
   Fixed Bottom Move Confirmation Bar (Mobile First)
   ========================================================================== */
.move-confirm-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 40;
    display: flex;
    justify-content: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.btn-confirm-move {
    width: 100%;
    max-width: 480px;
    padding: 13px 20px;
    border-radius: 9999px;
    border: none;
    background: var(--accent-dark);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
    text-align: center;
}

.btn-confirm-move:hover {
    background: var(--accent-dark-hover);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
    transform: translateY(-1px);
}

.btn-confirm-move.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ==========================================================================
   Status Banner (Game Over Overlay)
   ========================================================================== */
.status-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    padding: 28px 36px;
    box-shadow: var(--shadow-elevated);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 100;
    text-align: center;
    display: none;
    min-width: 300px;
    max-width: 90vw;
}

.status-banner h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--accent-dark);
    margin-bottom: 6px;
}

.status-banner p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ==========================================================================
   Modals & Reusable Components
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-content {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-elevated);
    padding: 24px;
    width: 100%;
    max-width: 520px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 12px;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--accent-dark);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 9999px;
}

.modal-close:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-secondary {
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
}

.btn-gold {
    background: var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-gold:hover {
    background: var(--accent-dark-hover);
    transform: translateY(-1px);
}

.btn-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 9999px;
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tab.active {
    background: var(--accent-dark);
    color: #ffffff;
    border-color: var(--accent-dark);
}

.game-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}
.game-type-badge.pente { background: rgba(16, 185, 129, 0.15); color: #059669; }
.game-type-badge.chess { background: rgba(217, 119, 6, 0.15); color: #b45309; }
.game-type-badge.othello { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.game-type-badge.battleship { background: rgba(2, 132, 199, 0.15); color: #0284c7; }
.game-type-badge.backgammon { background: rgba(245, 158, 11, 0.15); color: #d97706; }

/* Responsive Media Queries */
@media (max-width: 640px) {
    .players-strip {
        grid-template-columns: 1fr;
    }
    .stat-pills {
        display: none;
    }
}


/* ==========================================================================
   STANDARDIZED LOBBY & DRAWER TOKENS (Serene Light-Glass Master Standard)
   ========================================================================== */

/* Standardized Match Action Buttons */
.btn-resume-match {
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    border-radius: 50%;
    background: var(--accent-dark, #0f172a);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    text-align: center;
    letter-spacing: -0.2px;
}

.btn-resume-match:hover {
    background: var(--accent-dark-hover, #1e293b);
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.btn-dismiss-match {
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    border-radius: 50%;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s ease;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    text-align: center;
}

.btn-dismiss-match:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
    color: #dc2626;
    transform: scale(1.08);
}

/* Modernized Lobby Mode Cards */
.lobby-mode-card {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.lobby-mode-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

/* Difficulty Selector */
.diff-selector {
    display: flex;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 9999px;
    padding: 3px;
    gap: 3px;
    margin-top: 6px;
    width: 100%;
}

.diff-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted, #64748b);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 0;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
}

.diff-btn:hover {
    color: var(--text-main, #0f172a);
    background: rgba(255, 255, 255, 0.5);
}

.diff-btn.active {
    background: var(--accent-dark, #0f172a);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.diff-elo {
    font-size: 0.72em;
    opacity: 0.75;
    font-weight: 500;
    margin-left: 3px;
    letter-spacing: -0.02em;
}

/* Ecosystem Group */
.ecosystem-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.ecosystem-group .drawer-link {
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
}
