/* Phosphor Instrument design tokens — the single source of truth.
   Spec: docs/superpowers/specs/2026-07-03-ui-redesign-design.md (owner-approved v5).
   Hard rules: flat surfaces (no gradients in element backgrounds); elevation via the
   4-step surface ladder + 1px borders; glow budget = status dot / LIVE dot / cursor /
   scanner line ONLY; --green is a signal, body copy stays mint. */
:root {
  /* surfaces (elevation ladder, light rises) */
  --bg: #040a06;
  --surf-1: #071309;   /* topbar / rail */
  --surf-2: #0a1810;   /* cards */
  --surf-3: #102718;   /* raised: buttons, chips, inputs */
  --inset: #020503;    /* wells: console, inputs, code */

  /* lines */
  --line-hair: #16301f;
  --line: #1f4630;
  --line-2: #2e6b45;

  /* phosphor accent + semantics */
  --green: #00ff41;
  --green-soft: #0a3d1f;
  --green-text: #6bffa0;
  --green-dim: #27c960;
  --cyan: #00e5ff;
  --amber: #ffb525;
  --red: #ff3b55;

  /* text */
  --head: #f4fff8;
  --text: #dff7e9;
  --muted: #93b9a2;
  /* --faint is the quietest text tier, and it is NOT decoration: it carries captions, table
     column headers, timestamps, server addresses, credit rates and the palette's key hints —
     131 `color:` uses across the app, no borders or fills. At its former #5c7f6b it measured
     4.09:1 on --surf-2 at 10-11px, i.e. an AA (1.4.3) failure everywhere it appeared, and the
     per-game themes were worse (3.48:1 zomboid-red, 3.59:1 hytale-azure).
     Scanning the live dashboard for elements whose computed colour IS --faint shows it lands
     on --surf-2, --surf-1, --bg and --inset, so --surf-2 is the worst case that occurs and
     the lift needed is small. (The scan reached everything except the DB browser's row-edit
     modal, which needs a provisioned database to open: `.dbx-nullbtn` put --faint on --surf-3,
     where even the lifted value is 4.00-4.37:1. That control now uses --muted. --faint on
     --surf-3 is out of contract — put quiet text on --surf-2 or quieter.) Each theme's value below is its own
     former colour scaled per-channel (not blended toward white), which holds AA at >=4.60:1
     on --surf-2 while moving OKLab hue by <0.7 deg and chroma by <0.05: the tier still reads
     as the same quiet colour, just legible. --muted stays clearly above it in every theme
     (gap 0.96-3.82 contrast points), so the text hierarchy is unchanged. */
  --faint: #638873;

  /* the only sanctioned glow */
  --glow: 0 0 9px rgba(0, 255, 65, 0.8);

  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --s1: 8px; --s2: 12px; --s3: 16px; --s4: 24px; --s5: 32px;

  /* type scale — one ladder, no ad-hoc sizes (absorbs the former half-pixel values) */
  --fs-2xs: 9px;    /* micro caps, ribbons, status pips */
  --fs-xs: 10px;    /* labels, uppercase caps, meta */
  --fs-sm: 11px;    /* small text, hints */
  --fs-md: 12px;    /* dense UI text — the default small size */
  --fs-base: 13px;  /* body copy */
  --fs-lg: 14px;    /* inputs, emphasis */
  --fs-xl: 15px;    /* larger emphasis, section values */
  --fs-2xl: 17px;   /* card subheads */
  --fs-3xl: 22px;   /* headings */
  --fs-4xl: 25px;   /* metric display numbers */
  --fs-5xl: 31px;   /* hero server name */
  --fs-6xl: 40px;   /* balance display */

  /* radius scale */
  --r-xs: 4px;      /* bars, kbd, tiny chips */
  --r-sm: 6px;      /* chips, small controls */
  --r: 8px;         /* default — cards, inputs, buttons */
  --r-md: 10px;     /* raised tiles */
  --r-lg: 14px;     /* feature cards */
  --r-pill: 100px;

  /* secondary categorical accents (badges/tags) + ink on a bright accent fill.
     The categorical ones stay fixed across themes on purpose — they distinguish categories,
     not the accent. --on-accent is the exception: it has to stay legible ON the accent, so a
     theme whose accent is too dark for this near-black ink may override it (zomboid-red). */
  --cyan-text: #4fd6e0;
  --cyan-dim: #2f7d86;
  --purple: #c77dff;
  --purple-dim: #6a4a86;
  /* The server mark's "running" pip (css/servermark.css). It is a SIGNAL, not a category, and
     it is here for the one reason a signal ever leaves its theme: every theme's green IS its
     accent, and painting "running" with the accent is the bug the mark exists to fix — under
     zomboid-red the accent is red, so running and crashed were two similar reds. The other
     three pips use --red / --amber / --muted, which every theme has already tuned to stand
     apart from its own accent; this is the fourth, and no theme carries a non-accent green.
     Declared here rather than on .smark so a theme CAN re-hue it (a directly-set custom
     property beats an inherited one, so a :root[data-theme] block could not have) and so
     test/helpers/palette.js resolves it — game-identity-contract.test.js measures it on the
     surface ladder and on --green-soft, where its floor is 6.92:1 (phosphor --green-soft). */
  --sm-ok: #3ddc84;
  --on-accent: #02180a;
  --syn-str: #d8a25a;   /* code editor: strings */
  --syn-num: #63cdd6;   /* code editor: numbers / keywords */

  /* legacy aliases (pre-uplift names still referenced in a few inline styles) */
  --green-bright: var(--green);
  --green-mid: var(--green-dim);
  --green-dark: var(--line);
  --font: var(--mono);
  --bg-panel: var(--surf-2);
  --bg-elevated: var(--surf-3);
  --bg-header: var(--surf-1);
  --bg-hover: var(--surf-3);
  --orange: var(--amber);
  --blue: var(--cyan);
  --radius: var(--r);
}
