/* NoWhiff. One stylesheet, no build step.
   Follows the "sleek" design guidelines in .claude/skills/design-system/SKILL.md, kept dark:
   - colour is 60 % neutrals, 30 % surfaces, 10 % blue. Blue means "you can press this" or
     "this is you / this is data". Violet is only the coach. Green and red only mean won/lost.
   - every gap and padding is a step on the 8 px scale below (4 is the half step).
   - Inter for text, JetBrains Mono for codes and the round strip. Both are served from here. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jetbrains-mono.woff2") format("woff2");
}

:root {
  --bg: #0a0c10;
  --surface: #11141a;
  --surface-2: #171b23;
  --surface-3: #232935;
  --line: #2b3240;
  --line-soft: #1c212b;
  --text: #f3f4f6;
  --text-2: #b6bdc9;
  --muted: #8b95a4;

  --accent: #60a5fa;              /* blue as text, outline or small mark on dark */
  --accent-solid: #2563eb;        /* blue as a fill with white text on it */
  --accent-solid-hover: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-line: rgba(96, 165, 250, 0.38);

  --coach: #a78bfa;               /* the coach's comments, nothing else */
  --coach-soft: rgba(139, 92, 246, 0.09);
  --coach-line: rgba(139, 92, 246, 0.28);

  --series: #3b82f6;              /* the one colour data marks use */
  --series-soft: rgba(59, 130, 246, 0.16);
  --good: #4ade80;
  --bad: #f87171;
  --warn: #fbbf24;

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px;
  --radius: 12px;
  --radius-s: 8px;
  --side: 240px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: 0.14s ease;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.015em; }
h3 { font-size: 12px; line-height: 1.35; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.muted { color: var(--muted); }
.soft { color: var(--text-2); }
.small { font-size: 13px; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.error { color: var(--bad); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- brand, buttons, tags ---- */
.brand { font-weight: 700; font-size: 19px; letter-spacing: -0.03em; display: inline-flex; align-items: center; gap: var(--s2); }
.brand:hover { color: var(--text); }
.brand b { font-weight: inherit; }
.brand span { color: var(--accent); }
.brand-mark {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--accent); position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent);
}
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  background: var(--accent-solid); color: var(--accent-ink); font-weight: 600; font-size: 14px; line-height: 20px;
  padding: 10px var(--s3); border-radius: var(--radius-s); border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.button:hover { color: var(--accent-ink); background: var(--accent-solid-hover); }
.button:active { background: #1e40af; }
.button.big { padding: 14px var(--s4); font-size: 16px; border-radius: 10px; }
.button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.button.ghost:hover { background: var(--surface-2); border-color: var(--muted); color: var(--text); }
.button.ghost:active { background: var(--surface-3); }
.button.danger { background: transparent; color: var(--bad); border-color: rgba(248, 113, 113, 0.45); }
.button.danger:hover { background: rgba(248, 113, 113, 0.1); color: var(--bad); border-color: var(--bad); }
.button[disabled], .button[disabled]:hover { opacity: 0.5; cursor: default; background: var(--accent-solid); }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; transition: color var(--ease); }
button.link:hover { color: var(--text); }
.tag {
  display: inline-block; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px var(--s2); border-radius: 999px; border: 1px solid var(--line); color: var(--text-2);
}
.tag.pro { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.tag.win { color: var(--good); border-color: rgba(74, 222, 128, 0.38); }
.tag.loss { color: var(--bad); border-color: rgba(248, 113, 113, 0.38); }
.tag.draw { color: var(--text-2); }

/* ---- app shell (signed in) ---- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: var(--s4) var(--s3); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: var(--s4); background: var(--bg);
}
.side .brand { padding: 0 var(--s2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) 12px; border-radius: var(--radius-s); color: var(--text-2); font-weight: 500; font-size: 14px;
  transition: background var(--ease), color var(--ease);
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.side-foot { margin-top: auto; padding: 12px; border-radius: var(--radius-s); border: 1px solid var(--line-soft); font-size: 13px; }
.side-foot .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .row { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s2); }
main.app { padding: var(--s5) 40px 72px; max-width: 1200px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.page-head p { margin-top: var(--s2); }

/* ---- public pages (signed out) ---- */
.top { display: flex; justify-content: space-between; align-items: center; padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line-soft); }
.top nav { display: flex; gap: var(--s4); align-items: center; color: var(--text-2); font-weight: 500; font-size: 14px; }
main.public { max-width: 1080px; margin: 0 auto; padding: var(--s4) var(--s4) 80px; }
.hero { padding: 80px 0 var(--s7); max-width: 760px; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -0.045em; line-height: 1.04; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: var(--text-2); font-size: 19px; line-height: 1.55; margin: var(--s4) 0 var(--s5); max-width: 600px; }
.hero .note { margin-top: var(--s3); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin: var(--s2) 0 var(--s7); }
.step { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: var(--s4); }
.step b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--accent); margin-bottom: var(--s2); }
.step h2 { margin-bottom: var(--s2); }
.step p { color: var(--text-2); font-size: 14px; }
.sample { margin-bottom: var(--s7); }
.sample .event { max-width: 760px; }
footer.site { border-top: 1px solid var(--line-soft); padding: var(--s4) var(--s5); color: var(--muted); font-size: 13px; display: flex; gap: var(--s4); flex-wrap: wrap; }

