/* CoD Guild Pro - Modern-Data Edition - Deep Space Glassmorphism */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Deep Space Palette */
    --bg-deep: #0d1117;
    --bg-navy: #161b22;
    --bg-surface: #21262d;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(10px);

    /* Game-specific themes (default: CoD) */
    --game-primary: rgba(232, 114, 42, 0.35);
    --game-secondary: rgba(124, 58, 237, 0.2);
    --game-accent: #e8722a;
    --game-gradient: radial-gradient(ellipse at 40% 30%, var(--game-primary) 0%, transparent 55%), radial-gradient(ellipse at 70% 80%, var(--game-secondary) 0%, transparent 50%);
    --game-dropdown-bg: rgba(232, 114, 42, 0.08);
    --game-dropdown-border: rgba(232, 114, 42, 0.2);

    /* Cyber Lime / Electric Gold Gradient (fallback) */
    --accent-start: #f3e03b;
    --accent-end: #f7b500;
    --accent-gradient: linear-gradient(135deg, var(--accent-start) 0%, var(--accent-end) 100%);
    --accent-glow: 0 0 20px rgba(243, 224, 59, 0.3);
    
    /* Typography */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Status Colors */
    --success: #43b581;
    --warning: #ff9800;
    --error: #f44336;
    --info: #5865f2;
    
    /* Spacing */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Backward-compat aliases (used in inline HTML styles) */
    --background-dark: var(--bg-deep);
    --background-light: var(--bg-navy);
    --border-color: var(--glass-border);
    --primary-color: var(--accent-start);
    --text-color: var(--text-primary);
    --error-color: var(--error);
    --success-color: var(--success);
    --warning-color: var(--warning);
    --secondary-color: var(--bg-navy);
    --accent: var(--accent-start);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:
        var(--game-gradient),
        linear-gradient(rgba(0,0,0,0.72), rgba(0,0,0,0.72)),
        url('/static/images/background.jpg') center / cover no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.5s ease;
}
body.has-banner {
    background:
        var(--game-gradient),
        linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.65)),
        var(--guild-banner, transparent) center top/cover no-repeat,
        url('/static/images/background.jpg') center / cover no-repeat;
    background-attachment: fixed;
}

/* Header */
.header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--spacing-lg) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Floating Pill Navigation */
.nav {
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 999px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.nav a:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.nav a.active {
    background: var(--accent-gradient);
    color: #0d1117;
    border-color: transparent;
    box-shadow: var(--accent-glow);
    font-weight: 600;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl) var(--spacing-xl);
}

/* Glassmorphism Cards */
.card {
    background: rgba(22, 27, 34, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    transition: all 0.35s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.card-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.card-header h2 {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Bento Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Stats Cards with Modern Typography */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(243, 224, 59, 0.3);
    transform: translateY(-2px);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-sm);
}

.stat-card .value {
    color: var(--text-primary);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-card .delta {
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.stat-card .delta.positive {
    color: var(--success);
}

.stat-card .delta.negative {
    color: var(--error);
}

/* Sparkline Canvas */
.sparkline {
    width: 100%;
    height: 40px;
    margin-top: var(--spacing-md);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--game-dropdown-bg);
    border: 1px solid var(--game-dropdown-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--game-accent);
    box-shadow: 0 0 0 3px var(--game-primary);
    background: rgba(33, 38, 45, 0.8);
}

.form-select {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--game-dropdown-bg);
    border: 1px solid var(--game-dropdown-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--game-accent);
    box-shadow: 0 0 0 3px var(--game-primary);
    background: rgba(33, 38, 45, 0.8);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--game-dropdown-bg);
    border: 1px solid var(--game-dropdown-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--game-accent);
    box-shadow: 0 0 0 3px var(--game-primary);
    background: rgba(33, 38, 45, 0.8);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' fill-opacity='0.6' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: 2.5rem;
}

/* Gradient Buttons with Hover-Glow */
.btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: inherit;
}

.btn-primary {
    background: var(--theme-gradient);
    color: #0d1117;
    box-shadow: 0 0 16px var(--theme-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--theme-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(67, 181, 129, 0.4);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
}

/* Drag & Drop Upload Zone */
.upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-start);
    background: rgba(243, 224, 59, 0.05);
    box-shadow: 0 0 30px rgba(243, 224, 59, 0.2);
}

