/* 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 (Pill Style) */
.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-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;
}

/* 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;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.drawer-btn:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.drawer-btn.active {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.drawer-btn.btn-new-game {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

.drawer-link {
    color: var(--text-muted);
}

.drawer-link:hover {
    color: var(--text-main);
}

.drawer-user-container {
    min-height: 40px;
    display: flex;
    align-items: center;
}

/* User profile button / chip */
.user-profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 7px 14px;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.user-profile-chip:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.user-avatar-mini {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-dark);
}

.user-name-mini {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

/* Difficulty Selector (Pill Group) */
.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);
    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);
}

.diff-btn.active {
    background: var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

/* ==========================================================================
   Main Game Layout (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 (Frosted Glass Card) */
.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;
}

.captures-section {
    background: rgba(241, 245, 249, 0.7);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.captures-title {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.capture-slots {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.capture-slot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px dashed rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s;
}

.capture-slot.filled {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.capture-slot.filled.black {
    background: radial-gradient(circle at 35% 35%, #555, #111 70%, #000);
}

.capture-slot.filled.white {
    background: radial-gradient(circle at 35% 35%, #ffffff, #edf2f7 70%, #cbd5e1);
}

.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, Zero-Scroll)
   ========================================================================== */
.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);
}

canvas#penteCanvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 15px;
    cursor: crosshair;
}

/* ==========================================================================
   Fixed Bottom Move Confirmation Bar (Pill Button)
   ========================================================================== */
.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
   ========================================================================== */
.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: 18px;
}

/* ==========================================================================
   Modals & Dialogs (Frosted White Glass)
   ========================================================================== */
.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;
}

.modal-close:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

.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 Table */
.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;
}

.lobby-item:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.lobby-host {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}

.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);
}

/* Standard Buttons (Capsule Pills) */
.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);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Form inputs */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.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;
}

.form-control:focus {
    border-color: var(--accent-dark);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* Cross-Platform Game 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); }

/* Compact Breakpoints */
@media (max-width: 480px) {
    .app-header {
        padding: 8px 12px;
    }
    .brand-logo {
        font-size: 18px;
    }
    .stat-pills {
        font-size: 11px;
        padding: 4px 10px;
        gap: 6px;
    }
    .player-details h3 {
        font-size: 12px;
    }
}

/* Ecosystem group spacing */
.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;
}


/* Modernized Lobby Mode Cards */
.lobby-mode-card {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    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);
}

/* 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);
}

.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); }
