/* ============================================
   BRIXOUR DESIGN SYSTEM
   ============================================ */

:root {
    --brixour-green-50:  #E8FBE9;
    --brixour-green-100: #C3F5C6;
    --brixour-green-200: #7DE882;
    --brixour-green-300: #3DD847;
    --brixour-green-400: #14C825;
    --brixour-green-500: #09A525;
    --brixour-green-600: #078A1F;
    --brixour-green-700: #056E19;
    --brixour-green-800: #035212;
    --brixour-green-900: #02360C;

    --bg-body:       #F5F7F5;
    --bg-surface:    #FFFFFF;
    --bg-elevated:   #FFFFFF;
    --bg-sidebar:    #FFFFFF;
    --bg-navbar:     #FFFFFF;
    --bg-input:      #F0F2F0;
    --bg-card:       #FFFFFF;
    --bg-card-hover: #F8FAF8;
    --bg-locked:     #F5F5F5;

    --border-subtle:  #E5E8E5;
    --border-default: #D0D5D0;
    --border-strong:  #B8BFB8;

    --text-primary:   #1A1D1A;
    --text-secondary: #5A635A;
    --text-muted:     #8A938A;
    --text-inverse:   #FFFFFF;
    --text-locked:    #B0B5B0;

    --accent-primary: var(--brixour-green-500);
    --accent-hover:   var(--brixour-green-400);
    --accent-success: var(--brixour-green-500);
    --accent-warning: #E5A000;
    --accent-danger:  #DC3545;

    --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:   0 8px 24px rgba(0,0,0,0.1);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);

    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-2xl: 48px;

    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-xl:   20px;
    --radius-full: 9999px;

    --font-family: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-width: 240px;
    --header-height: 60px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
}

[data-theme="dark"] {
    --bg-body:       #0F120F;
    --bg-surface:    #171B17;
    --bg-elevated:   #1E231E;
    --bg-sidebar:    #141814;
    --bg-navbar:     #141814;
    --bg-input:      #1E231E;
    --bg-card:       #1A1F1A;
    --bg-card-hover: #232923;
    --bg-locked:     #1A1D1A;

    --border-subtle:  #2A302A;
    --border-default: #353D35;
    --border-strong:  #454F45;

    --text-primary:   #F0F2F0;
    --text-secondary: #A0A8A0;
    --text-muted:     #687068;
    --text-locked:    #505850;

    --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg:   0 8px 24px rgba(0,0,0,0.5);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--brixour-green-400); color: white; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: var(--radius-full); }

/* Layout */
.app-container { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 300ms var(--ease-out);
    overflow-y: auto; overflow-x: hidden;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo { display: flex; align-items: center; gap: var(--space-sm); }

.sidebar-logo-icon {
    width: 24px; height: 24px;
    background: var(--accent-primary);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(9, 165, 37, 0.3);
}

.sidebar-logo-text {
    font-size: 1.25rem; font-weight: 800;
    color: var(--text-primary); letter-spacing: -0.02em;
}

.sidebar-nav { flex: 1; padding: var(--space-md); overflow-y: auto; }
.nav-section { margin-bottom: var(--space-lg); }

.nav-section-title {
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
}

.nav-item {
    display: flex; align-items: center; gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary); font-weight: 500; font-size: 0.9375rem;
    cursor: pointer; transition: all var(--duration-fast) var(--ease-out);
    position: relative; margin-bottom: 2px;
}

.nav-item:hover:not(.locked) { background: var(--bg-input); color: var(--text-primary); }

.nav-item.active { background: var(--brixour-green-50); color: var(--accent-primary); font-weight: 600; }
[data-theme="dark"] .nav-item.active { background: rgba(9, 165, 37, 0.12); }

.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; background: var(--accent-primary); border-radius: var(--radius-full);
}

.nav-item.locked { color: var(--text-locked); cursor: not-allowed; }
.nav-item.locked:hover { background: transparent; }

.nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
.nav-label { flex: 1; }

.lock-icon { width: 14px; height: 14px; opacity: 0.5; }

.sidebar-footer { padding: var(--space-md); border-top: 1px solid var(--border-subtle); }

.theme-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md); background: var(--bg-input);
    cursor: pointer; transition: background var(--duration-fast);
}

