/*
  Design tokens of the TriviAI web game. Colours come from the Unity sources named beside them
  (client/Unity/Assets/Scripts/UI/Utilities/BrandPalette.cs, HeaderTheme.cs, AdventureWarmTheme.cs)
  and the approved player palette in AGENTS.md.

  Units: Unity UI is authored on a 1080x1920 canvas (CanvasScaler match 0.5). --u is the CSS size
  of one canvas unit and is set by js/ui/layout.js:
    phone   (< 760 px wide): sqrt((w / 1080) * (h / 1920)), the CanvasScaler's own factor
    wide    (>= 760 px):      a fixed density for the desktop column layout
  Size anything taken from a prefab as calc(N * var(--u)).
*/
:root {
  --u: 0.42px;

  /* brand */
  --navy: #001242;
  --ink: #1b2559;
  --ink-strong: #041845;
  --ink-muted: #3c465a;
  --ink-soft: rgba(27, 37, 89, 0.62);
  --cream: #fff6e3;
  --cream-rim: #eddfc2;
  --white: #ffffff;
  --warm: #f8f6f1;
  --card-warm: #fbf8f2;
  --page-mint: #e3f1e8;

  /* actions */
  --yellow: #feb90b;
  --action-yellow: #ffc800;
  --amber-edge: #965c00;
  --amber: #ffae0d;
  --amber-ink: #8f4403;
  --gold: #f4b43a;

  /* modes (approved HTML palette) */
  --mode-master: #ffae0d;
  --mode-rapid: #2fcb6a;
  --mode-adventure: #7050b8;
  --mode-couch: #d384b1;
  --mode-online: #3a7bd5;

  /* semantic */
  --brand-green: #0d8439;
  --correct: #0b9f49;
  --correct-ink: #07672f;
  --correct-soft: #cfedd6;
  --danger: #dd6251;
  --danger-ink: #ad292e;
  --danger-soft: #f9e1df;
  --alert: #ff4c3d;
  --slate: #566596;
  --disabled-face: #b5bac1;
  --news-blue: #5cabeb;
  --home-green: #37d479;
  --section-grey: #5f6877;

  /* hub chrome: HeaderTheme.Aurora* (translucent near-white band over the park art) */
  --aurora-band: rgba(246, 249, 255, 0.88);
  --aurora-hairline: rgba(27, 37, 89, 0.14);
  --aurora-ring-track: rgba(27, 37, 89, 0.16);
  --tabbar-top: #304580;
  --tabbar: #071845;

  /* type */
  --font: 'Rubik', 'DejaVu Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
  --w-extrabold: 800;
  --w-black: 900;
  /* TMP draws a bold-style label with the font asset's boldSpacing (7 units on Rubik's ~66-unit faces):
     about 0.105em more advance per letter. Every Unity label with style Bold (buttons, popup titles)
     carries it, which is the airy look of the game's buttons. */
  --tmp-bold: 0.105em;

  /* the white-on-colour text treatment (owner rule 15 Oct 2026): white text, 1 px dark shadow */
  --on-colour-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.25);

  /* geometry (canvas units, HeaderTheme) */
  --header-h: calc(180 * var(--u));
  --control: calc(88 * var(--u));
  --tabbar-h: calc(200 * var(--u));
  --hub-band-h: calc(156 * var(--u));
  --radius-card: calc(44 * var(--u));
  --radius-row: calc(40 * var(--u));

  /* safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* wide layout */
  --rail-w: 104px;
  --column-max: 1160px;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 120ms;
  --t-med: 220ms;
  --t-slow: 420ms;
}

.reduced-motion {
  --t-fast: 0ms;
  --t-med: 0ms;
  --t-slow: 0ms;
}

/* large monitors: the hub column grows past the laptop width instead of leaving wide empty margins */
@media (min-width: 1600px) {
  :root {
    --column-max: clamp(1160px, calc(100vw - 440px), 1480px);
  }
}
