/* ==============================================
   WINFLOW - PREMIUM 3D DESIGN SYSTEM
   Skill Gaming - Zero RNG - 100% Deterministic
   ============================================== */

/* ---------------------------------------------
   CSS CUSTOM PROPERTIES - 3D DESIGN TOKENS
   --------------------------------------------- */
:root {
    /* Core Colors */
    --bg-void: #030305;
    --bg-deep: #050508;
    --bg-surface: #0a0a0f;
    --bg-card: #0d0d14;
    --bg-elevated: #121219;
    
    /* Primary Accent - Cyan */
    --cyan-100: #e0f7ff;
    --cyan-200: #a5edff;
    --cyan-300: #6ee3ff;
    --cyan-400: #00d4ff;
    --cyan-500: #00b8e6;
    --cyan: var(--cyan-400);
    --cyan-glow: 0 0 20px #00d4ff60, 0 0 40px #00d4ff30;
    --cyan-glow-strong: 0 0 30px #00d4ff80, 0 0 60px #00d4ff50, 0 0 100px #00d4ff30;
    
    /* Secondary Accent - Magenta */
    --magenta-100: #ffe0f7;
    --magenta-200: #ffb3e6;
    --magenta-300: #ff66d4;
    --magenta-400: #ff00aa;
    --magenta-500: #d60090;
    --magenta: var(--magenta-400);
    --magenta-glow: 0 0 20px #ff00aa60, 0 0 40px #ff00aa30;
    
    /* Accent - Gold */
    --gold-100: #fff7e0;
    --gold-200: #ffebaa;
    --gold-300: #ffd866;
    --gold-400: #ffc800;
    --gold-500: #e6b400;
    --gold: var(--gold-400);
    --gold-glow: 0 0 20px #ffc80060, 0 0 40px #ffc80030;
    
    /* Status Colors */
    --green: #00ff88;
    --green-glow: 0 0 20px #00ff8860;
    --red: #ff3366;
    --red-glow: 0 0 20px #ff336660;
    --orange: #ff8800;
    --purple: #9966ff;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #606078;
    --text-dim: #404050;
    
    /* Glass Effect */
    --glass-bg: rgba(10, 10, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.5);
    
    /* Depth Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.7);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    
    /* 3D Depth */
    --depth-1: translateZ(10px);
    --depth-2: translateZ(20px);
    --depth-3: translateZ(40px);
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms var(--ease-out-expo);
    --transition-normal: 300ms var(--ease-out-expo);
    --transition-slow: 500ms var(--ease-out-expo);
    
    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Layout */
    --navbar-height: 60px;
    --dock-height: 64px;
    --legal-height: 28px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-void);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--cyan-500);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cyan-400);
}

/* Selection */
::selection {
    background: var(--cyan-400);
    color: var(--bg-void);
}

/* Focus */
:focus-visible {
    outline: 2px solid var(--cyan-400);
    outline-offset: 2px;
}

/* ---------------------------------------------
   3D BACKGROUND UNIVERSE
   --------------------------------------------- */
.bg-universe {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    perspective: 1000px;
}

/* Stars Layer */
.bg-stars {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.8) 0%, transparent 50%),
        radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.6) 0%, transparent 50%),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.7) 0%, transparent 50%),
        radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.5) 0%, transparent 50%),
        radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.6) 0%, transparent 50%),
        radial-gradient(2px 2px at 15% 75%, rgba(0,212,255,0.8) 0%, transparent 50%),
        radial-gradient(2px 2px at 85% 25%, rgba(255,0,170,0.8) 0%, transparent 50%);
    animation: starsFloat 120s linear infinite;
}

@keyframes starsFloat {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-5%) rotate(1deg); }
}

/* Nebula Layer */
.bg-nebula {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(255, 0, 170, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 50%, rgba(153, 102, 255, 0.04) 0%, transparent 50%);
    animation: nebulaShift 30s ease-in-out infinite;
}

@keyframes nebulaShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* 3D Grid Layer */
.bg-grid-3d {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg) translateY(-50%);
    transform-origin: center top;
    animation: gridPulse 4s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Particles Container */
.bg-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Scanlines */
.bg-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    opacity: 0.3;
}

/* Vignette */
.bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 80% 60% at center,
        transparent 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
}

