/* Design tokens: dark stone, parchment and beveled gold.

   Readability rules (tests/test_dashboard_contrast.py enforces them):
   - every text colour in the CSS is a `--text-*` token, `--class-text` or
     `--quality-color`, and css/contrast.json lists the background each one sits
     on; the test checks every pair against WCAG 2.1 AA (4.5:1, 3:1 for large);
   - `--surface-*` are the worst cases: for light text the lightest background
     it can sit on (e.g. a gold-lit leader row), for dark ink the darkest;
   - no font-size anywhere resolves below 13 px (--fs-label is the floor).

   Class colours are the plain hex values every WoW fan site uses; the deep ones
   (Death Knight, Shaman, Warlock, Demon Hunter, Evoker) get a lighter
   `--class-text` for names, while bars and fills keep `--class-color`. */

:root {
  color-scheme: dark;

  /* stone (backgrounds) */
  --stone-950: #09070d;
  --stone-900: #0e0b13;
  --stone-850: #15111c;
  --stone-800: #1b1623;
  --stone-700: #261f30;
  --stone-600: #362c43;

  /* surfaces text sits on (worst cases, see contrast.json) */
  --surface-page: #09070d;
  --surface-panel: #221c2c;
  --surface-lit: #4a3f36;
  --surface-parchment: #dcc48e;
  --surface-gold: #e0b44a;
  --surface-silver: #c3c8d4;
  --surface-bronze: #d99a62;
  --surface-ribbon: #a8301f;
  --surface-curtain: #6a5640;
  --surface-banner-bad: #3c1714;
  --surface-banner-warn: #3a2c10;

  /* tints laid over a panel; composited they stay darker than --surface-lit */
  --panel-top: rgba(36, 29, 46, 0.94);
  --panel-bottom: rgba(14, 11, 19, 0.97);
  --tint-row: rgba(255, 255, 255, 0.045);
  --tint-gold: rgba(212, 175, 55, 0.16);

  /* text */
  --text: #f3ead6;
  --text-strong: #fff8e8;
  --text-gold: #f5d77e;
  --text-gold-bright: #fde9a9;
  --text-muted: #d3c6a8;
  --text-faint: #bfb196;
  --text-ember: #ffc27a;
  --text-arcane: #c6b6ff;
  --text-ok: #82e2ad;
  --text-warn: #f4c76c;
  --text-bad: #ff9a90;
  --text-azure: #93caff;
  --text-shame: #ffb4aa;
  --text-on-parchment: #2b1c0e;
  --text-on-parchment-red: #7a1712;
  --text-on-gold: #241904;
  --text-on-ribbon: #ffe9b0;
  --text-banner-warn: #fbe6bb;
  --text-banner-bad: #ffdcd6;
  /* Item tooltips (js/tooltip.js): the game's tooltip colours, lifted where
     the plain colour is too dark on the tooltip box (contrast.json). */
  --text-tip-white: #ffffff;
  --text-tip-grey: #a8a8a8;
  --text-tip-green: #1eff00;
  --text-tip-yellow: #ffd100;
  --text-tip-blue: #5aaeff;
  --text-tip-purple: #c999f5;
  --text-tip-orange: #ff9a33;
  --text-tip-red: #ff5a5a;
  --text-tip-cyan: #33d6ff;
  --text-tip-gold: #e6cc80;
  /* recipe difficulty (the game's orange, yellow, green, grey), AA on the recipe list */
  --text-diff-optimal: #ff8a4c;
  --text-diff-medium: #ffff00;
  --text-diff-easy: #4fc94f;
  --text-diff-trivial: #a5a5a5;

  /* gold for gradient (background-clip: text) display type: every stop must
     clear 3:1 on --surface-lit, the outline and depth come from shadows */
  --gold-text-top: #fffbea;
  --gold-text-mid: #f9dc84;
  --gold-text-low: #e2a93c;

  /* gold metal (frames, rims, fills: not text) */
  --gold: #d4af37;
  --gold-bright: #f7e7ac;
  --gold-mid: #b8902c;
  --gold-dim: #6d5518;
  --gold-deep: #4a3208;
  --gold-glass: rgba(212, 175, 55, 0.14);
  --gold-line: rgba(212, 175, 55, 0.42);
  --ink-line: #140c03;

  /* accents (fills, glows) */
  --parchment: #ece0c6;
  --parchment-dim: #c9b88f;
  --ember: #ff8a2b;
  --ember-hot: #ffd27a;
  --arcane: #9a7bff;
  --jade: #4fd39a;
  --blood: #d6453f;
  --azure: #55a8ff;
  --ok: #67d39a;
  --warn: #e8b24c;
  --bad: #e2564f;

  /* shape */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --panel-pad: clamp(1rem, 2vw, 1.4rem);
  --gap: clamp(1rem, 1.6vw, 1.5rem);
  --page-max: 1400px;
  --gutter: clamp(1rem, 3vw, 2rem);

  /* one spacing scale (4 px steps up to 16, then 24, 32, 48) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;

  /* the calm panel: a gold-tinted hairline, a soft top light */
  --panel-line: rgba(212, 175, 55, 0.26);
  --panel-line-strong: rgba(212, 175, 55, 0.5);
  --panel-rule: rgba(212, 175, 55, 0.14);

  /* type */
  --font-display: "Cinzel", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-body: "Alegreya", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;

  /* type scale: 13 px is the floor for anything (small caps labels) */
  --fs-label: 0.8125rem;
  --fs-small: 0.875rem;
  --fs-note: clamp(0.9375rem, 0.9rem + 0.12vw, 1rem);
  --fs-text: clamp(1rem, 0.95rem + 0.15vw, 1.0625rem);
  --fs-body: clamp(1.0625rem, 0.95rem + 0.25vw, 1.125rem);
  --fs-lead: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem);
  --fs-name: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem);
  --fs-title: clamp(1.3125rem, 1.1rem + 0.6vw, 1.55rem);
  --track-label: 0.08em;

  /* motion (zeroed under prefers-reduced-motion in effects.css) */
  --t-fast: 140ms;
  --t-mid: 320ms;
  --t-slow: 900ms;

  /* set per row/page from JS */
  --class-color: var(--parchment-dim);
  --class-text: var(--parchment-dim);
  --quality-color: #ece9e1;
  --xp: 0%;
}

