/**
 * Chatlings / Glødkeeper — canonical TYPE SYSTEM
 * ============================================================================
 * One place that names the three type roles and the reading scale the whole
 * app should share. Loaded on every page by simple-header.js, so these tokens
 * are always available.
 *
 * GOAL: consistency without a straitjacket. Pages keep their own layout; they
 * just pull sizes/fonts from these named tokens instead of inventing new ones
 * per session. When you reach for a font-family or a font-size, use a token.
 *
 * The rem scale is anchored to the "How to play" modal (game-guides.js →
 * .guide-modal-shared), which is our trusted long-form reading reference:
 *   body/li 1.3rem · h3 1.5rem · h2 1.95rem.
 *
 * ALWAYS write tokens with a literal fallback — var(--fs-body, 1.3rem) — so a
 * page still renders correctly if this sheet is slow or missing.
 * ============================================================================
 */

:root {
  /* ---- Three font ROLES (use these three; avoid new families) ---------- */

  /* UI / workhorse — menus, buttons, controls, most body copy. The default. */
  --font-ui: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  /* Atlas / wiki — world reading: locations, lore, Field Notes, codex pages.
     The serif deliberately signals "reference reading", not interactive UI. */
  --font-atlas: 'EB Garamond', Georgia, serif;

  /* Display accent — playful hero headings & big HUD numbers (Caveat).
     Requires the Caveat @import on the page; falls back to the UI stack. */
  --font-display: 'Caveat', 'Segoe UI', cursive;

  /* Mono — IDs, debug readouts, log panels ONLY. Never body copy. */
  --font-mono: 'Courier New', monospace;

  /* ---- Type SCALE (rem — anchored to the How-to-play modal) ------------ */
  --fs-display: 2.6rem;  /* Caveat hero titles, splash numbers            */
  --fs-h1:      2.4rem;  /* page title                                    */
  --fs-h2:      1.95rem; /* section heading  (== modal h2)                */
  --fs-h3:      1.5rem;  /* sub-heading      (== modal h3)                */
  --fs-body:    1.3rem;  /* long-form reading (== modal body) — wiki/lore */
  --fs-ui:      1rem;    /* compact UI: buttons, controls, dense lists     */
  --fs-label:   0.9rem;  /* captions, tags, meta                          */
  --fs-small:   0.8rem;  /* fine print, IDs                               */

  /* ---- Line heights ---------------------------------------------------- */
  --lh-tight: 1.2;  /* headings, HUD */
  --lh-body:  1.5;  /* reading text  */

  /* ---- Rarity colours (R2-51; owner picked the card-reveal pair 2026-11-18) --
     THE palette for CSS. JavaScript uses window.RarityColors
     (user/components/rarity-colors.js) — the same values, pinned by
     test/unit/rarity-colors.test.js. Face colour, then the deep shade. */
  --rarity-common:         #94A3B8;
  --rarity-common-deep:    #64748B;
  --rarity-uncommon:       #10B981;
  --rarity-uncommon-deep:  #059669;
  --rarity-rare:           #667eea;
  --rarity-rare-deep:      #4F46E5;
  --rarity-epic:           #9D50BB;
  --rarity-epic-deep:      #6E48AA;
  --rarity-legendary:      #FFD700;
  --rarity-legendary-deep: #FFA500;
  --rarity-mythic:         #FF1493;
  --rarity-mythic-deep:    #FF69B4;
}

/**
 * Responsive root anchor.
 * ---------------------------------------------------------------------------
 * rem is anchored to the browser default (16px) on phones — the PWA's primary
 * platform — so activating this changes NOTHING there. Tablets/desktop get a
 * gentle bump so rem-based layouts breathe on larger screens.
 *
 * NOTE: this intentionally does NOT reproduce the old (unused) landscape
 * "shrink to 14px" rule from styles/mobile-responsive.css — shrinking the root
 * would disrupt game boards that were tuned at 16px. Kept deliberately gentle.
 */
@media screen and (min-width: 768px) {
  :root { font-size: 17px; }
}

/**
 * OPTIONAL helper classes — pages may opt in, but tokens are the primary API.
 * Use these when you just want "the standard reading block" without bespoke CSS
 * (e.g. new wiki/lore sections). Not required; not a replacement for layout CSS.
 */
.type-reading {           /* a standard long-form reading block */
  font-family: var(--font-atlas, Georgia, serif);
  font-size: var(--fs-body, 1.3rem);
  line-height: var(--lh-body, 1.5);
}
.type-ui {                /* standard compact UI text */
  font-family: var(--font-ui, 'Segoe UI', sans-serif);
  font-size: var(--fs-ui, 1rem);
}
.type-display {           /* playful hero heading */
  font-family: var(--font-display, 'Segoe UI', cursive);
  font-size: var(--fs-display, 2.6rem);
  line-height: var(--lh-tight, 1.2);
}