/* ---------------------------------------------
   NAVBAR DOCK - MOBILE BOTTOM (ICONIC)
   --------------------------------------------- */
.navbar-dock {
    position: fixed;
    bottom: 28px; /* Space for legal banner below */
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-xs) var(--space-md);
    display: flex;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
}

/* Navbar dock visible on ALL devices */

.dock-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    gap: 0;
    position: relative;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-2xl);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.dock-glass {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-2xl);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        transparent 100%
    );
    pointer-events: none;
}

.dock-border {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 -10px 40px rgba(0, 212, 255, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.dock-side {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}
.dock-side.dock-left {
    justify-content: space-evenly;
}
.dock-side.dock-right {
    justify-content: space-evenly;
}

/* Dock Item */
.dock-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    min-width: 56px;
}

.dock-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.dock-item:active {
    transform: scale(0.92) translateY(2px);
}

.dock-item.active {
    color: var(--cyan);
}

.dock-item.active .dock-glow {
    opacity: 1;
}

.dock-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-icon svg {
    width: 100%;
    height: 100%;
}

.dock-label {
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dock-glow {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 4px;
    background: var(--cyan);
    border-radius: var(--radius-full);
    filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.dock-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: var(--radius-full);
    animation: badgePulse 2s ease-in-out infinite;
}

.dock-badge.hidden {
    display: none;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Dock Center Logo */
.dock-center {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 var(--space-sm);
}

.dock-logo {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.dock-logo:hover {
    transform: scale(1.05);
}

.dock-logo:active {
    transform: scale(0.95);
}

.logo-orb {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.logo-ring-1 {
    inset: 0;
    border-color: var(--cyan);
    opacity: 0.3;
    animation: ringRotate 8s linear infinite;
}

.logo-ring-2 {
    inset: 4px;
    border-color: var(--magenta);
    opacity: 0.5;
    animation: ringRotate 6s linear infinite reverse;
}

.logo-ring-3 {
    inset: 8px;
    border-color: var(--gold);
    opacity: 0.7;
    animation: ringRotate 4s linear infinite;
}

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

.logo-core {
    position: relative;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--magenta) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 20px var(--cyan),
        0 0 40px rgba(0, 212, 255, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.logo-w {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 900;
    color: var(--bg-void);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.logo-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
    opacity: 0;
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.3; transform: scale(1.2); }
}

/* ---------------------------------------------
   NAVBAR TOP - DESKTOP
   --------------------------------------------- */
.navbar-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--navbar-height);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
}

/* Top navbar hidden - using bottom dock on all devices */

.nav-logo {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.02);
}

.logo-win {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 900;
    color: var(--cyan);
    text-shadow: var(--cyan-glow);
}

.logo-flow {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 900;
    color: var(--magenta);
    text-shadow: var(--magenta-glow);
}

.logo-tagline {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: var(--space-sm);
}

.nav-btn {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-login {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--cyan);
    border: 1px solid var(--cyan);
}

.nav-login:hover {
    background: rgba(0, 212, 255, 0.1);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.btn-icon svg {
    width: 100%;
    height: 100%;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-user span {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--cyan);
}

.nav-logout {
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--text-dim);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-logout:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ---------------------------------------------
   PAGE SYSTEM & TRANSITIONS
   --------------------------------------------- */
.page {
    position: absolute;
    inset: 0;
    padding-top: var(--space-lg);
    padding-bottom: calc(var(--dock-height) + var(--legal-height) + var(--safe-area-bottom) + var(--space-xl));
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: 
        opacity 400ms var(--ease-out-expo),
        transform 400ms var(--ease-out-expo),
        visibility 0ms 400ms;
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: 
        opacity 400ms var(--ease-out-expo),
        transform 400ms var(--ease-out-expo),
        visibility 0ms;
}

/* Unified padding for all devices (bottom dock) */

/* Game page - fullscreen on all devices */
#game {
    padding: 0;
    padding-bottom: calc(var(--dock-height) + var(--legal-height) + var(--safe-area-bottom));
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

.page-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.title-bracket {
    color: var(--cyan);
    opacity: 0.6;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ---------------------------------------------
   LANDING PAGE - HERO PREMIUM 3D
   --------------------------------------------- */
.landing-content {
    padding: 0;
}

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-md);
    overflow: hidden;
}

/* Hero Background Elements */
.hero-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 15s ease-in-out infinite;
}

.hero-orb-1 {
    width: 400px;
    height: 400px;
    top: 10%;
    left: 10%;
    background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
    opacity: 0.15;
}

.hero-orb-2 {
    width: 300px;
    height: 300px;
    bottom: 20%;
    right: 10%;
    background: radial-gradient(circle, var(--magenta) 0%, transparent 70%);
    opacity: 0.15;
    animation-delay: -5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.05); }
    50% { transform: translate(0, 20px) scale(0.95); }
    75% { transform: translate(-20px, -10px) scale(1.02); }
}

