@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');
/* ============================================================
   COLOR TOKENS — Modern Slate
   Cool neutral dark UI, one sharp accent hue (amber).
   Base tones use oklch for perceptual consistency.
   ============================================================ */

:root {
  /* ---- Base neutrals (cool slate, hue ~250) ---- */
  --slate-950: oklch(14% 0.010 252);
  --slate-900: oklch(17% 0.011 252);
  --slate-850: oklch(20% 0.012 252);
  --slate-800: oklch(24% 0.013 252);
  --slate-700: oklch(29% 0.014 252);
  --slate-600: oklch(36% 0.015 252);
  --slate-500: oklch(46% 0.016 252);
  --slate-400: oklch(58% 0.015 252);
  --slate-300: oklch(70% 0.013 252);
  --slate-200: oklch(82% 0.010 252);
  --slate-100: oklch(91% 0.006 252);
  --slate-50:  oklch(97% 0.003 252);

  /* ---- Brand accent — amber (the one sharp hue) ---- */
  --accent-900: oklch(30% 0.07 75);
  --accent-700: oklch(48% 0.12 75);
  --accent-600: oklch(62% 0.16 75);
  --accent-500: oklch(78% 0.17 75);   /* primary accent */
  --accent-400: oklch(83% 0.16 75);   /* hover */
  --accent-300: oklch(89% 0.12 75);
  --accent-ink: oklch(20% 0.03 75);   /* text/icon ON accent-500 */

  /* ---- Semantic (same L/C family, hue-shifted) ---- */
  --success-500: oklch(72% 0.16 148);
  --success-ink: oklch(18% 0.03 148);
  --danger-500:  oklch(66% 0.19 25);
  --danger-ink:  oklch(97% 0.01 25);
  --warning-500: oklch(80% 0.15 95);
  --warning-ink: oklch(20% 0.03 95);
  --info-500:    oklch(72% 0.13 231);
  --info-ink:    oklch(18% 0.02 231);

  /* ---- Player / presence palette (live cursors, roster tokens) ----
     Same L/C, six distinct hues — stable identity per player. */
  --player-1: oklch(72% 0.16 25);   /* coral */
  --player-2: oklch(72% 0.14 95);   /* gold-green */
  --player-3: oklch(72% 0.15 148);  /* jade */
  --player-4: oklch(72% 0.13 210);  /* sky */
  --player-5: oklch(72% 0.15 275);  /* violet */
  --player-6: oklch(72% 0.16 335);  /* rose */

  /* ---- Semantic surface & text aliases ---- */
  --bg-app:        var(--slate-950);
  --bg-canvas:     var(--slate-900);
  --surface-1:     var(--slate-850);   /* cards */
  --surface-2:     var(--slate-800);   /* raised / popover */
  --surface-3:     var(--slate-700);   /* overlay / modal */
  --surface-sunken: var(--slate-950);

  --border-subtle: var(--slate-700);
  --border-default: var(--slate-600);
  --border-strong: var(--slate-500);
  --border-accent:  var(--accent-500);

  --text-primary:   var(--slate-50);
  --text-secondary: var(--slate-300);
  --text-tertiary:  var(--slate-400);
  --text-disabled:  var(--slate-600);
  --text-on-accent: var(--accent-ink);
  --text-link:      var(--accent-400);
  --text-link-hover: var(--accent-300);

  --focus-ring: var(--accent-500);
}

/* ============================================================
   LIGHT THEME — same accent/semantic/player hues, inverted
   neutral scale. Apply by setting data-theme="light" on <html>
   (or any container root); every semantic alias below flips,
   components need no changes since they only read the aliases.
   ============================================================ */
:root[data-theme='light'], [data-theme='light'] {
  --bg-app:        oklch(97% 0.004 252);
  --bg-canvas:     oklch(94% 0.006 252);
  --surface-1:     oklch(99% 0.002 252);
  --surface-2:     oklch(96% 0.004 252);
  --surface-3:     oklch(91% 0.007 252);
  --surface-sunken: oklch(89% 0.008 252);

  --border-subtle: oklch(88% 0.008 252);
  --border-default: oklch(80% 0.010 252);
  --border-strong: oklch(65% 0.012 252);
  --border-accent:  var(--accent-600);

  --text-primary:   oklch(22% 0.014 252);
  --text-secondary: oklch(40% 0.016 252);
  --text-tertiary:  oklch(54% 0.014 252);
  --text-disabled:  oklch(76% 0.010 252);
  --text-on-accent: var(--accent-ink);
  --text-link:      var(--accent-700);
  --text-link-hover: var(--accent-900);

  --focus-ring: var(--accent-600);
}

