@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&display=swap");
/* Games: shared design system. Art direction "Wildfire Marsh" (see /assets/STYLE.md). Dark-first. */

:root {
  color-scheme: dark;
  --bg: #07110d;
  --panel: #0f1d17;
  --panel-2: #152a21;
  --panel-3: #1f3a2e;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --ink: #f3f5fb;
  --ink-2: #b4bccf;
  --ink-3: #8a93ab;
  --brand: #3ddc84;
  --brand-2: #2ee6ff;
  --brand-grad: linear-gradient(135deg, #5fe08f 0%, #26c486 50%, #1fb5c9 100%);
  --gold: #f6b93b;
  --gold-grad: linear-gradient(135deg, #ffd36b, #f59f2a);
  --bronze: #c07a3c; --silver: #9aa6b8;
  --good: #2bd17e;
  --bad: #ff5d6c;
  --live: #ff4d5e;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px -12px rgba(0,0,0,.55);
  --glow: 0 10px 30px -8px rgba(61, 220, 132, .45);
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Chakra Petch", ui-rounded, "SF Pro Rounded", "Inter", system-ui, sans-serif;
  --cyan: #2ee6ff; --magenta: #ff3db8; --amber: #ffb020; --fire: #ff7a1f; --outline: #0b1a12;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  /* game canvas palette (jetdraw.js) */
  --sky: #0e1f18; --sky-line: #1d3a2d; --zap: #ff7a1f; --zap-core: #ffe27a; --coin: #ffc83d;
  /* players: fixed order, never by rank */
  --series-1: #4f8dff; --series-2: #ff7a45; --series-3: #22c3a6; --series-4: #f6b93b;
  /* 5-8 for bigger leagues (lavender, pink, green, olive; checked for separation and >=3:1 on --panel).
     Past 8 pilots get --ink-3 plus their name label (JS.colorVarName), never a generated hue. */
  --series-5: #d5a8f8; --series-6: #de65bb; --series-7: #86e670; --series-8: #9d9e3d;

  /* aliases used by page scripts */
  --surface-1: var(--panel); --surface-2: var(--panel-2); --border: var(--line);
  --text-primary: var(--ink); --text-secondary: var(--ink-2); --text-muted: var(--ink-3);
  --accent: var(--brand-2); --ok: var(--good); --err: var(--bad);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f2f7ef;
    --panel: #ffffff;
    --panel-2: #eef5ec;
    --panel-3: #e0ecdc;
    --line: rgba(15, 23, 42, .08);
    --line-strong: rgba(15, 23, 42, .14);
    --ink: #0e1428;
    --ink-2: #4a536b;
    --ink-3: #626a82;
    --shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px -14px rgba(15,23,42,.18);
    --glow: 0 10px 26px -10px rgba(31, 164, 99, .45);
    --sky: #eaf4e6; --sky-line: #d5e6d0; --zap: #ff7a1f; --zap-core: #ffe27a; --coin: #e9a400;
    --series-1: #2f74f0; --series-2: #ef6a2e; --series-3: #11a88c; --series-4: #e09a00;
    --series-5: #9b5fd6; --series-6: #a3176f; --series-7: #3e6102; --series-8: #86802a;
    --bronze: #a8642a; --silver: #7d8798;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.5 var(--font);
  background:
    radial-gradient(1200px 500px at 15% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
    radial-gradient(900px 420px at 95% -5%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--brand) 40%, transparent); }

/* ---------- app shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 19px/1 var(--display); letter-spacing: -0.01em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-grad); display: grid; place-items: center; box-shadow: var(--glow); }
.logo-mark svg { width: 20px; height: 20px; }
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tab { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s; }
.tab:hover { color: var(--ink); background: var(--panel-2); }
.tab.on { color: #fff; background: var(--brand-grad); box-shadow: var(--glow); }
.spacer { flex: 1; }
.sfx-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 16px; display: grid; place-items: center; }
.sfx-btn:hover { border-color: var(--line-strong); }
.me-btn { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 4px 12px 4px 4px; font: 600 14px var(--font); cursor: pointer; }
.me-btn:hover { border-color: var(--line-strong); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 14px var(--display); color: #fff; flex: none; }
.menu { position: absolute; right: 20px; top: 58px; width: 260px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: 0 24px 60px -20px rgba(0,0,0,.6); padding: 14px; display: none; }
.menu.open { display: block; animation: pop .18s ease both; }
.menu .who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.menu .who b { font-size: 15px; }
.menu .who span { display: block; font-size: 12px; color: var(--ink-3); }
.menu a.item { display: block; text-decoration: none; padding: 9px 10px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.menu a.item:hover, .menu button.item:hover { background: var(--panel-2); color: var(--ink); }
.menu button.item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; padding: 9px 10px; border-radius: 10px; font: 600 14px var(--font); color: var(--ink-2); }
.menu button.item b { color: var(--ink); }
@media (max-width: 720px) {
  .topbar-in { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; justify-content: space-between; }
  .tab { flex: 1; text-align: center; padding: 8px 10px; }
  .me-btn .nm { display: none; }
  .menu { right: 14px; }
}

/* ---------- layout ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }
.page-head { margin: 8px 0 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
@media (prefers-color-scheme: dark) { .eyebrow { color: #6ee89c; } }
h1, .h1 { font: 800 clamp(30px, 4.2vw, 44px)/1.05 var(--display); letter-spacing: -0.025em; margin: 0; }
.lede { color: var(--ink-2); font-size: 16px; margin: 10px 0 0; max-width: 640px; }
h2, .h2 { font: 750 19px/1.25 var(--display); letter-spacing: -0.01em; margin: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 14px; }
.section-title p { margin: 0; color: var(--ink-3); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 920px) { .grid-2 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 20px; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .sub { color: var(--ink-3); font-size: 13px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.muted { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: 13px; margin: -6px 0 14px; }

/* ---------- buttons & inputs ---------- */
.btn, button.primary, button.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel-2); color: var(--ink); font: 650 14px var(--font); text-decoration: none; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, opacity .15s; white-space: nowrap;
}
.btn:hover, button.ghost:hover { background: var(--panel-3); }
.btn:active, button.primary:active, button.ghost:active { transform: translateY(1px) scale(.99); }
.btn-primary, button.primary { background: var(--brand-grad); color: #fff; border: 0; box-shadow: var(--glow); }
.btn-primary:hover, button.primary:hover { filter: brightness(1.08); background: var(--brand-grad); }
.btn-gold { background: var(--gold-grad); color: #2a1a00; border: 0; box-shadow: 0 10px 24px -10px rgba(245, 159, 42, .7); }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
button:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; transform: none; }
input, select, textarea {
  font: 500 14px var(--font); color: var(--ink); background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 10px 12px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23868ea5' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.help { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ---------- small things ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); }
.chip b { color: var(--ink); }
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--panel-3); color: var(--ink-2); }
.tag.official, .tag.ranked { background: var(--gold-grad); color: #2a1a00; }
.tag.practice { background: color-mix(in srgb, var(--brand-2) 22%, transparent); color: color-mix(in srgb, var(--brand-2) 80%, var(--ink)); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--live); color: #fff; }
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.stat { display: grid; gap: 2px; }
.stat span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stat b { font: 750 22px/1.1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.stats-row { display: flex; flex-wrap: wrap; gap: 26px; }
.empty-state { text-align: center; padding: 34px 16px; color: var(--ink-3); }
.empty-state .ill { font-size: 34px; margin-bottom: 8px; }
.empty-state b { display: block; color: var(--ink); font: 700 16px var(--display); margin-bottom: 4px; }
canvas.stage { width: 100%; max-width: 100%; display: block; border-radius: 14px; border: 1px solid var(--line); }
/* Canvases set their pixel size from their CSS width; without min-width:0 a grid/flex track
   would grow to the canvas's pixel size, which grows the canvas again (runaway width on phones). */
.card, .grid-2 > *, .stack > *, .stage-wrap { min-width: 0; }
canvas { max-width: 100%; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
footer.foot { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 40px; }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,77,94,.55); } 50% { box-shadow: 0 0 0 6px rgba(255,77,94,0); } }
/* Reduced motion: everything still, unless the player opted in (localStorage.fx = "force" -> html.fx-force, see fx.js). */
@media (prefers-reduced-motion: reduce) { html:not(.fx-force) * { animation: none !important; transition: none !important; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 16px; font-weight: 650; font-size: 14px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.6); animation: toastIn .22s cubic-bezier(.2,1.3,.4,1) both; display: flex; align-items: center; gap: 10px; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.toast.warn::before { background: var(--gold); } .toast.err::before { background: var(--bad); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toastIn { 0% { opacity: 0; transform: translateY(10px) scale(.97); } 100% { opacity: 1; transform: none; } }
@media (max-width: 920px) { .toasts { bottom: 96px; } }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 70%, white); outline-offset: 2px; }
.kbd { font: 600 11px var(--mono); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--ink-2); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--brand-grad); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 10px; }