.hero-lines {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, transparent 49.9%, rgba(0, 212, 255, 0.03) 50%, transparent 50.1%),
        linear-gradient(0deg, transparent 49.9%, rgba(0, 212, 255, 0.03) 50%, transparent 50.1%);
    background-size: 100px 100px;
}

/* Hero Badge */
.hero-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-xl);
}

.badge-text {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.badge-pulse {
    width: 6px;
    height: 6px;
    background: var(--cyan);
    border-radius: 50%;
    animation: badgePulse 2s ease-in-out infinite;
}

.animate-float {
    animation: floatY 3s ease-in-out infinite;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Hero Title */
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 15vw, 120px);
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: var(--space-lg);
    perspective: 500px;
}

.title-line {
    display: block;
    position: relative;
}

.title-win {
    color: var(--cyan);
    text-shadow: 
        0 0 40px rgba(0, 212, 255, 0.8),
        0 0 80px rgba(0, 212, 255, 0.4),
        0 4px 0 rgba(0, 100, 140, 0.8);
    transform: perspective(500px) rotateX(-5deg);
    animation: titleGlow 3s ease-in-out infinite;
}

.title-flow {
    color: var(--magenta);
    text-shadow: 
        0 0 40px rgba(255, 0, 170, 0.8),
        0 0 80px rgba(255, 0, 170, 0.4),
        0 4px 0 rgba(140, 0, 90, 0.8);
    transform: perspective(500px) rotateX(5deg);
    animation: titleGlow 3s ease-in-out infinite 0.5s;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* Hero Subtitle */
.hero-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.subtitle-bracket {
    font-family: var(--font-mono);
    font-size: clamp(14px, 3vw, 20px);
    color: var(--text-dim);
}

.subtitle-text {
    font-family: var(--font-display);
    font-size: clamp(14px, 3vw, 20px);
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 4px;
    text-shadow: var(--gold-glow);
}

/* Hero Tagline */
.hero-tagline {
    font-size: clamp(16px, 3vw, 20px);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.highlight-cyan {
    color: var(--cyan);
    font-weight: 600;
}

.highlight-magenta {
    color: var(--magenta);
    font-weight: 600;
}

/* Hero Actions */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-2xl);
}

/* CTA Buttons - Premium 3D */
.cta-primary,
.cta-secondary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.cta-primary {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-500) 100%);
    color: var(--bg-void);
    box-shadow: 
        0 4px 20px rgba(0, 212, 255, 0.4),
        0 8px 40px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 30px rgba(0, 212, 255, 0.5),
        0 12px 50px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cta-primary:active {
    transform: translateY(1px);
}

.cta-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.cta-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--cyan);
    box-shadow: var(--cyan-glow);
}

.cta-bg {
    position: absolute;
    inset: 0;
    background: inherit;
    transition: opacity var(--transition-fast);
}

.cta-border {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.cta-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cta-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-icon svg {
    width: 100%;
    height: 100%;
}

.cta-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.cta-main {
    font-size: 14px;
    line-height: 1.2;
}

.cta-sub {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 400;
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4), 0 8px 40px rgba(0, 212, 255, 0.2); }
    50% { box-shadow: 0 4px 30px rgba(0, 212, 255, 0.6), 0 8px 50px rgba(0, 212, 255, 0.3); }
}

/* Hero Features Pills */
.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
}

.feature-pill {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
}

.pill-icon {
    width: 20px;
    height: 20px;
    color: var(--cyan);
}

.pill-icon svg {
    width: 100%;
    height: 100%;
}

