/* ============================================================================
   PuzzleSuite marketing site — shared styles.

   Mirrors the app's actual visual identity (see PuzzleSuite/src/theme):
     · Tailwind "stone" palette — warm off-white #fafaf9 → near-black #1c1917
     · Playfair Display serif for display/headings + system sans for utility
     · Deliberately SHARP 2px corners (the app's editorial "sharp everywhere")
     · Monochrome chrome; colour comes only from the per-game accent tiles
     · Ornate hairline rule dividers
   Light by default, with a dark scheme that maps to the app's dark theme.
   ========================================================================== */

:root {
  /* Stone scale (matches src/theme/stone.js) */
  --stone-50:  #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;

  /* Semantic (light theme = lightTheme.js) */
  --bg: var(--stone-50);
  --surface: #ffffff;
  --elevated: var(--stone-100);
  --ink: var(--stone-900);
  --ink-2: var(--stone-600);
  --muted: var(--stone-500);
  --border: var(--stone-200);
  --border-strong: var(--stone-900);
  --rule: rgba(28, 25, 23, 0.10);
  --cta-bg: var(--stone-900);
  --cta-text: var(--stone-50);

  /* Functional accents (src/theme/stone.js → accent) */
  --orange: #f97316;
  --emerald: #059669;
  --blue: #2563eb;
  --purple: #7c3aed;
  --rose: #e11d48;
  --amber: #d97706;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;

  --r-sharp: 2px;   /* CTAs, chips, glyphs — the editorial default */
  --r-card: 8px;    /* cards / surfaces */
  --r-pill: 999px;

  --max: 1140px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow: 0 24px 48px -28px rgba(28, 25, 23, 0.40);
  --shadow-lift: 0 30px 60px -30px rgba(28, 25, 23, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* darkTheme.js */
    --bg: var(--stone-900);
    --surface: var(--stone-800);
    --elevated: var(--stone-700);
    --ink: var(--stone-50);
    --ink-2: var(--stone-300);
    --muted: var(--stone-400);
    --border: var(--stone-600);
    --border-strong: var(--stone-50);
    --rule: rgba(250, 250, 249, 0.12);
    --cta-bg: var(--stone-50);
    --cta-text: var(--stone-900);
    --shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.65);
    --shadow-lift: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
  }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Guard against horizontal overflow WITHOUT turning <body> into a scroll
     container. `overflow-x: hidden` would compute overflow-y to `auto`, making
     <body> the scroller — which breaks the sticky header (it would scroll away
     instead of pinning to the viewport). `overflow-x: clip` clips without
     establishing a scroll container, so the window stays the scroller and the
     header stays fixed at the top. `hidden` is kept first as a fallback for the
     rare engine without `clip` support. */
  overflow-x: hidden;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Serif display headings */
h1, h2, h3, .serif { font-family: var(--serif); }

/* ---------- Ornate rule (matches OrnateRule.jsx) ---------- */
.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  color: var(--rule);
}
.rule::before, .rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: currentColor;
}
.rule .diamond {
  width: 7px; height: 7px;
  transform: rotate(45deg);
  border: 1px solid var(--border-strong);
  opacity: 0.35;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand .logo {
  width: 34px; height: 34px;
  border-radius: var(--r-sharp);
  flex: none;
  display: block;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fafaf9; /* matches the icon's own canvas so the badge reads cleanly in dark mode */
}
.nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  position: relative;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14.5px;
  padding: 8px 13px;
  border-radius: var(--r-sharp);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--ink); background: var(--elevated); }
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px; bottom: 2px;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
}
.nav .btn { margin-left: 8px; }

/* Hamburger toggle — hidden on desktop, shown below the nav breakpoint */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sharp);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-toggle:hover { border-color: var(--border-strong); }
.nav-toggle .bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.18s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  padding: 12px 20px;
  border-radius: var(--r-sharp);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease,
    background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.btn-primary {
  background: var(--cta-bg);
  color: var(--cta-text);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }
.nav .btn { padding: 9px 16px; }

