/* ════════════════════════════════════════════════════════════════════════════
   LUNAR UI v2 — Design System Layer
   Loaded AFTER style.css. Establishes one coherent visual language:
   • Neutral near-black surfaces, one accent (violet), restrained gradients
   • Sentence-case typography, tight headings, no shouty letter-spaced caps
   • Subtle 1px borders instead of neon glows
   • Mobile-first components (≤ 900px) with a native app feel
   ════════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens & Multi-Theme Engine (All 8 Themes Supported) ────────────── */
:root,
html[data-theme="dark"] {
  --bg-app: #08080c;
  --bg-sidebar: rgba(11, 11, 16, 0.9);
  --bg-card: #101016;
  --bg-card-hover: #15151d;
  --bg-input: #0d0d13;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text-main: #ededf2;
  --text-sub: #a1a1ad;
  --text-mute: #6e6e7a;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-cyan: #22d3ee;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --hero-grad: linear-gradient(120deg, #c4b5fd 0%, #a78bfa 45%, #818cf8 100%);
  --accent-glow: rgba(139, 92, 246, 0.22);
  --pill-active-bg: #ffffff;
  --pill-active-fg: #0a0a0f;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="cyberpunk"] {
  --bg-app: #0c0218;
  --bg-sidebar: rgba(18, 4, 36, 0.92);
  --bg-card: #16062c;
  --bg-card-hover: #210a40;
  --bg-input: #110422;
  --border: rgba(244, 63, 94, 0.26);
  --border-hover: rgba(6, 182, 212, 0.55);
  --text-main: #fdf2f8;
  --text-sub: #f9a8d4;
  --text-mute: #9d6b8c;
  --accent: #f43f5e;
  --accent-light: #fb7185;
  --accent-cyan: #06b6d4;
  --accent-grad: linear-gradient(135deg, #f43f5e 0%, #06b6d4 100%);
  --hero-grad: linear-gradient(120deg, #fb7185 0%, #f43f5e 45%, #22d3ee 100%);
  --accent-glow: rgba(244, 63, 94, 0.28);
  --pill-active-bg: #f43f5e;
  --pill-active-fg: #ffffff;
}

html[data-theme="sakura"] {
  --bg-app: #140510;
  --bg-sidebar: rgba(28, 8, 22, 0.92);
  --bg-card: #210a1a;
  --bg-card-hover: #2e1025;
  --bg-input: #190714;
  --border: rgba(244, 114, 182, 0.25);
  --border-hover: rgba(251, 113, 133, 0.5);
  --text-main: #fdf2f8;
  --text-sub: #fbcfe8;
  --text-mute: #a87693;
  --accent: #ec4899;
  --accent-light: #f472b6;
  --accent-cyan: #fda4af;
  --accent-grad: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  --hero-grad: linear-gradient(120deg, #f9a8d4 0%, #f472b6 50%, #fb7185 100%);
  --accent-glow: rgba(236, 72, 153, 0.26);
  --pill-active-bg: #ec4899;
  --pill-active-fg: #ffffff;
}

html[data-theme="emerald"] {
  --bg-app: #02120d;
  --bg-sidebar: rgba(4, 24, 18, 0.92);
  --bg-card: #062118;
  --bg-card-hover: #0a2e22;
  --bg-input: #041912;
  --border: rgba(16, 185, 129, 0.25);
  --border-hover: rgba(52, 211, 153, 0.5);
  --text-main: #ecfdf5;
  --text-sub: #a7f3d0;
  --text-mute: #5e9c84;
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-cyan: #06b6d4;
  --accent-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --hero-grad: linear-gradient(120deg, #6ee7b7 0%, #34d399 50%, #22d3ee 100%);
  --accent-glow: rgba(16, 185, 129, 0.26);
  --pill-active-bg: #10b981;
  --pill-active-fg: #02120d;
}

html[data-theme="solar"] {
  --bg-app: #140702;
  --bg-sidebar: rgba(28, 12, 4, 0.92);
  --bg-card: #221006;
  --bg-card-hover: #301709;
  --bg-input: #1a0b04;
  --border: rgba(249, 115, 22, 0.26);
  --border-hover: rgba(251, 146, 60, 0.5);
  --text-main: #fff7ed;
  --text-sub: #fed7aa;
  --text-mute: #a87b56;
  --accent: #f97316;
  --accent-light: #fb923c;
  --accent-cyan: #eab308;
  --accent-grad: linear-gradient(135deg, #f97316 0%, #eab308 100%);
  --hero-grad: linear-gradient(120deg, #fdba74 0%, #fb923c 45%, #facc15 100%);
  --accent-glow: rgba(249, 115, 22, 0.26);
  --pill-active-bg: #f97316;
  --pill-active-fg: #ffffff;
}

html[data-theme="amethyst"] {
  --bg-app: #0c031c;
  --bg-sidebar: rgba(18, 6, 38, 0.92);
  --bg-card: #160930;
  --bg-card-hover: #210e44;
  --bg-input: #110626;
  --border: rgba(168, 85, 247, 0.28);
  --border-hover: rgba(192, 132, 252, 0.55);
  --text-main: #faf5ff;
  --text-sub: #d8b4fe;
  --text-mute: #8e6fb3;
  --accent: #a855f7;
  --accent-light: #c084fc;
  --accent-cyan: #818cf8;
  --accent-grad: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  --hero-grad: linear-gradient(120deg, #e9d5ff 0%, #c084fc 45%, #818cf8 100%);
  --accent-glow: rgba(168, 85, 247, 0.28);
  --pill-active-bg: #a855f7;
  --pill-active-fg: #ffffff;
}

html[data-theme="glacial"] {
  --bg-app: #02101f;
  --bg-sidebar: rgba(4, 22, 42, 0.92);
  --bg-card: #071d36;
  --bg-card-hover: #0c294a;
  --bg-input: #041529;
  --border: rgba(56, 189, 248, 0.26);
  --border-hover: rgba(125, 211, 252, 0.55);
  --text-main: #f0f9ff;
  --text-sub: #bae6fd;
  --text-mute: #6495b8;
  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-cyan: #0284c7;
  --accent-grad: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
  --hero-grad: linear-gradient(120deg, #bae6fd 0%, #38bdf8 45%, #818cf8 100%);
  --accent-glow: rgba(56, 189, 248, 0.26);
  --pill-active-bg: #38bdf8;
  --pill-active-fg: #02101f;
}

html[data-theme="light"] {
  --bg-app: #f6f7fb;
  --bg-sidebar: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(124, 58, 237, 0.4);
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-mute: #64748b;
  --accent: #7c3aed;
  --accent-light: #6d28d9;
  --accent-cyan: #0891b2;
  --accent-grad: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --hero-grad: linear-gradient(120deg, #7c3aed 0%, #4f46e5 55%, #0891b2 100%);
  --accent-glow: rgba(124, 58, 237, 0.16);
  --pill-active-bg: #0f172a;
  --pill-active-fg: #ffffff;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
}

html,
html[data-theme] {
  --ui-surface: var(--bg-card);
  --ui-surface-2: var(--bg-card-hover);
  --ui-border: var(--border);
  --ui-border-strong: var(--border-hover);
  --ui-r-sm: 10px;
  --ui-r: 14px;
  --ui-r-lg: 20px;
  --ui-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ui-nav-h: 64px;
}

/* ── 2. Base ──────────────────────────────────────────────────────────────── */
html body {
  background: var(--bg-app) !important;
  color: var(--text-main) !important;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Calm the ambient background: one soft top glow using active theme's accent */
html body .bg-glow-container { opacity: 1; }
html body .bg-glow { animation: none !important; opacity: 0.12 !important; filter: blur(60px); }
html body .glow-2 { display: none; }
html body .falling-stars { display: none !important; }
html body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(60% 100% at 50% 0%, var(--accent-glow) 0%, transparent 70%);
}

html body ::selection { background: var(--accent); color: #fff; }

/* Typography */
html body h1, html body h2, html body h3, html body h4 { letter-spacing: -0.02em; }

html body .page-title {
  font-family: var(--font-h);
  font-weight: 700 !important;
  font-size: clamp(1.5rem, 4vw, 2rem) !important;
  letter-spacing: -0.025em !important;
  color: var(--text-main);
  line-height: 1.15 !important;
}
html body .page-sub {
  color: var(--text-sub) !important;
  font-size: 0.92rem !important;
  line-height: 1.5 !important;
}

/* Eyebrows / kickers: quiet, not neon */
html body .void-kicker-num,
html body .void-section-kicker,
html body .tfw-kicker,
html body .tgh-badge,
html body .asp-badge,
html body .portal-badge-pill,
html body .inventory-pill-badge {
  font-family: var(--font-b) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
  color: var(--accent-light) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  text-shadow: none !important;
}
html body .void-section-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
html body .void-section-kicker .kicker-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

html body .void-section-title {
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  color: var(--text-main) !important;
}
html body .void-section-subtitle { color: var(--text-sub) !important; }

/* Gradient text: uses active theme's hero gradient */
html body .void-gradient-text,
html body .accent-gradient,
html body .accent {
  background: var(--hero-grad, var(--accent-grad)) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* ── 3. Buttons ───────────────────────────────────────────────────────────── */
html body .void-btn,
html body .corner-btn,
html body .search-btn,
html body .portal-submit-btn,
html body .auth-submit-btn {
  font-family: var(--font-b) !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
  text-transform: none !important;
  border-radius: var(--ui-r-sm) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ui-ease), box-shadow 0.15s ease !important;
}
html body .void-btn:active,
html body .corner-btn:active { transform: scale(0.98) !important; }

html body .void-btn-primary,
html body .corner-btn.primary,
html body .portal-submit-btn.primary,
html body .auth-submit-btn {
  background: var(--accent) !important;
  background-image: var(--accent-grad) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 6px 20px -6px var(--accent-glow) !important;
}
html body .void-btn-primary:hover,
html body .corner-btn.primary:hover,
html body .portal-submit-btn.primary:hover { filter: brightness(1.08); transform: none !important; }
html body .void-btn-primary::after,
html body .portal-auth-card::before,
html body .standalone-auth-card::before { display: none !important; }

html body .void-btn-outline,
html body .void-btn-ghost,
html body .corner-btn.secondary,
html body .corner-btn:not(.primary) {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
}
html body .void-btn-outline:hover,
html body .void-btn-ghost:hover,
html body .corner-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: var(--ui-border-strong) !important;
  transform: none !important;
}

/* ── 4. Inputs ────────────────────────────────────────────────────────────── */
html body .search-input,
html body .portal-input,
html body .corner-input,
html body .corner-select,
html body .tycoon-text-input,
html body input[type="text"],
html body input[type="password"],
html body input[type="email"],
html body input[type="number"],
html body select {
  background: var(--bg-input) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-r-sm) !important;
  color: var(--text-main) !important;
  box-shadow: none !important;
  font-size: 16px; /* prevents iOS zoom on focus */
}
html body .search-input:focus,
html body .portal-input:focus,
html body .corner-input:focus,
html body input:focus,
html body select:focus {
  border-color: rgba(139, 92, 246, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18) !important;
  outline: none !important;
}

/* ── 5. Surfaces / Cards ──────────────────────────────────────────────────── */
html body .glass,
html body .lunar-bento-card,
html body .void-hero-container,
html body .void-stats-strip,
html body .auth-showcase-panel,
html body .portal-auth-card,
html body .tycoon-guest-hero,
html body .tycoon-founder-wrap,
html body .tycoon-exec-banner,
html body .tycoon-module-card,
html body .tycoon-kpi-card,
html body .corner-section,
html body .corner-login-card,
html body .pd-stat-card,
html body .pd-hero-card,
html body .req-card,
html body .cmd-card-item,
html body .bot-status-card,
html body .void-rules-list,
html body .lb-panel {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html body .lunar-bento-card:hover,
html body .req-card:hover,
html body .cmd-card-item:hover {
  border-color: var(--ui-border-strong) !important;
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow) !important;
}
html body .lbc-glow,
html body .asp-glow,
html body .tgh-glow,
html body .lunar-bento-card::before,
html body .vstat-item::before,
html body .pd-stat-card::before { display: none !important; }

/* Chips & tags */
html body .lbc-chip,
html body .badge-pill,
html body .vstat-badge,
html body .lbc-tag {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--text-sub) !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
}
html body .lbc-link { color: var(--accent-light) !important; font-weight: 600 !important; }

/* ── 6. Topbar ────────────────────────────────────────────────────────────── */
html body .topbar {
  background: var(--bg-sidebar) !important;
  backdrop-filter: saturate(160%) blur(16px) !important;
  -webkit-backdrop-filter: saturate(160%) blur(16px) !important;
  border-bottom: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
}
html body .theme-picker-popover {
  right: 0 !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--ui-border-strong) !important;
  box-shadow: var(--shadow) !important;
}
html body .brand-logo-aura { display: none !important; }
html body .topbar-brand-logo,
html body .sidebar-brand-logo { filter: none !important; }
html body .topbar-title {
  background: none !important;
  -webkit-text-fill-color: var(--text-main) !important;
  color: var(--text-main) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}
html body .hamburger,
html body .theme-toggle,
html body .music-toggle-btn {
  background: transparent !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
  border-radius: var(--ui-r-sm) !important;
}
html body .music-toggle-btn .mtb-eq i { background: var(--accent-light) !important; }
html body .topbar-auth-btn {
  font-weight: 600 !important;
  text-transform: none !important;
  border-radius: var(--ui-r-sm) !important;
  box-shadow: none !important;
}
html body .topbar-auth-btn.secondary {
  background: var(--pill-active-bg) !important;
  color: var(--pill-active-fg) !important;
  border: 1px solid var(--pill-active-bg) !important;
}
html body .topbar-auth-btn.primary {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--ui-border) !important;
}

/* Sidebar */
html body .sidebar { background: var(--bg-sidebar) !important; border-right: 1px solid var(--ui-border) !important; }
html body .nav-item { border-radius: var(--ui-r-sm) !important; color: var(--text-sub) !important; }
html body .nav-item:hover { background: rgba(255, 255, 255, 0.04) !important; color: var(--text-main) !important; }
html body .nav-item.active {
  background: var(--accent-glow) !important;
  color: var(--text-main) !important;
  box-shadow: none !important;
  border: none !important;
}
html body .nav-section-title { color: var(--text-mute) !important; letter-spacing: 0.06em !important; font-size: 0.68rem !important; }

/* ── 7. Home hero ─────────────────────────────────────────────────────────── */
html body .void-hero-container {
  background:
    radial-gradient(120% 80% at 50% -10%, var(--accent-glow) 0%, transparent 60%),
    var(--ui-surface) !important;
  border-radius: 24px !important;
  overflow: hidden;
}
html body .void-hero-backdrop .void-portal-ring,
html body .void-hero-backdrop .void-portal-glow,
html body .void-aurora-mesh { display: none !important; }
html body .void-hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 0%, transparent 100%);
  pointer-events: none;
}
html body .vhe-orbit { display: none !important; }
html body .vhe-img { filter: drop-shadow(0 8px 24px rgba(139, 92, 246, 0.35)) !important; }
html body .vhe-core { animation: none !important; }

html body .void-status-badge {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--text-sub) !important;
  font-family: var(--font-b) !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
}
html body .void-pulse-dot { background: #22c55e !important; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18) !important; }

html body .void-hero-title {
  font-weight: 800 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.05 !important;
  color: var(--text-main) !important;
  text-shadow: none !important;
}
html body .void-hero-desc { color: var(--text-sub) !important; }

html body .vh-pill {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--text-sub) !important;
  font-family: var(--font-b) !important;
  font-weight: 500 !important;
  backdrop-filter: none !important;
}
html body .vh-pill:hover { color: var(--text-main) !important; border-color: var(--ui-border-strong) !important; box-shadow: none !important; }

/* Ticker: quieter */
html body .void-ticker-wrap {
  border-top: 1px solid var(--ui-border) !important;
  border-bottom: 1px solid var(--ui-border) !important;
  background: transparent !important;
}
html body .void-ticker-track span { color: var(--text-mute) !important; font-weight: 600 !important; letter-spacing: 0.04em !important; }

/* Stats */
html body .vstat-item { text-align: left !important; }
html body .vstat-number {
  font-family: var(--font-h) !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: var(--text-main) !important;
  font-variant-numeric: tabular-nums;
}
html body .vstat-label {
  color: var(--text-mute) !important;
  font-family: var(--font-b) !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-size: 0.8rem !important;
}

/* Scroll-reveal: subtle, and never leaves content invisible */
html body .reveal-on-scroll {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ui-ease), transform 0.5s var(--ui-ease);
}
html body .reveal-on-scroll.is-visible { opacity: 1; transform: none; }
html body.intro-entered .reveal-on-scroll { animation: uiRevealFailsafe 0s 2.5s forwards; }
@keyframes uiRevealFailsafe { to { opacity: 1; transform: none; } }

/* Featured card carousel frames */
html body .void-card-frame {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-r) !important;
  box-shadow: none !important;
}
html body .vcf-tier-pill {
  background: rgba(139, 92, 246, 0.12) !important;
  color: var(--accent-light) !important;
  border: none !important;
  letter-spacing: 0.02em !important;
}
html body .carousel-arrow-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--text-main) !important;
  box-shadow: none !important;
}