.theme-toggle:hover { background: var(--border-subtle); }

.theme-toggle-label {
    font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
    display: flex; align-items: center; gap: var(--space-sm);
}

.theme-toggle-switch {
    width: 44px; height: 24px; background: var(--border-default);
    border-radius: var(--radius-full); position: relative;
    transition: background var(--duration-fast);
}

.theme-toggle-switch::after {
    content: ''; position: absolute; width: 18px; height: 18px;
    background: white; border-radius: 50%; top: 3px; left: 3px;
    transition: transform var(--duration-fast) var(--ease-out);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .theme-toggle-switch { background: var(--accent-primary); }
[data-theme="dark"] .theme-toggle-switch::after { transform: translateX(20px); }

/* ---- Sidebar overlay (mobile) ---- */
.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 99; opacity: 0; pointer-events: none;
    transition: opacity 300ms var(--ease-out);
}
.sidebar-overlay.visible { opacity: 1; pointer-events: auto; }

/* ---- Main Content ---- */
.main-content {
    flex: 1; margin-left: var(--sidebar-width);
    display: flex; flex-direction: column;
}

.main-content::before {
    content: ''; position: fixed;
    top: 0; right: 0; bottom: 0; left: var(--sidebar-width);
    background-image: radial-gradient(var(--border-subtle) 1px, transparent 1px);
    background-size: 24px 24px; opacity: 0.4;
    pointer-events: none; z-index: -1;
}

[data-theme="dark"] .main-content::before { opacity: 0.15; }

/* ---- Header ---- */
.header {
    height: var(--header-height); background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center; padding: 0 var(--space-xl);
    position: sticky; top: 0; z-index: 50;
}

.hamburger {
    display: none; background: none; border: none;
    padding: var(--space-xs); border-radius: var(--radius-sm);
    cursor: pointer; color: var(--text-primary); margin-right: var(--space-sm);
}
.hamburger:hover { background: var(--bg-input); }
.hamburger svg { width: 20px; height: 20px; }

.header-left { display: flex; align-items: center; gap: var(--space-lg); }
.header-title { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: var(--space-md); }

.header-stat {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.875rem; font-weight: 600; color: var(--text-secondary);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-input); border-radius: var(--radius-full);
}
.header-stat svg { width: 16px; height: 16px; }
.header-stat.currency { color: var(--accent-primary); }

.logout-btn {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
    border: 1px solid var(--border-default); border-radius: var(--radius-md);
    background: transparent; cursor: pointer; font-family: var(--font-family);
    transition: all var(--duration-fast);
}
.logout-btn:hover { background: var(--bg-input); color: var(--accent-danger); border-color: var(--accent-danger); }
.logout-btn svg { width: 16px; height: 16px; }

/* Search Bar */
.search-bar { flex: 1; max-width: 360px; position: relative; }
.search-bar input {
    width: 100%; padding: var(--space-sm) var(--space-md) var(--space-sm) 36px;
    font-family: var(--font-family); font-size: 0.875rem;
    color: var(--text-primary); background: var(--bg-input);
    border: 1px solid var(--border-default); border-radius: var(--radius-md);
    outline: none; transition: border-color var(--duration-fast);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus { border-color: var(--accent-primary); }
.search-bar svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--text-muted); stroke: currentColor; fill: none;
}

/* ---- Page Content ---- */
.page-content { padding: var(--space-xl); max-width: 1000px; width: 100%; margin: 0 auto; flex: 1; }

/* ---- Loading ---- */
.loading-overlay {
    position: fixed; inset: 0; background: var(--bg-body);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 300ms var(--ease-out);
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border-default); border-top-color: var(--accent-primary);
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem; font-weight: 600; font-family: var(--font-family);
    border-radius: var(--radius-md); border: none; cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}
.btn-primary {
    background: var(--accent-primary); color: white;
    box-shadow: 0 2px 8px rgba(9, 165, 37, 0.25);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(9, 165, 37, 0.3); }
.btn-secondary { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border-default); }
.btn-secondary:hover { background: var(--border-subtle); color: var(--text-primary); }