/* ---------- Eyebrow / pill label ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px 14px;
  border-radius: var(--r-pill);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 56px;
  padding: 88px 0 64px;
}
.hero-copy { max-width: 36rem; }
.hero h1 {
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 22px 0 20px;
}
.hero h1 .accent { color: var(--orange); font-style: italic; }
.hero p.lead {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-2);
  max-width: 38ch;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-note .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

/* Hero tile mosaic — echoes the app's home game grid */
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  perspective: 1000px;
}
.mosaic .m-tile {
  aspect-ratio: 1;
  border-radius: var(--r-card);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 30px);
  color: #fff;
  background: var(--a, var(--ink));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.mosaic .m-tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(150deg, rgba(255,255,255,0.22), transparent 55%);
}
.mosaic .m-tile.muted {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
  font-family: var(--sans);
  font-size: 22px;
}

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}
.stat { padding: 26px 18px; text-align: center; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat .num {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat .label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-top: 10px;
}

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { max-width: 60ch; margin: 0 auto 48px; text-align: center; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: -0.02em;
  font-weight: 800;
  line-height: 1.08;
}
.section-head p { color: var(--ink-2); margin-top: 14px; font-size: 17px; }

/* ---------- Feature grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card .ico {
  width: 44px; height: 44px;
  border-radius: var(--r-sharp);
  display: grid; place-items: center;
  font-size: 20px;
  background: var(--ink);
  color: var(--bg);
  margin-bottom: 18px;
}
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.card p { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.card a.inline { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }

/* ---------- Game showcase ---------- */
.cat { margin-bottom: 56px; }
.cat:last-child { margin-bottom: 0; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cat-head h3 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; letter-spacing: -0.01em; }
.cat-head .cat-meta { font-size: 13px; color: var(--ink-2); max-width: 46ch; }
.cat-head .count {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px 11px; white-space: nowrap;
}

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tile:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.tile .glyph {
  flex: none;
  width: 46px; height: 46px;
  border-radius: var(--r-sharp);
  background: var(--a, var(--ink));
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 23px;
  box-shadow: inset 0 0 0 100px rgba(0,0,0,0); /* keeps paint crisp */
}
.tile .meta { min-width: 0; }
.tile .meta .name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.tile .meta .tag { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }

/* ---------- Multiplayer highlight band ---------- */
.band {
  background: var(--ink);
  color: var(--stone-50);
  border-radius: var(--r-card);
  padding: 56px 48px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (prefers-color-scheme: dark) {
  .band { background: var(--stone-800); border: 1px solid var(--border); }
}
.band .eyebrow { color: var(--stone-300); background: transparent; border-color: rgba(250,250,249,0.25); }
.band .eyebrow .dot { background: var(--orange); }
.band h2 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; margin: 18px 0 16px; color: #fff; }
.band p { color: var(--stone-300); font-size: 16px; max-width: 44ch; }
.band .modes { display: grid; gap: 12px; }
.band .mode {
  border: 1px solid rgba(250,250,249,0.18);
  border-radius: var(--r-card);
  padding: 16px 18px;
  background: rgba(250,250,249,0.04);
}
.band .mode .m-name { font-family: var(--serif); font-weight: 700; font-size: 17px; color: #fff; }
.band .mode .m-desc { color: var(--stone-400); font-size: 13.5px; margin-top: 4px; }

/* ---------- CTA band ---------- */
.cta {
  text-align: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  padding: 64px 28px;
  background: var(--surface);
}
.cta h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.02em; font-weight: 800; }
.cta p { color: var(--ink-2); margin: 14px auto 28px; max-width: 48ch; font-size: 17px; }
.cta .hero-actions { justify-content: center; }

/* ---------- Content / legal pages ---------- */
.page { max-width: 820px; margin: 0 auto; padding: 72px 24px 24px; }
.page .eyebrow { margin-bottom: 18px; }
.page h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.02em; font-weight: 800; margin-bottom: 12px; }
.page .lede { color: var(--ink-2); font-size: 17px; max-width: 60ch; }
.page h2 { font-size: 24px; margin: 40px 0 12px; }
.page h3 { font-size: 18px; margin: 24px 0 8px; }
.page p, .page li { color: var(--ink-2); font-size: 16px; }
.page ul, .page ol { margin: 12px 0 12px 22px; }
.page li { margin-bottom: 8px; }
.page a.inline { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Version history (what's-new) ---------- */
.timeline { max-width: 820px; margin: 0 auto; position: relative; }
.release {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 26px 28px;
  margin-bottom: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.release:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.release-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.release-head .ver { font-family: var(--serif); font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.release-head .date {
  color: var(--muted); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid transparent;
}
.tag.latest { background: var(--ink); color: var(--bg); }
.tag.new { background: transparent; color: var(--emerald); border-color: color-mix(in srgb, var(--emerald) 45%, transparent); }
.tag.fix { background: transparent; color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.release ul { margin: 0; padding-left: 20px; }
.release li { color: var(--ink-2); margin-bottom: 9px; font-size: 15px; line-height: 1.55; }
.release li::marker { color: var(--orange); }
.release li b { color: var(--ink); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .container { padding-top: 36px; padding-bottom: 36px; }
.site-footer .f-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 24px; margin-bottom: 28px;
}
.site-footer .f-brand { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-weight: 700; font-size: 19px; }
.site-footer .f-brand .logo { width: 30px; height: 30px; border-radius: var(--r-sharp); flex: none; display: block; object-fit: cover; border: 1px solid var(--border); background: #fafaf9; }
.site-footer .f-tag { color: var(--ink-2); font-size: 14px; margin-top: 10px; max-width: 34ch; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer nav a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; }
.site-footer nav a:hover { color: var(--ink); }
.site-footer .copy { color: var(--muted); font-size: 13px; padding-top: 24px; border-top: 1px solid var(--border); }

/* ---------- Scroll reveal ----------
   Progressive enhancement: content is visible by default. Only once JS adds the
   `js` class to <html> do elements start hidden and animate in — so a blank page
   is impossible if JS is disabled or the observer never fires. */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding: 64px 0 48px; }
  .hero-copy { max-width: none; }
  .hero p.lead { max-width: 52ch; }
  .mosaic { max-width: 440px; }
  .band { grid-template-columns: 1fr; padding: 44px 32px; gap: 32px; }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 600px) {
  .container { padding: 0 18px; }
  .grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: 0; }
  section { padding: 52px 0; }
  .hero { padding: 44px 0 36px; }
  .band { padding: 36px 24px; }
  .cta { padding: 48px 22px; }
  .mosaic { grid-template-columns: repeat(4, 1fr); max-width: none; }
}

/* ---------- Mobile navigation (hamburger) ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px 24px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    /* Collapsed by default; the toggle adds .open to reveal it. */
    display: none;
  }
  .nav.open { display: flex; }
  .nav-link {
    padding: 13px 12px;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-link:last-of-type { border-bottom: 0; }
  .nav-link.active { background: var(--elevated); }
  .nav-link.active::after { display: none; }
  .nav .btn { margin-left: 0; margin-top: 12px; width: 100%; padding: 14px 20px; font-size: 15px; }
}
@media (max-width: 600px) {
  .nav { padding-left: 18px; padding-right: 18px; }
}

/* ============================================================================
   Leaderboards page
   ========================================================================== */
.lb-wrap { padding: 56px 0 80px; }
.lb-head { text-align: center; max-width: 60ch; margin: 0 auto 36px; }
.lb-head .eyebrow { margin-bottom: 18px; }
.lb-head h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -0.02em; font-weight: 800; line-height: 1.04; }
.lb-head p { color: var(--ink-2); margin-top: 14px; font-size: 17px; }
.lb-head .live {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
}
.lb-head .live .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--emerald);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--emerald) 60%, transparent);
  animation: lbpulse 2s infinite;
}
@keyframes lbpulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--emerald) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .lb-head .live .pulse { animation: none; } }