/* Class colours. Set on an element with .c-<token>: --class-color for bars,
   glows and fills, --class-text for names (AA on every panel surface). */
.c-warrior { --class-color: #c69b6d; --class-text: #d6ae83; }
.c-paladin { --class-color: #f48cba; --class-text: #f69cc4; }
.c-hunter { --class-color: #aad372; --class-text: #aad372; }
.c-rogue { --class-color: #fff468; --class-text: #fff468; }
.c-priest { --class-color: #f0f0f0; --class-text: #f0f0f0; }
.c-deathknight { --class-color: #c41e3a; --class-text: #ff94a3; }
.c-shaman { --class-color: #3b7fe0; --class-text: #6bb8ff; }
.c-mage { --class-color: #3fc7eb; --class-text: #3fc7eb; }
.c-warlock { --class-color: #8788ee; --class-text: #aeafff; }
.c-monk { --class-color: #00ff98; --class-text: #00ff98; }
.c-druid { --class-color: #ff7c0a; --class-text: #ff9433; }
.c-demonhunter { --class-color: #a330c9; --class-text: #dc9cf6; }
.c-evoker { --class-color: #33937f; --class-text: #55d2b3; }
.c-unknown { --class-color: #c9b88f; --class-text: #d3c6a8; }

/* Item quality colours: the generic, fan-site-wide palette (text only, no
   item art); poor, rare, epic and legendary are lifted a little for AA
   contrast on dark stone. */
.q-poor { --quality-color: #b0b0b0; }
.q-common { --quality-color: #ece9e1; }
.q-uncommon { --quality-color: #1eff00; }
.q-rare { --quality-color: #68b6ff; }
.q-epic { --quality-color: #d4a2fb; }
.q-legendary { --quality-color: #ff9a33; }
.q-artifact { --quality-color: #e6cc80; }
.q-heirloom { --quality-color: #00ccff; }
