/* Game-specific styles (Shared tokens moved to serene-core.css) */
/* ==========================================================================
   Main Layout & Game Arena (Vertical Stack)
   ========================================================================== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 14px 84px 14px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.game-arena {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.game-status-tag {
    font-size: 12px;
    color: var(--accent-dark);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.players-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: min(calc(100vw - 24px), calc(100vh - 280px), 640px);
}

/* Player Cards */
.player-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 10px 14px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s;
}

.player-card.active-turn {
    border: 1.5px solid var(--accent-dark);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.player-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stone-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.stone-badge.black {
    background: radial-gradient(circle at 35% 35%, #555, #111 70%, #000);
    border: 1px solid rgba(0, 0, 0, 0.4);
}

.stone-badge.white {
    background: radial-gradient(circle at 35% 35%, #ffffff, #edf2f7 70%, #cbd5e1);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.player-details {
    min-width: 0;
    overflow: hidden;
}

.player-details h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-details span {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Disc count pill box */
.disc-count-box {
    display: flex;
    align-items: baseline;
    gap: 6px;
    background: rgba(241, 245, 249, 0.7);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.disc-count-number {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-dark);
}

.disc-count-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.turn-badge {
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.player-card.active-turn .turn-badge {
    background: var(--accent-dark);
    color: #ffffff;
}

/* ==========================================================================
   Board Viewport & Canvas (Auto-Responsive)
   ========================================================================== */
.board-container {
    position: relative;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.canvas-viewport {
    position: relative;
    width: min(calc(100vw - 24px), calc(100vh - 280px), 640px);
    height: min(calc(100vw - 24px), calc(100vh - 280px), 640px);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    border-radius: 16px;
    box-shadow: var(--shadow-elevated);
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: var(--board-felt);
}

canvas#othelloCanvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 15px;
    cursor: pointer;
}

/* ==========================================================================
   Fixed Bottom Move Confirmation Bar
   ========================================================================== */
.move-confirm-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.88);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

.btn-confirm-move {
    min-height: 48px;
    width: 100%;
    max-width: min(calc(100vw - 24px), calc(100vh - 280px), 640px);
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    letter-spacing: 0.5px;
}

.btn-confirm-move:disabled {
    background: rgba(241, 245, 249, 0.85);
    color: var(--text-muted);
    border: 1px solid rgba(0, 0, 0, 0.06);
    cursor: default;
    opacity: 0.85;
}

.btn-confirm-move:not(:disabled) {
    background: var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.25);
    animation: confirmPulseLight 2s infinite ease-in-out;
}

.btn-confirm-move:not(:disabled):active {
    transform: scale(0.98);
}

@keyframes confirmPulseLight {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.25);
    }
    50% {
        transform: scale(1.015);
        box-shadow: 0 6px 26px rgba(15, 23, 42, 0.38);
    }
}

/* ==========================================================================
   Floating Status Banner & Modals
   ========================================================================== */
.status-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 24px 36px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    display: none;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: min(340px, 90%);
}

.status-banner h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    color: var(--accent-dark);
    margin-bottom: 8px;
}

.status-banner p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    padding: 24px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    color: var(--accent-dark);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    border-radius: 9999px;
    padding: 2px 6px;
}

.btn-tab {
    padding: 8px 18px;
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 9999px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-tab.active {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.lobby-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0;
}

.lobby-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.badge-locked {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-open {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.btn {
    padding: 10px 20px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-gold {
    background: var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.btn-gold:hover {
    background: var(--accent-dark-hover);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(241, 245, 249, 0.9);
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    font-family: inherit;
}

/* Leaderboard Table */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.leaderboard-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}


/* ==========================================================================
   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;
}


/* Unified Active Games Type Badges */
.game-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}
.game-type-badge.pente { background: rgba(16, 185, 129, 0.12); color: #059669; border: 1px solid rgba(16, 185, 129, 0.3); }
.game-type-badge.chess { background: rgba(15, 23, 42, 0.08); color: #0f172a; border: 1px solid rgba(15, 23, 42, 0.2); }
.game-type-badge.othello { background: rgba(59, 130, 246, 0.12); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.3); }
.game-type-badge.battleship { background: rgba(239, 68, 68, 0.12); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.3); }
.game-type-badge.backgammon { background: rgba(245, 158, 11, 0.12); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.3); }
.game-type-badge.sudoku { background: rgba(139, 92, 246, 0.12); color: #7c3aed; border: 1px solid rgba(139, 92, 246, 0.3); }
.game-type-badge.solitaire { background: rgba(236, 72, 153, 0.12); color: #db2777; border: 1px solid rgba(236, 72, 153, 0.3); }
