:root {
  color-scheme: light dark;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --ink: #17202e;
  --muted: #4c5668;
  --line: #d3d9e3;
  --accent: #1f6a47;
  --button-bg: #1f6a47;
  --button-ink: #f3f6fb;
  --warn-bg: #fdf1d3;
  --code-bg: #eceff5;
  --sheet: #ffffff;
  --row-line: #e3e7ee;
  --tick-grey: #8a93a3;
  --good: #1f6a47;
  --bad: #a3322a;
  --good-bg: #e3f3ea;
  --bad-bg: #f9e4e2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c;
    --surface: #1a2029;
    --ink: #e8ecf3;
    --muted: #a8b1c2;
    --line: #333b4a;
    --accent: #7fd6a8;
    --button-bg: #e8ecf3;
    --button-ink: #11151c;
    --warn-bg: #3d3216;
    --code-bg: #262c38;
    --sheet: #232a35;
    --row-line: #333b4a;
    --tick-grey: #8a93a3;
    --good: #7fd6a8;
    --bad: #f2a29b;
    --good-bg: #17301f;
    --bad-bg: #3a1d1b;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.site-header { padding: 16px 0; }
.header-row { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: center; }
.header-row nav { display: flex; flex-wrap: wrap; gap: 0 16px; }
.header-row nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.soon { display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: 999px; background: var(--warn-bg); font-size: 15px; font-weight: 650; }
.not-yet { font-size: 15px; color: var(--muted); }
.logo { color: var(--ink); font-weight: 750; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }

h1 { font-size: clamp(28px, 6vw, 42px); line-height: 1.12; letter-spacing: -0.02em; margin: 8px 0 12px; overflow-wrap: break-word; }
h2 { font-size: 23px; line-height: 1.2; margin: 40px 0 10px; }
h3 { font-size: 18px; margin: 24px 0 4px; }
.lead { color: var(--muted); max-width: 66ch; }
.lead p { margin: 0 0 10px; }
.small { font-size: 15px; color: var(--muted); margin: 0 0 12px; }
ul, ol { padding-left: 22px; }
li { margin: 6px 0; }
p, li { overflow-wrap: break-word; }

kbd, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }

/* Buttons */
.cta { margin: 20px 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--button-bg);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  max-width: 100%;
  text-align: center;
}
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.button.cws:disabled { opacity: 1; background: var(--surface); color: var(--muted); border-color: var(--line); border-style: dashed; }

/* Pro */
.prices { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.prices li { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.prices li:first-child { border-color: var(--accent); }

.legal { max-width: 720px; }
.steps li { margin: 10px 0; }
.features li { margin: 10px 0; }
.disclaimer { margin: 24px 0 0; padding: 12px 14px; border-left: 3px solid var(--line); color: var(--muted); font-size: 15px; }
.data li { margin: 8px 0; }

.site-footer { margin-top: 56px; padding: 24px 0 32px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.footer-note { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* Calculator */
.calc-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 20px 0 8px; min-width: 0; }
.calc { margin: 0; }
.settings { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.toggle { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 0; }
.toggle legend { font-size: 14px; font-weight: 650; color: var(--muted); margin-bottom: 4px; padding: 0; }
.toggle label { position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); margin-left: -1px; background: var(--bg); cursor: pointer; font-size: 15px; font-weight: 600; }
.toggle label:first-of-type span { border-radius: 8px 0 0 8px; margin-left: 0; }
.toggle label:last-of-type span { border-radius: 0 8px 8px 0; }
.toggle input:checked + span { background: var(--button-bg); color: var(--button-ink); border-color: var(--button-bg); }
.toggle input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.teams { display: flex; flex-direction: column; font-size: 14px; font-weight: 650; color: var(--muted); }
.teams select { min-height: 44px; margin-top: 4px; padding: 6px 10px; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.calc .small { margin: 12px 0; }
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.side { min-width: 0; }
.side-title { display: block; font-size: 19px; font-weight: 750; margin-bottom: 6px; }
.search { position: relative; }
.search input { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.search input:focus-visible, .teams select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.search input:disabled { opacity: 0.6; }
.options { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.15); max-height: 320px; overflow-y: auto; }
.options li { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 10px; border-radius: 6px; cursor: pointer; min-height: 44px; align-items: center; }
.options li[aria-selected="true"] { background: var(--code-bg); }
.options .no-match { color: var(--muted); cursor: default; }
.opt-meta, .picked-meta { color: var(--muted); font-size: 14px; }
.opt-meta { text-align: right; }
.picked { list-style: none; padding: 0; margin: 8px 0 0; }
/* Name over meta ("RB · KC · last played week 9"), value and remove button on the right: fits 375 px. */
.picked li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 8px; align-items: center; margin: 4px 0; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.picked-name { grid-column: 1; grid-row: 1; overflow-wrap: anywhere; font-weight: 600; }
.picked-meta { grid-column: 1; grid-row: 2; }
.picked-value { grid-column: 2; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; font-weight: 700; }
.picked .remove { grid-column: 3; grid-row: 1 / span 2; }
.remove { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; border-radius: 6px; }
.remove:hover { background: var(--code-bg); color: var(--ink); }
.remove:focus-visible { outline: 3px solid var(--accent); }
.side-total { margin: 8px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.status { margin: 12px 0 0; padding: 10px 12px; background: var(--warn-bg); border-radius: 8px; }
.result { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.result p { margin: 2px 0; font-variant-numeric: tabular-nums; }
.result .verdict { font-size: 22px; font-weight: 750; }
.result[data-verdict="win"], .result[data-verdict="slightWin"] { background: var(--good-bg); border-color: var(--good); }
.result[data-verdict="loss"], .result[data-verdict="slightLoss"] { background: var(--bad-bg); border-color: var(--bad); }
.result .updated { color: var(--muted); font-size: 14px; margin-top: 6px; }
.attribution { font-size: 15px; color: var(--muted); }