.upload-zone .icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.6;
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.upload-zone .processing {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--accent-start);
    font-weight: 600;
}

.upload-zone.processing .processing {
    display: flex;
}

.upload-zone.processing .default {
    display: none;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    transition: 0.4s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
    background: var(--text-secondary);
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--accent-gradient);
    border-color: transparent;
}

input:checked + .slider:before {
    transform: translateX(26px);
    background: #0d1117;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: rgba(33, 38, 45, 0.5);
    padding: var(--spacing-md);
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}

.table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.95rem;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Status Indicator Dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--spacing-sm);
}

.status-dot.active {
    background: var(--success);
    animation: pulse 2s infinite;
}

.status-dot.inactive {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-free {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.badge-premium {
    background: var(--accent-gradient);
    color: #0d1117;
}

.badge-enterprise {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-navy) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 1rem;
    margin-bottom: var(--spacing-sm);
}

.skeleton-title {
    height: 1.5rem;
    margin-bottom: var(--spacing-md);
    width: 60%;
}

.skeleton-card {
    height: 120px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--glass-border);
    border-top: 3px solid var(--accent-start);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 0.8s linear infinite;
    margin: var(--spacing-xl) auto;
}

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

/* Alerts */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border: 1px solid;
}

.alert-success {
    background: rgba(67, 181, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* Pagination */
.pagination {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-xl);
}

.pagination button {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.pagination button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-start);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination button.active {
    background: var(--accent-gradient);
    color: #0d1117;
    border-color: transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    .nav a {
        width: 100%;
        text-align: center;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-card .value {
        font-size: 1.8rem;
    }
}

/* ── Upload Drop Zone ─────────────────────────── */
.upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-zone .default { display: block; }
.upload-zone .processing { display: none; align-items: center; justify-content: center; gap: 0.75rem; }
.upload-zone.processing .default { display: none; }
.upload-zone.processing .processing { display: flex; }

.upload-zone .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-start);
    background: rgba(243, 224, 59, 0.04);
    box-shadow: inset 0 0 30px rgba(243, 224, 59, 0.06), var(--accent-glow);
}

.upload-zone p {
    color: var(--text-secondary);
    margin: 0;
}

.upload-zone code {
    background: var(--bg-surface);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--accent-start);
}

/* ── Sparkline Canvas ─────────────────────────── */
.sparkline {
    display: none;
    width: 100%;
    height: 40px;
    margin-top: 0.75rem;
}

/* ── Delta Indicators ─────────────────────────── */
.delta {
    font-size: 0.85rem;
    font-weight: 600;
}

.delta.positive { color: var(--success); }
.delta.negative { color: var(--error); }

/* ═══════════════════════════════════════════════════════════════
   NEW DESIGN SYSTEM — 2026-05-15 Redesign
   ═══════════════════════════════════════════════════════════════ */