/* ---- Welcome Section ---- */
.welcome-section { margin-bottom: var(--space-xl); }
.welcome-title { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); margin-bottom: var(--space-xs); letter-spacing: -0.02em; }
.welcome-subtitle { font-size: 1rem; color: var(--text-secondary); }

/* ---- Section Header ---- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.section-title {
    font-size: 1rem; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: var(--space-sm);
}
.section-title svg { width: 18px; height: 18px; color: var(--accent-primary); }
.section-link {
    font-size: 0.8125rem; font-weight: 600; color: var(--accent-primary);
    display: flex; align-items: center; gap: 4px; transition: opacity var(--duration-fast);
}
.section-link:hover { opacity: 0.8; }

/* ---- Classic Divider ---- */
.classic-divider { display: flex; align-items: center; gap: var(--space-md); margin: var(--space-xl) 0; }
.classic-divider::before, .classic-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-default), transparent);
}
.classic-divider-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); opacity: 0.5; }

/* ---- Game Cards ---- */
.games-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-md);
}
.game-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card); overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-normal) var(--ease-out); cursor: pointer;
    animation: fadeInUp 400ms var(--ease-out) forwards; opacity: 0;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent-primary); }

.game-card-thumb {
    aspect-ratio: 16/10; position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--brixour-green-100), var(--brixour-green-200));
    display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .game-card-thumb { background: linear-gradient(135deg, var(--brixour-green-900), var(--brixour-green-800)); }
.game-card-thumb canvas, .game-card-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.game-card-thumb-icon { font-size: 3rem; opacity: 0.5; }
.game-card-badge {
    position: absolute; top: var(--space-sm); left: var(--space-sm);
    background: var(--accent-primary); color: white;
    font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 3px 8px; border-radius: var(--radius-sm);
}

.game-card-content { padding: var(--space-md); }
.game-card-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.game-card-author { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: var(--space-sm); }
.game-card-desc {
    font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.4;
    margin-bottom: var(--space-md); display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.game-card-stats {
    display: flex; align-items: center; gap: var(--space-md);
    padding-top: var(--space-sm); border-top: 1px solid var(--border-subtle);
}
.game-stat { display: flex; align-items: center; gap: 4px; font-size: 0.8125rem; color: var(--text-muted); }
.game-stat svg { width: 14px; height: 14px; }
.game-stat.players .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-primary); animation: pulse 2s ease infinite; }
.game-stat.likes { color: var(--accent-primary); font-weight: 600; }

/* ---- Profile Card ---- */
.profile-card {
    background: var(--bg-card); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card); overflow: hidden;
    border: 1px solid var(--border-subtle); margin-bottom: var(--space-xl);
}
.profile-banner { width: 100%; height: 140px; }
.profile-card-body {
    padding: var(--space-xl); display: flex; gap: var(--space-xl);
}
.profile-avatar {
    width: 88px; height: 88px; border-radius: var(--radius-lg);
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    flex-shrink: 0; border: 4px solid var(--bg-card);
    margin-top: -44px; position: relative; z-index: 2;
}
.profile-avatar canvas {
    width: 100%; height: 100%; display: block;
}
.profile-info { flex: 1; }
.profile-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--accent-primary); background: var(--brixour-green-50);
    padding: 3px 10px; border-radius: var(--radius-full); margin-bottom: var(--space-xs);
}
[data-theme="dark"] .profile-badge { background: rgba(9, 165, 37, 0.15); }
.profile-name { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 2px; letter-spacing: -0.02em; }
.profile-handle { font-size: 0.9375rem; color: var(--text-muted); font-weight: 500; }