.pill-text {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.pill-glow {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--cyan), var(--magenta));
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-fast);
}

.feature-pill:hover .pill-glow {
    opacity: 0.2;
}

/* ---------------------------------------------
   HOW TO PLAY SECTION
   --------------------------------------------- */
.section-howto {
    padding: var(--space-3xl) var(--space-md);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.title-marker {
    color: var(--cyan);
    margin-right: var(--space-sm);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    max-width: 1000px;
    margin: 0 auto;
}

.step-card {
    position: relative;
    padding: var(--space-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.step-card::before {
    content: attr(data-step);
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    font-family: var(--font-display);
    font-size: 60px;
    font-weight: 900;
    color: var(--cyan);
    opacity: 0.05;
    line-height: 1;
}

.step-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.1);
}

.step-number {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--cyan);
    margin-bottom: var(--space-sm);
}

.step-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    color: var(--cyan);
}

.step-icon svg {
    width: 100%;
    height: 100%;
}

.step-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    transition: width var(--transition-slow);
}

.step-card:hover .step-line {
    width: 100%;
}

/* ---------------------------------------------
   LIVE PREVIEW SECTION
   --------------------------------------------- */
.section-preview {
    padding: var(--space-2xl) var(--space-md);
    display: flex;
    justify-content: center;
}

.preview-window {
    position: relative;
    width: 100%;
    max-width: 540px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px var(--glass-border);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--glass-border);
}

.window-dots {
    display: flex;
    gap: 6px;
}

.window-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.window-dots .dot.red { background: #ff5f57; }
.window-dots .dot.yellow { background: #febc2e; }
.window-dots .dot.green { background: #28c840; }

.window-title {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.window-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--green);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: statusBlink 1s ease-in-out infinite;
}

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

.preview-screen {
    position: relative;
    aspect-ratio: 3/2;
    background: var(--bg-void);
}

.preview-screen canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.preview-reflection {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(
        to top,
        rgba(0, 212, 255, 0.02) 0%,
        transparent 100%
    );
    pointer-events: none;
}

/* ---------------------------------------------
   GAME PAGE - ARENA 3D
   --------------------------------------------- */
.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Allow flex shrink */
}

/* Game HUD - Premium Glass */
.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-md);
    gap: var(--space-md);
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .game-hud {
        padding: var(--space-lg) var(--space-xl);
    }
}

.hud-section {
    display: flex;
    gap: var(--space-sm);
}

.hud-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-md);
}

@media (max-width: 600px) {
    .hud-center {
        position: relative;
        left: auto;
        transform: none;
    }
    
    .game-hud {
        flex-wrap: nowrap;
        justify-content: space-between;
        padding: var(--space-xs) var(--space-sm);
        gap: 4px;
    }
    
    .hud-section {
        gap: 4px;
    }
    
    .hud-card {
        padding: 4px 6px;
        min-width: 40px;
        border-radius: var(--radius-md);
    }
    
    .hud-label {
        font-size: 7px;
        letter-spacing: 0.5px;
    }
    
    .hud-value {
        font-size: 14px;
    }
}

.hud-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    min-width: 60px;
}

.hud-card-bg {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 50%
    );
}

.hud-label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.hud-glow {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.hud-glow { background: linear-gradient(135deg, var(--cyan), transparent); }
.hud-glow.green { background: linear-gradient(135deg, var(--green), transparent); }

.hud-card:hover .hud-glow {
    opacity: 0.1;
}

.combo-value {
    color: var(--gold);
    text-shadow: var(--gold-glow);
}

.timer-value {
    font-family: var(--font-mono);
    font-size: 18px;
}

.envois-value {
    color: var(--green);
}

/* Lives Display */
.lives-container {
    display: flex;
    gap: 4px;
}

.life-orb {
    width: 12px;
    height: 12px;
    background: var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--cyan);
    transition: all var(--transition-fast);
}

.life-orb.lost {
    background: var(--red);
    opacity: 0.3;
    box-shadow: none;
}

/* Game Arena */
.game-arena {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    position: relative;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 768px) {
    .game-arena {
        padding: var(--space-xs);
        align-items: center;
        justify-content: center;
    }
}

.arena-frame {
    position: absolute;
    inset: var(--space-md);
    pointer-events: none;
}