/* ============================================================
   TYPOGRAPHY TOKENS
   IBM Plex Sans — UI text (clean, utilitarian, high legibility)
   IBM Plex Mono — numbers, dice results, timers, room codes
     (tabular figures give countdown/roll readouts a precise,
      technical confidence that matches the brand)
   ============================================================ */

:root {
  --font-sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;

  /* ---- Scale (px) ---- */
  --text-2xs: 11px;
  --text-xs:  12px;
  --text-sm:  13px;
  --text-base: 15px;
  --text-md:  17px;
  --text-lg:  20px;
  --text-xl:  24px;
  --text-2xl: 30px;
  --text-3xl: 38px;
  --text-4xl: 48px;

  /* ---- Weights ---- */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---- Line heights ---- */
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* ---- Letter spacing ---- */
  --tracking-tight: -0.01em;
  --tracking-normal: 0em;
  --tracking-wide: 0.04em;
  --tracking-label: 0.08em; /* uppercase labels/eyebrows */
}

/* ============================================================
   SPACING & LAYOUT TOKENS — 4px base unit
   ============================================================ */
:root {
  --space-0: 0px;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 20px;
  --space-7: 24px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 48px;
  --space-11: 64px;
  --space-12: 80px;

  /* ---- Radii — moderate rounding, utilitarian not toy-like ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* ---- Container widths ---- */
  --container-panel: 360px;
  --container-modal: 480px;
  --container-app: 1200px;
}

/* ============================================================
   EFFECTS — elevation, borders, motion
   Dark UI: shadows are soft & deep (black), never glow by default.
   Focus/active states use a slim accent ring instead of glow blur.
   ============================================================ */
:root {
  /* ---- Elevation (dp1 -> dp4) ---- */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-2: 0 2px 8px rgba(0,0,0,0.40), 0 1px 2px rgba(0,0,0,0.30);
  --shadow-3: 0 8px 24px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.30);
  --shadow-4: 0 16px 48px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.35);

  /* ---- Focus ring ---- */
  --ring-width: 2px;
  --ring-offset: 2px;

  /* ---- Motion ---- */
  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 280ms;
  --duration-roll: 620ms;   /* dice roll settle */

  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.3, 0, 0.1, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Borders ---- */
  --border-width-hairline: 1px;
  --border-width-thick: 1.5px;
}

/* Light theme — softer, shorter shadows (heavy dark shadows read
   muddy on white); everything else about elevation stays the same. */
:root[data-theme='light'], [data-theme='light'] {
  --shadow-1: 0 1px 2px rgba(30,30,40,0.06);
  --shadow-2: 0 2px 8px rgba(30,30,40,0.08), 0 1px 2px rgba(30,30,40,0.05);
  --shadow-3: 0 8px 24px rgba(30,30,40,0.10), 0 2px 6px rgba(30,30,40,0.06);
  --shadow-4: 0 16px 48px rgba(30,30,40,0.14), 0 4px 12px rgba(30,30,40,0.08);
}

/* Minimal, deliberate resets shared across the system */
html, body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--text-link-hover); text-decoration: underline; }

* { box-sizing: border-box; }

::selection { background: var(--accent-500); color: var(--accent-ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-600); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--slate-500); }

/* Server-rendered pages. Served at /site.css after the design-system tokens. */
html, body { background: var(--bg-app); color: var(--text-primary); font-family: var(--font-sans); margin: 0; line-height: 1.55; }
* { box-sizing: border-box; }
a { color: var(--accent-500); }
header.site, main.site, footer.site { max-width: 880px; margin: 0 auto; padding: 16px; }
header.site { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
header.site .brand { font-weight: 700; color: var(--text-primary); text-decoration: none; font-size: 1.1rem; }
header.site nav { display: flex; gap: 16px; }
footer.site { color: var(--text-secondary); font-size: 0.875rem; border-top: 1px solid var(--border-default); margin-top: 48px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.15; }
.hero { padding: 24px 0; }
.button { display: inline-block; padding: 12px 20px; border-radius: 6px; background: var(--accent-500); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.muted { color: var(--text-secondary); font-size: 0.875rem; }
ul.systems { list-style: none; padding: 0; columns: 2 240px; }
ul.systems li { padding: 4px 0; break-inside: avoid; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
dl.facts dt { color: var(--text-secondary); }
dl.facts dd { margin: 0; }
.crumbs { margin: 0; font-size: 0.875rem; }