.profile-stats-grid {
    display: flex; gap: 0; background: var(--bg-card);
    border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: var(--space-xl);
}
.profile-stat-item {
    flex: 1; padding: var(--space-lg) var(--space-md);
    display: flex; flex-direction: column; align-items: center; gap: var(--space-xs);
    border-right: 1px solid var(--border-subtle);
}
.profile-stat-item:last-child { border-right: none; }
.profile-stat-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; color: var(--text-muted); }
.profile-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.profile-stat-label { font-size: 0.625rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Hero Card (game page) ---- */
.hero-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-card);
    overflow: hidden; margin-bottom: var(--space-lg);
}
.hero-banner {
    width: 100%; height: 180px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--brixour-green-100), var(--brixour-green-200));
}
[data-theme="dark"] .hero-banner { background: linear-gradient(135deg, var(--brixour-green-900), var(--brixour-green-800)); }
.hero-banner canvas, .hero-banner img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hero-banner-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 60%); }
.hero-body { padding: var(--space-xl); display: flex; gap: var(--space-xl); }
.hero-icon-wrap {
    width: 80px; height: 80px; border-radius: var(--radius-lg);
    border: 3px solid var(--bg-card); box-shadow: var(--shadow-lg);
    overflow: hidden; flex-shrink: 0; margin-top: -48px;
    position: relative; z-index: 2; background: var(--bg-input);
}
.hero-icon-wrap canvas, .hero-icon-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hero-info { flex: 1; min-width: 0; }
.hero-title { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.hero-creator { margin-top: var(--space-xs); font-size: 0.875rem; color: var(--text-secondary); }
.hero-creator a { font-weight: 600; color: var(--accent-primary); }
.hero-desc { margin-top: var(--space-sm); font-size: 0.875rem; color: var(--text-secondary); line-height: 1.55; }

/* Play Button */
.play-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-primary); color: white; border: none;
    border-radius: var(--radius-lg); font-family: var(--font-family);
    font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: 0 4px 16px rgba(9, 165, 37, 0.3); margin-bottom: var(--space-lg);
}
.play-btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 22px rgba(9, 165, 37, 0.35); }
.play-btn:active { transform: translateY(0); }
.play-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.play-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* Stats Row (game page) */
.stats-row { display: flex; gap: var(--space-md); margin-bottom: var(--space-lg); }
.stat-card {
    flex: 1; background: var(--bg-card); border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg); padding: var(--space-md) var(--space-lg);
    display: flex; align-items: center; gap: var(--space-sm);
    box-shadow: var(--shadow-card); transition: all var(--duration-normal) var(--ease-out);
}
.stat-icon-wrap {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon-wrap svg { width: 20px; height: 20px; }
.stat-icon-wrap.visits { background: rgba(9, 165, 37, 0.08); color: var(--accent-primary); }
.stat-icon-wrap.likes { background: rgba(138, 147, 138, 0.08); color: var(--text-muted); }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1; }
.stat-label-text { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

.stat-like { cursor: pointer; user-select: none; }
.stat-like:hover { border-color: rgba(255,45,85,0.3); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,45,85,0.12); }
.stat-like:hover .stat-icon-wrap.likes { background: rgba(255,45,85,0.08); color: #ff2d55; }
.stat-like.liked { border-color: rgba(255,45,85,0.2); }
.stat-like.liked .stat-icon-wrap.likes { background: rgba(255,45,85,0.1); color: #ff2d55; }

@keyframes heartBounce { 0%{transform:scale(1)} 15%{transform:scale(1.4)} 30%{transform:scale(.82)} 45%{transform:scale(1.18)} 60%{transform:scale(.94)} 100%{transform:scale(1)} }
.stat-like.pop .stat-icon-wrap svg { animation: heartBounce 650ms var(--ease-out); }
@keyframes numPop { 0%{transform:scale(1)} 40%{transform:scale(1.15)} 100%{transform:scale(1)} }
.stat-value.pop { animation: numPop 300ms var(--ease-out); }

/* Details Grid */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.detail-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); padding: var(--space-lg); box-shadow: var(--shadow-card);
}
.detail-card-title { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-sm); }
.detail-card-value { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); line-height: 1.4; }
.detail-card-value a { color: var(--accent-primary); font-weight: 600; }

