/* OddScope odds board.
   Reference is the printed pools coupon: dense numeric grid, provider columns, and the
   winning price marked by hand. Graphite structure on warm grey stock, cobalt reserved
   exclusively for that mark — it is the only saturated colour on the page. */

:root {
  --graphite: #171A1F;
  --stock: #E8E6E1;
  --card: #F7F6F3;
  --rule: #C6C2B8;
  --cobalt: #1D5FD0;
  --amber: #8A6A2F;
  --muted: #6B6A66;

  --display: "Saira Condensed", "Arial Narrow", sans-serif;
  --data: "IBM Plex Mono", ui-monospace, monospace;

  --gap: clamp(0.75rem, 2vw, 1.25rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --graphite: #E8E6E1;
    --stock: #14161A;
    --card: #1C1F24;
    --rule: #383C44;
    --cobalt: #6E9BF0;
    --amber: #C9A44E;
    --muted: #8D8F95;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--stock);
  color: var(--graphite);
  font-family: var(--data);
  font-size: 15px;
  line-height: 1.45;
}

/* ── header ─────────────────────────────────────────────────────────────── */

.board-head {
  display: flex;
  align-items: center;
  gap: var(--gap);
  flex-wrap: wrap;
  padding: var(--gap) clamp(0.75rem, 3vw, 2rem);
  border-bottom: 2px solid var(--graphite);
  position: sticky;
  top: 0;
  background: var(--stock);
  z-index: 2;
}

.brand { display: flex; align-items: center; gap: 0.5rem; margin-right: auto; }

.brand__mark {
  width: 1.6rem;
  height: 1.15rem;
  border: 2px solid var(--cobalt);
  border-radius: 50%;
  flex: none;
}

.brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.disciplines { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.disciplines button {
  font: 500 0.85rem/1 var(--display);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
  cursor: pointer;
}

.disciplines button:hover { color: var(--graphite); border-color: var(--graphite); }

.disciplines button[aria-current="true"] {
  background: var(--graphite);
  border-color: var(--graphite);
  color: var(--stock);
}

.disciplines button:focus-visible,
.retry:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

.freshness {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── legend ─────────────────────────────────────────────────────────────── */

main {
  padding: var(--gap) clamp(0.75rem, 3vw, 2rem) 3rem;
  /* Wide enough for four provider columns, narrow enough that a row stays one eye movement. */
  max-width: 64rem;
}

.legend {
  margin: 0 0 var(--gap);
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 62ch;
}

.legend__ring { color: var(--cobalt); }
.legend__susp { color: var(--amber); }

/* ── coupon blocks ──────────────────────────────────────────────────────── */

.board { display: grid; gap: var(--gap); }

.coupon {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: clamp(0.7rem, 2vw, 1.1rem);
}

.coupon__eyebrow {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
}

.coupon__held--long { color: var(--amber); }

.coupon__teams {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  letter-spacing: 0.01em;
  margin: 0.55rem 0 0.7rem;
}

.coupon__dash { color: var(--muted); padding: 0 0.35em; }

/* Grid, not <table>: the provider count varies and the row label is a header cell. */
.grid {
  display: grid;
  grid-template-columns: 2.4rem repeat(var(--providers), minmax(4rem, 1fr));
  gap: 0.15rem 0.4rem;
  align-items: center;
  justify-content: start;
  overflow-x: auto;
}

.grid__provider,
.grid__outcome {
  font: 500 0.72rem/1.2 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.grid__outcome {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--graphite);
}

.grid__provider { text-align: center; padding-bottom: 0.2rem; }

.price {
  position: relative;
  text-align: center;
  padding: 0.6rem 0.15rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.price--none { color: var(--rule); }
.price--suspended { color: var(--amber); }

/* Signature: the best price is circled, the way a coupon is marked by hand. */
.price__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.price__ring ellipse {
  fill: none;
  stroke: var(--cobalt);
  stroke-width: 1.6;
  stroke-linecap: round;
  /* The cell is wider than it is tall, so the viewBox scales unevenly; without this the
     stroke would thicken with it. */
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 128;
  stroke-dashoffset: 128;
  animation: draw 620ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.price--best { color: var(--cobalt); font-weight: 600; }

@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .price__ring ellipse { animation: none; stroke-dashoffset: 0; }
}

/* ── states ─────────────────────────────────────────────────────────────── */

.state {
  border: 1px dashed var(--rule);
  padding: clamp(1.25rem, 5vw, 2.5rem);
  max-width: 60ch;
}

.state h2 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.state p { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.88rem; }

.retry {
  font: 500 0.8rem/1 var(--display);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--graphite);
  color: var(--stock);
  border: 0;
  cursor: pointer;
}

.board-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  padding: var(--gap) clamp(0.75rem, 3vw, 2rem);
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--muted);
}
