/*
 * Twinring Drift — design tokens「雙環軌道儀」(Twin-Orbit Instrument)
 * Owner: design-twinring. Spec: design/ART-DIRECTION.md (the why behind every value lives there).
 * Prefix: --tw-*. One colour = one job (§3.2): ring = press me, core = secondary/structure,
 * spark = currency only, pulse = hype moments, shard = danger, shield = safe/success.
 * Text on any coloured fill uses --tw-ink (never white: white on #ff4d8d was 3.14:1).
 * Pure custom properties: loading this file changes nothing until style.css uses the tokens.
 */
:root {
  /* ---------- base: cold vacuum ---------- */
  --tw-void: #0b0a1c;
  --tw-void-deep: #08071a;
  --tw-nebula: #1d1746;
  --tw-hull: #15123a;
  --tw-hull-hi: #221d55;
  --tw-hull-glass: rgba(21, 18, 58, 0.88);
  --tw-tile: #120f2c;                         /* start-screen satellite tiles (under a 6% white veil) */
  --tw-scrim: rgba(8, 7, 26, 0.88);

  /* ---------- text (contrast checked against void and hull, see ART-DIRECTION §3.5) ---------- */
  --tw-star: #f2f0ff;                         /* 17.4:1 on void */
  --tw-star-2: rgba(242, 240, 255, 0.72);     /* 9.2:1 on void  */
  --tw-star-3: rgba(242, 240, 255, 0.60);     /* 6.3:1 on hull  */
  --tw-star-4: rgba(242, 240, 255, 0.50);     /* 4.75:1 on hull — floor, never lighter for text */
  --tw-line: rgba(242, 240, 255, 0.14);
  --tw-line-soft: rgba(242, 240, 255, 0.08);
  --tw-fill-1: rgba(242, 240, 255, 0.05);
  --tw-fill-2: rgba(242, 240, 255, 0.10);
  --tw-ink: #1a0618;                          /* text on coloured fills */
  --tw-ink-cyan: #06121a;                     /* text on ring gradient: 11.0 / 5.1:1 */

  /* ---------- primary lights ---------- */
  --tw-ring: #7df9ff;          /* press me: primary button, selected, focus, "you" row */
  --tw-ring-hi: #38d9e6;
  --tw-ring-lo: #1c8fb3;
  --tw-ring-grad: linear-gradient(180deg, var(--tw-ring-hi), var(--tw-ring-lo));
  --tw-core: #a08cff;          /* secondary & structure: daily, outlines, tab track */
  --tw-core-hi: #b9a8ff;
  --tw-core-lo: #6c4cff;
  --tw-spark: #ffd166;         /* currency only: sparks, stardust (+ legendary, gold medal) */
  --tw-spark-soft: #ffe7a8;
  --tw-pulse: #ff5fd2;         /* hype: new best, NEW dot, overtakes, 2nd half of the twin shadow */
  --tw-shard: #ff4d6d;         /* danger: shards, misses, error text */
  --tw-shard-soft: #ff9fbf;
  --tw-shield: #7dffcf;        /* safe / success / live */
  --tw-live: #9dffc0;
  /* pale tints: highlights inside glowing spheres and light text on dark glass (BACKLOG #6) */
  --tw-hot: #ffffff;           /* white-hot centre: score, best score, ring head, stats numbers */
  --tw-ring-pale: #c8fbff;     /* text on a ring outline (name chip) 13.9:1 on void */
  --tw-ring-mist: #e9feff;
  --tw-core-mist: #efeaff;
  --tw-pulse-soft: #ff9fe6;    /* system lines in chat (on magenta tint) */

  /* tints (backgrounds behind a coloured accent) */
  --tw-ring-a12: rgba(125, 249, 255, 0.12);
  --tw-ring-a25: rgba(125, 249, 255, 0.25);
  --tw-core-a12: rgba(160, 140, 255, 0.12);
  --tw-core-a28: rgba(160, 140, 255, 0.28);
  --tw-spark-a16: rgba(255, 209, 102, 0.16);
  --tw-pulse-a20: rgba(255, 95, 210, 0.20);
  --tw-shard-a20: rgba(255, 77, 109, 0.20);
  --tw-live-a12: rgba(125, 255, 170, 0.12);

  /* title gradient for "Drift" */
  --tw-title-2: linear-gradient(90deg, var(--tw-core-hi), var(--tw-pulse));

  /* ---------- rarity ---------- */
  --tw-rarity-common: #c9d3e3;
  --tw-rarity-rare: #5cb2ff;
  --tw-rarity-epic: #c08cff;
  --tw-rarity-legendary: #ffc23d;

  /* ---------- zones (canvas; mirrors game.js ZONES until dev reads these, request 1) ---------- */
  --tw-zone1-bg0: #1d1746; --tw-zone1-bg1: #0b0a1c; --tw-zone1-ring: #7df9ff; --tw-zone1-core: #a08cff; /* Nebula */
  --tw-zone2-bg0: #3a1420; --tw-zone2-bg1: #120609; --tw-zone2-ring: #ffaa6e; --tw-zone2-core: #ff785a; /* Red Giant */
  --tw-zone3-bg0: #0c2e3f; --tw-zone3-bg1: #04121a; --tw-zone3-ring: #5adcff; --tw-zone3-core: #3caaff; /* Abyss */
  --tw-zone4-bg0: #10331f; --tw-zone4-bg1: #06140c; --tw-zone4-ring: #8cffaa; --tw-zone4-core: #50dc8c; /* Aurora */
  --tw-zone5-bg0: #2a2a2a; --tw-zone5-bg1: #060606; --tw-zone5-ring: #ffdc8c; --tw-zone5-core: #ffc850; /* Event Horizon */
  --tw-zone-ring: var(--tw-zone1-ring);       /* current zone, switched by [data-zone] below */

  /* confetti / particle palette (5 lights), read by game.js (results burst, combo bursts) */
  --tw-confetti-1: var(--tw-spark);
  --tw-confetti-2: var(--tw-pulse);
  --tw-confetti-3: var(--tw-ring);
  --tw-confetti-4: #ffffff;
  --tw-confetti-5: var(--tw-core-hi);

  /* rewarded-ad marker + fragments: violet, deliberately not green (Poki rule) */
  --tw-ad: #b48cff;
  --tw-ad-a16: rgba(180, 140, 255, 0.16);
  --tw-ad-a18: rgba(180, 140, 255, 0.18);

  /* ---------- typography ---------- */
  --tw-font-cjk: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei";
  --tw-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, var(--tw-font-cjk), sans-serif;
  /* display stack (ART-DIRECTION §4): squared-off DIN-like Latin, then the CJK fonts per language. No italic anywhere.
     game.js reads it for canvas text (score card). */
  --tw-font-display: Bahnschrift, "DIN Alternate", "Avenir Next", "Segoe UI Variable Display",
    system-ui, -apple-system, "Segoe UI", Roboto, var(--tw-font-cjk), sans-serif;
  --tw-fw-body: 600;
  --tw-fw-strong: 700;
  --tw-fw-display: 800;
  --tw-fw-black: 900;
  --tw-lh-body: 1.4;
  --tw-lh-tight: 1;
  --tw-track-label: 0.22em;    /* Latin all-caps labels */
  --tw-track-label-cjk: 0.08em;

  /* type scale (mobile portrait first; vmin keeps landscape iframes sane) */
  --tw-fs-xs: 11px;
  --tw-fs-sm: 13px;
  --tw-fs-md: clamp(14px, 2.8vmin, 17px);
  --tw-fs-lg: clamp(16px, 3.2vmin, 21px);
  --tw-fs-xl: clamp(22px, 5vmin, 34px);
  --tw-fs-title: clamp(34px, 9vmin, 72px);
  --tw-fs-score: clamp(64px, 21vmin, 150px);
  --tw-fs-score-short: clamp(48px, 17vmin, 84px); /* max-height: 560px */

  /* twin shadow — the signature. Static: never animate its offset (photosensitivity). */
  --tw-twin-x: 1.5px;
  --tw-twin: calc(var(--tw-twin-x) * -1) 0 0 rgba(125, 249, 255, 0.85), var(--tw-twin-x) 0 0 rgba(255, 95, 210, 0.85);
  --tw-twin-glow: var(--tw-twin), 0 0 22px rgba(125, 249, 255, 0.35);
  --tw-twin-best: var(--tw-twin), 0 0 28px rgba(255, 209, 102, 0.6), 0 0 60px rgba(255, 95, 210, 0.45);
  --tw-score-fg: #f6fbff;      /* white-hot score, not gold */

  /* ---------- shape: everything is round, min radius 10px ---------- */
  --tw-r-sm: 10px;
  --tw-r-md: 16px;
  --tw-r-lg: 24px;
  --tw-r-pill: 999px;
  --tw-r-orb: 50%;
  --tw-border: 1.5px;
  --tw-orbit-gap: 3px;         /* vacuum gap between a primary button and its orbit ring */
  --tw-orbit-w: 2px;

  /* ---------- light (glow, not drop shadow) ---------- */
  --tw-glow-1: 0 0 10px rgba(125, 249, 255, 0.35);
  --tw-glow-2: 0 0 22px rgba(125, 249, 255, 0.45);
  --tw-glow-3: 0 0 34px rgba(125, 249, 255, 0.7);
  --tw-glow-core: 0 0 18px rgba(160, 140, 255, 0.45);
  --tw-glow-spark: 0 0 18px rgba(255, 209, 102, 0.55);
  --tw-glow-pulse: 0 0 14px rgba(255, 95, 210, 0.6);
  --tw-lift: 0 12px 40px rgba(0, 0, 0, 0.45); /* only for floating panels over the play field */
  --tw-blur: 10px;
  --tw-hairline: linear-gradient(90deg, transparent, var(--tw-line), transparent);
  --tw-hairline-ring: linear-gradient(90deg, transparent, var(--tw-ring), transparent);

  /* ---------- spacing (4px grid) ---------- */
  --tw-s-1: 4px;
  --tw-s-2: 8px;
  --tw-s-3: 12px;
  --tw-s-4: 16px;
  --tw-s-5: 24px;
  --tw-s-6: 32px;
  --tw-s-7: 48px;
  --tw-gap-stack: clamp(6px, 1.6vh, 14px);
  --tw-safe-t: max(10px, env(safe-area-inset-top));
  --tw-safe-r: max(10px, env(safe-area-inset-right));
  --tw-safe-b: max(18px, env(safe-area-inset-bottom));
  --tw-safe-l: max(10px, env(safe-area-inset-left));

  /* ---------- sizes ---------- */
  --tw-touch: 44px;            /* minimum hit target */
  --tw-icon-btn: 46px;
  --tw-btn-h: 48px;
  --tw-btn-h-big: clamp(52px, 8vh, 62px);
  --tw-satellite: 72px;        /* start-screen menu orbs, label sits below */
  --tw-panel-w: 560px;
  --tw-res-w: 440px;

  /* ---------- motion: orbit, pop, iris (never horizontal slide-ins) ---------- */
  --tw-ease-orbit: cubic-bezier(0.2, 1.6, 0.4, 1);   /* pop with overshoot */
  --tw-ease-iris: cubic-bezier(0.3, 0.9, 0.3, 1);    /* panel iris open */
  --tw-ease-drift: cubic-bezier(0.25, 0.8, 0.25, 1); /* general ease-out */
  --tw-ease-spin: linear;
  --tw-dur-instant: 80ms;
  --tw-dur-fast: 160ms;
  --tw-dur-base: 280ms;
  --tw-dur-slow: 420ms;
  --tw-dur-count: 900ms;
  --tw-dur-ring: 1000ms;
  --tw-dur-breathe: 2400ms;
  --tw-dur-orbit: 24s;
  --tw-stagger: 60ms;
  --tw-press-scale: 0.96;
  --tw-pop-from: 0.85;

  /* ---------- layers ---------- */
  --tw-z-hud: 5;
  --tw-z-screen: 10;
  --tw-z-toast: 20;
}