/* Install Modal */
.install-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease-out);
}
.install-overlay.visible { opacity: 1; pointer-events: auto; }
.install-modal {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl); padding: var(--space-2xl);
    max-width: 440px; width: 90%; box-shadow: var(--shadow-lg);
    text-align: center; position: relative;
    transform: translateY(12px) scale(0.97); transition: transform 250ms var(--ease-out);
}
.install-overlay.visible .install-modal { transform: translateY(0) scale(1); }
.install-icon svg { width: 48px; height: 48px; stroke: var(--accent-primary); fill: none; stroke-width: 1.5; }
.install-icon { margin-bottom: var(--space-md); }
.install-title { font-size: 1.25rem; font-weight: 700; margin-bottom: var(--space-sm); color: var(--text-primary); }
.install-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: var(--space-xl); }
.install-steps { text-align: left; margin: 0 auto var(--space-xl); max-width: 320px; }
.install-step { display: flex; align-items: flex-start; gap: var(--space-md); margin-bottom: var(--space-md); font-size: 0.875rem; line-height: 1.45; color: var(--text-primary); }
.install-step-num {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent-primary); color: white;
    font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.install-download-btn {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xl);
    background: var(--accent-primary); color: white; border: none;
    border-radius: var(--radius-md); font-family: var(--font-family);
    font-size: 0.9375rem; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
    box-shadow: 0 4px 14px rgba(9,165,37,0.3); margin-bottom: var(--space-md);
}
.install-download-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.install-retry-btn {
    display: inline-flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: transparent; color: var(--accent-primary);
    border: 1.5px solid var(--accent-primary); border-radius: var(--radius-md);
    font-family: var(--font-family); font-size: 0.875rem; font-weight: 600;
    cursor: pointer; transition: all var(--duration-fast) var(--ease-out);
}
.install-retry-btn:hover { background: var(--accent-primary); color: white; }
.install-close {
    position: absolute; top: var(--space-md); right: var(--space-md);
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: var(--space-xs);
}
.install-close:hover { color: var(--text-primary); }
.install-close svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }

/* ---- Auth Pages ---- */
.auth-container {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--bg-body); padding: var(--space-lg);
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
    padding: var(--space-2xl) var(--space-xl); text-align: center;
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); margin-bottom: var(--space-xl); }
.auth-logo-icon {
    width: 32px; height: 32px; background: var(--accent-primary); border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(9,165,37,0.3);
}
.auth-logo-text { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.auth-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-xs); }
.auth-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: var(--space-xl); }
.form-group { margin-bottom: var(--space-md); text-align: left; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-xs); }
.form-input {
    width: 100%; padding: 10px var(--space-md);
    font-family: var(--font-family); font-size: 0.9375rem;
    color: var(--text-primary); background: var(--bg-input);
    border: 1px solid var(--border-default); border-radius: var(--radius-md);
    outline: none; transition: border-color var(--duration-fast);
}
.form-input:focus { border-color: var(--accent-primary); }
.form-input.error { border-color: var(--accent-danger); }
.form-hint { font-size: 0.75rem; margin-top: var(--space-xs); color: var(--text-muted); }
.form-hint.error { color: var(--accent-danger); }
.form-hint.success { color: var(--accent-success); }
.auth-error {
    background: rgba(220,53,69,0.08); color: var(--accent-danger);
    font-size: 0.8125rem; font-weight: 500;
    padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md);
    margin-bottom: var(--space-md); display: none;
}
.auth-error.visible { display: block; }
.auth-submit {
    width: 100%; padding: 10px var(--space-lg);
    font-family: var(--font-family); font-size: 1rem; font-weight: 700;
    color: white; background: var(--accent-primary); border: none;
    border-radius: var(--radius-md); cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    box-shadow: 0 2px 8px rgba(9,165,37,0.25); margin-top: var(--space-md);
}
.auth-submit:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(9,165,37,0.3); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-footer { margin-top: var(--space-lg); font-size: 0.8125rem; color: var(--text-muted); }
.auth-footer a { color: var(--accent-primary); font-weight: 600; }
.auth-theme-toggle {
    position: fixed; top: var(--space-md); right: var(--space-md);
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full); padding: var(--space-sm);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.auth-theme-toggle svg { width: 18px; height: 18px; stroke: var(--text-muted); fill: none; }

/* ---- Legal Content ---- */
.legal-card {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-card); padding: var(--space-2xl);
}
.legal-title { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); margin-bottom: var(--space-lg); letter-spacing: -0.02em; }
.legal-section { margin-bottom: var(--space-xl); }
.legal-section h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-sm); }
.legal-section p, .legal-section ul { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.65; }
.legal-section ul { padding-left: var(--space-xl); margin-top: var(--space-sm); }
.legal-section li { margin-bottom: var(--space-xs); }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: var(--space-2xl); color: var(--text-muted); }
.empty-state-icon { margin-bottom: var(--space-md); opacity: 0.3; }
.empty-state-icon svg { width: 48px; height: 48px; stroke: currentColor; fill: none; }
.empty-state p { font-size: 0.875rem; }

