/* Starball · "Floodlit evening"
   Material 3 Expressive (tonal surfaces, bold type, spring motion, shape morphing)
   meets Apple's Liquid Glass (floating translucent chrome, specular edges,
   concentric corners). Soothing palette, true light and dark themes. */

@font-face {
  font-family: 'Flex';
  font-style: oblique 0deg 10deg; font-display: swap; font-weight: 100 1000; font-stretch: 25% 151%;
  src: url(/fonts/roboto-flex-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Flex';
  font-style: oblique 0deg 10deg; font-display: swap; font-weight: 100 1000; font-stretch: 25% 151%;
  src: url(/fonts/roboto-flex-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  /* dark (default): midnight ink, misty sage, periwinkle sky */
  --ink: #121a24;            /* background */
  --s1: #18222e;             /* surface container low */
  --s2: #1e2a38;             /* surface container */
  --s3: #253344;             /* surface container high */
  --s4: #2d3d50;             /* surface container highest */
  --on: #e3e9f0;             /* on surface */
  --on-v: #9aa8b8;           /* on surface variant */
  --outline: #34465b;
  --primary: #9fd8c4;        /* sage mint */
  --on-primary: #0d3a2f;
  --primary-c: #1f4e42;      /* primary container */
  --on-primary-c: #bdf2de;
  --secondary: #b9c6ff;      /* periwinkle */
  --secondary-c: #2f3b66;
  --on-secondary-c: #dde2ff;
  --tertiary: #f4d08e;       /* floodlight amber: captain, Man of the Match */
  --tertiary-c: #4f3d12;
  --error: #ffb4ab;
  --error-c: #5c2420;
  --good: #8fe0b0;
  --good-c: #1d4a33;
  --glass: rgba(30, 42, 56, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --pitch-a: #1d4a40; --pitch-b: #1a4339; --pitch-line: rgba(220, 245, 236, 0.22);
  --shadow: 0 10px 30px rgba(3, 8, 14, 0.35);
  /* legacy names used by the markup */
  --bg: var(--ink); --panel: var(--s1); --panel-2: var(--s3); --line: var(--outline); --text: var(--on); --muted: var(--on-v);
  --accent: var(--primary); --accent-ink: var(--on-primary); --violet: var(--secondary); --up: var(--good); --down: var(--error); --gold: var(--tertiary);

  /* shape (M3 expressive scale) + motion */
  --r-xs: 8px; --r-s: 12px; --r-m: 16px; --r-l: 24px; --r-xl: 32px; --r-full: 999px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Flex', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink: #eef3f1; --s1: #f8fbfa; --s2: #ffffff; --s3: #e6eeeb; --s4: #dbe6e2;
    --on: #18231f; --on-v: #586863; --outline: #c6d3ce;
    --primary: #2f6b5b; --on-primary: #ffffff; --primary-c: #c4eedd; --on-primary-c: #08372b;
    --secondary: #4d5d97; --secondary-c: #dde2ff; --on-secondary-c: #0b1a4d;
    --tertiary: #8a6100; --tertiary-c: #ffdea0;
    --error: #ba1a1a; --error-c: #ffdad6; --good: #1f7a4c; --good-c: #c7f0d6;
    --glass: rgba(255, 255, 255, 0.66); --glass-edge: rgba(255, 255, 255, 0.85); --glass-hi: rgba(255, 255, 255, 0.5);
    --pitch-a: #5f9d86; --pitch-b: #58947e; --pitch-line: rgba(255, 255, 255, 0.45);
    --shadow: 0 10px 30px rgba(30, 60, 50, 0.12);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ink: #eef3f1; --s1: #f8fbfa; --s2: #ffffff; --s3: #e6eeeb; --s4: #dbe6e2;
  --on: #18231f; --on-v: #586863; --outline: #c6d3ce;
  --primary: #2f6b5b; --on-primary: #ffffff; --primary-c: #c4eedd; --on-primary-c: #08372b;
  --secondary: #4d5d97; --secondary-c: #dde2ff; --on-secondary-c: #0b1a4d;
  --tertiary: #8a6100; --tertiary-c: #ffdea0;
  --error: #ba1a1a; --error-c: #ffdad6; --good: #1f7a4c; --good-c: #c7f0d6;
  --glass: rgba(255, 255, 255, 0.66); --glass-edge: rgba(255, 255, 255, 0.85); --glass-hi: rgba(255, 255, 255, 0.5);
  --pitch-a: #5f9d86; --pitch-b: #58947e; --pitch-line: rgba(255, 255, 255, 0.45);
  --shadow: 0 10px 30px rgba(30, 60, 50, 0.12);
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--on); }
body {
  min-height: 100dvh; overflow-x: hidden; -webkit-tap-highlight-color: transparent;
  font-family: var(--font); font-size: 16px; line-height: 1.45; font-variation-settings: 'opsz' 16;
  -webkit-font-smoothing: antialiased;
  /* a faint floodlight glow at the top of the screen */
  background-image: radial-gradient(120% 60% at 50% -10%, color-mix(in oklab, var(--secondary) 14%, transparent), transparent 70%);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img { display: block; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; border-radius: var(--r-s); }
#app { max-width: 600px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(var(--nav-h) + var(--safe-b) + 36px); }
.muted { color: var(--on-v); }
.small { font-size: 14px; }
.pos { color: var(--good); } .neg { color: var(--error); }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.empty { text-align: center; color: var(--on-v); padding: 40px 20px; }

/* ---------- glass + press physics ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.nav, .icon-btn, .mode, .pc .nm, .sheet-body, .toast, .plan-bar {
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
}
button, .card[data-action], .match, .trow, .bar-row { transition: transform .35s var(--spring), border-radius .35s var(--spring), background-color .2s var(--ease); }
button:active, .match:active, .bar-row:active, .card[data-action]:active { transform: scale(0.96); }

/* ---------- header (large title, glass controls) ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 2px 18px; }
.top h1 { margin: 0; font-size: 40px; line-height: 1; font-weight: 760; font-stretch: 112%; letter-spacing: -0.02em; font-variation-settings: 'opsz' 72; }
.top .row { gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r-full); display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi);
}
.icon-btn svg { width: 21px; height: 21px; stroke: var(--on); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { border-radius: 14px; }
.pill { background: var(--s3); border-radius: var(--r-full); padding: 9px 16px; font-weight: 650; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; border: 0; }
select.pill {
  appearance: none; width: 100%; color: var(--on); padding-right: 40px; font-size: 16px;
  background-color: var(--s3);
  background-image: linear-gradient(45deg, transparent 50%, var(--on-v) 50%), linear-gradient(135deg, var(--on-v) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat;
}

/* ---------- cards: tonal, no hard shadows ---------- */
.card { background: var(--s1); border-radius: var(--r-l); padding: 18px; margin-bottom: 12px; }
.card .card { background: var(--s2); }
.card b, .card h3 { font-weight: 680; }
.card h3 { font-size: 19px; letter-spacing: -0.01em; }
.err { background: var(--error-c); color: var(--on); }
.banner { background: var(--secondary-c); color: var(--on-secondary-c); }
.btn {
  background: var(--primary); color: var(--on-primary); font-weight: 680; padding: 13px 22px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 15px;
}
.btn:active { border-radius: var(--r-m); }
.btn.ghost { background: var(--s3); color: var(--on); }
.btn.small { padding: 8px 14px; font-size: 14px; }

/* ---------- hero: matchday summary ---------- */
.summary {
  position: relative; overflow: hidden; padding: 22px 20px 70px; margin-bottom: -52px; border-radius: var(--r-xl);
  background: linear-gradient(160deg, var(--primary-c), color-mix(in oklab, var(--primary-c) 40%, var(--s1)) 70%);
  color: var(--on-primary-c);
}
.summary::after { /* cookie-shaped floodlight in the corner (M3 expressive shape) */
  content: ""; position: absolute; right: -36px; top: -36px; width: 150px; height: 150px; opacity: .13;
  background: var(--on-primary-c);
  clip-path: polygon(50% 0%, 61% 11%, 75% 7%, 79% 21%, 93% 25%, 89% 39%, 100% 50%, 89% 61%, 93% 75%, 79% 79%, 75% 93%, 61% 89%, 50% 100%, 39% 89%, 25% 93%, 21% 79%, 7% 75%, 11% 61%, 0% 50%, 11% 39%, 7% 25%, 21% 21%, 25% 7%, 39% 11%);
  animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.summary h2 { margin: 0 0 14px; font-size: 17px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.kpis { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; position: relative; z-index: 1; }
.kpi b { font-size: 46px; line-height: 1; font-weight: 820; font-stretch: 118%; letter-spacing: -0.03em; font-variation-settings: 'opsz' 96; font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 18px; font-weight: 600; font-stretch: 100%; margin-left: 2px; opacity: .7; letter-spacing: 0; }
.kpi > div { opacity: .78; font-size: 14px; margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.move { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-full); }
.move.up { background: var(--good-c); color: var(--good); }
.move.down { background: var(--error-c); color: var(--error); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--error); display: inline-block; box-shadow: 0 0 0 0 color-mix(in oklab, var(--error) 60%, transparent); animation: beat 1.6s infinite; }
@keyframes beat { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* live rank card */
.rankcard { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; background: var(--s2); border-radius: var(--r-xl); }
.rankcard .big { font-size: 34px; line-height: 1.05; font-weight: 800; font-stretch: 116%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.progress { height: 10px; background: var(--s3); border-radius: var(--r-full); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: var(--r-full); transition: width .5s var(--ease); }

/* ---------- the pitch: dusk turf, glass player chips ---------- */
.pitch {
  position: relative; border-radius: var(--r-xl); overflow: hidden; padding: 26px 8px 16px;
  background:
    radial-gradient(90% 50% at 50% 0%, rgba(255,255,255,.10), transparent 70%),
    repeating-linear-gradient(180deg, var(--pitch-a) 0 58px, var(--pitch-b) 58px 116px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.pitch::before { content: ""; position: absolute; left: 24%; right: 24%; top: -2px; height: 66px; border: 2px solid var(--pitch-line); border-top: 0; border-radius: 0 0 14px 14px; }
.pitch::after { content: ""; position: absolute; left: 50%; bottom: -74px; width: 148px; height: 148px; border: 2px solid var(--pitch-line); border-radius: 50%; transform: translateX(-50%); }
.line { display: flex; justify-content: center; gap: 6px; margin: 4px 0 20px; position: relative; z-index: 1; }
.pc { width: 23%; max-width: 106px; text-align: center; position: relative; }
.pc .crest { width: 40px; height: 40px; margin: 0 auto 5px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.pc .nm {
  border-radius: 14px 14px 4px 4px; padding: 6px 4px; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(12, 22, 30, .55); color: #f1f6f4; border: 1px solid rgba(255,255,255,.16); border-bottom: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.pc .pt {
  border-radius: 4px 4px 14px 14px; padding: 5px 4px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgba(240, 248, 245, .9); color: #17302a; margin-top: 2px;
}
.pc .pt.hot { background: var(--tertiary); color: #2d2100; font-weight: 800; }
.pc .pt.on { box-shadow: inset 0 -3px 0 var(--error); }
.pc .cap, .pc .flag {
  position: absolute; top: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.pc .cap { right: 8%; background: var(--tertiary); color: #2d2100; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.pc .flag { left: 8%; background: var(--error); color: #fff; }
.pc .ev { display: flex; justify-content: center; gap: 3px; margin-top: -7px; position: relative; }
.ev i { font-style: normal; font-size: 11px; min-width: 21px; height: 21px; border-radius: var(--r-full); background: #fff; color: #17302a; display: inline-grid; place-items: center; padding: 0 6px; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.ev i.a { background: var(--secondary); color: #0d1a4a; }
.ev i.y { background: #f6d55c; } .ev i.r { background: #e5484d; color: #fff; }
.ev i.cs { background: var(--primary); color: var(--on-primary); }
.bench { background: rgba(10, 20, 28, .32); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-l); margin: 4px 6px 0; padding: 12px 4px 14px; position: relative; z-index: 1; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.bench .lbl { text-align: center; font-size: 13px; font-weight: 600; color: rgba(240,248,245,.8); margin-bottom: 10px; }
.bench .line { margin: 0; }
.xp { font-size: 12px; font-weight: 750; color: #e9fff6; margin-top: 3px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.fx-chips { display: flex; gap: 2px; justify-content: center; margin-top: 4px; }
.fx-chips span { font-size: 10px; padding: 2px 4px; border-radius: 6px; font-weight: 750; }

/* fixture difficulty: calm, distinguishable steps */
.d1 { background: #7fd3a4; color: #0b2a1a; }
.d2 { background: #b9e6a8; color: #1b2c0f; }
.d3 { background: #d9e0e7; color: #24303a; }
.d4 { background: #f5c39a; color: #3a1d06; }
.d5 { background: #ef9a9f; color: #3d0b10; }

/* ---------- segmented buttons, chips, tabs ---------- */
.seg { display: flex; background: var(--s1); border-radius: var(--r-full); padding: 5px; margin-bottom: 16px; gap: 4px; }
.seg button { flex: 1; padding: 12px 6px; border-radius: var(--r-full); font-weight: 650; color: var(--on-v); font-size: 15px; }
.seg button.on { background: var(--secondary-c); color: var(--on-secondary-c); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar, .subtabs::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: none; }
.chips button { background: var(--s1); border: 1px solid var(--outline); padding: 9px 16px; border-radius: var(--r-s); white-space: nowrap; font-weight: 600; font-size: 14px; color: var(--on-v); scroll-snap-align: start; }
.chips button.on { background: var(--primary-c); color: var(--on-primary-c); border-color: transparent; border-radius: var(--r-full); }
.subtabs { display: flex; gap: 22px; overflow-x: auto; margin: 0 4px 14px; scrollbar-width: none; border-bottom: 1px solid var(--outline); }
.subtabs button { padding: 10px 0 12px; color: var(--on-v); font-weight: 600; white-space: nowrap; position: relative; }
.subtabs button.on { color: var(--on); }
.subtabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }

/* ---------- league table ---------- */
.thead { display: grid; grid-template-columns: 1fr 76px 108px; padding: 4px 16px 8px; color: var(--on-v); font-size: 13px; font-weight: 600; }
.trow { display: grid; grid-template-columns: 36px 1fr 76px 108px; align-items: center; gap: 8px; background: var(--s1); border-radius: var(--r-m); padding: 12px; margin-bottom: 6px; }
.trow.fav { grid-template-columns: 32px minmax(0,1fr) 54px 96px 24px; gap: 6px; }
.trow.fav .badge { padding: 6px 4px; }
.trow.me { background: var(--primary-c); color: var(--on-primary-c); }
.trow.me .who span, .trow.me .num small { color: inherit; opacity: .75; }
.rk { text-align: center; }
.rk b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 12px; background: var(--s3); font-size: 14px; font-variant-numeric: tabular-nums; }
.trow.me .rk b { background: color-mix(in oklab, var(--on-primary-c) 18%, transparent); }
.rk span { font-size: 12px; font-weight: 700; display: block; margin-top: 3px; }
.rk .up { color: var(--good); } .rk .down { color: var(--error); }
.who { min-width: 0; }
.who b { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { color: var(--on-v); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.badge { background: var(--s3); border-radius: var(--r-full); padding: 6px 10px; font-weight: 650; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.trow.me .badge { background: color-mix(in oklab, var(--on-primary-c) 14%, transparent); }
.num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.num small { color: var(--on-v); font-weight: 500; }
.star { font-size: 20px; color: var(--on-v); padding: 2px; }
.star.on { color: var(--tertiary); }

/* ---------- bar lists ---------- */
.bar-row { display: grid; grid-template-columns: 42px 1fr 104px 46px; gap: 10px; align-items: center; background: var(--s2); border-radius: var(--r-m); padding: 10px 12px; margin-bottom: 6px; color: var(--on); }
.face { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--s3); }
.bars { display: flex; gap: 2px; height: 22px; }
.bars i { flex: 1; border-radius: 4px; background: var(--s4); }
.bars i.f { background: var(--secondary); }
.pct { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }

/* ---------- awards ---------- */
.award { text-align: center; padding: 24px 18px 18px; }
.award svg { width: 96px; height: 110px; margin: 0 auto 8px; display: block; filter: drop-shadow(0 8px 18px rgba(0,0,0,.25)); }
.award h3 { margin: 6px 0 2px; font-size: 24px; font-stretch: 110%; }
.award .podium { margin-top: 16px; text-align: left; }
.award .podium .item { display: flex; align-items: center; gap: 12px; background: var(--s2); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 6px; }
.award .podium .item b.n { width: 30px; height: 30px; border-radius: 10px; background: var(--s4); display: grid; place-items: center; font-size: 13px; }
.award .podium .item span { flex: 1; }
.award .podium .item em { font-style: normal; background: var(--tertiary-c); color: var(--tertiary); padding: 6px 12px; border-radius: var(--r-full); font-weight: 800; }

/* ---------- games ---------- */
.day { color: var(--on-v); font-weight: 650; margin: 20px 6px 10px; font-size: 15px; }
.match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: var(--s1); border-radius: var(--r-l); padding: 16px 14px; margin-bottom: 8px; width: 100%; text-align: inherit; color: var(--on); }
.match:active { border-radius: var(--r-m); }
.match .t { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; min-width: 0; }
.match .t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .t.h { justify-content: flex-end; text-align: right; }
.match .t img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.match .sc { background: var(--s3); border-radius: var(--r-m); padding: 8px 14px; font-weight: 800; font-size: 19px; min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; font-stretch: 112%; }
.match .sc.live { background: var(--primary-c); color: var(--on-primary-c); }
.match .st { grid-column: 1 / -1; text-align: center; color: var(--on-v); font-size: 13px; display: flex; gap: 6px; justify-content: center; align-items: center; }

/* ---------- feed ---------- */
.fe { background: var(--s1); border-radius: var(--r-l); overflow: hidden; margin-bottom: 8px; }
.fe-h { background: var(--s2); display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 14px; }
.fe-h img { width: 20px; height: 20px; object-fit: contain; }
.fe-h b { margin: 0 4px; font-variant-numeric: tabular-nums; }
.fe-h .m { margin-left: auto; color: var(--on-v); font-variant-numeric: tabular-nums; }
.fe-b { padding: 14px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.fe-b .k { font-weight: 750; display: inline-flex; align-items: center; gap: 8px; }
.fe-b .sep { width: 1px; height: 18px; background: var(--outline); }
.card-y, .card-r { width: 12px; height: 16px; border-radius: 3px; background: #f6d55c; display: inline-block; }
.card-r { background: #e5484d; }
.tag { padding: 5px 11px; border-radius: var(--r-full); font-size: 14px; font-weight: 600; }
.tag.off { background: var(--error-c); color: var(--error); }
.tag.on { background: var(--good-c); color: var(--good); }
.mine { box-shadow: inset 4px 0 0 var(--primary); }

/* ---------- floating glass tab bar ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); width: min(560px, calc(100% - 24px)); height: var(--nav-h);
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-full);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 14px 40px rgba(3, 8, 14, .35);
  display: flex; align-items: center; padding: 0 8px; gap: 2px; z-index: 20;
}
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--on-v); font-size: 12px; font-weight: 600; padding: 6px 0; position: relative; }
.nav-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; position: relative; z-index: 1; }
.nav-btn span { position: relative; z-index: 1; }
.nav-btn::before { /* M3 active indicator pill */
  content: ""; position: absolute; top: 2px; left: 50%; width: 0; height: 32px; border-radius: var(--r-full);
  background: var(--secondary-c); transform: translateX(-50%); transition: width .45s var(--spring);
}
.nav-btn.on { color: var(--on-secondary-c); }
.nav-btn.on::before { width: 58px; }
.nav-btn.on span { color: var(--on); }

/* Live / Plan switch (segmented, glass) */
.mode { display: flex; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-full); padding: 3px; }
.mode.inline { margin: 0; }
.mode-btn { padding: 8px 14px; border-radius: var(--r-full); font-size: 14px; font-weight: 650; color: var(--on-v); }
.mode-btn.on { background: var(--primary); color: var(--on-primary); }

/* ---------- bottom sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 10, 16, .45); animation: fade .25s var(--ease); }
.sheet-body {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; width: min(584px, calc(100% - 16px)); max-height: 86dvh; overflow-y: auto;
  background: color-mix(in oklab, var(--s1) 88%, transparent); border: 1px solid var(--glass-edge); border-radius: var(--r-xl);
  padding: 10px 20px calc(24px + var(--safe-b)); box-shadow: inset 0 1px 0 var(--glass-hi), 0 -10px 40px rgba(0,0,0,.3);
  animation: rise .45s var(--spring);
}
.sheet-body::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--outline); margin: 0 auto 16px; }
@keyframes rise { from { transform: translate(-50%, 40px) scale(.98); opacity: .3; } }
@keyframes fade { from { opacity: 0; } }
.ph { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.ph img.face { width: 64px; height: 64px; border-radius: 22px; }
.ph h3 { margin: 0; font-size: 22px; font-stretch: 108%; }
.grid2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.grid2 div { background: var(--s2); border-radius: var(--r-m); padding: 12px 8px; text-align: center; }
.grid2 b { display: block; font-size: 20px; font-weight: 780; font-stretch: 112%; font-variant-numeric: tabular-nums; }
.grid2 span { color: var(--on-v); font-size: 12px; }
.list-btn { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 12px 6px; border-bottom: 1px solid var(--outline); color: var(--on); }
.list-btn img { width: 30px; height: 30px; object-fit: contain; }
.list-btn .xp { font-size: 15px; color: var(--primary); text-shadow: none; }
input[type=search], input[type=text], input[type=password], input[type=number], textarea {
  width: 100%; background: var(--s2); border: 1px solid var(--outline); color: var(--on); border-radius: var(--r-m); padding: 13px 14px;
}
textarea { min-height: 90px; font-family: ui-monospace, monospace; font-size: 12px; }
code { background: var(--s3); padding: 2px 7px; border-radius: 6px; font-size: 13px; word-break: break-all; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 24px); transform: translateX(-50%);
  background: color-mix(in oklab, var(--on) 92%, transparent); color: var(--ink); padding: 12px 20px; border-radius: var(--r-full);
  font-weight: 650; z-index: 50; max-width: 90vw; text-align: center; animation: rise .4s var(--spring);
}
.skeleton { height: 140px; border-radius: var(--r-l); background: linear-gradient(90deg, var(--s1) 0%, var(--s2) 50%, var(--s1) 100%); background-size: 200% 100%; animation: sh 1.3s infinite; margin-bottom: 12px; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- planner bits ---------- */
.plan-bar { position: sticky; top: 8px; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: space-between; background: color-mix(in oklab, var(--secondary-c) 80%, transparent); color: var(--on-secondary-c); border: 1px solid var(--glass-edge); border-radius: var(--r-l); }
.plan-bar .muted { color: inherit; opacity: .8; }
.hist { display: flex; gap: 6px; align-items: flex-end; height: 76px; margin-top: 14px; }
.hist > div { flex: 1; text-align: center; font-size: 11px; color: var(--on-v); }
.hist i { display: block; background: var(--secondary); border-radius: 8px 8px 3px 3px; margin: 0 auto 4px; width: 70%; }
.hist i.avg { background: var(--s4); }
.hscroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.mini { flex: none; width: 96px; background: var(--s2); border-radius: var(--r-m); padding: 10px 6px; text-align: center; color: var(--on); }
.mini img { width: 30px; height: 30px; object-fit: contain; margin: 0 auto 4px; }
.mini b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini span { font-size: 12px; color: var(--on-v); }
.mini em { font-style: normal; font-size: 12px; font-weight: 800; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.t th { color: var(--on-v); font-weight: 600; text-align: right; padding: 8px 4px; font-size: 12px; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t td { padding: 10px 4px; border-top: 1px solid var(--outline); text-align: right; }
.ticker td { padding: 5px 2px; text-align: center; font-size: 11px; font-weight: 700; }
.ticker td span { display: block; border-radius: 8px; padding: 5px 0; text-align: center; }

/* theme picker in settings */
.theme-pick { display: flex; gap: 6px; background: var(--s2); padding: 5px; border-radius: var(--r-full); }
.theme-pick button { flex: 1; padding: 10px; border-radius: var(--r-full); font-weight: 650; color: var(--on-v); }
.theme-pick button.on { background: var(--primary); color: var(--on-primary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 640px) { .top h1 { font-size: 46px; } }

/* ---------- predict, plans, accounts ---------- */
.tools { display: grid; gap: 12px; }
.tools input[type=search] { padding: 11px 14px; }
.seg.compact { margin-bottom: 0; }
.seg.compact button { padding: 9px 8px; font-size: 14px; }
.chips.tight { padding-bottom: 2px; }
.card.flush { padding: 6px 0 4px; overflow: hidden; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tscroll table.picks { min-width: 620px; }
table.sched td.cell { min-width: 64px; }
.tscroll table.t th, .tscroll table.t td { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
table.t .sticky { position: sticky; left: 0; background: var(--s1); z-index: 1; box-shadow: 1px 0 0 var(--outline); }
table.t thead th { position: sticky; top: 0; }
table.t td.hl { color: var(--primary); font-weight: 750; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:hover td { background: color-mix(in oklab, var(--s3) 55%, transparent); }
button.sort { color: inherit; font: inherit; padding: 2px 0; }
button.sort.on { color: var(--primary); }
button.sort.on::after { content: " ↓"; }
.warn { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--error-c); color: var(--error); font-size: 11px; font-weight: 800; vertical-align: 1px; }

.paywall { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; background: linear-gradient(135deg, var(--secondary-c), var(--s1) 70%); }
.pw-mark { width: 40px; height: 40px; border-radius: 14px 14px 14px 4px; background: var(--secondary); color: var(--secondary-c); display: grid; place-items: center; font-size: 15px; }

.lu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.lu-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 6px 0; border-bottom: 1px solid var(--outline); color: var(--on); font-size: 14px; }
.lu-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-row .mins { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: var(--r-full); background: color-mix(in oklab, var(--primary-c) var(--p), var(--s3)); color: var(--on); }
.pos-tag { font-size: 11px; font-weight: 750; color: var(--on-v); background: var(--s3); border-radius: 6px; padding: 2px 5px; text-align: center; }

table.sched td.cell { --heat: 50%; background: color-mix(in oklab, var(--primary-c) var(--heat), color-mix(in oklab, var(--error-c) 60%, var(--s1))); text-align: center; line-height: 1.15; }
table.sched td.cell span { display: block; font-size: 11px; color: var(--on-v); }
table.sched td.cell b { font-size: 14px; }
.crest-sm { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; object-fit: contain; }

.big-num { font-size: 28px; font-weight: 780; letter-spacing: -0.02em; }
.big-num small { font-size: 14px; color: var(--on-v); font-weight: 600; }
.opt-line { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: start; padding: 10px 0; border-top: 1px solid var(--outline); }
.opt-line:first-of-type { margin-top: 10px; }
.opt-line .pos-tag { margin-top: 6px; }
.opt-line > button + button { grid-column: 2; }
.opt-p { display: grid; text-align: left; color: var(--on); padding: 4px 0; }
.opt-p span { font-size: 13px; color: var(--on-v); }
.opt-p em { font-style: normal; font-size: 12px; color: var(--on-v); opacity: .8; }
.bans { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
.bans .tag { background: var(--s3); color: var(--on); border: 0; font-size: 13px; }
.field-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 14px; color: var(--on-v); }

.plan-card .step { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--outline); }
.step-md { font-weight: 750; color: var(--secondary); }
.mv { display: inline-block; margin-right: 10px; font-weight: 650; }
.tag.chip { background: var(--tertiary-c); color: var(--tertiary); font-size: 12px; }

.preview h2 { font-size: 24px; line-height: 1.2; letter-spacing: -0.015em; margin: 4px 0 14px; max-width: 30ch; }
.preview h3 { font-size: 16px; margin: 18px 0 4px; }
.preview p { line-height: 1.6; margin: 0; max-width: 62ch; }

.plans { display: grid; gap: 10px; margin-top: 12px; }
@media (min-width: 720px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { background: var(--s2); border-radius: var(--r-l); padding: 16px; display: grid; gap: 8px; align-content: start; border: 1px solid var(--outline); }
.plan h4 { margin: 0; font-size: 17px; }
.plan .price { font-size: 26px; font-weight: 780; letter-spacing: -0.02em; }
.plan .price small { font-size: 13px; color: var(--on-v); font-weight: 600; }
.plan ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; color: var(--on); }
.plan.pro { border-color: var(--primary); }
.plan.current { outline: 2px solid var(--secondary); outline-offset: -2px; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--on-v); }
.form input[type=email] { width: 100%; background: var(--s2); border: 1px solid var(--outline); color: var(--on); border-radius: var(--r-m); padding: 13px 14px; }
.form .check { grid-template-columns: 22px 1fr; align-items: center; color: var(--on); }
.form a, p a { color: var(--primary); }
button.link { color: var(--primary); font-weight: 650; padding: 0; font-size: inherit; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn.danger, .btn.ghost.danger { background: var(--error-c); color: var(--error); }
.btn[disabled] { opacity: .6; }
.lists { display: grid; gap: 12px; }
@media (min-width: 720px) { .lists { grid-template-columns: 1fr 1fr; } }
.lists .card { margin: 0; }
@media (max-width: 719px) { .plan.pro { order: -2; } .plan.elite { order: -1; } }
.sheet .card .btn.ghost { background: var(--s4); }
