/* =====================================================================
   Scalar Core design tokens: the single source of truth for the game
   (/play) and the website. Brief: claude/design-brief.md.

   Rules:
   - Components reference these tokens only, with no raw hex values.
   - Dark is the default; light redefines colour and elevation only.
     Shapes, sizes, type and motion never change between themes.
   ===================================================================== */

:root, [data-theme='dark'] {
  --crimson: #ff6ea7;
  /* ---- colour: graphite family (dark) ------------------------------- */
  --sc-field: #0e1110;          /* page and board background */
  --sc-plate: #161a19;          /* panels, cards, modals */
  --sc-raised: #222826;         /* inputs, tiles, hover fill */
  --sc-text: #ecefe6;
  --sc-muted: #9aa29b;          /* ≥ 4.5:1 on plate */
  --sc-fg-rgb: 236 239 230;     /* text colour as a triplet, for lines */
  --sc-line: rgb(var(--sc-fg-rgb) / .14);
  --sc-line-strong: rgb(var(--sc-fg-rgb) / .3);
  --sc-scrim: rgb(8 10 9 / .78);
  --sc-glass: rgb(22 26 25 / .72);

  --sc-signal: #d4ff2a;  --sc-signal-rgb: 212 255 42;   /* only: your next action, focus */
  --sc-signal-ink: #10130a;                             /* text on signal */
  --sc-signal-text: #d4ff2a;                            /* signal used as text on plate */
  --sc-p1: #2f8cff;      --sc-p1-rgb: 47 140 255;       /* Azure */
  --sc-p2: #ff2d8a;      --sc-p2-rgb: 255 45 138;       /* Violet */
  --sc-p1-text: #6fb0ff; --sc-p2-text: #ff6fab;         /* faction colour as text on plate */
  --sc-gold: #e3b34a;    --sc-gold-rgb: 227 179 74;     /* only: the Scalar Core */
  --sc-token-edge: var(--sc-signal);                    /* control tokens are the accent green; edge for contrast */
  --sc-gold-text: #e3b34a;
  --sc-hazard: #ff4d3d;  --sc-hazard-rgb: 255 77 61;
  --sc-on-faction: #0b0d0c;                              /* text on a faction fill */

  /* ---- elevation: dark lights with glow ----------------------------- */
  --sc-glow-strength: .55;
  --sc-glow-sm: 0 0 10px rgb(var(--sc-glow-rgb, var(--sc-signal-rgb)) / calc(var(--sc-glow-strength) * .6));
  --sc-glow-md: 0 0 22px rgb(var(--sc-glow-rgb, var(--sc-signal-rgb)) / calc(var(--sc-glow-strength) * .7));
  --sc-glow-lg: 0 0 40px rgb(var(--sc-glow-rgb, var(--sc-signal-rgb)) / var(--sc-glow-strength));
  --sc-shadow-sm: 0 1px 0 rgb(0 0 0 / .4);
  --sc-shadow-md: 0 8px 24px rgb(0 0 0 / .45);
  --sc-blur: blur(14px) saturate(1.15);

  /* ---- space: 4px base ---------------------------------------------- */
  --sc-s-1: 4px; --sc-s-2: 8px; --sc-s-3: 12px; --sc-s-4: 16px; --sc-s-5: 24px; --sc-s-6: 32px; --sc-s-7: 64px;

  /* ---- size ---------------------------------------------------------- */
  --sc-h-sm: 32px; --sc-h-md: 42px; --sc-h-lg: 52px;
  --sc-h-icon: 36px;            /* square icon buttons */
  --sc-hit-min: 44px;           /* minimum touch target on phone */

  /* ---- type ---------------------------------------------------------- */
  --sc-font-ui: 'Tech', 'Chakra Petch', sans-serif;
  --sc-font-display: 'Orbitron', 'ScalarNavigation', sans-serif;
  --sc-font-body: 'Inter', system-ui, sans-serif;
  --sc-font-logo: 'Yume', 'yumeXHA', sans-serif;
  --sc-fs-1: 11px; --sc-fs-2: 13px; --sc-fs-3: 16px; --sc-fs-4: 20px; --sc-fs-5: 28px; --sc-fs-6: 40px;
  --sc-tr-none: 0; --sc-tr-caps: .12em; --sc-tr-wide: .22em;   /* wide: tiny status readouts only */
  --sc-fw-regular: 400; --sc-fw-semi: 600; --sc-fw-bold: 700;
  --sc-lh-tight: 1.1; --sc-lh-ui: 1.25; --sc-lh-body: 1.5;

  /* ---- shape: one corner rule, cut top-right + bottom-left ----------- */
  --sc-cut-sm: 6px;   /* chips, tags, pips */
  --sc-cut-md: 10px;  /* buttons, inputs, tiles, tooltips */
  --sc-cut-lg: 16px;  /* cards, panels, modals, frames */
  --sc-line-w: 1px;
  --sc-accent-w: 3px;

  /* ---- motion -------------------------------------------------------- */
  --sc-t-fast: 120ms; --sc-t-base: 200ms; --sc-t-slow: 360ms; --sc-t-epic: 700ms;
  --sc-ease-out: cubic-bezier(.2, .7, .2, 1);
  --sc-ease-in-out: cubic-bezier(.65, 0, .35, 1);

  /* ---- focus --------------------------------------------------------- */
  --sc-focus-w: 2px; --sc-focus-offset: 3px;
}

/* ---- light: the same object under daylight --------------------------- */
[data-theme='light'] {
  --crimson: #7e0047;
  --sc-field: #d8dcd5;
  --sc-plate: #eef0eb;
  --sc-raised: #f8f9f6;
  --sc-text: #121714;
  --sc-muted: #3a443d;
  --sc-fg-rgb: 18 23 20;
  --sc-line: rgb(var(--sc-fg-rgb) / .2);
  --sc-line-strong: rgb(var(--sc-fg-rgb) / .38);
  --sc-scrim: rgb(196 202 193 / .72);
  --sc-glass: rgb(238 240 235 / .86);

  --sc-signal: #b6e01c;  --sc-signal-rgb: 182 224 28;
  --sc-signal-ink: #10130a;
  --sc-signal-text: #355000;
  --sc-p1: #0b5fae;      --sc-p1-rgb: 11 95 174;
  --sc-p2: #a8166a;      --sc-p2-rgb: 168 22 106;
  --sc-p1-text: #0b5fae; --sc-p2-text: #a8166a;
  --sc-gold: #b47f12;    --sc-gold-rgb: 180 127 18;
  --sc-gold-text: #5e3f00;
  --sc-hazard: #c42a1c;  --sc-hazard-rgb: 196 42 28;
  --sc-on-faction: #ffffff;
  --sc-token-edge: rgb(var(--sc-fg-rgb) / .62);       /* lime alone is 1.3:1 on light plates */

  /* light lights with shadow, never a pale halo */
  --sc-glow-strength: .28;
  --sc-shadow-sm: 0 1px 0 rgb(var(--sc-fg-rgb) / .18);
  --sc-shadow-md: 0 8px 22px rgb(var(--sc-fg-rgb) / .16);
}

@media (prefers-reduced-motion: reduce) {
  :root { --sc-t-fast: 1ms; --sc-t-base: 1ms; --sc-t-slow: 1ms; --sc-t-epic: 1ms; }
}

html:not([data-theme="light"]) { --crimson: #ff6ea7; }
html[data-theme="light"] { --crimson: #7e0047; }
.modal-updated-date { color: var(--muted) !important; font-weight: 800; font-size: 11px; letter-spacing: 2px; margin-bottom: 20px; }