/* ---- panels, tiles, tables ---- */
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s3); }
.panel > h2 { margin-bottom: var(--s3); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.panel.center { text-align: center; max-width: 520px; margin: 72px auto; padding: 40px var(--s5); }
.panel.center h2 { justify-content: center; word-break: break-word; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s3); }
.grid-2 > .panel { margin-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(144px, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.tile { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: var(--s3) 20px; }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.tile .v { font-size: 28px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; margin-top: var(--s1); font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 14px; font-weight: 500; color: var(--text-2); margin-left: 2px; letter-spacing: 0; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; padding: 0 12px var(--s2); white-space: nowrap; }
td { padding: 12px; border-top: 1px solid var(--line-soft); white-space: nowrap; }
tbody tr { transition: background var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tr.click { cursor: pointer; }
tr.selected, tr.selected:hover { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
td .you { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); margin-left: var(--s2); }

/* ---- data marks (one hue; text stays in text colours) ---- */
.meter { display: flex; align-items: center; gap: var(--s2); }
.meter-track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; min-width: 60px; }
.meter-fill { display: block; height: 100%; background: var(--series); border-radius: 0 3px 3px 0; }
.meter-val { width: 30px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rating { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center; }
.rating .big { font-size: 48px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.rating .big small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.bars { display: grid; gap: var(--s2); }
.bar { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 44px; gap: 12px; align-items: center; font-size: 14px; }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--series); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar .n { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .dot { r: 6; }
#tip {
  position: fixed; z-index: 50; pointer-events: none; background: #05070a; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 10px; font-size: 13px; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.08s;
}
#tip.on { opacity: 1; }

/* ---- upload ---- */
.drop {
  display: flex; flex-direction: column; gap: var(--s1); align-items: center; text-align: center;
  padding: var(--s5) var(--s4); border: 1px dashed var(--line); border-radius: var(--radius); cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop span { color: var(--muted); font-size: 13px; }
.progress { height: 4px; background: var(--surface-3); border-radius: 2px; margin-top: var(--s3); overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--series); transition: width 0.2s; }
.jobs { list-style: none; margin: 0; padding: 0; }
.jobs li { display: flex; justify-content: space-between; gap: 12px; padding: var(--s2) 0; border-top: 1px solid var(--line-soft); }
.jobs li:first-child { border-top: 0; }
.status { font-size: 13px; color: var(--muted); }
.status.failed { color: var(--bad); }
.status.running { color: var(--accent); }

/* ---- match page ---- */
.match-head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap;
  padding: var(--s4) var(--s5); margin-bottom: var(--s3); border-radius: var(--radius); border: 1px solid var(--line-soft);
  background: var(--surface);
}
.scoreline { font-size: 48px; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1; display: flex; align-items: baseline; gap: 12px; }
.scoreline .sep { color: var(--muted); font-weight: 300; }
.scoreline .lost { color: var(--muted); }
.scoreline .tag { letter-spacing: 0.06em; align-self: center; }
.strip { display: flex; gap: var(--s1); flex-wrap: wrap; }
.rnd {
  width: 32px; height: 40px; border-radius: 6px; background: var(--surface-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 600; position: relative; color: var(--text-2);
  border-bottom: 2px solid var(--line);
}
.rnd.won { border-bottom-color: var(--good); }
.rnd.lost { border-bottom-color: var(--bad); }
.rnd .k { font-size: 13px; color: var(--text); line-height: 1; }
.rnd .k.zero { color: var(--muted); }
.rnd .d { width: 4px; height: 4px; border-radius: 50%; background: var(--bad); margin-top: var(--s1); }
.rnd .d.alive { background: transparent; }
.rnd.half { margin-right: 12px; }
.legend { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: var(--s3); }
.legend i { display: inline-block; width: 12px; height: 2px; border-radius: 1px; margin-right: 6px; vertical-align: middle; }

.round { display: grid; grid-template-columns: 80px 1fr; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line-soft); }
.round:first-of-type { border-top: 0; }
.round-no { color: var(--muted); font-size: 13px; font-weight: 500; padding-top: 10px; }
.round-events { display: flex; flex-direction: column; gap: var(--s2); }
.event { background: var(--surface-2); border-radius: var(--radius-s); padding: 12px var(--s3); border-left: 2px solid var(--line); }
.event.death { border-left-color: var(--bad); }
.event.kill { border-left-color: var(--good); }
.event-head { display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
.kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); width: 48px; }
.label { font-weight: 600; }
.label.plain { font-weight: 400; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); margin: var(--s2) 0 0 56px; font-size: 13px; }
.facts div { display: flex; gap: 6px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.ai {
  margin: 12px 0 2px 56px; padding: 12px var(--s3); border-radius: var(--radius-s); font-size: 14px; line-height: 1.55;
  background: var(--coach-soft); border: 1px solid var(--coach-line);
}
.ai.waiting { color: var(--text-2); }
.ai.round-ai { margin: 0 0 2px 0; }
.ai-tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--coach); margin-right: var(--s2); }
.cooking::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---- locks and plans ---- */
.lock {
  border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--radius);
  padding: var(--s4); display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3);
}
.lock h2 { margin-bottom: var(--s1); }
.lock p { color: var(--text-2); font-size: 14px; max-width: 560px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.plan.featured { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-soft), 0 16px 48px rgba(37, 99, 235, 0.1); }
.plan .name { font-size: 22px; font-weight: 650; letter-spacing: -0.025em; display: flex; gap: var(--s2); align-items: center; }
.plan .price { font-size: 14px; color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); align-content: start; font-size: 14px; color: var(--text-2); flex: 1; }
.plan li { padding-left: var(--s4); position: relative; }
.plan li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 9px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

