@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Design system ── */
:root {
  --surface:            #0d0d18;
  --surface-low:        #111120;
  --surface-mid:        #161628;
  --surface-high:       #1c1c34;
  --surface-bright:     rgba(255,255,255,0.06);

  /* Single accent: cyan. Purple/orange demoted to gradient-text only. */
  --primary:            #a1faff;
  --primary-alt:        #00f4fe;
  --primary-dim:        rgba(161,250,255,0.10);
  --primary-glow:       0 0 24px rgba(161,250,255,0.30);

  /* Reserved only for gradient-text and rare accents. */
  --secondary:          #ac8aff;
  --tertiary:           #ff8439;

  --green:  #22d3ee;
  --red:    #f43f5e;
  --gold:   #fbbf24;

  --text-primary:   #e8e8ff;
  --text-secondary: rgba(232,232,255,0.62);
  --text-muted:     rgba(232,232,255,0.38);

  --border:         rgba(161,250,255,0.10);
  --border-strong:  rgba(161,250,255,0.22);

  --font-head: 'Outfit', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  12px;
  --r-xl:  18px;

  --sidebar-w: 0px;
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
@media(max-width:1400px) { html { font-size: 15.5px; } }
@media(max-width:1100px) { html { font-size: 15px; } }
body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--surface);
  color: var(--text-primary);
  overflow-x: hidden; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-head); border: none; }
ul { list-style: none; }
h1,h2,h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem,5vw,4.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem,3.4vw,2.6rem); }
h3 { font-size: clamp(1.05rem,1.5vw,1.3rem); }
code { font-family: var(--font-mono); font-size: 0.85em; padding: 1px 5px; background: var(--surface-high); border-radius: var(--r-sm); }

/* ── Shell ── */
.app-shell { display: flex; min-height: 100vh; overflow-x: hidden; width: 100%; }
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; max-width: calc(100vw - var(--sidebar-w)); overflow-x: hidden; }

