:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1d2320;
  --muted: #66706b;
  --line: #e3e1da;
  --accent: #1f6f5c;
  --accent-soft: #e2f0eb;
  --pos: #1f7a4d;
  --neg: #b4413c;
  --value-bg: #fff4d6;
  --value-ink: #7a5300;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514;
    --surface: #1b1f1d;
    --ink: #e6ebe8;
    --muted: #93a09a;
    --line: #2b312e;
    --accent: #5cc4a6;
    --accent-soft: #1d332c;
    --pos: #5cc48a;
    --neg: #e6827c;
    --value-bg: #3a3115;
    --value-ink: #f1cf72;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 12px; padding-bottom: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.logo { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); position: relative; }
.logo::after { content: ""; position: absolute; left: 9px; top: 7px; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.sub { margin: 0; color: var(--muted); font-size: 12.5px; }

.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 12px; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

main { padding-top: 20px; padding-bottom: 24px; min-height: 60vh; }
.panel { display: none; }
.panel.active { display: block; }
.lead { color: var(--muted); margin: 0 0 16px; max-width: 70ch; }
.note { color: var(--muted); font-size: 13px; max-width: 80ch; }
.section-title { font-size: 15px; margin: 24px 0 8px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 16px; }
.toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.day { margin-bottom: 20px; }
.day h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.match {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px;
  display: grid; grid-template-columns: minmax(180px, 1.3fr) 2fr; gap: 10px 20px; align-items: center;
}
.match.has-value { border-left: 3px solid var(--value-ink); }
.teams { font-weight: 600; }
.teams .vs { color: var(--muted); font-weight: 400; margin: 0 4px; }
.meta { color: var(--muted); font-size: 12.5px; }
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cell { background: var(--bg); border-radius: 8px; padding: 6px 8px; text-align: center; }
.cell .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cell .p { font-weight: 600; font-size: 15px; }
.cell .o { font-size: 12px; color: var(--muted); }
.cell.value { background: var(--value-bg); color: var(--value-ink); }
.cell.value .o, .cell.value .lbl { color: var(--value-ink); }
.badges { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { background: var(--value-bg); color: var(--value-ink); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card .k { color: var(--muted); font-size: 12.5px; }
.card .v { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.card .s { color: var(--muted); font-size: 12px; }
.chart-card { margin-bottom: 14px; }
.chart-card h3 { font-size: 13.5px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.chart svg { width: 100%; height: auto; display: block; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
tr:last-child td { border-bottom: 0; }
.bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--accent); vertical-align: middle; }

.row-result { display: grid; grid-template-columns: 90px 1fr auto auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 6px; font-size: 14px; }
.hit { font-weight: 600; }

.prose { max-width: 72ch; }
.prose h2 { font-size: 17px; margin: 8px 0; }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }

.foot { color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: 32px; }

@media (max-width: 720px) {
  .match { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-result { grid-template-columns: 1fr auto; }
  .row-result .meta { grid-column: 1 / -1; }
}