/* ---- training ---- */
.focus { display: grid; gap: var(--s3); }
.focus-item { background: var(--surface-2); border-radius: var(--radius-s); padding: var(--s3) var(--s4); display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); }
.focus-item .n { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--accent); }
.focus-item h2 { margin-bottom: var(--s1); }
.focus-item p { color: var(--text-2); font-size: 14px; }
.focus-item .drill { color: var(--text); margin-top: var(--s2); }
.focus-item .meta { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s2); font-size: 13px; color: var(--muted); }
.focus-item .meta a { color: var(--accent); }
.focus-item .meta a:hover, .prose a:hover { text-decoration: underline; }

/* ---- forms ---- */
.field { display: grid; gap: var(--s2); margin-bottom: var(--s3); max-width: 460px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
input[type=text], input[type=password], select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px;
  font: inherit; width: 100%; transition: border-color var(--ease), box-shadow var(--ease);
}
input[type=text]:hover, input[type=password]:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px var(--s3); margin-bottom: var(--s3); }
.keybox { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; word-break: break-all; margin: var(--s2) 0; }
.prose { max-width: 720px; }
.prose h2 { margin: var(--s4) 0 var(--s2); }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 20px; margin: var(--s2) 0; }

.spinner { width: 32px; height: 32px; margin: var(--s2) auto var(--s3); border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .spinner { animation-duration: 3s; }
  .cooking::after { animation: none; content: "..."; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--s2); padding: 12px var(--s3); border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--accent); }
  .side-foot { margin: 0 0 0 auto; padding: var(--s2) 12px; }
  .side-foot .row { margin-top: 2px; gap: var(--s2); }
  main.app { padding: var(--s4) var(--s3) 56px; }
  .grid-2, .plans, .steps { grid-template-columns: 1fr; }
  .round { grid-template-columns: 1fr; gap: var(--s1); }
  .facts, .ai { margin-left: 0; }
  .bar { grid-template-columns: 110px 1fr 36px; }
  .scoreline { font-size: 36px; }
  .match-head { padding: var(--s3) var(--s4); }
  .top { padding: 12px var(--s3); }
  .top nav a.hide-s { display: none; }
  .hero { padding: var(--s6) 0 var(--s6); }
}