/* Footer */
html body .lunar-footer { background: transparent !important; backdrop-filter: none !important; border-top: 1px solid var(--ui-border) !important; }
html body .lf-col-title { color: var(--text-mute) !important; letter-spacing: 0.06em !important; }
html body .lf-col a:hover { color: #fff !important; transform: none !important; }
html body .lf-logo-img { filter: none !important; }

/* ── 8. Tabs (leaderboard / cards / inventory / commands) — segmented pills ── */
html body .lb-tab,
html body .cards-tab,
html body .inv-tab,
html body .cmd-tab-btn,
html body .req-tab-btn,
html body .portal-tab {
  background: transparent !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--text-sub) !important;
  font-family: var(--font-b) !important;
  font-weight: 500 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
html body .lb-tab:hover,
html body .cards-tab:hover,
html body .inv-tab:hover,
html body .cmd-tab-btn:hover { color: var(--text-main) !important; border-color: var(--ui-border-strong) !important; background: rgba(255, 255, 255, 0.03) !important; }
html body .lb-tab.active,
html body .cards-tab.active,
html body .inv-tab.active,
html body .cmd-tab-btn.active,
html body .req-tab-btn.active,
html body .portal-tab.active {
  background: var(--pill-active-bg) !important;
  color: var(--pill-active-fg) !important;
  border-color: var(--pill-active-bg) !important;
  box-shadow: none !important;
}
html body .cards-tabs-row { border-bottom: none !important; }

/* ── 9. Leaderboard table ─────────────────────────────────────────────────── */
html body .lb-panel { border-radius: var(--ui-r) !important; overflow: hidden; }
html body .lb-table { border-collapse: collapse; width: 100%; }
html body .lb-table thead th {
  background: transparent !important;
  color: var(--text-mute) !important;
  font-family: var(--font-b) !important;
  font-weight: 500 !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  border-bottom: 1px solid var(--ui-border) !important;
}
html body .lb-table td { border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important; vertical-align: middle; }
html body .lb-table tbody tr:last-child td { border-bottom: none !important; }
html body .lb-row:hover { background: rgba(255, 255, 255, 0.025) !important; }
html body .lb-row-top-1,
html body .lb-row-top-2,
html body .lb-row-top-3 { background: transparent !important; }
html body .rank-badge {
  width: 26px !important; height: 26px !important;
  font-size: 0.78rem !important; font-weight: 700 !important;
  box-shadow: none !important; border: none !important;
}
html body .rank-1 { background: linear-gradient(180deg, #fde68a, #f59e0b) !important; color: #3b2600 !important; }
html body .rank-2 { background: linear-gradient(180deg, #f1f5f9, #94a3b8) !important; color: #1e293b !important; }
html body .rank-3 { background: linear-gradient(180deg, #fdba74, #c2410c) !important; color: #2a1000 !important; }
html body .rank-n { color: var(--text-mute) !important; font-variant-numeric: tabular-nums; }
html body .player-name-txt { font-weight: 600 !important; color: var(--text-main) !important; }
html body .player-mini-avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}
html body .avatar-container-has-media .avatar-fallback-ch {
  position: relative;
  z-index: 1;
  line-height: 1;
}
html body .avatar-container-has-media .avatar-media {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  z-index: 2 !important;
}

/* ── 10. Cards grid ───────────────────────────────────────────────────────── */
html body .card-item-box {
  background: var(--ui-surface) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-r) !important;
  box-shadow: none !important;
}
html body .card-item-box:hover {
  transform: translateY(-3px) !important;
  border-color: var(--ui-border-strong) !important;
  box-shadow: var(--shadow) !important;
}
html body .card-item-img-container {
  background: radial-gradient(80% 60% at 50% 40%, rgba(139, 92, 246, 0.07), transparent 70%), #0b0b10 !important;
}
html body .card-item-details {
  text-align: left !important;
  background: transparent !important;
  border-top: 1px solid var(--ui-border) !important;
  padding: 10px 12px 12px !important;
}
html body .card-item-name { font-family: var(--font-b) !important; font-weight: 600 !important; font-size: 0.88rem !important; }
html body .card-item-tier {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 500 !important;
  font-size: 0.75rem !important;
  color: var(--text-mute) !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html body .cards-total-label { color: var(--text-mute) !important; font-size: 0.82rem !important; font-weight: 500 !important; letter-spacing: 0 !important; }
html body .pagination-controls button,
html body .page-btn {
  background: transparent !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--text-sub) !important;
  border-radius: var(--ui-r-sm) !important;
  box-shadow: none !important;
}
html body .pagination-controls button.active,
html body .page-btn.active { background: var(--pill-active-bg) !important; color: var(--pill-active-fg) !important; border-color: var(--pill-active-bg) !important; }

/* ── 11. Modals ───────────────────────────────────────────────────────────── */
html body .modal { background: rgba(0, 0, 0, 0.7) !important; backdrop-filter: blur(6px) !important; }
html body .modal-box,
html body .card-modal-box,
html body .inv-modal-box,
html body .avatar-modal-box {
  background: var(--bg-card) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6) !important;
}

/* ── 12. Intro portal — calmer, crisper ───────────────────────────────────── */
html body .lunar-intro-overlay { background: #08080c !important; }
html body .lunar-intro-overlay::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 40% at 50% 40%, rgba(139, 92, 246, 0.16), transparent 70%);
}
html body .lio-hud-frame,
html body .lio-cells-row,
html body .lio-backdrop { display: none !important; }
html body .lio-kicker-pill { background: transparent !important; border: none !important; box-shadow: none !important; }
html body .lio-kicker { color: var(--text-mute) !important; letter-spacing: 0.14em !important; font-weight: 600 !important; }
html body .lkp-dot { background: #22c55e !important; box-shadow: none !important; }
html body .lio-core-logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 50px -10px rgba(139, 92, 246, 0.45) !important; border: none !important; }
html body .lio-ring-inner { border-color: rgba(255, 255, 255, 0.08) !important; background: none !important; }
html body .lio-progress-track { height: 3px !important; background: rgba(255, 255, 255, 0.08) !important; }
html body .lio-progress-fill { background: #a78bfa !important; box-shadow: none !important; }
html body .lio-status-txt { color: var(--text-mute) !important; font-weight: 500 !important; letter-spacing: 0.04em !important; }
html body .lio-enter-btn {
  background: #fff !important;
  color: #0a0a0f !important;
  border: none !important;
  letter-spacing: 0.02em !important;
  font-weight: 700 !important;
  text-transform: none !important;
  box-shadow: 0 10px 40px -10px rgba(167, 139, 250, 0.6) !important;
}
html body .lio-enter-btn::after,
html body .leb-glow,
html body .leb-icon { display: none !important; }
html body .lio-audio-hint { color: var(--text-mute) !important; }

/* Page transitions: subtler laser, no veil flash */
html body .page-transition-bar { height: 2px !important; background: #a78bfa !important; box-shadow: none !important; }
html body .page-transition-veil { display: none !important; }
html body .stagger-reveal-item { animation-duration: 0.35s !important; }

/* Tycoon guest hero */
html body .tycoon-guest-hero { text-align: left !important; }
html body .tgh-title { font-weight: 700 !important; letter-spacing: -0.03em !important; }
html body .tgh-desc { color: var(--text-sub) !important; margin-left: 0 !important; }
html body .tgh-paths-preview, html body .tgh-actions { justify-content: flex-start !important; }
html body .tgh-path-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--ui-border) !important;
}

/* Leaderboard column visibility (desktop shows all) */
.col-hide-m { }

/* ════════════════════════════════════════════════════════════════════════════
   13. MOBILE (≤ 900px) — native app feel
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  html body .page-inner,
  html body .home-page-inner { padding: 16px 16px 24px !important; }

  html body .page-title { font-size: 1.6rem !important; margin-bottom: 4px !important; }
  html body .page-sub { font-size: 0.88rem !important; margin-bottom: 16px !important; }

  /* Topbar */
  html body .topbar { height: 56px !important; padding: 0 12px !important; padding-top: env(safe-area-inset-top, 0px) !important; }
  html body .hamburger,
  html body .music-toggle-btn,
  html body .theme-toggle { width: 38px !important; height: 38px !important; padding: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }
  html body #app-refresh-btn { display: none !important; }
  html body .music-toggle-btn .mtb-label { display: none !important; }
  html body .topbar-logo-wrap { width: 30px !important; height: 30px !important; }
  html body .topbar-brand-logo { width: 30px !important; height: 30px !important; }
  html body .topbar-title { font-size: 1.05rem !important; }
  html body .topbar-auth-btn { height: 34px !important; padding: 0 14px !important; font-size: 0.82rem !important; }

  /* Hero: compact, left-aligned, content-first */
  html body .void-hero-container {
    padding: 28px 20px 22px !important;
    border-radius: 20px !important;
    margin-bottom: 20px !important;
    text-align: left !important;
  }
  html body .void-hero-content { align-items: flex-start !important; text-align: left !important; }
  html body .void-hero-emblem-wrap { display: none !important; }
  html body .void-status-badge { font-size: 0.75rem !important; padding: 5px 10px !important; margin-bottom: 14px !important; }
  html body .void-hero-title { font-size: 2.15rem !important; margin: 0 0 12px !important; text-align: left !important; }
  html body .void-hero-title br { display: none; }
  html body .void-hero-title .void-gradient-text { display: block; }
  html body .void-hero-desc {
    font-size: 0.94rem !important;
    line-height: 1.55 !important;
    text-align: left !important;
    margin: 0 0 20px !important;
    -webkit-line-clamp: 4 !important;
  }
  html body .void-hero-actions { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; width: 100% !important; }
  html body .void-hero-actions .void-btn { height: 46px !important; padding: 0 12px !important; font-size: 0.88rem !important; }
  html body .void-hero-actions .void-btn:first-child { grid-column: 1 / -1 !important; height: 50px !important; font-size: 0.95rem !important; }
  html body .void-hero-pills { display: none !important; }
  html body .void-ticker-wrap { display: none !important; }

  /* Stats: 2x2 clean tiles, no badges */
  html body .void-live-data-section { margin-bottom: 28px !important; }
  html body .void-stats-strip {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    gap: 10px !important;
  }
  html body .vstat-item {
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-r) !important;
    padding: 14px !important;
  }
  html body .vstat-item:hover { transform: none !important; }
  html body .vstat-top-row { margin-bottom: 8px !important; }
  html body .vstat-badge { display: none !important; }
  html body .vstat-icon { font-size: 1rem !important; opacity: 0.9; }
  html body .vstat-number { font-size: 1.5rem !important; line-height: 1.1 !important; }
  html body .vstat-label { font-size: 0.78rem !important; margin-top: 2px; }

  /* Section headers */
  html body .void-showcase-section { margin-bottom: 32px !important; }
  html body .void-section-title { font-size: 1.35rem !important; line-height: 1.2 !important; }
  html body .void-section-subtitle { font-size: 0.88rem !important; line-height: 1.5 !important; }
  html body .void-section-head-row { gap: 14px !important; }
  html body .void-carousel-actions { display: flex !important; gap: 8px !important; width: 100%; }
  html body .void-carousel-actions .carousel-nav-btns { display: none !important; }
  html body .void-carousel-actions .void-btn { flex: 1; height: 42px !important; font-size: 0.85rem !important; width: auto !important; }

  /* Horizontal card carousel with snap */
  html body .void-cards-carousel { scroll-snap-type: x mandatory; gap: 12px !important; padding-bottom: 4px; }
  html body .void-card-frame { scroll-snap-align: start; width: 150px !important; flex-shrink: 0; }

  /* Bento: tighter, image-led */
  html body .lunar-bento-card { padding: 16px !important; border-radius: var(--ui-r-lg) !important; }
  html body .lbc-media-banner,
  html body .lunar-bento-card.bento-span-2 .lbc-media-banner {
    width: calc(100% + 32px) !important;
    margin: -16px -16px 14px !important;
    height: 140px !important;
    border-bottom: 1px solid var(--ui-border) !important;
  }
  html body .lbc-media-banner::after { background: linear-gradient(180deg, transparent 50%, rgba(16, 16, 22, 0.9) 100%) !important; }
  html body .lbc-top { display: none !important; }
  html body .lbc-title { font-size: 1.1rem !important; font-weight: 700 !important; margin-bottom: 6px !important; }
  html body .lbc-desc { font-size: 0.86rem !important; color: var(--text-sub) !important; -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  html body .lbc-metrics-row { display: none !important; }
  html body .lbc-link { font-size: 0.86rem !important; margin-top: 10px !important; display: inline-block; }

  /* Tabs: one swipeable row */
  html body .lb-tabs,
  html body .cards-tabs-row,
  html body .inventory-tabs,
  html body .cmd-filter-tabs,
  html body .req-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px !important;
    margin: 0 -16px 16px !important;
    padding: 0 16px 2px !important;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  html body .lb-tabs::-webkit-scrollbar,
  html body .cards-tabs-row::-webkit-scrollbar,
  html body .inventory-tabs::-webkit-scrollbar { display: none; }
  html body .lb-tab,
  html body .cards-tab,
  html body .inv-tab,
  html body .cmd-tab-btn,
  html body .req-tab-btn {
    flex-shrink: 0 !important;
    height: 36px !important;
    padding: 0 14px !important;
    font-size: 0.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }

  /* Leaderboard: fits the screen, no horizontal scroll needed */
  html body .lb-panel { overflow-x: auto !important; margin: 0 !important; }
  html body .lb-table { min-width: 0 !important; font-size: 0.88rem !important; table-layout: auto; }
  html body .lb-table th,
  html body .lb-table td { padding: 12px 10px !important; }
  html body .lb-table th:first-child,
  html body .lb-table td:first-child { width: 40px; padding-left: 14px !important; padding-right: 4px !important; }
  html body .lb-table td:last-child,
  html body .lb-table th:last-child { padding-right: 14px !important; white-space: nowrap; }
  html body .col-hide-m { display: none !important; }
  html body .player-name-cell { gap: 10px !important; min-width: 0; }
  html body .player-mini-avatar { width: 32px !important; height: 32px !important; }
  html body .player-name-txt {
    display: -webkit-box !important;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    max-width: 52vw;
    font-size: 0.9rem !important;
  }
  html body .tycoon-lb-icon { width: 32px !important; height: 32px !important; font-size: 1rem !important; }

  /* Cards page */
  html body .cards-filters-bar { display: grid !important; grid-template-columns: 1fr 120px !important; gap: 8px !important; margin-bottom: 12px !important; }
  html body .cards-filters-bar .search-input { height: 44px !important; min-width: 0 !important; }
  html body .filter-select-wrap { display: block !important; }
  html body .filter-select-wrap label { display: none !important; }
  html body .filter-select-wrap select { height: 44px !important; width: 100% !important; padding: 0 10px !important; }
  html body .cards-pagination-bar:not(.bottom-bar) { flex-direction: row !important; justify-content: space-between !important; margin-bottom: 12px !important; }
  html body .cards-pagination-bar:not(.bottom-bar) .pagination-controls { display: none !important; }
  html body .cards-pagination-bar.bottom-bar { margin-top: 20px !important; }
  html body .pagination-controls button,
  html body .page-btn { min-width: 40px !important; height: 40px !important; }
  html body .cards-grid,
  html body .inv-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  html body .card-item-img-container { padding: 4px !important; }

  /* Auth: form first, marketing panel hidden on mobile */
  html body .auth-split-container { display: flex !important; flex-direction: column !important; gap: 16px !important; }
  html body .auth-form-panel { order: -1 !important; width: 100% !important; }
  html body .auth-showcase-panel { display: none !important; }
  html body .portal-auth-card { padding: 22px 18px !important; border-radius: var(--ui-r-lg) !important; }
  html body .portal-title { font-size: 1.6rem !important; font-weight: 700 !important; }
  html body .portal-subtitle { font-size: 0.88rem !important; color: var(--text-sub) !important; }
  html body .portal-tabs { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 6px !important; padding: 4px !important; background: rgba(255, 255, 255, 0.03) !important; border-radius: 12px !important; border: 1px solid var(--ui-border) !important; }
  html body .portal-tab { height: 38px !important; justify-content: center !important; font-size: 0.84rem !important; white-space: nowrap !important; border-radius: 9px !important; border: none !important; }
  html body .portal-input { height: 48px !important; padding: 0 44px 0 42px !important; }

  /* Tycoon */
  html body .tycoon-page-header { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; margin-bottom: 16px !important; }
  html body .tycoon-page-header .page-sub { -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  html body .tycoon-header-actions { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  html body .tycoon-header-actions .corner-btn { height: 42px !important; font-size: 0.85rem !important; justify-content: center; }
  html body .tycoon-wallet-pill { grid-column: 1 / -1; justify-content: center; }
  html body .tycoon-guest-hero { padding: 22px 18px !important; border-radius: var(--ui-r-lg) !important; }
  html body .tgh-title { font-size: 1.5rem !important; line-height: 1.15 !important; margin-bottom: 8px !important; }
  html body .tgh-desc { font-size: 0.9rem !important; line-height: 1.55 !important; margin-bottom: 18px !important; }
  html body .tgh-paths-preview { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; margin-bottom: 18px !important; }
  html body .tgh-path-card { min-width: 0 !important; padding: 14px !important; border-radius: var(--ui-r) !important; }
  html body .tgh-path-icon { font-size: 1.5rem !important; margin-bottom: 6px !important; }
  html body .tgh-path-name { font-size: 0.9rem !important; }
  html body .tgh-path-sub { font-size: 0.74rem !important; }
  html body .tgh-actions { display: grid !important; grid-template-columns: 1fr !important; gap: 8px !important; }
  html body .tgh-actions .void-btn { height: 46px !important; width: 100% !important; }
  html body .tycoon-founder-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  html body .tycoon-founder-wrap { padding: 18px !important; }

  /* Modals as bottom sheets */
  html body .modal { align-items: flex-end !important; }
  html body .modal.open .modal-box,
  html body .modal.open .card-modal-box,
  html body .modal.open .inv-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    animation: uiSheetUp 0.32s var(--ui-ease);
  }
  @keyframes uiSheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* Footer */
  html body .lunar-footer { padding: 32px 20px 24px !important; }

  /* ── Bottom navigation (SVG icons) ── */
  html body .mobile-bottom-nav {
    height: calc(var(--ui-nav-h) + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0 8px env(safe-area-inset-bottom, 0px) !important;
    background: var(--bg-sidebar) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
    border-top: 1px solid var(--ui-border) !important;
    box-shadow: none !important;
  }
  html body .mbn-item {
    height: var(--ui-nav-h);
    gap: 4px !important;
    padding: 0 !important;
    color: var(--text-mute) !important;
    background: transparent !important;
    border-radius: 0 !important;
  }
  html body .mbn-item::before { display: none !important; }
  html body .mbn-svg { width: 23px; height: 23px; transition: transform 0.2s var(--ui-ease), color 0.2s ease; }
  html body .mbn-label { font-family: var(--font-b) !important; font-size: 0.68rem !important; font-weight: 500 !important; letter-spacing: 0 !important; }
  html body .mbn-item.active { color: var(--text-main) !important; }
  html body .mbn-item.active .mbn-svg { color: var(--accent-light); transform: translateY(-1px); }
  html body .mbn-item.active .mbn-label { font-weight: 600 !important; }
  html body .mbn-item:active .mbn-svg { transform: scale(0.9); }
  html body .mbn-dot {
    position: absolute; top: 12px; left: calc(50% + 9px);
    width: 7px; height: 7px; border-radius: 50%;
    background: #f43f5e; box-shadow: 0 0 0 2px rgba(10, 10, 14, 0.9);
  }
  html body .main-wrapper { padding-bottom: calc(var(--ui-nav-h) + env(safe-area-inset-bottom, 0px) + 8px) !important; }

  /* Disable hover lifts on touch */
  html body .lunar-bento-card:hover,
  html body .card-item-box:hover,
  html body .req-card:hover,
  html body .cmd-card-item:hover { transform: none !important; box-shadow: none !important; }
}

@media (max-width: 380px) {
  html body .void-hero-title { font-size: 1.9rem !important; }
  html body .cards-filters-bar { grid-template-columns: 1fr 100px !important; }
}

@media (prefers-reduced-motion: reduce) {
  html body *, html body *::before, html body *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