.arena-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--cyan);
    opacity: 0.3;
}

.arena-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.arena-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.arena-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.arena-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.game-wrapper {
    position: relative;
    background: var(--bg-void);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 
        0 0 0 1px var(--glass-border),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 100px rgba(0, 212, 255, 0.03);
    /* Desktop: 4:3 aspect ratio */
    width: 100%;
    max-width: 720px;
    aspect-ratio: 4/3;
}

/* Mobile: let wrapper size from canvas, slightly reduced height */
@media (max-width: 768px) {
    .game-wrapper {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: calc(100% - 12px);
        aspect-ratio: unset;
    }
    .game-arena {
        padding: var(--space-xs);
    }
}

#game-canvas {
    display: block;
    /* Size set by JS resizeCanvas() */
}

@media (min-width: 769px) {
    #game-canvas {
        width: 100%;
        height: 100%;
    }
}

/* Game Overlay */
.game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    transition: opacity var(--transition-normal);
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    padding: var(--space-xl);
}

.overlay-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--cyan), var(--magenta));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-void);
    box-shadow: 0 0 40px var(--cyan);
}

.overlay-icon svg {
    width: 40px;
    height: 40px;
    margin-left: 4px;
}

.overlay-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.overlay-instruction {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.overlay-controls {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.control-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-muted);
}

.control-icon {
    font-size: 16px;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
}

.overlay-tips {
    font-size: 12px;
    color: var(--text-dim);
}

.overlay-tips .tip {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin: 0 2px;
}

.tip.green { background: rgba(0, 255, 136, 0.2); color: var(--green); }
.tip.red { background: rgba(255, 51, 102, 0.2); color: var(--red); }
.tip.gold { background: rgba(255, 200, 0, 0.2); color: var(--gold); }

/* Arena Glow */
.arena-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 50% 30% at 50% 100%,
        rgba(0, 212, 255, 0.1) 0%,
        transparent 70%
    );
    pointer-events: none;
}

/* Game Mode Badge */
.game-mode-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .game-mode-badge {
        display: none;
    }
}
@media (min-width: 769px) {
    .game-mode-badge {
        top: calc(var(--navbar-height) + var(--space-md));
    }
}

.badge-indicator {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
}

.beta-badge {
    background: rgba(255, 136, 0, 0.2);
    border-color: var(--orange);
    color: var(--orange);
}

/* ---------------------------------------------
   LOBBY PAGE
   --------------------------------------------- */
.beta-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: rgba(255, 136, 0, 0.1);
    border: 1px solid rgba(255, 136, 0, 0.3);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--orange);
    margin-bottom: var(--space-md);
}

/* Formats Grid */
.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.format-card {
    position: relative;
    padding: var(--space-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    overflow: hidden;
}

.format-card .card-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.02) 0%,
        transparent 50%
    );
}

.format-card .card-border {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.format-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.format-card:hover .card-border {
    border-color: var(--cyan);
}

.format-card.featured {
    border-color: var(--gold);
}

.format-card.featured .card-glow {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    opacity: 0.1;
    z-index: -1;
}

.format-card.selected {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.05);
}

.format-popular {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--gold);
    color: var(--bg-void);
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.format-tier {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: var(--space-sm);
}

.format-name {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: var(--space-sm);
}

.format-entry {
    margin-bottom: var(--space-sm);
}

.entry-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.entry-unit {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
}

.format-pot {
    font-size: 14px;
    color: var(--gold);
    margin-bottom: var(--space-md);
}

.format-rewards {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.reward {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--glass-border);
}

.reward:last-child {
    border-bottom: none;
}

.rank {
    color: var(--text-muted);
}

.amount {
    color: var(--green);
    font-weight: 600;
}

/* Dashboard Card */
.dashboard-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    backdrop-filter: blur(10px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

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

.dash-title h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: statusBlink 1s ease-in-out infinite;
}

.dash-timer {
    text-align: right;
}

.timer-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dash-timer .timer-value {
    font-family: var(--font-mono);
    font-size: 24px;
    color: var(--cyan);
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
}

.stat-card.highlight {
    background: rgba(255, 200, 0, 0.1);
    border: 1px solid rgba(255, 200, 0, 0.2);
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    color: var(--cyan);
}

