/* ARASHIDAY design tokens — SHARED by every page.
 *
 * Extracted from japan-snowboarder-tracker.html so the tracker, login, admin
 * and 3D map read from ONE definition instead of three drifting copies.
 * Both design languages (Classic, Material) in both appearances.
 * Page-specific component rules live in that page's own stylesheet.
 */
/* ─── TOKENS ─── */
:root{
  --acc-on:#ffffff;
  --bg:#f2f7fd;--surf:#fff;--surf2:#edf3fa;--surf3:#e2ecf7;
  --bdr:#ccdff0;--bdr2:#b3cfea;
  --text:#0c1e35;--text2:#244166;--muted:#566f8a;--dim:#8aa4bd;
  --open:#077a48;--open-bg:#e6f5ee;--open-bd:#8ecfab;
  --closed:#b52828;--closed-bg:#fceaea;--closed-bd:#e89898;
  --season:#a05800;--season-bg:#fdf3e3;--season-bd:#e8b870;
  /* off-season = "not this season" → neutral grey, distinct from standby(amber)/closed(red).
     standby = "open, lift on wind-hold" → amber (does not collide with the slope-difficulty
     legend, which is green/red/black/purple). */
  --offseason:#566575;--offseason-bg:#eef1f4;--offseason-bd:#b8c2cc;
  --standby:#a05800;--standby-bg:#fdf3e3;--standby-bd:#e8b870;
  --limited:    #6b7c00;--limited-bg:#f5f9d6;--limited-bd:#a8b800;
  --live:#0a72c8;--live-bg:#e3f0fb;--live-bd:#7fbce8;
  --oc:#7a5500;--oc-bg:#fef8e4;--oc-bd:#d4a830;
  --lnk:#526070;--lnk-bg:#eef3f8;--lnk-bd:#c0d0e0;
  --acc:#1568c8;--acc-h:#0e52a8;--acc-bg:#e3eefb;
  --gold:#d4900a;
  --snow:linear-gradient(135deg,#d0e8fc,#e8f4ff,#c8e0f8);
  --sh-sm:0 1px 4px rgba(0,60,140,.07);
  --sh-md:0 4px 16px rgba(0,60,140,.10);
  --sh-lg:0 8px 32px rgba(0,60,140,.14);
  --fn-h:'Syne',sans-serif;--fn-b:'DM Sans',sans-serif;
  --fn-jp:'Noto Sans JP',sans-serif;--fn-tc:'Noto Serif TC',serif;
  --pw:420px;--th:52px;
  /* --ink and --accent are referenced as var(--ink,#1a1f2b) in a few places but
     were never defined, so those call sites fell back to a hardcoded LIGHT ink
     and were unreadable in dark mode — in Classic as well as Material. Aliasing
     them to the real tokens fixes every theme at once, because a custom
     property that references another resolves against the cascaded value. */
  --ink:var(--text);--accent:var(--acc);
}

/* ── Dark theme overrides (applied via html[data-theme="dark"]) ── */
html[data-theme="dark"]{
  --acc-on:#ffffff;
  --bg:#0d1520;--surf:#16202e;--surf2:#1d2937;--surf3:#27384a;
  --bdr:#2a3a4d;--bdr2:#36495f;
  --text:#f2f7fc;--text2:#c4d3e2;--muted:#9fb3c6;--dim:#7e93a8;
  --open:#3fbb83;--open-bg:#16302a;--open-bd:#2c5e48;
  --closed:#f08585;--closed-bg:#34211f;--closed-bd:#6e3838;
  --season:#e0a850;--season-bg:#33260f;--season-bd:#6e5424;
  --offseason:#9aabc0;--offseason-bg:#232a33;--offseason-bd:#3e4a58;
  --standby:#e0a850;--standby-bg:#33260f;--standby-bd:#6e5424;
  --limited:#c0cc40;--limited-bg:#2a2f10;--limited-bd:#5a6420;
  --live:#4a9fe0;--live-bg:#10293f;--live-bd:#2c5878;
  --oc:#d4a830;--oc-bg:#2a2410;--oc-bd:#5a4a18;
  --lnk:#9ab0c4;--lnk-bg:#1d2937;--lnk-bd:#36495f;
  --acc:#4a9fe0;--acc-h:#7fbce8;--acc-bg:#15293c;
  --gold:#e0b040;
  --sh-sm:0 1px 4px rgba(0,0,0,.3);
  --sh-md:0 4px 16px rgba(0,0,0,.4);
  --sh-lg:0 8px 32px rgba(0,0,0,.5);
}

/* ── MATERIAL 3 DESIGN VARIATION ────────────────────────────────────────────
   Opt-in alternative to the Classic snow-blue look, selected in
   Settings → Design and stored as jsbt_design. These are the SAME colour
   roles the Android app uses (mobile/lib/md3.ts) — generated with Google's
   material-color-utilities from the brand seed #0d4f9e — so choosing
   Material makes the web tracker and the app look like one product.

   Classic remains the default: existing users see no change unless they ask
   for one. */
html[data-design="material"]{
  --acc-on:#ffffff;
  --bg:#fdfbff;--surf:#efedf1;--surf2:#e9e7ec;--surf3:#e3e2e6;
  --bdr:#c4c6d0;--bdr2:#74777f;
  --text:#1a1b1f;--text2:#44474e;--muted:#44474e;--dim:#74777f;
  --open:#146c2e;--open-bg:#c8f0d3;--open-bd:#8bd0a0;
  --closed:#ba1a1a;--closed-bg:#ffdad6;--closed-bd:#f2b8b5;
  --season:#7a5900;--season-bg:#ffdf9a;--season-bd:#e0c070;
  --offseason:#74777f;--offseason-bg:#e0e2ec;--offseason-bd:#c4c6d0;
  --standby:#7a5900;--standby-bg:#ffdf9a;--standby-bd:#e0c070;
  --limited:#5c6300;--limited-bg:#e2ea88;--limited-bd:#c6ce6e;
  --live:#255dad;--live-bg:#d7e2ff;--live-bd:#a8c0ea;
  --oc:#7a5900;--oc-bg:#ffdf9a;--oc-bd:#e0c070;
  --lnk:#565e71;--lnk-bg:#dae2f9;--lnk-bd:#c0c8de;
  --acc:#255dad;--acc-h:#001b3f;--acc-bg:#d7e2ff;
  --gold:#7a5900;
  --snow:linear-gradient(160deg,#fdfbff,#f4f3f7);
  /* MD3 expresses depth with tonal surfaces, not heavy shadows. */
  --sh-sm:0 1px 2px rgba(0,0,0,.30),0 1px 3px 1px rgba(0,0,0,.15);
  --sh-md:0 1px 2px rgba(0,0,0,.30),0 2px 6px 2px rgba(0,0,0,.15);
  --sh-lg:0 4px 4px rgba(0,0,0,.30),0 8px 12px 6px rgba(0,0,0,.15);
  --fn-h:'Roboto',sans-serif;--fn-b:'Roboto',sans-serif;
}

html[data-design="material"][data-theme="dark"]{
  --acc-on:#002f66;
  /* Dark surface sits at neutral tone 6 so the container tiers above it read
     as raised — at tone 10 it collides with surfaceContainerLow and cards
     vanish, the same bug fixed in the app. */
  --bg:#121316;--surf:#1f1f23;--surf2:#292a2d;--surf3:#343538;
  --bdr:#44474e;--bdr2:#8e9099;
  --text:#e3e2e6;--text2:#c4c6d0;--muted:#c4c6d0;--dim:#8e9099;
  --open:#8bd89e;--open-bg:#00391a;--open-bd:#14622f;
  --closed:#ffb4ab;--closed-bg:#5c0004;--closed-bd:#93000a;
  --season:#f0c04e;--season-bg:#3d2c00;--season-bd:#5c4300;
  --offseason:#8e9099;--offseason-bg:#292a2d;--offseason-bd:#44474e;
  --standby:#f0c04e;--standby-bg:#3d2c00;--standby-bd:#5c4300;
  --limited:#c6ce6e;--limited-bg:#2e3200;--limited-bd:#454b00;
  --live:#abc7ff;--live-bg:#002f66;--live-bd:#00458f;
  --oc:#f0c04e;--oc-bg:#3d2c00;--oc-bd:#5c4300;
  --lnk:#bec6dc;--lnk-bg:#3e4759;--lnk-bd:#565e71;
  --acc:#abc7ff;--acc-h:#d7e2ff;--acc-bg:#00458f;
  --gold:#f0c04e;
  --snow:linear-gradient(160deg,#1f1f23,#121316);
}

/* ── Compatibility aliases ──────────────────────────────────────────────────
 * The admin panel grew its own token vocabulary (--card, --ok, --warn, --err…)
 * with hardcoded light-only values. Aliasing those names onto the shared roles
 * lets admin drop its private :root and inherit light/dark AND Classic/Material
 * for free, without renaming anything in css/admin.css.
 *
 * --card2 is included because admin REFERENCES it but nothing ever defined it,
 * so every use silently fell back to the initial value. */
:root{
  --card:var(--surf);
  --card2:var(--surf2);
  --text3:var(--dim);
  --ok:var(--open);        --ok-bg:var(--open-bg);
  --warn:var(--standby);   --warn-bg:var(--standby-bg);
  --err:var(--closed);     --err-bg:var(--closed-bg);
  --gray-bg:var(--surf2);
}