/* ---- Footer ---- */
.page-footer { margin-top: auto; padding: var(--space-xl); border-top: 1px solid var(--border-subtle); text-align: center; }
.footer-text { font-size: 0.8125rem; color: var(--text-muted); }
.footer-text a { color: var(--accent-primary); font-weight: 500; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .main-content::before { left: 0; }
    .hamburger { display: flex; }
}
@media (max-width: 768px) {
    .header { padding: 0 var(--space-lg); }
    .page-content { padding: var(--space-lg); }
    .hero-banner { height: 180px; }
    .hero-body { flex-direction: column; align-items: center; text-align: center; padding: var(--space-lg); gap: var(--space-md); }
    .hero-icon-wrap { margin-top: -48px; width: 84px; height: 84px; }
    .stats-row { flex-direction: column; }
    .details-grid { grid-template-columns: 1fr; }
    .profile-card-body { flex-direction: column; align-items: center; text-align: center; }
    .games-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-stats-grid { flex-wrap: wrap; }
    .profile-stat-item { min-width: 50%; }
}
@media (max-width: 500px) {
    .page-content { padding: var(--space-md); }
    .header { padding: 0 var(--space-md); }
    .games-grid { grid-template-columns: 1fr; gap: var(--space-sm); }
    .search-bar { max-width: none; }
    .profile-stat-item { min-width: 50%; }
}

/* ---- Tab Slider ---- */
.tab-slider {
    display: flex; background: var(--bg-input); border-radius: var(--radius-md);
    padding: 3px; margin-bottom: var(--space-lg); position: relative;
    border: 1px solid var(--border-subtle);
}
.tab-slider-btn {
    flex: 1; padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-family); font-size: 0.875rem; font-weight: 600;
    color: var(--text-muted); background: none; border: none; cursor: pointer;
    border-radius: var(--radius-sm); transition: all var(--duration-fast) var(--ease-out);
    position: relative; z-index: 1;
}
.tab-slider-btn:hover { color: var(--text-primary); }
.tab-slider-btn.active {
    color: white; background: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(9, 165, 37, 0.25);
}
.tab-content { display: none; animation: fadeInUp 250ms var(--ease-out); }
.tab-content.active { display: block; }

/* ---- Server Browser ---- */
.server-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.server-row {
    display: flex; align-items: center; gap: var(--space-md);
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-card); transition: all var(--duration-fast) var(--ease-out);
    cursor: pointer; animation: fadeInUp 300ms var(--ease-out) forwards; opacity: 0;
}
.server-row:hover { border-color: var(--accent-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.server-row-index {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: var(--bg-input); display: flex; align-items: center; justify-content: center;
    font-size: 0.8125rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0;
}
.server-row-players {
    flex: 1; display: flex; align-items: center; gap: -4px;
}
.server-avatars {
    display: flex; align-items: center;
}
.server-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    overflow: hidden; border: 2px solid var(--bg-card);
    margin-left: -6px; flex-shrink: 0;
}
.server-avatar:first-child { margin-left: 0; }
.server-avatar canvas { width: 100%; height: 100%; display: block; }
.server-player-count {
    margin-left: var(--space-sm);
    font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary);
}
.server-join-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-primary); color: white; border: none;
    border-radius: var(--radius-sm); font-family: var(--font-family);
    font-size: 0.75rem; font-weight: 700; cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    box-shadow: 0 2px 6px rgba(9,165,37,0.2);
}
.server-join-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.server-join-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.server-empty {
    text-align: center; padding: var(--space-xl); color: var(--text-muted);
    font-size: 0.875rem;
}
.server-loading { text-align: center; padding: var(--space-xl); }
.server-loading .loading-spinner { margin: 0 auto; }

/* ---- Active Badge ---- */
.active-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.75rem; font-weight: 600; color: var(--accent-primary);
    background: rgba(9,165,37,0.08); padding: 2px 8px;
    border-radius: var(--radius-full);
}
.active-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-primary); animation: pulse 2s ease infinite; }

/* ---- Animations ---- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
