:root{
  --bg:#08080c; --bg-2:#0f1018; --bg-3:#161826;
  --ink:#e8e6f0; --ink-dim:#9a97ad;
  /* Was #5d5a70, which is 3.01:1 on --bg — under WCAG AA's 4.5:1 for body
     text, in the default theme. It carries the HUD's secondary line (Flaw,
     Lineage, Class) and every choice hint, so it has to be read, not just
     sensed. This is 5.13:1. The light-mode value below had the same fault. */
  --ink-faint:#827e98;
  --line:#242536;
  --accent:#7b5cff;      /* soul essence violet */
  --accent-2:#c9a227;    /* memory gold — also the Aspect rune's colour */
  --danger:#c0392b;
  --ok:#3fb27f;
  --radius:14px;
  --pad:18px;
  --fs-body:16px;
  --maxw:640px;
}
/* Rank accent colours, applied on <body data-rank="...">. This is also the
   colour the rune glyphs glow with, so the whole HUD's palette shifts as
   the character climbs — dormant grey, awakened violet, and so on up. */
body[data-rank="dormant"]     { --rank:#6b6f80; }
body[data-rank="awakened"]    { --rank:#7b5cff; }
body[data-rank="ascended"]    { --rank:#2f8fd8; }
body[data-rank="transcendent"]{ --rank:#c9a227; }
body[data-rank="supreme"]     { --rank:#d2603a; }
body[data-rank="sacred"]      { --rank:#e0e0ea; }
body[data-rank="divine"]      { --rank:#fff6c9; }

/* -------------------------------------------------------------
   DAY MODE
   Opt-in via the toggle button (top-right, all screens). The
   Nightmare Spell's default aesthetic is night — this is the one
   concession to players who want to read this on a bright train.
   Rank colours are redeclared here: several of the dark-theme
   values (near-white "sacred", pale "divine") are unreadable once
   the background itself turns pale, so they get darker, more
   saturated variants instead of being reused as-is.
------------------------------------------------------------- */
html[data-theme="light"]{
  --bg:#f6f3ec; --bg-2:#ffffff; --bg-3:#ece6d6;
  --ink:#241f2e; --ink-dim:#5c5468;
  /* --ink-faint was #8b8496, which is only 3.25:1 against this background —
     under WCAG AA's 4.5:1 for body text. It carries the HUD's secondary line
     (Flaw, Lineage, Class), so it has to be legible, not decorative. This is
     5.7:1. Verified in a real browser, not by eye. */
  --ink-faint:#625b70;
  --line:#ddd5c0;
  --accent:#5b3fd6;
  --accent-2:#9a6f0e;
  --danger:#a8332a;
  --ok:#237a55;
}
html[data-theme="light"] body[data-rank="dormant"]     { --rank:#585c6d; }
html[data-theme="light"] body[data-rank="awakened"]    { --rank:#5b3fd6; }
html[data-theme="light"] body[data-rank="ascended"]    { --rank:#1f6fae; }
html[data-theme="light"] body[data-rank="transcendent"]{ --rank:#9a6f0e; }
html[data-theme="light"] body[data-rank="supreme"]     { --rank:#a8492a; }
html[data-theme="light"] body[data-rank="sacred"]      { --rank:#6b6458; }
html[data-theme="light"] body[data-rank="divine"]      { --rank:#a3841a; }