/* ======================================================================
   Wildfire Marsh layer: game look on top of the base system.
   ====================================================================== */
body {
  background:
    radial-gradient(2px 2px at 12% 22%, rgba(220,255,140,.75), transparent 60%),
    radial-gradient(1.5px 1.5px at 66% 12%, rgba(220,255,140,.55), transparent 60%),
    radial-gradient(2px 2px at 86% 34%, rgba(255,170,60,.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 36% 48%, rgba(220,255,140,.45), transparent 60%),
    radial-gradient(2px 2px at 54% 76%, rgba(255,120,40,.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 92% 68%, rgba(220,255,140,.5), transparent 60%),
    radial-gradient(1100px 520px at 8% -12%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 62%),
    radial-gradient(900px 460px at 100% -8%, color-mix(in srgb, var(--cyan) 12%, transparent), transparent 60%),
    radial-gradient(1200px 380px at 70% 115%, rgba(255,110,30,.16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
@media (prefers-color-scheme: light) {
  body {
    background:
      radial-gradient(1100px 520px at 8% -12%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 62%),
      radial-gradient(900px 460px at 100% -8%, color-mix(in srgb, var(--cyan) 14%, transparent), transparent 60%),
      radial-gradient(1200px 380px at 70% 115%, rgba(255,140,60,.14), transparent 60%),
      var(--bg);
    background-attachment: fixed;
  }
}

/* icons from the sprite (art.js) */
.ai { width: 1.3em; height: 1.3em; display: inline-block; vertical-align: -0.28em; flex: none; overflow: visible; }
.ai-wrap { display: inline-flex; align-items: center; line-height: 1; }
.ai-lg { width: 2em; height: 2em; }

/* type */
h1, .h1 { font-weight: 700; letter-spacing: -0.01em; }
h2, .h2 { font-weight: 700; letter-spacing: 0; }
.eyebrow { font-family: var(--display); font-weight: 700; letter-spacing: .18em; }
.stat b, .hero, td.num b { font-family: var(--display); }
.stat span, th, .tag, .label { letter-spacing: .06em; }
.stat span { text-transform: uppercase; font-size: 11px; }

/* panels: a little depth and a lit top edge, like hangar hardware */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 70%, var(--panel)) 0%, var(--panel) 46%);
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 0 rgba(0,0,0,.35), 0 18px 40px -22px rgba(0,0,0,.75);
}
@media (prefers-color-scheme: light) {
  .card { background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%); border-color: color-mix(in srgb, var(--brand) 12%, var(--line)); box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(15,23,42,.06), 0 14px 32px -18px rgba(40,40,120,.22); }
}

/* chunky arcade buttons: a solid "lip" under each button that you press into */
.btn, button.primary, button.ghost { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
.btn { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 3px 0 color-mix(in srgb, var(--panel-3) 60%, #000); }
.btn-primary, button.primary {
  background: linear-gradient(180deg, #6ee89c 0%, #2cc777 55%, #1aa863 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 0 #0e6b3e, 0 12px 26px -10px rgba(61,220,132,.6);
  text-shadow: 0 1px 0 rgba(5,60,30,.55);
}
.btn-gold { background: linear-gradient(180deg, #ffe08a, #ffc83d 55%, #e79a12); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 #a86a05, 0 12px 24px -10px rgba(245,159,42,.7); }
.btn:active, button.primary:active, .btn-primary:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 0 rgba(0,0,0,.4); }
.btn-sm { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 0 color-mix(in srgb, var(--panel-3) 60%, #000); }
@media (prefers-color-scheme: light) {
  .btn { box-shadow: inset 0 1px 0 #fff, 0 3px 0 #d5d9ea; background: #fff; }
  .btn-primary, button.primary { background: linear-gradient(180deg, #6ee89c 0%, #2cc777 55%, #1aa863 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 0 #0e6b3e, 0 12px 24px -12px rgba(31,164,99,.55); color: #fff; }
  .btn-gold { background: linear-gradient(180deg, #ffe08a, #ffc83d 55%, #e79a12); color: #2a1a00; }
}

/* top bar: logo mark art, icon tabs */
.logo { font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
.logo-mark.art { background: none; box-shadow: none; width: 38px; height: 38px; }
.logo-mark.art img { width: 38px; height: 38px; display: block; filter: drop-shadow(0 6px 14px rgba(61,220,132,.35)); }
.tab { font-family: var(--display); font-weight: 600; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.tab .ai { width: 1.35em; height: 1.35em; }
.tab.on { background: linear-gradient(180deg, #6ee89c, #1fb06a); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 3px 0 #0e6b3e, 0 8px 20px -8px rgba(61,220,132,.6); color: #fff; }
.tabs { background: color-mix(in srgb, var(--panel) 85%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.sfx-btn .ai { width: 22px; height: 22px; }
.hud-coins { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font: 700 14px var(--display); color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.hud-coins .ai { width: 22px; height: 22px; }
@media (max-width: 440px) { .tab .ai { display: none; } }
@media (max-width: 720px) { .hud-coins { display: none; } }

/* chips & tags read as game UI */
.chip { font-family: var(--display); font-weight: 600; }
.tag { font-family: var(--display); }
.tag.official, .tag.ranked { background: linear-gradient(180deg, #ffe08a, #ffc83d 60%, #f0a21a); }
.live-pill { font-family: var(--display); background: linear-gradient(180deg, #ff6f8a, #ff3d6a); box-shadow: 0 0 0 0 rgba(255,77,94,.55); animation: pulse 1.6s ease-in-out infinite; }

/* empty states use the spot illustrations */
.empty-state .ill .ai { width: 44px; height: 44px; }
.empty-state img.spot { width: min(220px, 70%); height: auto; display: block; margin: 0 auto 10px; }

/* toasts: HUD style */
.toast { font-family: var(--display); font-weight: 600; letter-spacing: .01em; background: linear-gradient(180deg, color-mix(in srgb, var(--panel-3) 90%, #fff 3%), var(--panel-2)); border-color: color-mix(in srgb, var(--brand) 30%, var(--line-strong)); }
.toast .ai { width: 22px; height: 22px; }

/* canvases get a hangar frame */
canvas.stage { border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 10px 30px -18px rgba(255,122,31,.3); }


/* ======================================================================
   Motion layer: water and fire. Every animation here honours reduced motion (rule above).
   ====================================================================== */
.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 95; }
.fx-ambient { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: -1; }

/* page transitions: the nav pill glides between pages, content cross-fades (Chromium; ignored elsewhere) */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.tab.on { view-transition-name: navpill; }
::view-transition-group(navpill) { animation-duration: .38s; animation-timing-function: cubic-bezier(.3, 1.3, .5, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
@media (prefers-reduced-motion: reduce) { html:not(.fx-force) { view-transition-name: none; } ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* entrances: rise in once (fx.js adds .fx-pre then .fx-in) */
.fx-pre { opacity: 0; transform: translateY(16px) scale(.985); }
.fx-pre.fx-in { opacity: 1; transform: none; transition: opacity .55s ease var(--fx-d, 0ms), transform .7s cubic-bezier(.2, .9, .2, 1.05) var(--fx-d, 0ms); }

/* press ripple: a ring of water spreading from the finger */
.btn, .mode, .tab, button.primary, button.ghost, .sfx-btn, .me-btn, .hud-coins, .seg button, .chip[href] { position: relative; overflow: hidden; isolation: isolate; }
.fx-ripple { position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(255,255,255,0) 30%, rgba(160,240,255,.55) 46%, rgba(255,255,255,.18) 54%, rgba(255,255,255,0) 64%);
  transform: scale(0); animation: fxRipple .65s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes fxRipple { to { transform: scale(1); opacity: 0; } }

/* primary buttons: a sheen of water sweeps across now and then */
.btn-primary::after, .mode.practice::after, .tab.on::after {
  content: ""; position: absolute; inset: -2px; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.28) 45%, rgba(190,250,255,.12) 52%, transparent 62%);
  transform: translateX(-120%); animation: fxSheen 5.5s ease-in-out infinite; }
.tab.on::after { animation-delay: 1.2s; }
@keyframes fxSheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn-primary:hover, .mode.practice:hover:not(:disabled) { filter: brightness(1.06) saturate(1.05); }

/* ranked button: heat. embers flicker along the lip */
.mode.ranked { animation: fxHeat 2.4s ease-in-out infinite; }
@keyframes fxHeat {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 5px 0 color-mix(in srgb, var(--gold) 45%, #000), 0 0 0 0 rgba(255,122,31,0); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 5px 0 color-mix(in srgb, var(--gold) 45%, #000), 0 8px 26px -6px rgba(255,122,31,.45); } }

/* icons that are alive */
.ai-flame { transform-origin: 50% 85%; animation: fxFlicker 1.25s ease-in-out infinite; filter: drop-shadow(0 0 4px rgba(255,122,31,.55)); }
@keyframes fxFlicker { 0%, 100% { transform: scale(1, 1) skewX(0); } 25% { transform: scale(.96, 1.06) skewX(-2deg); } 50% { transform: scale(1.03, .97) skewX(1.5deg); } 75% { transform: scale(.98, 1.04) skewX(-1deg); } }
.ai-bolt { animation: fxZap 3.2s ease-in-out infinite; }
@keyframes fxZap { 0%, 88%, 100% { filter: none; } 92% { filter: drop-shadow(0 0 6px #5fe3ff) brightness(1.3); } }
.ai-coin { transform-origin: 50% 50%; }
.hud-coins:hover .ai-coin, .hud-coins.bump .ai-coin { animation: fxSpin .7s ease; }
@keyframes fxSpin { 0% { transform: rotateY(0) scale(1); } 50% { transform: rotateY(180deg) scale(1.2); } 100% { transform: rotateY(360deg) scale(1); } }
.hud-coins.bump { animation: fxBump .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes fxBump { 40% { transform: scale(1.12); } }
.tab .ai { transition: transform .25s cubic-bezier(.3, 1.8, .5, 1); }
.tab:hover .ai { transform: translateY(-2px) rotate(-6deg); }
.logo:hover .logo-mark img { animation: fxHop .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fxHop { 40% { transform: translateY(-5px) rotate(-6deg); } 70% { transform: translateY(1px) scale(1.04, .96); } }

/* liquid progress: every bar is water with a moving wave and a few bubbles */
.xpbar i, .jdy-bar i, .meter i, .dist i, .jl-bar i, .vs .bar i { position: relative; overflow: hidden; }
.xpbar i::after, .jdy-bar i::after, .meter i::after, .dist i::after, .jl-bar i::after, .vs .bar i::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='12' viewBox='0 0 40 12'%3E%3Cpath d='M0 6 Q10 0 20 6 T40 6 V12 H0Z' fill='%23ffffff' fill-opacity='.38'/%3E%3C/svg%3E") repeat-x 0 0 / 40px 100%; mix-blend-mode: soft-light; animation: fxWave 1.8s linear infinite; }
.xpbar i::before, .meter i::before, .vs .bar i::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(1.5px 1.5px at 20% 60%, rgba(255,255,255,.9), transparent 70%), radial-gradient(1px 1px at 55% 40%, rgba(255,255,255,.8), transparent 70%), radial-gradient(1.5px 1.5px at 80% 70%, rgba(255,255,255,.85), transparent 70%);
  background-size: 60px 100%; animation: fxBubbles 2.6s linear infinite; }
@keyframes fxWave { to { background-position: 40px 0; } }
@keyframes fxBubbles { from { background-position: 0 4px; } to { background-position: 60px -6px; } }
.xpbar i { transition: width 1s cubic-bezier(.2, .9, .2, 1); }

/* toasts land like a drop: dip, then settle, with a ring */
@keyframes toastIn { 0% { opacity: 0; transform: translateY(16px) scale(.94); } 55% { opacity: 1; transform: translateY(-3px) scale(1.01); } 100% { transform: none; } }
.toast { position: relative; }
.toast::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; border: 2px solid rgba(95,227,255,.6); animation: fxToastRing .7s ease-out forwards; }
.toast.warn::after { border-color: rgba(255,176,32,.6); } .toast.err::after { border-color: rgba(255,77,31,.7); }
@keyframes fxToastRing { from { transform: scale(.96); opacity: 1; } to { transform: scale(1.12, 1.4); opacity: 0; } }

/* illustrations breathe */
.empty-state img.spot { animation: fxBob 4.5s ease-in-out infinite; }
@keyframes fxBob { 50% { transform: translateY(-5px); } }
.live-pill::before { animation: blink 1.2s ease-in-out infinite, fxFlicker 1s ease-in-out infinite; }

/* streak chips get a warm glow */
.chip:has(.ai-flame), .jdy-streak:has(.ai-flame) { box-shadow: 0 0 0 1px rgba(255,122,31,.25), 0 6px 18px -8px rgba(255,122,31,.55); }

/* shake for crashes (stronger, with a little rotation) */
.fx-shake { animation: fxShake .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes fxShake { 10%, 90% { transform: translate(-1px, 0) rotate(-.3deg); } 20%, 80% { transform: translate(3px, 1px) rotate(.4deg); } 30%, 50%, 70% { transform: translate(-5px, -1px) rotate(-.6deg); } 40%, 60% { transform: translate(5px, 1px) rotate(.6deg); } }