/* Game selector */
.lb-selector-label, .lb-control-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.lb-games {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.lb-games::-webkit-scrollbar { height: 6px; }
.lb-games::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.lb-game {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 78px; padding: 12px 6px 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}
.lb-game:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.lb-game.active { border-color: var(--a, var(--ink-2)); border-width: 2px; background: color-mix(in srgb, var(--a, var(--ink)) 8%, var(--surface)); }
.lb-game .glyph {
  width: 40px; height: 40px; border-radius: var(--r-sharp); flex: none;
  background: var(--a, var(--ink)); color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 20px;
}
.lb-game .nm {
  font-size: 11px; font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.lb-game.active .nm { color: var(--ink); }

/* Controls (metric / level / period) */
.lb-controls {
  margin-top: 22px; display: grid; gap: 14px;
  border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px; background: var(--surface);
}
.lb-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lb-row .lb-control-label { margin-bottom: 0; width: 62px; flex: none; }
.lb-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); background: transparent; border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 7px 14px; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip-btn:hover { border-color: var(--border-strong); color: var(--ink); }
.chip-btn.active { color: var(--ink); border-color: var(--a, var(--ink)); background: color-mix(in srgb, var(--a, var(--ink)) 12%, transparent); }

/* Board */
.lb-board { margin-top: 30px; }
.lb-caption {
  text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 28px;
}
.lb-caption b { color: var(--ink-2); font-weight: 700; }

/* Podium */
.lb-podium {
  display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 14px;
  max-width: 540px; margin: 0 auto 8px;
}
.lb-col { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.lb-col .crown { height: 22px; font-size: 18px; line-height: 1; margin-bottom: 2px; color: var(--medal, var(--muted)); }
.lb-ava {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--ink);
  border: 2px solid var(--medal, var(--border)); background: color-mix(in srgb, var(--medal, var(--muted)) 14%, transparent);
}
.lb-col.first .lb-ava { width: 62px; height: 62px; font-size: 26px; }
.lb-col.empty .lb-ava { border-style: dashed; color: var(--muted); background: transparent; }
.lb-nm { font-family: var(--serif); font-weight: 700; font-size: 14px; margin-top: 10px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-col.empty .lb-nm { color: var(--muted); }
.lb-sc { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.lb-ped {
  width: 100%; margin-top: 12px; border: 1px solid color-mix(in srgb, var(--medal, var(--border)) 40%, transparent);
  border-bottom: 0; border-radius: var(--r-card) var(--r-card) 0 0;
  background: color-mix(in srgb, var(--medal, var(--muted)) 10%, transparent);
  display: grid; place-items: center; padding-top: 6px;
  font-family: var(--serif); font-weight: 700; color: var(--medal, var(--muted)); font-variant-numeric: tabular-nums;
}
.lb-col.first .lb-ped { height: 60px; font-size: 26px; }
.lb-col.second .lb-ped { height: 42px; font-size: 20px; }
.lb-col.third .lb-ped { height: 30px; font-size: 20px; }

/* Ranked list */
.lb-list { max-width: 620px; margin: 24px auto 0; }
.lb-list-label { font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.lb-entry {
  display: flex; align-items: center; gap: 14px; min-height: 56px;
  padding: 10px 16px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
}
.lb-entry .rk { width: 30px; font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.lb-entry .av {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1px solid var(--border); font-family: var(--serif); font-weight: 700; font-size: 13px; color: var(--ink-2);
}
.lb-entry .nm { flex: 1; min-width: 0; font-family: var(--serif); font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-entry .sc { margin-left: auto; font-weight: 800; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; flex: none; }

/* States */
.lb-state { text-align: center; padding: 56px 24px; color: var(--ink-2); }
.lb-state .ico { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 16px; font-size: 22px; color: var(--muted); }
.lb-state h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.lb-state p { font-size: 15px; max-width: 38ch; margin: 0 auto; }
.lb-state .btn { margin-top: 20px; }
.lb-skel { max-width: 620px; margin: 0 auto; }
.lb-skel .row { height: 56px; border-radius: var(--r-card); margin-bottom: 8px; border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--surface) 0%, var(--elevated) 50%, var(--surface) 100%);
  background-size: 200% 100%; animation: lbshimmer 1.2s ease-in-out infinite; }
@keyframes lbshimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .lb-skel .row { animation: none; } }

@media (max-width: 600px) {
  .lb-wrap { padding: 40px 0 60px; }
  .lb-controls { padding: 16px; }
  .lb-row .lb-control-label { width: 100%; }
  .lb-podium { gap: 8px; }
  .lb-ava { width: 44px; height: 44px; font-size: 18px; }
  .lb-col.first .lb-ava { width: 54px; height: 54px; font-size: 22px; }
  .lb-nm { font-size: 12.5px; }
  .lb-game { width: 70px; }
}