/* ── Game Theme Variables ──────────────────────────────────────── */
:root {
    --theme-primary: #f3e03b;
    --theme-secondary: #f7b500;
    --theme-glow: rgba(243, 224, 59, 0.22);
    --theme-gradient: linear-gradient(135deg, #f3e03b 0%, #f7b500 100%);
    --theme-bg-tint: rgba(243, 224, 59, 0.03);
}
[data-game="call_of_dragons"] {
    --theme-primary: #e8722a;
    --theme-secondary: #7c3aed;
    --theme-glow: rgba(232, 114, 42, 0.22);
    --theme-gradient: linear-gradient(135deg, #e8722a 0%, #7c3aed 100%);
    --theme-bg-tint: rgba(232, 114, 42, 0.03);
}
[data-game="rise_of_kingdoms"] {
    --theme-primary: #d4af37;
    --theme-secondary: #c2610a;
    --theme-glow: rgba(212, 175, 55, 0.22);
    --theme-gradient: linear-gradient(135deg, #d4af37 0%, #c2610a 100%);
    --theme-bg-tint: rgba(212, 175, 55, 0.03);
}
[data-game="whiteout_survival"] {
    --theme-primary: #38bdf8;
    --theme-secondary: #0ea5e9;
    --theme-glow: rgba(56, 189, 248, 0.22);
    --theme-gradient: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    --theme-bg-tint: rgba(56, 189, 248, 0.03);
}
[data-game="universal_4x"] {
    --theme-primary: #10b981;
    --theme-secondary: #047857;
    --theme-glow: rgba(16, 185, 129, 0.22);
    --theme-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
    --theme-bg-tint: rgba(16, 185, 129, 0.03);
}

/* ── Sidebar App Shell ─────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; width: 100%; }

.sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh; width: 240px;
    background: rgba(8, 10, 14, 0.97);
    border-right: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    display: flex; flex-direction: column;
    z-index: 100; overflow: hidden;
}
.main-content {
    margin-left: 240px;
    flex: 1; min-height: 100vh;
    display: flex; flex-direction: column;
    overflow-x: hidden;
}

/* ── Sidebar Header ──────────────────────────────────────────── */
.sidebar-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.sidebar-logo {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 14px rgba(var(--theme-accent-rgb, 212,175,55), 0.35);
    transition: box-shadow 0.4s;
}
.sidebar-logo:hover {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.15), 0 0 22px rgba(var(--theme-accent-rgb, 212,175,55), 0.55);
}
.sidebar-brand {
    font-size: 1rem; font-weight: 800; letter-spacing: -0.01em;
    background: linear-gradient(135deg, #ffffff 0%, var(--game-accent, #ffd700) 60%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.2;
    transition: background 0.4s;
}
.sidebar-brand-sub {
    display: block; font-size: 0.68rem; font-weight: 500;
    color: var(--text-secondary); -webkit-text-fill-color: var(--text-secondary);
    letter-spacing: 0.04em; text-transform: uppercase; margin-top: 1px;
}

/* ── Game Switcher ───────────────────────────────────────────── */
.sidebar-game-switcher {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.game-switcher-select {
    width: 100%;
    padding: 0.42rem 2rem 0.42rem 0.65rem;
    background: var(--game-dropdown-bg);
    border: 1px solid var(--game-dropdown-border);
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 0.8rem; font-family: inherit; font-weight: 600;
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23ffffff' fill-opacity='0.45' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    transition: all 0.2s;
}
.game-switcher-select:focus {
    outline: none;
    border-color: var(--game-accent);
    box-shadow: 0 0 0 2px var(--game-primary);
}

/* ── Sidebar Nav ─────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1; padding: 0.4rem 0;
    overflow-y: auto; scrollbar-width: none;
}

.sidebar-nav a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.875rem;
    color: rgba(255,255,255,0.45);
    text-decoration: none; font-size: 0.855rem; font-weight: 500;
    border-radius: 7px;
    margin: 0.08rem 0.5rem;
    transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
    position: relative;
}
.sidebar-nav a:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.045); }
.sidebar-nav a.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.065);
    text-shadow: 0 0 8px var(--theme-glow);
}
.sidebar-nav a.active::before {
    content: '';
    position: absolute; left: -0.5rem; top: 22%; bottom: 22%;
    width: 2px; background: var(--theme-gradient);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px var(--theme-glow);
}
.nav-icon { font-size: 0.95rem; width: 1.1rem; text-align: center; flex-shrink: 0; display: none; }

/* ── Lucide SVG Nav Icons ────────────────────────────────────── */
.nav-icon-svg {
    width: 16px; height: 16px;
    color: var(--theme-primary);
    filter: drop-shadow(0 0 3px var(--theme-glow));
    transition: color 0.4s ease, filter 0.4s ease;
    flex-shrink: 0;
}
.sidebar-nav a:hover .nav-icon-svg {
    filter: drop-shadow(0 0 6px var(--theme-glow));
}
.sidebar-nav a.active .nav-icon-svg {
    filter: drop-shadow(0 0 10px var(--theme-primary));
}

/* ── Sidebar Game Badge (replaces game-switcher) ──────────── */
.sidebar-game-badge {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    margin: 0.4rem 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: default;
}
.sidebar-game-badge .game-badge-icon {
    width: 16px; height: 16px;
    color: var(--theme-primary);
    filter: drop-shadow(0 0 4px var(--theme-glow));
}
.sidebar-game-badge .game-badge-name {
    font-size: 0.78rem; font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-badge {
    margin-left: auto;
    background: #ef4444; color: #fff;
    border-radius: 999px; min-width: 18px; height: 18px;
    padding: 0 5px; font-size: 0.68rem; font-weight: 700; line-height: 18px;
    text-align: center;
}
.nav-external { opacity: 0.65; }
.nav-external-icon { margin-left: auto; font-size: 0.68rem; opacity: 0.45; }

/* ── Sidebar Footer / User ───────────────────────────────────── */
.sidebar-footer {
    padding: 0.65rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0.4rem; border-radius: 7px; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--bg-surface); flex-shrink: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 108px; display: block; }
.user-role { font-size: 0.68rem; color: var(--text-muted); display: block; }
.sidebar-logout {
    margin-left: auto;
    background: none; border: 1px solid rgba(255,255,255,0.09);
    color: rgba(255,255,255,0.45); border-radius: 6px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.85rem; transition: all 0.2s; flex-shrink: 0;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #ef4444; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.65rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(8,10,14,0.75); backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 50; gap: 1rem; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.guild-selector {
    width: 100%; max-width: 300px;
    padding: 0.38rem 2rem 0.38rem 0.7rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px; color: var(--text-primary);
    font-size: 0.855rem; font-family: inherit; font-weight: 500;
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23ffffff' fill-opacity='0.45' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.55rem center; transition: all 0.2s;
}
.guild-selector:focus { outline: none; border-color: rgba(255,255,255,0.3); }
.cmd-palette-trigger {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09);
    border-radius: 6px; padding: 0.3rem 0.6rem; cursor: pointer;
    color: var(--text-muted); font-size: 0.75rem; font-family: inherit;
    display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; transition: all 0.2s;
}
.cmd-palette-trigger:hover { background: rgba(255,255,255,0.08); color: var(--text-secondary); border-color: rgba(255,255,255,0.18); }
.topbar-status { display: flex; align-items: center; gap: 0.35rem; }
.topbar-guild-name { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }

/* ── Content Area ────────────────────────────────────────────── */
.content-area { flex: 1; padding: 1.5rem; max-width: 1200px; width: 100%; }
.section-page { animation: sectionIn 0.18s cubic-bezier(0.4,0,0.2,1); }
@keyframes sectionIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.section-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1.25rem; }

/* Stat card accent top border per game theme */
.stat-card { border-top: 2px solid var(--theme-primary) !important; }

/* ── Empty State ─────────────────────────────────────────────── */
/* ── Empty States ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 2rem; }
.empty-state-icon { font-size: 2.25rem; margin-bottom: 0.65rem; opacity: 0.4; }
.empty-state-illustration { margin: 0 auto 1rem; opacity: 0.6; }
.empty-state-title { font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }
.empty-state-desc { font-size: 0.82rem; color: var(--text-muted); max-width: 300px; margin: 0 auto 1.1rem; line-height: 1.55; }

/* ── Command Palette ─────────────────────────────────────────── */
.cmd-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
    z-index: 9000; animation: fadeIn 0.12s ease;
}
.cmd-palette {
    position: fixed; top: 18vh; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 560px;
    background: rgba(13,16,22,0.98);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 13px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    z-index: 9001; overflow: hidden;
    animation: cmdIn 0.14s cubic-bezier(0.4,0,0.2,1);
}
@keyframes cmdIn { from { opacity:0; transform: translateX(-50%) translateY(-10px) scale(0.97); } to { opacity:1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.cmd-input {
    width: 100%; padding: 0.9rem 1.1rem;
    background: transparent; border: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    color: var(--text-primary); font-size: 0.95rem; font-family: inherit; outline: none;
}
.cmd-input::placeholder { color: var(--text-muted); }
.cmd-list { max-height: 340px; overflow-y: auto; padding: 0.3rem 0; }
.cmd-section-label { padding: 0.4rem 1rem 0.15rem; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.cmd-item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 1rem; cursor: pointer;
    font-size: 0.875rem; color: var(--text-secondary); transition: background 0.1s;
}
.cmd-item:hover, .cmd-item.selected { background: rgba(255,255,255,0.055); color: var(--text-primary); }
.cmd-item-icon {
    width: 26px; height: 26px; background: rgba(255,255,255,0.055); border-radius: 6px;
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0;
}
.cmd-item-label { flex: 1; }
.cmd-item-shortcut { font-size: 0.7rem; color: var(--text-muted); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); padding: 0.1rem 0.35rem; border-radius: 4px; }
.cmd-footer { padding: 0.45rem 1rem; border-top: 1px solid rgba(255,255,255,0.06); display: flex; gap: 1rem; font-size: 0.7rem; color: var(--text-muted); }

/* ── Alert Severity Extensions ───────────────────────────────── */
.alert-info { background: rgba(88,101,242,0.09); border-color: #5865f2; color: #818cf8; }
.alert-critical { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #f87171; border-left: 3px solid #ef4444; }

/* ── Sidebar Mobile Toggle ───────────────────────────────────── */
.sidebar-toggle {
    display: none; position: fixed; top: 0.65rem; left: 0.65rem; z-index: 200;
    background: rgba(8,10,14,0.92); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    width: 40px; height: 40px; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.1rem; color: var(--text-primary);
    transition: all 0.2s ease;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.sidebar-toggle:active { transform: scale(0.95); }
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99;
}

/* ── Responsive: Sidebar collapse on mobile ──────────────────── */
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.22s cubic-bezier(0.4,0,0.2,1); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .sidebar-overlay.open { display: block; }
    .content-area { padding: 1rem; }
    .cmd-palette { max-width: calc(100vw - 1.5rem); top: 8vh; }
    .topbar { padding: 0.6rem 1rem 0.6rem 3rem; }
    /* Larger touch targets for mobile sidebar nav */
    .sidebar-nav a { padding: 0.85rem 1rem; font-size: 0.95rem; margin: 0.15rem 0.5rem; }
    /* Hide toggle during pre-guild-select and welcome state on mobile */
    body.pre-guild-select .sidebar-toggle,
    body.welcome-bg .sidebar-toggle { display: none !important; }
    .sidebar-nav a .nav-icon-svg { width: 20px; height: 20px; }
    /* Hide command palette text on small screens, show only icon */
    .cmd-palette-trigger .kbd { display: none; }
    .cmd-palette-trigger { padding: 0.3rem 0.5rem; gap: 0.2rem; }
    /* Smaller guild selector on mobile */
    .guild-selector { max-width: 180px; font-size: 0.8rem; }
}

/* ── Form Grid ────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* ── Floating Activity Feed Panel ───────────────────────────────── */
.activity-feed-panel {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    width: 320px;
    max-height: calc(100vh - 7rem);
    background: rgba(22,27,34,0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 100;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

.activity-feed-panel.collapsed {
    height: 48px;
}

.activity-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
}

.activity-feed-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.activity-feed-toggle {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.75rem;
    transition: all 0.2s;
}

.activity-feed-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.activity-feed-content {
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}

.activity-feed-panel.collapsed .activity-feed-content {
    max-height: 0;
    overflow: hidden;
}

.activity-feed-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.activity-feed-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-start);
    border-radius: 50%;
    animation: activity-spin 0.8s linear infinite;
}

@keyframes activity-spin {
    to { transform: rotate(360deg); }
}

.activity-feed-items {
    padding: 0.5rem;
}

.activity-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.35rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    animation: activity-fade-in 0.3s ease-out;
}

@keyframes activity-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.activity-feed-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.activity-feed-icon i { width: 14px; height: 14px; }
.activity-feed-icon.verification { background: rgba(67,181,129,0.15); color: #43b581; }
.activity-feed-icon.verification_rejection { background: rgba(244,67,54,0.15); color: #f44336; }
.activity-feed-icon.unbind { background: rgba(255,152,0,0.15); color: #ff9800; }
.activity-feed-icon.player_data_upload { background: rgba(88,101,242,0.15); color: #5865f2; }
.activity-feed-icon.migration_approve { background: rgba(67,181,129,0.15); color: #43b581; }
.activity-feed-icon.migration_reject { background: rgba(244,67,54,0.15); color: #f44336; }
.activity-feed-icon.wos_state_transfer_new { background: rgba(56,189,248,0.15); color: #38bdf8; }
.activity-feed-icon.wos_state_transfer_approved { background: rgba(67,181,129,0.15); color: #43b581; }
.activity-feed-icon.wos_state_transfer_rejected { background: rgba(244,67,54,0.15); color: #f44336; }
.activity-feed-icon.alert { background: rgba(255,152,0,0.15); color: #ff9800; }

.activity-feed-content-inner {
    flex: 1;
    min-width: 0;
}

.activity-feed-description {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.2rem;
}

.activity-feed-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.activity-feed-empty {
    text-align: center;
    padding: 2rem 1rem;
}

.activity-feed-empty-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

.activity-feed-empty-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Live Counters ─────────────────────────────────────────────── */
.stat-card-live {
    position: relative;
}

.stat-live-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.topbar-live-counters {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-right: 1rem;
}

.topbar-counter {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.topbar-counter-icon {
    font-size: 0.7rem;
}

/* ── Status Dot Pulse Animation ────────────────────────────────── */
.status-dot {
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(34,197,94,0.4);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 4px rgba(34,197,94,0);
    }
}

/* ── Mobile: Activity Feed Below Overview ───────────────────────── */
@media (max-width: 860px) {
    .activity-feed-panel {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 1rem;
    }
    .activity-feed-panel.collapsed {
        height: auto;
    }
    .activity-feed-content {
        max-height: 400px;
    }
    .topbar-live-counters {
        display: none;
    }
}

/* ── Activity Timeline ───────────────────────────────────────────── */
.activity-timeline-filters {
    display: flex;
    gap: 0.5rem;
}

.timeline-filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-filter-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.timeline-filter-btn.active {
    background: var(--accent-gradient);
    border-color: var(--accent-start);
    color: var(--bg-deep);
    font-weight: 600;
}

.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, rgba(243,224,59,0.3), rgba(243,224,59,0.1));
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.6rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-start);
    border: 2px solid var(--bg-navy);
}

.timeline-item.success::before {
    background: #22c55e;
}

.timeline-item.error::before {
    background: #ef4444;
}

.timeline-item.warning::before {
    background: #ff9800;
}

.timeline-item.info::before {
    background: #5865f2;
}

.timeline-item-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.timeline-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.timeline-item-icon.success { background: rgba(34,197,94,0.15); }
.timeline-item-icon.error { background: rgba(239,68,68,0.15); }
.timeline-item-icon.warning { background: rgba(255,152,0,0.15); }
.timeline-item-icon.info { background: rgba(88,101,242,0.15); }

.timeline-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.timeline-item-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.timeline-item-metadata {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* ── Upload Zone icon variant ────────────────────────────────── */
.upload-zone { cursor: pointer; text-align: center; }
.upload-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.45; }

/* ── Card header ─────────────────────────────────────────────── */
.card-header { margin-bottom: 1rem; }
.card-header h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }

/* ── AI Recommendations ───────────────────────────────────────── */
.recommendation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(243,224,59,0.05);
    border: 1px solid rgba(243,224,59,0.15);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.recommendation-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(243,224,59,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.recommendation-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Game Picker Gateway Overlay ─────────────────────────────── */
.game-picker-overlay {
    position: fixed; inset: 0; z-index: 500;
    background:
        linear-gradient(rgba(0,0,0,0.82), rgba(0,0,0,0.82)),
        url('/static/images/background.jpg') center / cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.3s ease;
}
.game-picker-container {
    max-width: 820px; width: 90%; text-align: center;
    animation: cmdIn 0.25s cubic-bezier(0.4,0,0.2,1);
}
.game-picker-header h1 {
    font-size: 2rem; font-weight: 800; letter-spacing: -0.03em;
    color: var(--text-primary); margin-bottom: 0.5rem;
}
.game-picker-header p {
    font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 2rem;
    max-width: 500px; margin-left: auto; margin-right: auto;
}
.game-picker-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem;
    margin-bottom: 2rem;
}
.game-picker-card {
    background: rgba(22,27,34,0.6); backdrop-filter: blur(14px);
    border: 2px solid rgba(255,255,255,0.08); border-radius: 14px;
    padding: 1.5rem 1rem; cursor: pointer;
    transition: all 0.25s ease; position: relative;
}
.game-picker-card:hover {
    border-color: rgba(255,255,255,0.2); transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.game-picker-card.selected {
    border-color: var(--theme-primary);
    box-shadow: 0 0 24px var(--theme-glow), 0 8px 32px rgba(0,0,0,0.3);
}
.game-picker-card .gpc-icon {
    width: 36px; height: 36px; margin: 0 auto 0.75rem;
    color: var(--text-secondary);
}
.game-picker-card.selected .gpc-icon {
    color: var(--theme-primary); filter: drop-shadow(0 0 8px var(--theme-glow));
}
.game-picker-card .gpc-name {
    font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.3rem;
}
.game-picker-card .gpc-desc {
    font-size: 0.75rem; color: var(--text-muted); line-height: 1.45;
}
.game-picker-confirm {
    padding: 0.75rem 2.5rem; font-size: 1rem; border-radius: 10px;
}
.game-picker-confirm:disabled {
    opacity: 0.35; cursor: not-allowed; transform: none !important;
}

/* ── Change Game Modal ───────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 9000; animation: fadeIn 0.12s ease;
}
.modal-box {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(13,16,22,0.98); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    z-index: 9001; max-width: 440px; width: 90%; padding: 2rem;
    animation: cmdIn 0.18s cubic-bezier(0.4,0,0.2,1);
}
.modal-box h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.75rem; }
.modal-box p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── Locked Game Display (Configuration section) ─────────────── */
.game-locked-display {
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.game-locked-display .game-locked-icon {
    width: 20px; height: 20px; color: var(--theme-primary);
    filter: drop-shadow(0 0 4px var(--theme-glow));
}
.game-locked-display .game-locked-name {
    font-size: 1rem; font-weight: 700; color: var(--text-primary);
}
.badge-active {
    background: rgba(67,181,129,0.15); color: #43b581;
    padding: 0.2rem 0.6rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 600;
}
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.78rem; }

/* ── Section title Lucide icons ──────────────────────────────── */
.section-title-icon {
    width: 20px; height: 20px; display: inline-block; vertical-align: middle;
    color: var(--theme-primary); filter: drop-shadow(0 0 4px var(--theme-glow));
    margin-right: 0.4rem; position: relative; top: -1px;
}

/* ── Welcome / Onboarding State ─────────────────────────────── */
#dashboard-welcome,
#dashboard-no-guilds {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 2rem 1rem;
}
.welcome-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}
.welcome-icon-wrap {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(243,224,59,.1);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: .5rem;
}
.welcome-icon {
    width: 34px; height: 34px;
    color: var(--text-secondary);
}
.welcome-logo {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.welcome-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}
.welcome-subtitle {
    font-size: .9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}
.welcome-guild-select {
    width: 100%;
    max-width: 320px;
    margin-top: .5rem;
    font-size: .95rem;
    padding: .6rem .9rem;
}
.setup-steps {
    list-style: none;
    padding: 0; margin: .25rem 0 0;
    text-align: left;
    width: 100%;
}
.setup-steps li {
    display: flex; align-items: center; gap: .55rem;
    font-size: .875rem; color: var(--text-secondary);
    padding: .45rem 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.setup-steps li:last-child { border-bottom: none; }
.step-icon {
    width: 16px; height: 16px;
    color: var(--text-secondary); flex-shrink: 0;
}

/* ── Initial state: hide sidebar and topbar until guild selected ───────────── */
.sidebar, .topbar {
    display: none !important;
}
body.guild-selected .sidebar,
body.guild-selected .topbar {
    display: flex !important;
}
/* Hide everything initially to prevent flash until JS initializes */
body.pre-guild-select .content-area,
body.pre-guild-select .sidebar,
body.pre-guild-select .topbar,
body.pre-guild-select .activity-feed-panel,
body.pre-guild-select .sidebar-toggle {
    display: none !important;
}
body.pre-guild-select .main-content {
    margin-left: 0;
    padding: 0;
}
/* Center welcome card when sidebar is hidden */
body:not(.guild-selected) .main-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    margin-left: 0;
}
body:not(.guild-selected) #dashboard-welcome,
body:not(.guild-selected) #dashboard-no-guilds {
    min-height: auto;
    padding: 2rem 1rem;
    width: 100%;
    max-width: 100%;
}

/* ── Hero background for welcome screen ───────────────────────────────────── */
body.welcome-bg {
    background-image: url('/static/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* ── Fade transition overlay ─────────────────────────────────── */
.theme-fade-overlay {
    position: fixed; inset: 0; z-index: 999; pointer-events: none;
    background: var(--bg-deep); opacity: 0;
    transition: opacity 0.25s ease;
}
.theme-fade-overlay.active { opacity: 1; }

