/* Deep Blue (docs/redesign/CANVAS.md, item 1). Colour values live here and nowhere else
   (tests/test_style_tokens.py). Every colour has one job; every text pairing used is WCAG AA
   (contrast noted next to the text tokens, measured on --bg and on --surface over --bg). */
:root {
  color-scheme: dark;

  /* ---------- Palette: the only colour values in the app ---------- */
  --navy: #0A1531;                       /* the background */
  --glow-blue: #2A5BD7;                  /* top-left glow */
  --glow-orange: #FF8A3D;                /* bottom-right glow */
  --blue: #2A5BD7;                       /* user messages, send, primary non-game actions */
  --blue-hover: #3B6CE8;                 /* icon buttons and borders only: text on it is 4.1 */
  --link: #8CC4FF;                       /* links and the focus ring; 9.3 on --bg */
  --play-from: #FFB060;                  /* games and Play only */
  --play-to: #FF7A2E;
  --gold: #FFC94D;                       /* XP, level, rewards only; 11.7 on --bg */
  --gold-rim: #E3A23A;                   /* Finn's coin rim */
  --mint: #4FE0B0;                       /* good outcome, money saved, done; 10.3 on --bg */
  --coral: #FF8A8A;                      /* cost, risk; 7.6 on --bg */
  --lilac: #C7B1FF;                      /* world / topic tags; 8.9 on --bg, 6.9 on its tag fill */
  --text-1: #EAF1FF;                     /* primary text; 16.1 on --bg */
  --text-body: #C9D6F2;                  /* body text; 12.3 on --bg */
  --text-2: #A9BAE0;                     /* secondary; 8.9 on --bg */
  --text-3: #7F93BF;                     /* muted; 5.5 on --bg, 4.7 on --surface */
  --on-bright: #0A1531;                  /* text on orange, gold and mint fills */

  /* ---------- Surfaces ---------- */
  --bg: var(--navy);
  --bg-glows:
    radial-gradient(60% 55% at 0% 0%, color-mix(in srgb, var(--glow-blue) 50%, transparent), transparent 70%),
    radial-gradient(55% 50% at 100% 100%, color-mix(in srgb, var(--glow-orange) 40%, transparent), transparent 70%);
  /* A handful of faint 1 px stars, static. */
  --bg-stars:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 34% 72%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 58% 26%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 81% 61%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 92% 12%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 23% 88%, rgba(255, 255, 255, 0.3), transparent);
  --pane: rgba(6, 13, 32, 0.5);          /* sidebar and right panel */
  --divider: rgba(255, 255, 255, 0.08);
  --surface: rgba(16, 30, 66, 0.85);     /* answer cards, sheets */
  --surface-solid: rgba(16, 30, 66, 1);  /* where nothing may show through (stage, dialogs) */
  --surface-soft: rgba(255, 255, 255, 0.05); /* tiles, panels */
  --border: rgba(255, 255, 255, 0.12);
  --border-card: rgba(140, 196, 255, 0.22);
  --scrim: rgba(3, 8, 22, 0.66);
  --tag-bg: rgba(176, 140, 255, 0.16);   /* lilac tag fill */
  --mint-bg: color-mix(in srgb, var(--mint) 16%, transparent);
  --coral-bg: color-mix(in srgb, var(--coral) 14%, transparent);
  --gold-bg: color-mix(in srgb, var(--gold) 14%, transparent);
  --blue-bg: color-mix(in srgb, var(--blue) 28%, transparent);
  --play: linear-gradient(180deg, var(--play-from), var(--play-to));
  --play-glow: 0 6px 16px rgba(255, 122, 46, 0.45);
  --shadow-raised: 0 16px 40px rgba(0, 0, 0, 0.35);  /* raised cards only */
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--link);

  /* ---------- Type ---------- */
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-ui);        /* headlines: 800, slight negative tracking */
  --font-num: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;  /* every number */
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14.5px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --tracking-head: -0.02em;

  /* ---------- Shape, space, motion ---------- */
  --r-12: 12px;
  --r-14: 14px;
  --r-18: 18px;
  --r-22: 22px;
  --r-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-fast: 150ms;
  --motion: 200ms;
  --motion-slow: 250ms;
  --lift: -1px;                          /* hover lift */
  --press: 0.98;                         /* press scale */

  /* ---------- Old names, mapped onto Deep Blue roles ----------
     Screens still use these; each item of the canvas moves its screen onto the roles above. */
  --paper: var(--bg);
  --paper-2: var(--surface-soft);
  --card: var(--surface);
  --panel: var(--surface);
  --raised: var(--surface-soft);
  --line: var(--border);
  --edge: var(--border-card);
  --outline: var(--border-card);
  --kit-ink: var(--border-card);
  --ink: var(--text-1);
  --muted: var(--text-2);
  --on-color: var(--text-1);             /* text on a tinted fill */
  --on-action: var(--text-1);            /* text on --action (blue) */
  --action: var(--blue);
  --action-dark: var(--blue);
  --action-shadow: var(--link);          /* used as a text colour */
  --sea: var(--blue);
  --leaf: var(--mint);
  --leaf-light: var(--mint-bg);
  --win: var(--mint-bg);
  --win-ink: var(--mint);
  --sky: var(--blue-bg);
  --info: var(--blue-bg);
  --info-ink: var(--link);
  --coin: var(--gold-bg);
  --coin-dark: var(--gold);
  --coin-ink: var(--gold);
  --lilac-fill: var(--tag-bg);
  --plum: var(--lilac);
  --rare: var(--tag-bg);
  --rare-ink: var(--lilac);
  --night-sky: var(--bg);
  --night-sky-deep: var(--bg);
  --night-gradient: var(--bg);
  --world-budget: var(--mint);
  --world-fees: var(--link);
  --world-debt: var(--coral);
  --world-growth: var(--blue);
  --world-mind: var(--lilac);
  --world-home: var(--gold);
  --world-budget-dark: var(--mint);
  --world-fees-dark: var(--link);
  --world-debt-dark: var(--coral);
  --world-growth-dark: var(--link);
  --world-mind-dark: var(--lilac);
  --world-home-dark: var(--gold);
  --world-budget-light: var(--mint-bg);
  --world-fees-light: var(--blue-bg);
  --world-debt-light: var(--coral-bg);
  --world-growth-light: var(--blue-bg);
  --world-mind-light: var(--tag-bg);
  --world-home-light: var(--gold-bg);
  --world-budget-shadow: transparent;
  --world-fees-shadow: transparent;
  --world-debt-shadow: transparent;
  --world-growth-shadow: transparent;
  --world-mind-shadow: transparent;
  --world-home-shadow: transparent;
  --text-sm: var(--fs-14);
  --text-md: var(--fs-16);
  --text-lg: var(--fs-20);
  --text-xl: var(--fs-24);
  --text-2xl: var(--fs-24);
  --r-control: var(--r-12);
  --r-card: var(--r-18);
  --radius-sm: var(--r-12);
  --radius-md: var(--r-14);
  --radius-lg: var(--r-18);
  --radius-pill: var(--r-pill);
  --radius: var(--r-18);
  --shadow-card: none;                   /* flat tiles; raised cards use --shadow-raised */
  --shadow-contact: none;
  --shadow: none;
  --press-shadow: none;                  /* no press edges: hover lifts, press scales */
  --press-shadow-soft: none;
  --ease-spring: var(--ease-out);        /* no bounce in the UI */
  --motion-tap: var(--motion-fast);
  --motion-card: var(--motion);
  --motion-scene: var(--motion-slow);
  --motion-xp: var(--motion-slow);
  --motion-level: var(--motion-slow);

  --z-base: 1;
  --z-nav: 40;
  --z-sheet: 60;
  --z-toast: 70;
  --z-modal: 80;
  /* Above the game stage (90): a level-up earned inside a game must be seen. */
  --z-celebrate: 95;

  /* ---------- Finn's Harbor 2D open-world canvas & handcrafted game chrome tokens ---------- */
  --harbor-outline: #050C1F;
  --harbor-plaque-bg: rgba(12, 24, 54, 0.94);
  --harbor-plaque-rim: rgba(140, 196, 255, 0.36);
  --harbor-plaque-hi: rgba(234, 241, 255, 0.14);
  --harbor-plaque-shadow: 0 4px 0 #050C1F, 0 10px 22px rgba(3, 8, 22, 0.48);
  --harbor-btn-bg: #162B5A;
  --harbor-btn-bg-hover: #1E3873;
  --harbor-btn-depth: 0 3px 0 #050C1F, 0 6px 14px rgba(3, 8, 22, 0.40);
  --harbor-play-depth: 0 4px 0 #9E3E10, 0 8px 18px rgba(255, 122, 46, 0.36);
  --harbor-mint-depth: 0 4px 0 #146B51, 0 6px 14px rgba(79, 224, 176, 0.28);
  --harbor-gold-depth: 0 4px 0 #8F5F10, 0 6px 14px rgba(255, 201, 77, 0.28);
  --harbor-attack-bg: linear-gradient(180deg, #FFC94D 0%, #FF8A65 55%, #F26464 100%);
  --harbor-attack-bg-active: linear-gradient(180deg, #FFE082 0%, #FF8A8A 100%);
  --harbor-attack-depth: 0 5px 0 #7C2228, 0 9px 20px rgba(255, 110, 96, 0.38);
  --harbor-dash-arcade-bg: linear-gradient(180deg, #8CC4FF 0%, #3B6CE8 100%);
  --harbor-dash-arcade-depth: 0 5px 0 #0B2259, 0 8px 18px rgba(42, 91, 215, 0.36);
  --harbor-boss-hp-bg: linear-gradient(90deg, #FF8A8A 0%, #FFB060 55%, #FFC94D 100%);
  --harbor-boss-vuln-bg: linear-gradient(90deg, #4FE0B0 0%, #FFC94D 100%);
  --harbor-goal-bg: rgba(16, 34, 74, 0.96);
  --harbor-goal-met-bg: rgba(14, 58, 54, 0.96);
  --harbor-modal-shadow: 0 6px 0 #050C1F, 0 22px 48px rgba(3, 8, 22, 0.65);

  --harbor-sea-abyss: #1F6EA3;
  --harbor-sea-mid: #3291CA;
  --harbor-sea-deep: #3EA6DB;
  --harbor-sea-shallow: #63CBE8;
  --harbor-sea-foam: rgba(255, 255, 255, 0.46);
  --harbor-sea-shimmer: rgba(255, 248, 220, 0.32);
  --harbor-sand-wet: rgba(176, 134, 78, 0.30);
  --harbor-sand-warm: rgba(252, 220, 148, 0.13);
  --harbor-grass-sun: rgba(255, 236, 158, 0.08);
  --harbor-grass-shade: rgba(10, 32, 46, 0.09);
  --harbor-plank-rim: rgba(74, 46, 22, 0.56);
  --harbor-plank-sun: rgba(255, 224, 150, 0.18);
  --harbor-sun-glow: rgba(255, 214, 120, 0.20);
  --harbor-shadow: rgba(5, 12, 31, 0.34);
  --harbor-gauge-bg: rgba(5, 12, 31, 0.88);
  --harbor-gauge-rim: rgba(234, 241, 255, 0.88);
  --harbor-prompt-bg: rgba(12, 24, 54, 0.95);
  --harbor-pad-ring: rgba(234, 241, 255, 0.28);
  --harbor-pad-fill: rgba(10, 21, 49, 0.42);
  --harbor-stone-pad: rgba(79, 224, 176, 0.38);
  --harbor-stone-ring: #4FE0B0;
  --harbor-hud-bg: rgba(10, 21, 49, 0.82);
  --harbor-hud-border: rgba(140, 196, 255, 0.28);
  --harbor-target-ring: rgba(255, 201, 77, 0.82);
  --harbor-bobber-line: rgba(234, 241, 255, 0.85);
  --harbor-dash-warning: rgba(255, 138, 138, 0.82);
  --harbor-dash-warning-fill: rgba(255, 138, 138, 0.16);
  --harbor-dash-magnet: rgba(255, 201, 77, 0.36);
  --harbor-dash-shield: rgba(79, 224, 176, 0.38);
  --harbor-dash-turbo: rgba(255, 176, 96, 0.42);
  --harbor-dash-tide: rgba(62, 166, 219, 0.78);
  --harbor-dash-wind: rgba(234, 241, 255, 0.34);
  --harbor-pocket-valid: rgba(79, 224, 176, 0.24);
  --harbor-pocket-valid-rim: rgba(79, 224, 176, 0.78);
  --harbor-pocket-headland: rgba(255, 201, 77, 0.30);
  --harbor-pocket-headland-rim: rgba(255, 201, 77, 0.90);
  --harbor-pocket-move: rgba(140, 196, 255, 0.36);
  --harbor-pocket-beam: rgba(255, 201, 77, 0.28);
  --harbor-pocket-beam-core: rgba(255, 232, 163, 0.52);
  --harbor-pocket-badge-bg: rgba(10, 21, 49, 0.90);
  --harbor-market-sky-top: #0A1531;
  --harbor-market-sky-mid: #162859;
  --harbor-market-sky-horizon: #2E3D7A;
  --harbor-market-sea: #132C58;
  --harbor-market-sea-shimmer: rgba(255, 201, 77, 0.24);
  --harbor-market-lantern-halo: rgba(255, 176, 96, 0.34);
  --harbor-market-lantern-core: rgba(255, 226, 138, 0.92);
  --harbor-market-string: rgba(234, 241, 255, 0.35);
  --harbor-market-counter: #1E3266;
  --harbor-market-counter-rim: rgba(255, 201, 77, 0.45);
  --harbor-market-bubble-bg: rgba(234, 241, 255, 0.96);
  --harbor-market-bubble-rim: rgba(10, 21, 49, 0.72);
  --harbor-market-rain: rgba(140, 196, 255, 0.48);
}
