/* Glad Heart Games tokens v3 — "Storybook Studio" (ADR 0021; v2 was "Paper-cut storybook")
   Layer 1  primitives   --gd-p-*      raw values. Never used by components.
   Layer 2  semantic     --gd-*        meaning (paper, ink, card types, tokens, suits, action, focus…).
   Layer 3  component    --card-* --btn-* --badge-* --hud-* --print-*  set per component.
   Rule: components read layer 3 (or 2). Only this file contains raw colour values.
   Contrast is checked by `node design-system/tools/contrast.mjs` (WCAG ≥4.5 text, ≥3 non-text).
   Fraunces (display, variable: opsz, wght, SOFT) and Atkinson Hyperlegible Next (text) are bundled under fonts/
   (SIL Open Font License): the latin subset, plus latin-ext for Polish and other Central European letters
   (ą ę ł ś ż …). The browser loads latin-ext only when a page uses it. No font is loaded from a CDN. */
@font-face{font-family:"Fraunces";font-style:normal;font-weight:100 900;font-display:swap;src:url("fonts/fraunces-latin-full-normal.woff2") format("woff2-variations"),url("fonts/fraunces-latin-full-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Fraunces";font-style:italic;font-weight:100 900;font-display:swap;src:url("fonts/fraunces-latin-full-italic.woff2") format("woff2-variations"),url("fonts/fraunces-latin-full-italic.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Atkinson Hyperlegible Next";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Atkinson Hyperlegible Next";font-style:normal;font-weight:600;font-display:swap;src:url("fonts/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Atkinson Hyperlegible Next";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Fraunces";font-style:normal;font-weight:100 900;font-display:swap;src:url("fonts/fraunces-latin-ext-full-normal.woff2") format("woff2-variations"),url("fonts/fraunces-latin-ext-full-normal.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Fraunces";font-style:italic;font-weight:100 900;font-display:swap;src:url("fonts/fraunces-latin-ext-full-italic.woff2") format("woff2-variations"),url("fonts/fraunces-latin-ext-full-italic.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Atkinson Hyperlegible Next";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Atkinson Hyperlegible Next";font-style:normal;font-weight:600;font-display:swap;src:url("fonts/atkinson-hyperlegible-next-latin-ext-600-normal.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Atkinson Hyperlegible Next";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
/* Card spacing (1em = 1 card unit = 1mm in print). The values are registered lengths and set on .gd-card,
   so each one resolves once against the card unit and keeps that size in any child. An unregistered
   2em inside 2.6em text would be 5.2mm. Cards that adopt the scale are checked by tools/card-spacing.js. */
@property --card-space-1{syntax:"<length>";inherits:true;initial-value:1mm}
@property --card-space-2{syntax:"<length>";inherits:true;initial-value:2mm}
@property --card-space-3{syntax:"<length>";inherits:true;initial-value:3mm}
@property --card-space-4{syntax:"<length>";inherits:true;initial-value:4mm}
@property --card-inset{syntax:"<length>";inherits:true;initial-value:3mm}
@property --card-gap{syntax:"<length>";inherits:true;initial-value:2mm}
@property --card-inset-small{syntax:"<length>";inherits:true;initial-value:2mm}
@property --card-index-w{syntax:"<length>";inherits:true;initial-value:7mm}
@property --card-index-x{syntax:"<length>";inherits:true;initial-value:3.4mm}
@property --card-index-y{syntax:"<length>";inherits:true;initial-value:3.2mm}
.gd-card{
  --card-space-1:1em; --card-space-2:2em; --card-space-3:3em; --card-space-4:4em;
  --card-inset:var(--card-space-3);  /* least space between text and any border, panel edge or corner index */
  --card-gap:var(--card-space-2);    /* between stacked blocks inside the frame */
  --card-inset-small:var(--card-space-2); /* the floor: quarter-card panels that set --text-inset to it */
  --card-index-w:7em;                /* number-card corner index */
  --card-index-x:3.4em; --card-index-y:3.2em; /* number-card corner index: distance from the card edge */
}
:root{
  /* ---------- 1. PRIMITIVES ---------- */
  /* paper + ink (warm, print-friendly; ink is a warm near-black, never #000) */
  --gd-p-cream-50:#fffaf0;  --gd-p-cream-100:#fbf1dc; --gd-p-cream-200:#f4e3bf; --gd-p-cream-300:#e3cb98;
  --gd-p-ink-900:#2b2118;   --gd-p-ink-700:#574636;   --gd-p-ink-600:#6e5a48;   --gd-p-ink-400:#a8957f;
  /* hue families: 100 tint · 300 light · 500 base · 700 deep · 900 darkest */
  --gd-p-lapis-100:#e6eefb; --gd-p-lapis-300:#a9c3ee; --gd-p-lapis-500:#2f6bc4; --gd-p-lapis-700:#1f4e98; --gd-p-lapis-900:#16325f;
  --gd-p-amber-100:#fff1d6; --gd-p-amber-300:#fcd383; --gd-p-amber-500:#f2a33a; --gd-p-amber-700:#9a5800; --gd-p-amber-900:#5f3600;
  --gd-p-plum-100:#f3e6f0;  --gd-p-plum-300:#c99cc2;  --gd-p-plum-500:#6e3470;  --gd-p-plum-700:#4f2152; --gd-p-plum-900:#341436;
  --gd-p-leaf-100:#e6f2da;  --gd-p-leaf-300:#a9d48c;  --gd-p-leaf-500:#4f9a3e;  --gd-p-leaf-700:#2c6b2c; --gd-p-leaf-900:#1d4a1f;
  --gd-p-sun-300:#fbe08a;   --gd-p-sun-500:#f7cd2e;   --gd-p-sun-800:#6e5200;
  --gd-p-toast-500:#e88a2a; --gd-p-toast-900:#5a2f00;
  --gd-p-rose-100:#f8dcd8; --gd-p-rose-400:#c6362b;  --gd-p-rose-500:#a8281e;  --gd-p-rose-800:#6e1610;
  --gd-p-sky-500:#3d8fd6;   --gd-p-sky-800:#164a7a;
  --gd-p-pink-100:#fbe4ee; --gd-p-pink-300:#f3b6cf;  --gd-p-pink-500:#d6578a;  --gd-p-pink-800:#7a1f45;   /* Friendship (see DESIGN.md "Friendship colour") */
  --gd-p-mint-500:#1d7a5f;  --gd-p-mint-800:#0d4334;
  --gd-p-night-900:#141a2a; --gd-p-night-800:#1d2539; --gd-p-night-700:#2a3450;
  --gd-p-white:#ffffff;     /* print paper only */
  /* Storybook Studio (ADR 0021): paper, slate ink, pine action, dusk night, gouache suits */
  --gd-p-paper-50:#fffcf6;  --gd-p-paper-100:#f6f1e7; --gd-p-paper-150:#efe8da; --gd-p-paper-200:#ede6d8; --gd-p-paper-300:#e4daca; --gd-p-paper-400:#cfc4b1;
  --gd-p-slate-950:#141c1d; --gd-p-slate-900:#1e2a2c; --gd-p-slate-800:#3a4547; --gd-p-slate-700:#4a5557; --gd-p-slate-600:#5b6567; --gd-p-mist-100:#e9e4da;
  --gd-p-pine-100:#dceae5;  --gd-p-pine-700:#1f5a55;  --gd-p-pine-900:#163f3c;
  --gd-p-dusk-100:#e3e6ee;  --gd-p-dusk-800:#2a3a5e;  --gd-p-dusk-900:#1d2b4a;
  --gd-p-honey-100:#fbefd2; --gd-p-honey-300:#f5e2b5; --gd-p-honey-500:#e8b13a; --gd-p-honey-800:#7a5208;      /* Comfort suit */
  --gd-p-clay-100:#f7e1d4;  --gd-p-clay-300:#f2d3c2;  --gd-p-clay-500:#cf6b3e;  --gd-p-clay-800:#93401c;       /* Food suit */
  --gd-p-cobalt-100:#e0e7f4; --gd-p-cobalt-300:#ccd6ec; --gd-p-cobalt-500:#3d5fa3; --gd-p-cobalt-800:#263f73;  /* Courage suit (was rose-red in v2) */
  --gd-p-rosehip-100:#f7e3e8; --gd-p-rosehip-300:#edc2ce; --gd-p-rosehip-500:#d98aa0; --gd-p-rosehip-800:#8a3552; /* Friendship suit */
  --gd-p-dawn-100:#faf0d7;  --gd-p-dawn-300:#f4d27e;  --gd-p-dawn-500:#d9a53a;  --gd-p-dawn-800:#6e4a0a;  --gd-p-dawn-900:#2e2006;   /* Jesus card */
  --gd-p-damson-50:#f6eef5; --gd-p-damson-100:#efe4ee; --gd-p-damson-500:#6b3f69;                              /* Grumble card */
  --gd-p-cucumber-500:#7fa35a;
  /* Version A (classic Grumble, frozen) colours. Only the classic-only aliases at the end of :root read these. */
  --gd-p-classic-lime-50:#f7fee7; --gd-p-classic-lime-100:#ecfccb; --gd-p-classic-lime-600:#65a30d; --gd-p-classic-lime-900:#365314;
  --gd-p-classic-red-600:#dc2626; --gd-p-classic-red-900:#7f1d1d; --gd-p-classic-pink-900:#831843;
  --gd-p-classic-gold-50:#fffdf5; --gd-p-classic-gold-100:#fffbeb; --gd-p-classic-gold-200:#fde68a; --gd-p-classic-gold-800:#92400e;

  /* ---------- 2. SEMANTIC ---------- */
  --gd-paper:var(--gd-p-paper-50);      /* card + panel ground */
  --gd-page:var(--gd-p-paper-100);      /* site page ground */
  --gd-table:var(--gd-p-paper-100);     /* app background ("the table") */
  --gd-table-2:var(--gd-p-paper-150);   /* table gradient end */
  --gd-line:var(--gd-p-paper-300);      /* hairlines, disabled fills */
  --gd-line-strong:var(--gd-p-paper-400); /* dashed rules and dividers */
  --gd-soon:var(--gd-p-paper-200);      /* "coming soon" fill */
  --gd-ink:var(--gd-p-slate-900);       /* text (Good Deeds card outlines too) */
  --gd-ink-deep:var(--gd-p-slate-950); /* text on mid-tone fills (the Good Deed leaf ribbon) */
  --gd-ink-soft:var(--gd-p-slate-700);  /* secondary text */
  --gd-ink-verse:var(--gd-p-slate-800); /* card verses */
  --gd-ink-mute:var(--gd-p-slate-600);  /* tertiary text, still >= 4.5:1 on paper and table */
  --gd-on-table:var(--gd-ink);          /* text placed straight on the table (headings, log) */
  --gd-on-table-soft:var(--gd-ink-soft);
  --gd-cut:var(--gd-p-ink-400);         /* print cut lines + crop marks */
  /* card types: base (frame/medallion) · ink (text on paper) · tint (panel bg) */
  --gd-character:var(--gd-p-lapis-500);  --gd-character-ink:var(--gd-p-lapis-700); --gd-character-tint:var(--gd-p-lapis-100);
  --gd-problem:var(--gd-p-amber-500);    --gd-problem-ink:var(--gd-p-amber-700);   --gd-problem-tint:var(--gd-p-amber-100);
  --gd-temptation:var(--gd-p-plum-700);  --gd-temptation-ink:var(--gd-p-plum-700); --gd-temptation-tint:var(--gd-p-plum-100);
  --gd-deed:var(--gd-p-leaf-500);        --gd-deed-ink:var(--gd-p-leaf-700);       --gd-deed-tint:var(--gd-p-leaf-100);
  --gd-clock:var(--gd-p-sun-500);       --gd-clock-ink:var(--gd-p-sun-800);       --gd-clock-tint:var(--gd-p-sun-300);   /* Clock card, sun side */
  --gd-clock-night:var(--gd-p-night-800); --gd-clock-night-tint:var(--gd-p-night-700);                                        /* Clock card, moon side */
  --gd-aid:var(--gd-p-ink-700);          --gd-aid-ink:var(--gd-p-ink-900);         --gd-aid-tint:var(--gd-p-cream-100);
  /* Grumble (Version B): Jesus card is gold, the Grumble card and back are plum; rank-card frames use the token colours */
  --gd-jesus:var(--gd-p-dawn-500);       --gd-jesus-ink:var(--gd-p-dawn-800);      --gd-jesus-tint:var(--gd-p-dawn-100);  --gd-on-jesus:var(--gd-p-dawn-900);
  --gd-grumble:var(--gd-p-damson-500);   --gd-grumble-ink:var(--gd-p-damson-500);  --gd-grumble-tint:var(--gd-p-damson-100); --gd-grumble-card:var(--gd-p-damson-50);
  --gd-cucumber:var(--gd-p-cucumber-500);
  --gd-sun:var(--gd-p-dawn-300);        /* the sun disc behind every Grumble figure, and gold words on night */
  /* Choose one! is mint (a kindness task, distinct from the leaf Good Deed and the plum Grumble).
     Rules cards are lapis, one step darker than the character frame. */
  --gd-choice:var(--gd-p-pine-700);      --gd-choice-ink:var(--gd-p-pine-700);     --gd-choice-tint:var(--gd-p-pine-100); --gd-choice-b:var(--gd-p-paper-150);
  --gd-rules:var(--gd-p-dusk-900);       --gd-rules-ink:var(--gd-p-dusk-900);      --gd-rules-tint:var(--gd-p-dusk-100);
  /* One fill per card back (ADR 0058, Option 1): number pine #1F5A55, Choose one! red #A8281E, rules cobalt #263F73,
     so the three backs read apart when printed at home. Hearts on number cards are one red, not the suit colour. */
  --gd-back-number:var(--gd-p-pine-700);
  --gd-back-choice:var(--gd-p-rose-500);
  --gd-back-rules:var(--gd-p-cobalt-800);
  --gd-heart:var(--gd-p-rose-400);
  /* Grumble suits (Storybook Studio): base (glyph, filled dots, art) · ink (number, words, reference) · tint (art window) · dot (empty dots).
     They differ in lightness too (L* 76 · 59 · 42 · 66), so the suits still read apart in greyscale print. Good Deeds keeps its own --gd-tok-*. */
  --gd-suit-comfort:var(--gd-p-honey-500);    --gd-suit-comfort-ink:var(--gd-p-honey-800);    --gd-suit-comfort-tint:var(--gd-p-honey-100);    --gd-suit-comfort-dot:var(--gd-p-honey-300);
  --gd-suit-food:var(--gd-p-clay-500);        --gd-suit-food-ink:var(--gd-p-clay-800);        --gd-suit-food-tint:var(--gd-p-clay-100);        --gd-suit-food-dot:var(--gd-p-clay-300);
  --gd-suit-courage:var(--gd-p-cobalt-500);   --gd-suit-courage-ink:var(--gd-p-cobalt-800);   --gd-suit-courage-tint:var(--gd-p-cobalt-100);   --gd-suit-courage-dot:var(--gd-p-cobalt-300);
  --gd-suit-friendship:var(--gd-p-rosehip-500); --gd-suit-friendship-ink:var(--gd-p-rosehip-800); --gd-suit-friendship-tint:var(--gd-p-rosehip-100); --gd-suit-friendship-dot:var(--gd-p-rosehip-300);
  /* tokens: fill · ink (label text on paper) · detail (marks drawn ON the fill).
     Lightness ladder L* ~ 84 → 66 → 58 → 46 → 38 so greyscale print still separates them; silhouettes do the rest */
  --gd-tok-comfort:var(--gd-p-sun-500);     --gd-tok-comfort-ink:var(--gd-p-sun-800);
  --gd-tok-food:var(--gd-p-toast-500);      --gd-tok-food-ink:var(--gd-p-toast-900);
  --gd-tok-friendship:var(--gd-p-pink-500); --gd-tok-friendship-ink:var(--gd-p-pink-800);
  --gd-tok-healing:var(--gd-p-mint-500);    --gd-tok-healing-ink:var(--gd-p-mint-800);
  --gd-tok-courage:var(--gd-p-rose-500);    --gd-tok-courage-ink:var(--gd-p-rose-800);
  --gd-tok-any:var(--gd-p-cream-50);        --gd-tok-any-ink:var(--gd-p-ink-900);
  --gd-tok-comfort-detail:var(--gd-p-sun-800); --gd-tok-food-detail:var(--gd-p-toast-900); --gd-tok-friendship-detail:var(--gd-p-cream-50);
  --gd-tok-healing-detail:var(--gd-p-cream-50); --gd-tok-courage-detail:var(--gd-p-cream-50); --gd-tok-any-detail:var(--gd-p-ink-900);
  /* UI roles, decoupled from card types */
  --gd-action:var(--gd-p-pine-700);  --gd-action-strong:var(--gd-p-pine-900); --gd-on-action:var(--gd-p-paper-50);
  --gd-night:var(--gd-p-dusk-900);   --gd-night-2:var(--gd-p-dusk-800);        /* header / HUD, site bands, Grumble backs */
  --gd-on-night:var(--gd-p-paper-50); --gd-on-night-soft:var(--gd-p-mist-100); --gd-on-night-accent:var(--gd-p-dawn-300);
  --gd-gold:var(--gd-p-sun-500);     /* Good Deeds selection highlight (always paired with an ink outline). The online Grumble no longer uses it: see --gd-select */
  --gd-select:var(--gd-action); --gd-select-gap:var(--gd-paper); --gd-select-tint:var(--gd-choice-tint);   /* online Grumble (ADR 0046): the ring of a chosen option, the turn seat and a picked card; the gap inside it; the chosen option's fill. Night: leaf ring, table gap */
  --gd-gold-ink:var(--gd-p-sun-800); /* gold rules and edges on paper */
  --gd-focus:var(--gd-p-lapis-700);  /* focus ring: 3:1 on paper AND table */
  --gd-target:var(--gd-action); --gd-target-gap:var(--gd-paper);   /* "play here" ring and the gap inside it (night: leaf on felt) */
  --gd-danger:var(--gd-p-rose-500);  --gd-success:var(--gd-p-leaf-700); --gd-warn:var(--gd-p-amber-700);
  --gd-scrim:rgb(20 26 42 / .72);
  --gd-warn-tint:var(--gd-p-amber-100); --gd-mat:var(--gd-p-cream-100);   /* warning band on cards; diagram mats in print */

  /* typography */
  --gd-font-display:"Fraunces",Georgia,"Times New Roman",serif;
  --gd-font-body:"Atkinson Hyperlegible Next",system-ui,"DejaVu Sans",sans-serif;
  --gd-font-soft:"SOFT" 100;   /* Fraunces soft axis on; font-variation-settings is inherited, so it is set on page and card roots */
  --gd-fw-body:400; --gd-fw-semi:600; --gd-fw-strong:700; --gd-fw-display:600;
  --gd-lh-tight:1.08; --gd-lh-snug:1.22; --gd-lh-body:1.4;
  /* UI fluid scale (rem = 16px). Floor for anything a child must read = 15px */
  --gd-text-xs:clamp(.875rem,.84rem + .15vw,.9375rem);   /* 14–15  meta only */
  --gd-text-sm:clamp(.9375rem,.9rem + .2vw,1.0625rem);   /* 15–17 */
  --gd-text-md:clamp(1.0625rem,1rem + .3vw,1.25rem);     /* 17–20  body */
  --gd-text-lg:clamp(1.25rem,1.1rem + .6vw,1.5rem);      /* 20–24  prompt bar */
  --gd-text-xl:clamp(1.5rem,1.2rem + 1.2vw,2.125rem);    /* 24–34  headings */
  --gd-text-2xl:clamp(2rem,1.4rem + 2.6vw,3.25rem);      /* 32–52  turn interstitial */
  /* card scale in card units (1em = 1 card unit = 1mm in print). 2.8em = 7.9pt, 3.4em = 9.6pt */
  --card-fs-name:5.2em; --card-fs-token:4.6em; --card-fs-rules:3.4em;
  --card-fs-label:2.8em; --card-fs-flavor:2.9em; --card-fs-meta:2.8em; --card-fs-kind:2.8em;
  --card-text-floor:0px;   /* the web app sets 13px: font-size:max(<em>, floor) */

  /* space (4-pt UI scale; card scale is 1mm) */
  --gd-space-1:.25rem; --gd-space-2:.5rem; --gd-space-3:.75rem; --gd-space-4:1rem;
  --gd-space-5:1.5rem; --gd-space-6:2rem;  --gd-space-7:3rem;   --gd-space-8:4rem;
  --gd-tap-min:48px;

  /* radii */
  --gd-radius-sm:8px; --gd-radius-md:14px; --gd-radius-lg:20px; --gd-radius-xl:24px; --gd-radius-pill:999px;
  --card-radius:3.2em; --card-radius-inner:2em; --card-radius-box:1.6em;

  /* strokes (card units) */
  --card-frame:2.4em;       /* coloured frame width */
  --card-frame-num:2.4em;   /* Grumble B number cards: the same frame as Good Deeds, so the suit colour reads (was .9em) */
  --card-outline:.45em;     /* ink outline round the frame (D-2: frames need it for 3:1 on the table) */
  --card-hair:.3em;         /* inner hairlines */

  /* elevation: paper on paper. A hairline edge in ink, then a soft warm shadow (no hard offset) */
  --gd-shadow-ink:70 48 24; --gd-edge-ink:30 42 44;
  --gd-elev-0:none;
  --gd-elev-1:0 1px 0 rgb(var(--gd-edge-ink) / .06),0 4px 10px rgb(var(--gd-shadow-ink) / .10);
  --gd-elev-2:0 1px 0 rgb(var(--gd-edge-ink) / .06),0 10px 22px rgb(var(--gd-shadow-ink) / .14);
  --gd-elev-3:0 1px 0 rgb(var(--gd-edge-ink) / .06),0 18px 36px rgb(var(--gd-shadow-ink) / .20);
  --card-elev:0 .25em 0 rgb(var(--gd-edge-ink) / .06),0 3.2em 6.8em rgb(var(--gd-shadow-ink) / .16);

  /* motion. Speed toggle scales durations with --anim-k; "Off" is data-motion="off" + animation:none, never a tiny scale */
  --gd-dur-instant:90ms; --gd-dur-quick:160ms; --gd-dur-base:260ms; --gd-dur-slow:420ms; --gd-dur-story:700ms;
  --gd-ease-standard:cubic-bezier(.2,0,0,1);
  --gd-ease-enter:cubic-bezier(0,0,.2,1);
  --gd-ease-exit:cubic-bezier(.4,0,1,1);
  --gd-ease-pop:cubic-bezier(.34,1.56,.64,1);
  --anim-k:1;
  /* durations the web game reads with getComputedStyle (web/src/ui/motion.js dur()). Keep these names. */
  --dur-fast:200ms; --dur-med:400ms; --dur-slow:600ms;

  /* layers */
  --gd-z-hand:10; --gd-z-sticky:20; --gd-z-fly:50; --gd-z-toast:60; --gd-z-scrim:80; --gd-z-dialog:90; --gd-z-tip:100;

  /* print geometry (mm). Home sheets: 4mm white gutter. Print-shop: 3mm bleed, 8mm mark area. */
  --print-trim-w:63mm; --print-trim-h:88mm; --print-bleed:3mm; --print-safe:4mm; --print-gutter:4mm; --print-mark:3mm;
  --print-cut-w:.2mm; --print-paper:var(--gd-p-white); --print-shop-margin:8mm;
  /* Tuck-box dieline (ADR 0032): the usual print-shop colours for the cut and the fold lines, never printed on the box. */
  --print-die-cut:#e6007e; --print-die-fold:#00a0e9;
  --print-crop-len:4mm; --print-crop-gap:1.2mm;
  --print-space-1:1mm; --print-space-2:2mm; --print-space-3:3mm; --print-space-4:4mm;   /* spacing on printed pages (rules, kit) */
  --card-unit:1mm;

  /* ---------- 3. COMPONENT defaults (components override per variant) ---------- */
  --btn-bg:var(--gd-action); --btn-fg:var(--gd-on-action); --btn-border:var(--gd-action); --btn-edge:var(--gd-action-strong);
  --btn-2-bg:var(--gd-paper); --btn-2-fg:var(--gd-ink); --btn-2-border:var(--gd-ink); --btn-off-bg:var(--gd-soon); --btn-off-fg:var(--gd-ink-soft);
  --btn-radius:var(--gd-radius-md); --btn-line:1.5px;
  --hud-bg:var(--gd-night); --hud-fg:var(--gd-on-night); --hud-pill:rgb(255 252 246 / .14);
  --hud-meter-track:var(--gd-p-night-900); --hud-meter-helped:var(--gd-p-leaf-300); --hud-meter-row:var(--gd-p-amber-300); --hud-meter-danger:var(--gd-p-rose-400);
  --badge-outline:var(--gd-ink);
  --gd-level-bg:var(--gd-paper); --gd-level-ink:var(--gd-ink);   /* level badge (L + pips): never a colour code */
  --ring-select:0 0 0 .7em var(--gd-ink),0 0 0 1.6em var(--gd-gold);
  --ring-target:0 0 0 .7em var(--gd-paper),0 0 0 1.5em var(--gd-action);
  --glow-target:rgb(79 154 62 / .35); --glow-select:rgb(247 205 46 / .45);   /* animated halo only; the rings above carry contrast */

  /* ---------- CLASSIC-ONLY legacy aliases (v1 names) ----------
     Grumble Version A (games/grumble/grumble-A.html) is frozen and still reads these, through the classic-only rules
     in components.css (.gd-rank*, .gd-jesus*, .gd-card--grumble, .gd-value, .gd-meter9, .gd-rank-back--classic).
     Nothing else may use them: Good Deeds, Grumble B, the starter kit, the web game and the site use --gd-* only.
     Raw colours live in the --gd-p-classic-* primitives above. */
  --ink:var(--gd-ink); --ink-soft:var(--gd-ink-soft); --ink-mute:var(--gd-ink-mute); --paper:var(--gd-paper); --white:var(--gd-paper);
  --table:var(--gd-table); --table-2:var(--gd-table-2); --gold:var(--gd-gold); --danger:var(--gd-danger);
  --font-display:var(--gd-font-display); --font-body:var(--gd-font-body);
  --t-character-main:var(--gd-character); --t-character-dark:var(--gd-character-ink); --t-character-light:var(--gd-character-tint);
  --t-problem-main:var(--gd-problem); --t-problem-dark:var(--gd-problem-ink); --t-problem-light:var(--gd-problem-tint);
  --t-temptation-main:var(--gd-temptation); --t-temptation-dark:var(--gd-temptation-ink); --t-temptation-light:var(--gd-temptation-tint);
  --t-deed-main:var(--gd-deed); --t-deed-dark:var(--gd-deed-ink); --t-deed-light:var(--gd-deed-tint);
  --fw-bold:var(--gd-fw-strong); --fw-semi:var(--gd-fw-semi);
  --r-pill:var(--gd-radius-pill); --r-card:var(--card-radius); --r-box:var(--card-radius-box);
  --sp-1:1em; --sp-2:2em; --sp-3:3em; --sp-4:4em;
  --bw-thin:var(--card-hair); --bw-outline:var(--card-outline); --bw-cut:var(--print-cut-w);
  --sh-card:var(--card-elev); --sh-ui:var(--gd-elev-1); --sh-banner:0 .5em 0 rgb(var(--gd-shadow-ink) / .25);
  --fs-card-name:var(--card-fs-name); --fs-card-kind:var(--card-fs-kind); --fs-card-body:var(--card-fs-rules); --fs-card-small:var(--card-fs-label);
  --fs-verse:2.45em; --lh-tight:var(--gd-lh-tight);
  --gold-dark:var(--gd-gold-ink);
  --tok-comfort:var(--gd-tok-comfort); --tok-comfort-ink:var(--gd-tok-comfort-ink);
  --tok-food:var(--gd-tok-food); --tok-food-ink:var(--gd-tok-food-ink);
  --tok-courage:var(--gd-tok-courage); --tok-courage-ink:var(--gd-tok-courage-ink);
  --tok-healing:var(--gd-tok-healing); --tok-healing-ink:var(--gd-tok-healing-ink);
  --tok-friendship:var(--gd-tok-friendship); --tok-friendship-ink:var(--gd-tok-friendship-ink);
  --t-character-paper:var(--gd-paper); --t-problem-paper:var(--gd-paper); --t-temptation-paper:var(--gd-paper); --t-deed-paper:var(--gd-paper);
  --t-grumble-main:var(--gd-p-classic-lime-600); --t-grumble-dark:var(--gd-p-classic-lime-900); --t-grumble-light:var(--gd-p-classic-lime-100); --t-grumble-paper:var(--gd-p-classic-lime-50);
  --suit-red:var(--gd-p-classic-red-600); --suit-ink:var(--gd-ink); --suit-courage-dark:var(--gd-p-classic-red-900); --suit-friendship-dark:var(--gd-p-classic-pink-900);
  --jesus-main:var(--gd-p-classic-gold-200); --jesus-dark:var(--gd-p-classic-gold-800); --jesus-light:var(--gd-p-classic-gold-100); --jesus-paper:var(--gd-p-classic-gold-50);
}

/* "Night table": app chrome only. Cards stay paper, like physical cards on dark felt.
   Opt in with <html data-theme="night">; follows the OS dark mode unless data-theme="day". Print is always day. */
:root[data-theme="night"]{
  --gd-table:var(--gd-p-night-900); --gd-table-2:var(--gd-p-night-800); --gd-night:var(--gd-p-night-800); --gd-night-2:var(--gd-p-night-700);
  --gd-on-table:var(--gd-p-cream-50); --gd-on-table-soft:var(--gd-p-cream-300); --gd-focus:var(--gd-p-sun-500);
  --hud-meter-track:var(--gd-p-night-900);
  --ring-target:0 0 0 .7em var(--gd-p-night-900),0 0 0 1.5em var(--gd-p-leaf-300);
  --gd-target:var(--gd-p-leaf-300); --gd-target-gap:var(--gd-p-night-900);
  --gd-select:var(--gd-p-leaf-300); --gd-select-gap:var(--gd-p-night-900);
}
@media screen and (prefers-color-scheme:dark){ :root:not([data-theme="day"]){
  --gd-table:var(--gd-p-night-900); --gd-table-2:var(--gd-p-night-800); --gd-night:var(--gd-p-night-800); --gd-night-2:var(--gd-p-night-700);
  --gd-on-table:var(--gd-p-cream-50); --gd-on-table-soft:var(--gd-p-cream-300); --gd-focus:var(--gd-p-sun-500);
  --hud-meter-track:var(--gd-p-night-900);
  --ring-target:0 0 0 .7em var(--gd-p-night-900),0 0 0 1.5em var(--gd-p-leaf-300);
  --gd-target:var(--gd-p-leaf-300); --gd-target-gap:var(--gd-p-night-900);
  --gd-select:var(--gd-p-leaf-300); --gd-select-gap:var(--gd-p-night-900);
}}