/* CJK: pick the right Han glyph forms per language (html[lang] is set by game.js) */
:root:lang(zh-CN), :root:lang(zh-Hans) { --tw-font-cjk: "Noto Sans SC", "PingFang SC", "Microsoft YaHei"; }
:root:lang(ja) { --tw-font-cjk: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo"; }
:root:lang(ko) { --tw-font-cjk: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic"; }

/* current zone tint for UI chrome (needs #stage[data-zone], request 2 — harmless until then) */
[data-zone="2"] { --tw-zone-ring: var(--tw-zone2-ring); }
[data-zone="3"] { --tw-zone-ring: var(--tw-zone3-ring); }
[data-zone="4"] { --tw-zone-ring: var(--tw-zone4-ring); }
[data-zone="5"] { --tw-zone-ring: var(--tw-zone5-ring); }

/* reduced motion: pops, iris, spins and breathing collapse to a short fade (the twin shadow is static and stays) */
@media (prefers-reduced-motion: reduce) {
  :root {
    --tw-ease-orbit: ease-out;
    --tw-ease-iris: ease-out;
    --tw-dur-base: 120ms;
    --tw-dur-slow: 120ms;
    --tw-dur-count: 1ms;
    --tw-dur-ring: 1ms;
    --tw-stagger: 0ms;
    --tw-press-scale: 1;
    --tw-pop-from: 1;
  }
}

/* Component rules (including the tsl-board skin) live in style.css; this file only declares values. */