.stat-icon.gold { color: var(--gold); }
.stat-icon.green { color: var(--green); }

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Mini Leaderboard */
.mini-leaderboard {
    margin-bottom: var(--space-lg);
}

.leaderboard-header {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.leader-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.leader-rank {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    min-width: 24px;
}

.leader-rank.gold { color: var(--gold); }
.leader-rank.silver { color: #c0c0c0; }
.leader-rank.bronze { color: #cd7f32; }

.leader-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.leader-score {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--cyan);
}

/* Dashboard Actions */
.dashboard-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.dashboard-status {
    margin-top: var(--space-md);
    font-size: 13px;
    color: var(--text-muted);
}

/* Page Nav */
.page-nav {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.btn-primary {
    padding: var(--space-sm) var(--space-lg);
    background: var(--cyan);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--bg-void);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    filter: brightness(1.1);
}

/* ---------------------------------------------
   WALLET PAGE
   --------------------------------------------- */
.wallet-guest,
.wallet-content {
    margin-bottom: var(--space-xl);
}

.empty-state {
    text-align: center;
    padding: var(--space-3xl);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    color: var(--text-dim);
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.wallet-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.wallet-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    text-align: center;
}

.wallet-icon {
    font-size: 32px;
    margin-bottom: var(--space-sm);
}

.wallet-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.wallet-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--cyan);
}

/* Limits Form */
.wallet-limits {
    margin-bottom: var(--space-xl);
}

.wallet-limits h2 {
    font-family: var(--font-display);
    font-size: 18px;
    margin-bottom: var(--space-sm);
}

.limits-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.limits-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-row label {
    font-size: 13px;
    color: var(--text-secondary);
}

.form-row input,
.form-row select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-deep);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-row input:focus,
.form-row select:focus {
    border-color: var(--cyan);
    outline: none;
}

/* Ledger */
.wallet-ledger h2 {
    font-family: var(--font-display);
    font-size: 18px;
    margin-bottom: var(--space-md);
}

.ledger-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.ledger-list li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 13px;
}

.ledger-empty {
    color: var(--text-muted);
    font-style: italic;
}

.dev-tools {
    text-align: center;
    margin-top: var(--space-lg);
}

.link-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.link-btn:hover {
    color: var(--text-muted);
}

/* ---------------------------------------------
   LEADERBOARD PAGE
   --------------------------------------------- */
