:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #14171c;
  --muted: #5d6573;
  --line: #e3e6eb;
  --accent: #0f7a4f;
  --pos-bg: #dff4ea;
  --pos-ink: #0b6a43;
  --neg-ink: #8a93a2;
  --chip: #eceff3;
  --chip-on: #14171c;
  --chip-on-ink: #ffffff;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --card: #161a21;
    --ink: #e8ebf0;
    --muted: #98a1b0;
    --line: #262c36;
    --accent: #34c287;
    --pos-bg: #113526;
    --pos-ink: #5fdca5;
    --neg-ink: #6b7484;
    --chip: #1f2530;
    --chip-on: #e8ebf0;
    --chip-on-ink: #0e1116;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: baseline; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 24px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand .plus { color: var(--accent); }
.tagline { margin: 0; color: var(--muted); font-size: 14px; }

.controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 0; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600;
  background: var(--chip); color: var(--ink); cursor: pointer;
}
.chip[aria-selected="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
.chip .count { opacity: 0.6; font-weight: 500; margin-left: 4px; }
.tools { display: flex; gap: 8px; align-items: center; }
.select { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
select, .btn {
  font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.panel p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.apps-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.apps-list label { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.apps-list .kind { color: var(--muted); font-size: 12px; }

.day { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 8px; }
.game { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.game-head { padding: 12px 16px 4px; }
.title { margin: 0; font-size: 16px; font-weight: 700; }
.meta { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.outcomes { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; table-layout: fixed; }
.outcomes col.c-out { width: 34%; }
.outcomes col.c-best { width: 31%; }
.outcomes col.c-edge { width: 13%; }
.outcomes col.c-fair { width: 11%; }
.outcomes col.c-more { width: 11%; }
.label { overflow-wrap: anywhere; }
.outcomes th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 6px 16px; }
.outcomes td { padding: 9px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.outcomes .num { text-align: right; }
.label { font-weight: 600; }
.best { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.best .price { font-weight: 700; font-size: 16px; }
.best .app { color: var(--muted); font-size: 13px; }
.edge { display: inline-block; min-width: 58px; text-align: center; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 6px; color: var(--neg-ink); }
.edge.pos { background: var(--pos-bg); color: var(--pos-ink); }
.edge.flat { color: var(--ink); }
.fair { color: var(--muted); }
.more { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; padding: 0; white-space: nowrap; }

.quotes td { padding: 0 16px 10px; border-top: 0; }
.quotes table { width: 100%; border-collapse: collapse; font-size: 13px; }
.quotes td td { padding: 5px 0; border-top: 1px dashed var(--line); }
.quotes .q-name { font-weight: 600; }
.quotes .q-price { text-align: right; width: 64px; }
.quotes .q-edge { width: 80px; }
.quotes .q-detail { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.quotes a { color: var(--accent); }

.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.foot { color: var(--muted); font-size: 13px; padding-top: 24px; padding-bottom: 40px; }
.foot details p { max-width: 70ch; }
.foot summary { cursor: pointer; color: var(--ink); }

@media (max-width: 560px) {
  .fair-col { display: none; }
  .outcomes col.c-out { width: 35%; }
  .outcomes col.c-best { width: 32%; }
  .outcomes col.c-edge { width: 18%; }
  .outcomes col.c-more { width: 15%; }
  .outcomes td:last-child, .outcomes th:last-child { padding-left: 0; }
  .outcomes th, .outcomes td { padding-left: 12px; padding-right: 12px; }
  .game-head { padding-left: 12px; padding-right: 12px; }
  .best .price { font-size: 15px; }
  .edge { min-width: 0; }
}