/* ── Top Nav Bar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; width: 100%;
  background: rgba(13,13,24,0.78); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar.scrolled { background: rgba(13,13,24,0.95); }
.topbar-logo {
  font-family: var(--font-head); font-weight: 800; font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.topbar-nav { display: flex; gap: 4px; }
.topbar-nav-link {
  padding: 7px 14px; border-radius: var(--r-sm);
  font-size: 0.875rem; font-weight: 500;
  font-family: var(--font-head); color: var(--text-secondary); transition: var(--transition);
}
.topbar-nav-link:hover { color: var(--text-primary); background: var(--surface-bright); }
.topbar-nav-link.active { color: var(--primary); background: var(--primary-dim); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.hud-av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,var(--primary),var(--secondary)); display:flex; align-items:center; justify-content:center; font-family:var(--font-head); font-weight:800; font-size:0.78rem; color:var(--surface); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--r-md);
  font-size: 0.9rem; font-weight: 600; font-family: var(--font-head);
  letter-spacing: -0.005em;
  transition: var(--transition); white-space: nowrap; position: relative;
}
.btn-primary {
  background: linear-gradient(135deg,var(--primary),var(--primary-alt));
  color: var(--surface);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--primary-glow); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--primary);
}
.btn-secondary:hover { background: var(--primary-dim); }
.btn-ghost { background: var(--surface-high); border: 1px solid var(--border); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text-primary); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 15px 32px; font-size: 1rem; }

/* ── Tags / labels ── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-sm);
  font-size: 0.7rem; font-weight: 600;
  font-family: var(--font-head);
}
.tag-cyan   { background: var(--primary-dim); color: var(--primary); border: 1px solid var(--border-strong); }
.tag-purple { background: rgba(172,138,255,0.12); color: var(--secondary); }
.tag-orange { background: rgba(255,132,57,0.10); color: var(--tertiary); }
.tag-gold   { background: rgba(251,191,36,0.10); color: var(--gold); }
.tag-red    { background: rgba(244,63,94,0.10); color: var(--red); }

/* ── Eyebrow label ── */
.sys-label {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.sys-label::before { content: ''; width: 18px; height: 1px; background: var(--primary); }

/* ── Gradient text — the only place purple/orange survive ── */
.gradient-text {
  background: linear-gradient(135deg,var(--primary) 0%,var(--secondary) 60%,var(--tertiary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── Layout utils ── */
.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; width: 100%; }
.section { padding: 84px 0; }
.section-alt { background: var(--surface-low); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.text-center { text-align: center; }
.section-lead { color: var(--text-secondary); max-width: 540px; margin: 14px auto 0; font-size: 1rem; line-height: 1.65; }

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ── Hero ── */
.hero { min-height: calc(100vh - 56px); display: flex; align-items: center; position: relative; overflow: hidden; padding: 60px 0; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.7; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; position: relative; z-index: 2; width: 100%; }
.hero-title { margin-bottom: 22px; }
.hero-sub { font-size: 1.05rem; color: var(--text-secondary); max-width: 500px; margin-bottom: 30px; line-height: 1.7; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-live-stat { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-muted); margin-bottom: 28px; display: inline-flex; align-items: center; gap: 8px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px var(--primary); animation: liveDot 1.8s ease-in-out infinite; }
@keyframes liveDot { 0%,100% { opacity: 0.5 } 50% { opacity: 1 } }
.hero-stats { display: flex; gap: 32px; padding: 18px 24px; background: var(--surface-high); border: 1px solid var(--border); border-radius: var(--r-lg); width: fit-content; }
.stat-val { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--primary); letter-spacing: -0.02em; }
.stat-label { font-family: var(--font-head); font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ── Product frame (replaces fake arena card) ── */
.hero-visual { display: flex; justify-content: flex-end; }
.product-frame {
  width: 100%; max-width: 560px;
  min-height: 360px;
  background: var(--surface-mid); border: 1px solid var(--border-strong);
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(161,250,255,0.04);
  position: relative;
}
.product-frame-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: var(--surface-high); border-bottom: 1px solid var(--border);
}
.pf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-bright); }
.pf-dot:nth-child(1) { background: rgba(244,63,94,0.5); }
.pf-dot:nth-child(2) { background: rgba(251,191,36,0.5); }
.pf-dot:nth-child(3) { background: rgba(34,211,238,0.5); }
.pf-url { margin-left: 14px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.product-video { display: block; width: 100%; min-height: 318px; aspect-ratio: 16 / 10; object-fit: contain; background: var(--surface-low); }
.product-video:not([poster]) + .product-fallback,
.product-video[src=""] + .product-fallback { display: flex; }
.product-fallback {
  position: absolute; inset: 41px 0 0 0;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px;
  background: linear-gradient(135deg, var(--surface-low), var(--surface-mid));
  pointer-events: none;
}
/* If no video file present, the <video> element will be empty/blank — show the fallback overlay always for now */
.product-frame:has(video:not([src])) .product-fallback,
.product-frame:has(video[poster]) .product-fallback { display: flex; opacity: 0.92; }
.pf-headline { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; color: var(--text-primary); }
.pf-sub { font-size: 0.85rem; color: var(--text-muted); max-width: 360px; line-height: 1.55; }

/* ── Mode Cards ── */
.mode-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.mode-card {
  background: var(--surface-low); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px;
  transition: var(--transition); position: relative; cursor: pointer;
}
.mode-card:hover { border-color: var(--border-strong); background: var(--surface-mid); transform: translateY(-3px); }
.mode-card-id { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin-bottom: 10px; }
.mode-card-icon { width: 28px; height: 28px; margin-bottom: 12px; color: var(--primary); }
.mode-card-icon svg { width: 100%; height: 100%; }
.mode-card-name { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.mode-card-desc { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.6; }
.mode-card-tag { position: absolute; top: 16px; right: 16px; }

.mode-card-soon { opacity: 0.55; cursor: default; pointer-events: none; }
.mode-card-featured { border-color: rgba(161,250,255,0.55); box-shadow: 0 0 0 1px rgba(161,250,255,0.3), 0 12px 32px rgba(161,250,255,0.08); }
.mode-card-featured:hover { border-color: rgba(161,250,255,0.8); }
.mode-card-coming-soon {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--primary-dim); border: 1px solid var(--border-strong);
  color: var(--primary); padding: 3px 8px; border-radius: var(--r-sm);
}

/* ── Steps ── */
.steps-row { display: flex; gap: 0; position: relative; }
.steps-row::before { content: ''; position: absolute; top: 36px; left: 12%; right: 12%; height: 1px; background: var(--border-strong); }
.step-item { flex: 1; text-align: center; position: relative; z-index: 1; }
.step-num {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600;
  background: var(--surface-mid); border: 1px solid var(--border-strong);
  color: var(--primary);
  transition: var(--transition);
}
.step-item:hover .step-num { transform: scale(1.06); border-color: var(--primary); }
.step-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.step-desc { font-size: 0.9rem; color: var(--text-secondary); max-width: 180px; margin: 0 auto; line-height: 1.6; }

/* ── Leaderboard ── */
.lb-wrap { background: var(--surface-low); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.lb-head { display: grid; grid-template-columns: 56px 1fr 120px 90px 70px; padding: 12px 24px; background: var(--surface-high); font-family: var(--font-head); font-size: 0.75rem; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.lb-row { display: grid; grid-template-columns: 56px 1fr 120px 90px 70px; padding: 14px 24px; align-items: center; border-bottom: 1px solid var(--border); transition: var(--transition); }
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--surface-high); }
.lb-row:nth-child(2) { background: rgba(251,191,36,0.04); border-left: 3px solid rgba(251,191,36,0.5); padding-left: 21px; }
.lb-row:nth-child(3) { background: rgba(192,192,192,0.03); border-left: 3px solid rgba(192,192,192,0.3); padding-left: 21px; }
.lb-row:nth-child(4) { background: rgba(205,127,50,0.03); border-left: 3px solid rgba(205,127,50,0.3); padding-left: 21px; }
.lb-rank { font-family: var(--font-mono); font-weight: 600; font-size: 0.92rem; }
.lb-rank.gold { color: var(--gold); } .lb-rank.silver { color: #c0c0c0; } .lb-rank.bronze { color: #cd7f32; }
.lb-player { display: flex; align-items: center; gap: 12px; }
.lb-av { width: 36px; height: 36px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 0.78rem; font-weight: 700; color: var(--surface); }
.lb-player-id { font-family: var(--font-head); font-size: 0.92rem; font-weight: 600; }
.lb-country { font-size: 0.74rem; color: var(--text-muted); font-family: var(--font-mono); }
.lb-elo { font-family: var(--font-mono); font-weight: 700; font-size: 0.92rem; color: var(--primary); }
.lb-wins { font-family: var(--font-mono); font-weight: 700; font-size: 0.88rem; color: var(--green); }
.lb-empty { padding: 48px 24px; text-align: center; font-family: var(--font-head); font-size: 0.95rem; color: var(--text-muted); }
.lb-empty-cta { display: inline-block; margin-top: 14px; }

/* ── Specs Grid ── */
.specs-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.spec-item { padding: 22px; background: var(--surface-low); border: 1px solid var(--border); border-radius: var(--r-md); transition: var(--transition); }
.spec-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.spec-icon { width: 22px; height: 22px; color: var(--primary); margin-bottom: 12px; }
.spec-icon svg { width: 100%; height: 100%; }
.spec-key { font-family: var(--font-head); font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.spec-val { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

/* ── Vanguard ── */
.vanguard-section { background: var(--surface-low); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.vanguard-note { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-top: 12px; }

/* ── Final CTA ── */
.final-cta { padding: 110px 0; text-align: center; border-bottom: 1px solid var(--border); }

/* ── Footer ── */
.footer { padding: 48px 0 24px; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-logo { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; color: var(--text-primary); }
.footer-desc { font-size: 0.88rem; color: var(--text-muted); margin: 10px 0 16px; max-width: 300px; line-height: 1.65; }
.footer-socials { display: flex; gap: 8px; }
.social-btn { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--surface-high); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: var(--transition); }
.social-btn:hover { border-color: var(--border-strong); color: var(--primary); }
.footer-col-label { font-family: var(--font-head); font-size: 0.78rem; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-lnk { font-size: 0.88rem; color: var(--text-secondary); transition: var(--transition); }
.footer-lnk:hover { color: var(--primary); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-muted); }
.footer-tag { color: var(--primary); font-family: var(--font-head); font-weight: 500; }

/* ── Toast ── */
.toast { position: fixed; bottom: 28px; right: 28px; background: var(--surface-high); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 14px 22px; font-size: 0.9rem; color: var(--text-primary); backdrop-filter: blur(16px); z-index: 9999; transform: translateY(60px); opacity: 0; transition: all 0.32s cubic-bezier(0.34,1.56,0.64,1); }
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Hero title animations ── */
.hl-1 { animation: slideInX 0.55s ease forwards; opacity: 0; transform: translateX(-30px); font-size: clamp(2.5rem,5.5vw,5rem); line-height: 1; margin-bottom: 4px; }
.hl-2 { animation: slideInX 0.55s ease 0.15s forwards; opacity: 0; transform: translateX(-30px); color: var(--text-secondary); font-size: clamp(2rem,4.4vw,4rem); line-height: 1; margin-bottom: 4px; }
.hl-3 { animation: slideInX 0.55s ease 0.3s forwards; opacity: 0; transform: translateX(-30px); font-size: clamp(2.5rem,5.5vw,5rem); line-height: 1; }
@keyframes slideInX { to { opacity: 1; transform: translateX(0); } }

/* ── Responsive ── */
@media(max-width:1280px) {
  .hero-inner { gap: 36px; }
  .mode-grid { grid-template-columns: repeat(3,1fr); gap: 14px; }
  .specs-grid { grid-template-columns: repeat(4,1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer-grid > *:last-child { display: none; }
}

@media(max-width:1080px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { justify-content: center; }
  .hero { padding: 36px 0 48px; min-height: unset; }
  .hero-sub { max-width: 100%; }
  .product-frame { max-width: 100%; }
}

@media(max-width:900px) {
  .mode-grid { grid-template-columns: repeat(2,1fr); }
  .specs-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .steps-row { flex-direction: column; gap: 24px; }
  .steps-row::before { display: none; }
  .lb-head,.lb-row { grid-template-columns: 44px 1fr 100px 70px; }
  .lb-head>*:nth-child(5),.lb-row>*:nth-child(5) { display: none; }
}

/* ── Hamburger + Mobile Nav ── */
.hamburger-btn {
  display: none; background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); padding: 6px 10px;
  border-radius: var(--r-sm); transition: var(--transition);
  align-items: center; justify-content: center;
}
.hamburger-btn:hover { border-color: var(--border-strong); color: var(--primary); }

.mobile-nav-drawer {
  display: none; flex-direction: column;
  background: rgba(13,13,24,0.97); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 99;
}
.mobile-nav-drawer.open { display: flex; }
.mobile-nav-link {
  padding: 16px 24px; font-family: var(--font-head); font-size: 0.95rem;
  font-weight: 500; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); transition: var(--transition);
}
.mobile-nav-link:hover { color: var(--primary); background: var(--primary-dim); }
.mobile-nav-cta { color: var(--primary); font-weight: 700; }

@media(max-width:768px) {
  .main-content { margin-left: 0; max-width: 100vw; }
  .topbar-nav { display: none; }
  .hamburger-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .hero { padding: 24px 0 32px; align-items: flex-start; }
  .hero-stats { gap: 20px; padding: 14px 18px; width: 100%; }
  .mode-grid { grid-template-columns: 1fr; }
  .specs-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .lb-head,.lb-row { grid-template-columns: 40px 1fr 80px; }
  .lb-head>*:nth-child(n+4),.lb-row>*:nth-child(n+4) { display: none; }
  .section { padding: 60px 0; }
  .container { padding: 0 18px; }
  .final-cta { padding: 70px 0; }
}

@media(max-width:480px) {
  .specs-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; }
  .btn-lg { width: 100%; justify-content: center; }
  .hero-stats { flex-direction: column; gap: 14px; align-items: flex-start; }
}

/* ── Auth Modal ── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: authFadeIn 0.28s ease;
}
.auth-overlay.hidden { display: none; }
@keyframes authFadeIn { from { opacity:0; transform:scale(0.97); } to { opacity:1; transform:scale(1); } }

.auth-modal {
  background: var(--surface-mid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 36px 36px 28px;
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 18px;
}
.auth-logo {
  font-family: var(--font-head); font-weight: 800; font-size: 1.6rem;
  text-align: center;
  color: var(--text-primary); letter-spacing: -0.02em;
}
.auth-sys {
  font-size: 0.85rem; color: var(--text-secondary);
  text-align: center; margin-top: -10px;
}
.auth-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-low); border-radius: var(--r-md);
}
.auth-tab {
  flex: 1; padding: 9px; font-family: var(--font-head);
  font-size: 0.88rem; font-weight: 600;
  background: transparent; color: var(--text-muted);
  border: none; border-radius: var(--r-sm);
  transition: var(--transition); cursor: pointer;
}
.auth-tab.active { background: var(--surface-high); color: var(--primary); }
.auth-tab:hover:not(.active) { color: var(--text-primary); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form.hidden { display: none; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.auth-input {
  background: var(--surface-low); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 14px;
  font-family: var(--font-body); font-size: 0.92rem; color: var(--text-primary);
  outline: none; transition: var(--transition);
}
.auth-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(161,250,255,0.10); }
.auth-input::placeholder { color: var(--text-muted); }
.auth-error {
  font-size: 0.82rem; color: var(--red);
  min-height: 18px;
  animation: errorShake 0.3s ease;
}
@keyframes errorShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.auth-submit {
  padding: 13px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-alt));
  color: var(--surface); font-family: var(--font-head); font-weight: 700;
  font-size: 0.95rem; transition: var(--transition); border: none;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--primary-glow); }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-guest {
  text-align: center; font-size: 0.85rem;
  color: var(--text-muted); cursor: pointer;
  transition: color 0.2s;
}
.auth-guest:hover { color: var(--primary); }

/* ── Profile Panel ── */
.profile-panel {
  position: fixed; top: 0; right: -380px; width: 360px; height: 100vh;
  background: var(--surface-mid); border-left: 1px solid var(--border-strong);
  z-index: 5000; transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
.profile-panel.open { right: 0; }
.profile-backdrop {
  position: fixed; inset: 0; z-index: 4990;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: none;
}
.profile-backdrop.active { display: block; }

.pp-header {
  display: flex; align-items: center; gap: 14px; padding: 24px 22px 18px;
  border-bottom: 1px solid var(--border);
}
.pp-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; color: var(--surface);
}
.pp-info { flex: 1; }
.pp-name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.pp-rank { font-size: 0.82rem; color: var(--primary); font-weight: 500; margin-bottom: 2px; }
.pp-country { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.pp-close {
  background: transparent; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-muted); font-size: 0.85rem; padding: 4px 8px; cursor: pointer;
  transition: var(--transition);
}
.pp-close:hover { border-color: var(--red); color: var(--red); }

.pp-xp-row {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.pp-xp-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.pp-xp-track {
  height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden;
}
.pp-xp-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-alt));
  transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
}
.pp-xp-val { font-family: var(--font-mono); font-size: 0.78rem; color: var(--primary); font-weight: 600; }

.pp-stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  border-bottom: 1px solid var(--border);
}
.pp-stat {
  padding: 16px 10px; text-align: center; border-right: 1px solid var(--border);
}
.pp-stat:last-child { border-right: none; }
.pp-stat-val { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: var(--primary); margin-bottom: 4px; }
.pp-stat-key { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.pp-history-hdr {
  padding: 14px 22px 8px; font-family: var(--font-head); font-size: 0.78rem;
  color: var(--text-muted); font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.pp-history-list { padding: 8px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }

.pp-hist-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: var(--r-sm); font-size: 0.82rem;
  border: 1px solid transparent;
}
.pp-hist-win  { background: rgba(34,211,238,0.06); border-color: rgba(34,211,238,0.12); }
.pp-hist-loss { background: rgba(244,63,94,0.06);  border-color: rgba(244,63,94,0.12); }
.pp-hist-draw { background: rgba(251,191,36,0.06); border-color: rgba(251,191,36,0.12); }
.ph-result { font-weight: 700; min-width: 36px; }
.pp-hist-win  .ph-result { color: var(--green); }
.pp-hist-loss .ph-result { color: var(--red); }
.pp-hist-draw .ph-result { color: var(--gold); }
.ph-opp  { color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-elo  { font-family: var(--font-mono); font-weight: 700; min-width: 52px; text-align: right; }
.ph-sub  { color: var(--text-muted); font-size: 0.7rem; min-width: 40px; text-align: right; }
.pp-hist-win  .ph-elo { color: var(--green); }
.pp-hist-loss .ph-elo { color: var(--red); }
.pp-hist-draw .ph-elo { color: var(--gold); }

.pp-actions {
  padding: 18px 22px; border-top: 1px solid var(--border); margin-top: auto;
}
.pp-btn-logout {
  width: 100%; padding: 11px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid rgba(244,63,94,0.25);
  color: var(--red); font-family: var(--font-head); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
}
.pp-btn-logout:hover { background: rgba(244,63,94,0.08); border-color: var(--red); }

/* Mobile polish */
@media (max-width: 768px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .app-shell,
  .main-content,
  .topbar,
  .container,
  .hero-inner {
    max-width: 100%;
    min-width: 0;
  }

  .container {
    width: auto;
    margin-inline: 0;
    padding-inline: 18px;
  }

  .section {
    padding: 48px 0;
  }

  .section-lead {
    width: calc(100vw - 36px);
    max-width: 34rem;
    padding: 0 4px;
    font-size: 0.95rem;
    line-height: 1.72;
  }

  .hero {
    padding: 18px 0 26px;
  }

  .hero-inner {
    gap: 24px;
  }

  .hero-title {
    margin-bottom: 16px;
  }

  .hl-1, .hl-3 {
    animation: none; opacity: 1; transform: none;
    font-size: clamp(2rem, 9vw, 3.4rem);
    word-break: break-word; overflow-wrap: anywhere;
  }
  .hl-2 {
    animation: none; opacity: 1; transform: none;
    font-size: clamp(1.7rem, 7.5vw, 2.8rem);
  }
  .hero-sub {
    width: calc(100vw - 36px);
    font-size: 0.98rem;
    line-height: 1.62;
    margin-bottom: 20px;
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .hero-ctas {
    width: calc(100vw - 36px);
    max-width: 100%;
    margin: 0 0 18px;
    padding: 4px 2px;
    overflow: visible;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-live-stat {
    margin-bottom: 14px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc(100vw - 36px);
    max-width: 100%;
    gap: 8px;
    padding: 10px;
    align-items: stretch;
  }

  .hero-stats > div {
    min-width: 0;
    padding: 10px 8px;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(161,250,255,0.08);
  }

  .stat-val {
    font-size: 1.15rem;
    line-height: 1;
  }

  .stat-label {
    font-size: 0.62rem;
    line-height: 1.25;
  }

  .hero-visual {
    display: none;
  }

  .product-frame {
    max-width: none;
    border-radius: var(--r-lg);
  }

  .product-frame-bar {
    padding: 8px 10px;
  }

  .product-video {
    aspect-ratio: 16 / 8.6;
    max-height: 260px;
  }

  .product-fallback {
    inset: 34px 0 0 0;
    padding: 18px;
  }

  .pf-headline {
    font-size: 0.95rem;
  }

  .pf-sub {
    font-size: 0.72rem;
    max-width: 280px;
  }

  .mode-grid {
    gap: 12px;
  }

  .mode-card {
    padding: 16px;
    min-height: auto;
  }

  .mode-card-id {
    margin-bottom: 12px;
  }

  .mode-card-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 10px;
  }

  .mode-card-name {
    font-size: 1.02rem;
  }

  .mode-card-desc {
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .mode-card-tag {
    top: 14px;
    right: 14px;
  }

  .mode-card-coming-soon {
    top: 14px;
    left: 14px;
    right: auto;
    max-width: calc(100% - 90px);
  }

  .mode-card-soon .mode-card-id {
    padding-top: 22px;
  }

  .steps-row {
    flex-direction: column;
    gap: 12px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .steps-row::before {
    display: block;
    top: 24px;
    bottom: 24px;
    left: 50%;
    right: auto;
    width: 1px;
    height: auto;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(161,250,255,0.28), rgba(161,250,255,0.04));
  }

  .step-item {
    background: var(--surface-low); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 18px 16px;
  }

  .step-num {
    width: 58px;
    height: 58px;
    margin-bottom: 12px;
    font-size: 0.95rem;
  }

  .step-title {
    margin-bottom: 6px;
  }

  .step-desc {
    max-width: 19rem;
    font-size: 0.86rem;
  }

  .lb-wrap { background: transparent; border: none; }
  .lb-head { display: none; }
  .lb-row {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    grid-template-areas: "rank player" "tier tier" "elo wins";
    gap: 12px 14px; padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface-low);
  }
  .lb-row > *:nth-child(1) { grid-area: rank; align-self: center; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: var(--r-md); background: rgba(255,255,255,0.03); }
  .lb-row > *:nth-child(2) { grid-area: player; }
  .lb-row > *:nth-child(3) { grid-area: tier; }
  .lb-row > *:nth-child(4) { grid-area: elo; }
  .lb-row > *:nth-child(5) { grid-area: wins; }
  .lb-row > *:nth-child(4), .lb-row > *:nth-child(5) {
    display: flex; flex-direction: column; gap: 4px;
    padding: 10px 12px; border-radius: var(--r-md);
    background: rgba(255,255,255,0.03);
  }
  .lb-row > *:nth-child(4)::before, .lb-row > *:nth-child(5)::before {
    font-family: var(--font-head); font-size: 0.68rem; color: var(--text-muted); font-weight: 500;
  }
  .lb-row > *:nth-child(4)::before { content: 'ELO'; }
  .lb-row > *:nth-child(5)::before { content: 'Wins'; }

  .footer-desc { max-width: none; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .topbar,
  .container {
    max-width: 390px;
  }

  .hero-sub,
  .section-lead,
  .hero-ctas,
  .hero-stats {
    width: min(100%, 354px);
    max-width: 354px;
  }

  .hero {
    padding-top: 14px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
  }

  .hero-stats > div {
    padding: 9px 6px;
  }

  .stat-val {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.56rem;
  }

  .mode-card {
    padding: 15px;
  }

  .product-video {
    max-height: 220px;
  }
}

/* ── Landing Daily Brawl modal ─────────────────────────────────────────────── */
.lb-overlay { position:fixed; inset:0; z-index:9000; display:none; align-items:center; justify-content:center; background:rgba(8,8,18,0.94); backdrop-filter:blur(18px); padding:16px; }
.lb-overlay.active { display:flex; animation:lbFade 0.24s ease; }
@keyframes lbFade { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
.lb-modal { width:100%; max-width:540px; max-height:calc(100vh - 32px); background:rgba(14,14,28,0.98); border:1px solid rgba(161,250,255,0.18); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; }
.lb-hdr { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1px solid rgba(255,255,255,0.06); }
.lb-hdr-text { font-family:monospace; font-size:0.68rem; color:#a1faff; letter-spacing:0.14em; }
.lb-close { background:none; border:1px solid rgba(255,255,255,0.12); border-radius:5px; color:#9ca3af; padding:4px 9px; cursor:pointer; font-size:0.85rem; }
.lb-close:hover { color:#fff; border-color:rgba(255,255,255,0.3); }
.lb-content { padding:20px; flex:1; overflow-y:auto; }
.lb-loading { font-family:monospace; font-size:0.7rem; color:#9ca3af; text-align:center; padding:40px 0; }
.lb-meta { display:flex; gap:8px; margin-bottom:8px; }
.lb-subject { font-family:monospace; font-size:0.62rem; color:#9ca3af; letter-spacing:0.1em; }
.lb-diff { font-family:monospace; font-size:0.58rem; padding:2px 7px; border-radius:2px; background:rgba(161,250,255,0.08); border:1px solid rgba(161,250,255,0.15); color:#a1faff; }
.lb-q-text { font-size:1.02rem; color:#e8e8f0; line-height:1.55; margin-bottom:14px; }
.lb-timer-row { display:flex; gap:8px; align-items:center; margin-bottom:12px; font-family:monospace; }
.lb-timer-label { font-size:0.6rem; color:#9ca3af; }
.lb-timer-val { font-size:0.85rem; color:#a1faff; font-weight:700; }
.lb-answers-grid { display:grid; gap:8px; }
.lb-answer { display:block; width:100%; padding:12px 14px; text-align:left; background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:8px; color:#e8e8f0; font-size:0.92rem; cursor:pointer; transition:all 0.15s ease; font-family:inherit; }
.lb-answer:hover:not(:disabled) { border-color:rgba(161,250,255,0.4); background:rgba(161,250,255,0.05); }
.lb-answer:disabled { cursor:default; opacity:0.7; }
.lb-answer.correct { background:rgba(34,197,94,0.15); border-color:#22c55e; color:#22c55e; }
.lb-answer.wrong { background:rgba(244,63,94,0.15); border-color:#f43f5e; color:#f43f5e; }
.lb-foot-note { margin-top:12px; font-family:monospace; font-size:0.62rem; color:#6b7280; text-align:center; }
.lb-leaderboard { margin-top:20px; padding-top:16px; border-top:1px solid rgba(255,255,255,0.06); }
.lb-lb-hdr { font-family:monospace; font-size:0.6rem; color:#9ca3af; letter-spacing:0.12em; margin-bottom:8px; }
.lb-lb-row { display:flex; gap:10px; padding:6px 0; font-family:monospace; font-size:0.74rem; }
.lb-lb-rank { color:#6b7280; width:30px; }
.lb-lb-name { flex:1; color:#e8e8f0; }
.lb-lb-score { color:#a1faff; font-weight:700; }
.lb-result { text-align:center; padding:12px 0; }
.lb-verdict { font-size:1.5rem; font-weight:800; margin-bottom:14px; letter-spacing:0.04em; }
.lb-verdict.win { color:#22c55e; }
.lb-verdict.loss { color:#f43f5e; }
.lb-score-big { font-size:4rem; font-weight:900; color:#a1faff; line-height:1; margin-bottom:4px; }
.lb-score-denom { font-size:1.5rem; color:#6b7280; font-weight:500; }
.lb-score-bar { font-family:monospace; font-size:1.2rem; letter-spacing:0.1em; color:#a1faff; margin-bottom:10px; }
.lb-solve-time { font-family:monospace; font-size:0.85rem; color:#9ca3af; margin-bottom:18px; }
.lb-cta-primary { display:inline-block; padding:12px 22px; background:#a1faff; color:#0a0a14; border:none; border-radius:8px; font-weight:800; font-size:0.92rem; cursor:pointer; text-decoration:none; margin-bottom:8px; transition:transform 0.15s ease; }
.lb-cta-primary:hover { transform:translateY(-2px); }
.lb-cta-secondary { display:block; width:100%; max-width:280px; margin:6px auto 0; padding:10px 18px; background:transparent; color:#a1faff; border:1px solid rgba(161,250,255,0.3); border-radius:8px; font-weight:600; font-size:0.82rem; cursor:pointer; transition:all 0.15s ease; font-family:inherit; }
.lb-cta-secondary:hover { background:rgba(161,250,255,0.06); border-color:rgba(161,250,255,0.6); }
.lb-next-label { margin-top:18px; font-family:monospace; font-size:0.6rem; color:#6b7280; }

/* ── Skeleton loaders ────────────────────────────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.35 }
  50%       { opacity: 0.7 }
}

.skeleton {
  background: var(--surface-high);
  border-radius: var(--r-md);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-text        { height: 13px; width: 100%; }
.skeleton-text.sm     { width: 55%; }
.skeleton-text.lg     { height: 18px; }
.skeleton-avatar      { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.skeleton-row         { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.skeleton-row:last-child { border-bottom: none; }
.skeleton-col         { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.skeleton-lb          { display: flex; flex-direction: column; }

/* ── prefers-reduced-motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* P1: hide non-P1 features during the retention test. Driven by flags.js / .p1-mode. */
.p1-mode .p1-hide { display: none !important; }

/* ── OAuth buttons (landing-page auth modal) ─────────────────────────────────── */
.oauth-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 16px; border-radius: 10px; text-decoration: none;
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.3px; cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
  border: 1px solid transparent;
}
.oauth-btn:hover  { transform: translateY(-1px); opacity: 0.95; }
.oauth-btn:active { transform: translateY(0); }
.oauth-google { background: #ffffff; color: #1f1f1f; border-color: #dadce0; }
.oauth-icon { font-weight: 800; font-size: 1.1rem; }
.oauth-divider {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
  color: var(--text-muted, #6b7280); font-family: var(--font-mono, monospace); font-size: 0.65rem;
}
.oauth-divider::before, .oauth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border, rgba(255,255,255,0.1));
}