.leaderboard-container {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.leaderboard-table th {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.leaderboard-table td {
    font-size: 14px;
}

.leaderboard-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.leaderboard-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

/* ---------------------------------------------
   RULES PAGE
   --------------------------------------------- */
.philosophy-card {
    position: relative;
    padding: var(--space-2xl);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(255, 0, 170, 0.05) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.philosophy-quote {
    position: absolute;
    top: var(--space-md);
    left: var(--space-lg);
    font-family: var(--font-display);
    font-size: 48px;
    color: var(--cyan);
    opacity: 0.3;
}

.philosophy-card blockquote {
    font-size: 18px;
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: var(--space-md);
}

.philosophy-card cite {
    font-size: 13px;
    color: var(--text-muted);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.rule-card {
    position: relative;
    padding: var(--space-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.rule-number {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    color: var(--cyan);
    opacity: 0.1;
}

.rule-card h3 {
    font-family: var(--font-display);
    font-size: 16px;
    margin-bottom: var(--space-sm);
    color: var(--cyan);
}

.rule-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.technical-summary {
    margin-bottom: var(--space-xl);
}

.technical-summary h2 {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--cyan);
    margin-bottom: var(--space-lg);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
}

.tech-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.tech-key {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.tech-val {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--cyan);
}

.debug-link {
    text-align: center;
    margin-top: var(--space-lg);
}

.debug-link a {
    color: var(--text-dim);
    font-size: 12px;
}

/* ---------------------------------------------
   LEGAL PAGES
   --------------------------------------------- */
.legal-page .page-content {
    max-width: 800px;
}

.legal-lead {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.legal-list {
    list-style: none;
    margin-bottom: var(--space-xl);
}

.legal-list li {
    padding: var(--space-md);
    border-left: 2px solid var(--cyan);
    margin-bottom: var(--space-sm);
    background: rgba(0, 212, 255, 0.05);
}

.legal-proof {
    padding: var(--space-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
}

.legal-proof h3 {
    font-family: var(--font-display);
    font-size: 16px;
    margin-bottom: var(--space-md);
}

.legal-proof code {
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.proof-live {
    margin-top: var(--space-md);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

/* Debug Output */
.debug-output {
    padding: var(--space-md);
    background: var(--bg-deep);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: pre-wrap;
    margin: var(--space-md) 0;
}

/* Admin Tables */
.admin-table-wrap {
    overflow-x: auto;
    margin-bottom: var(--space-xl);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: var(--space-sm);
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.admin-table th {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ---------------------------------------------
   MODALS
   --------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 
        opacity 300ms var(--ease-out-expo),
        visibility 0ms 300ms;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: 
        opacity 300ms var(--ease-out-expo),
        visibility 0ms;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transform: translateY(20px);
    transition: transform 300ms var(--ease-out-expo);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 20px;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Tutorial Modal */
.tutorial-content {
    max-width: 500px;
}

.tutorial-step {
    display: none;
    text-align: center;
    padding: var(--space-lg);
}

.tutorial-step.active {
    display: block;
}

.tuto-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.tutorial-step h3 {
    font-family: var(--font-display);
    font-size: 20px;
    margin-bottom: var(--space-sm);
}

.tutorial-step p {
    font-size: 14px;
    color: var(--text-secondary);
}

.tutorial-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
}

.tutorial-dots {
    display: flex;
    gap: var(--space-sm);
}

.tutorial-dots .dot {
    width: 8px;
    height: 8px;
    background: var(--text-dim);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tutorial-dots .dot.active {
    background: var(--cyan);
    transform: scale(1.2);
}

.tutorial-buttons {
    display: flex;
    gap: var(--space-md);
}

/* Auth Modal */
.auth-content {
    max-width: 400px;
}

.auth-step {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-step p {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-step input {
    padding: var(--space-md);
    background: var(--bg-deep);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-primary);
}

.auth-step input:focus {
    border-color: var(--cyan);
    outline: none;
}

.auth-status {
    font-size: 13px;
    min-height: 20px;
}

/* Game Over Modal */
.gameover-content {
    max-width: 400px;
    text-align: center;
}

.score-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.score-main .score-value {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    color: var(--cyan);
    text-shadow: var(--cyan-glow);
}

.score-divider {
    width: 1px;
    height: 60px;
    background: var(--glass-border);
}

.score-best .score-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
}

.score-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-item {
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.stat-key {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.stat-val {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.competition-result {
    padding: var(--space-lg);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* ---------------------------------------------
   LEGAL BANNER / FOOTER
   --------------------------------------------- */
.legal-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: 6px var(--space-md);
    padding-bottom: calc(6px + var(--safe-area-bottom));
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    font-size: 10px;
    z-index: 100;
}

/* Legal banner same on all devices (dock is always visible) */

.legal-text {
    color: var(--text-dim);
}

.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
}

.legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.legal-links a:hover {
    color: var(--cyan);
}

/* ---------------------------------------------
   UTILITY CLASSES
   --------------------------------------------- */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------
   RESPONSIVE ADJUSTMENTS
   --------------------------------------------- */
@media (max-width: 768px) {
    /* Hide top navbar on mobile */
    .navbar-top {
        display: none !important;
    }
    
    /* Adjust page padding */
    .page {
        padding-top: var(--space-md);
    }
    
    /* Hero adjustments */
    .hero {
        min-height: calc(100vh - var(--dock-height) - var(--safe-area-bottom));
        padding: var(--space-xl) var(--space-md);
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-primary,
    .cta-secondary {
        width: 100%;
        justify-content: center;
    }
    
    /* Game HUD mobile */
    .hud-card {
        padding: var(--space-xs) var(--space-sm);
        min-width: 50px;
    }
    
    .hud-value {
        font-size: 16px;
    }
    
    .hud-label {
        font-size: 8px;
    }
    
    /* Hide legal banner on game page */
    #game.active ~ .legal-banner {
        display: none;
    }
}

@media (max-width: 480px) {
    .formats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .score-display {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .score-divider {
        width: 60px;
        height: 1px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--space-lg) var(--space-md);
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .game-hud {
        padding: var(--space-xs) var(--space-md);
    }
}
