/* ==========================================================================
   Typing Games — design tokens layered on top of assets/css/tokens.css.
   Loaded only on /typing-games/* pages, so every rule in this file is
   scoped to the learning centre — nothing here reaches any other page.

   Palette: a Bisleri-inspired aqua green plus a bright complementary
   yellow, specific to the Typing Games & Champions identity (not the
   institute's main green/gold palette, and not a claim about Bisleri's
   own brand colors). Contrast-checked pairings (WCAG AA, 4.5:1 for normal
   text / 3:1 for large text or UI boundaries):
     - Deep green text on yellow:      5.8:1  (primary buttons, badges)
     - White text on deep green:       8.0:1  (dark emphasis, footers)
     - Ink text on aqua green:         6.3:1  (safe for body text)
     - Deep green text on aqua green:  3.0:1  (large/bold text only — see
       usage notes below; never used for small body copy)
   ========================================================================== */

:root {
  /* ---- Raw palette ---- */
  --tg-aqua-green: #00b3a1;
  --tg-yellow: #ffd84d;
  --tg-yellow-deep: #ffcf26; /* hover/active state for yellow fills — still 5.4:1+ with deep-green text */
  --tg-deep-green: #075b50;
  --tg-deep-green-hover: #054238;
  --tg-pale-aqua: #c9f1e9;
  --tg-soft-bg: #f7f8f3;
  --tg-white: #ffffff;
  --tg-yellow-wash: #fff6d9; /* light tint for key/char "active" backgrounds */

  /* ---- Re-scoped semantic tokens ----
     These are the SAME variable names assets/css/components.css and
     layout.css already consume (.btn, .card, .kicker, .section--muted,
     etc.) — redefining their values here, in a stylesheet only the
     typing-games pages load, gives the learning centre its own identity
     while every shared component keeps working unmodified. */
  --color-bg: var(--tg-soft-bg);
  --color-bg-raised: var(--tg-white);
  --color-text: var(--ink);
  --color-text-muted: #4b5a54;
  --color-border: #bfe6df;
  --color-primary: var(--tg-deep-green);
  --color-primary-hover: var(--tg-deep-green-hover);
  --color-on-primary: var(--tg-white);
  --color-accent: var(--tg-aqua-green);
  --color-kicker: var(--tg-deep-green);
  --color-kicker-bg: var(--tg-pale-aqua);
  --color-gold: var(--tg-yellow);
  --color-focus-ring: var(--tg-deep-green);

  --color-button-bg: var(--tg-yellow);
  --color-button-text: var(--tg-deep-green);
  --color-button-hover: var(--tg-yellow-deep);

  /* ---- Visual keyboard key states ---- */
  --tg-key-bg: var(--white);
  --tg-key-border: var(--color-border);
  --tg-key-bg-active: var(--tg-yellow-wash);
  --tg-key-border-active: var(--tg-yellow);
  --tg-key-bg-correct: var(--tg-pale-aqua);
  --tg-key-border-correct: var(--tg-aqua-green);
  --tg-key-bg-incorrect: #fde3e0;
  --tg-key-border-incorrect: #c23b2d;

  /* ---- Character-level highlighting in passages ---- */
  --tg-char-correct: var(--tg-deep-green);
  --tg-char-correct-bg: var(--tg-pale-aqua);
  --tg-char-incorrect: #ffffff;
  --tg-char-incorrect-bg: #c23b2d;
  --tg-char-current-bg: var(--tg-yellow-wash);
  --tg-char-current-caret: var(--tg-deep-green);

  /* ---- Badge tiers (Hall of Fame + achievements) ---- */
  --tg-badge-gold: var(--tg-yellow);
  --tg-badge-silver: #c7cdd6;
  --tg-badge-bronze: #d08a4d;
  --tg-badge-locked-bg: var(--mist);
  --tg-badge-locked-text: var(--color-text-muted);
}

/* .section--muted (components.css) re-scoped from the sitewide pale-green
   wash to pale aqua, so the hub's widget band reads as part of this
   page's own palette rather than the institute's default green wash. */
.section--muted {
  --color-bg: var(--tg-pale-aqua);
  --color-bg-raised: var(--tg-white);
}
