:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #14161a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --good: #12855a;
  --bad: #c0392b;
  --warn: #8a6d1f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #171a21;
    --ink: #eef0f4;
    --muted: #9aa3b2;
    --line: #262b36;
    --accent: #5b7cf5;
    --accent-ink: #0f1115;
    --good: #35c48b;
    --bad: #f0736a;
    --warn: #d4b45a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.head {
  text-align: center;
  margin-bottom: 1.25rem;
}
.company {
  font-weight: 650;
  letter-spacing: -0.01em;
}
.season {
  color: var(--muted);
  font-size: 0.875rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
}
.card.centered,
.centered {
  text-align: center;
}

.kicker {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.headline {
  font-size: 1.75rem;
}
.versus {
  font-size: 1.25rem;
}
.question {
  font-size: 1.3rem;
  margin: 1.25rem 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9375rem;
}
.warn {
  color: var(--warn);
  font-size: 0.875rem;
}
.deadline {
  font-size: 0.875rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 1rem;
}

.meta {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.meta li:not(:last-child)::after {
  content: " ·";
}

button {
  font: inherit;
  cursor: pointer;
}
.primary {
  width: 100%;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.progress {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
  color: var(--muted);
}
.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.clock.low {
  color: var(--bad);
}

.bar {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  /* No transition: the bar must read as the honest remaining time. */
}

.options {
  display: grid;
  gap: 0.625rem;
}
.option {
  text-align: left;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: inherit;
}
.option:hover:not(:disabled) {
  border-color: var(--accent);
}
.option:disabled {
  opacity: 0.5;
}
.option.chosen {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  opacity: 1;
}

.score {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0 0;
  font-variant-numeric: tabular-nums;
}

.result {
  margin: 1rem 0;
  border-top: 1px solid var(--line);
}
.row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.row.you .name {
  font-weight: 650;
}
.name {
  flex: 1;
}
.value {
  font-variant-numeric: tabular-nums;
}
.time {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.marks {
  display: flex;
  gap: 0.375rem;
  justify-content: center;
}
.mark {
  width: 1.75rem;
  height: 1.75rem;
  line-height: 1.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 700;
}
.mark.correct {
  background: color-mix(in srgb, var(--good) 18%, transparent);
  color: var(--good);
}
.mark.wrong {
  background: color-mix(in srgb, var(--bad) 18%, transparent);
  color: var(--bad);
}

/* ── league page ──────────────────────────────────────────────────────────
   The table is the page an office argues about, so it gets a little more room
   than a match screen and the columns that only matter to a tie-break are
   dropped on a phone rather than squeezed. */

.app.wide {
  max-width: 44rem;
}

.app.wide .card + .card {
  margin-top: 1rem;
}

.mine {
  border-color: var(--accent);
}
.mine-head {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

a.as-button {
  display: block;
  text-decoration: none;
  text-align: center;
}

.footnote {
  font-size: 0.8125rem;
  margin: 0.875rem 0 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0 0.4rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .num {
  text-align: right;
  width: 1px;
  white-space: nowrap;
}
.table .who {
  text-align: left;
  width: 100%;
}
.table .pts {
  font-weight: 650;
}

/* Your own row, so a table of thirty names answers "where am I" at a glance. */
.table tr.you td {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.table tr.you .player-name {
  font-weight: 650;
}

.tag {
  margin-left: 0.4rem;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.out {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}

.fixture {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.fixture:last-child {
  border-bottom: 0;
}
.fixture-names {
  flex: 1;
  min-width: 0;
}
.fixture-name.won {
  font-weight: 650;
}
.vee {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 0 0.4rem;
}
.fixture-state {
  color: var(--muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.fixture-score {
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.table-link {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 30rem) {
  .wide-only {
    display: none;
  }
}

/* ── playoff bracket ───────────────────────────────────────────────────── */

.stage-label {
  margin: 1rem 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.bracket > .stage-label:first-child {
  margin-top: 0;
}

/* The seed is the reason a level knockout match resolves the way it does, so
   it stays on screen next to the name rather than living in the rules doc. */
.seed {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0 0.25rem;
  border-radius: 5px;
  background: var(--line);
  color: var(--muted);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.champion {
  border-color: var(--accent);
}
.champion .headline {
  margin-bottom: 0.5rem;
}

.bracket .footnote {
  margin: 0 0 0.5rem;
  padding-left: 0.25rem;
}

.fixture-outcome {
  white-space: nowrap;
}
.advances {
  font-size: 0.8125rem;
  color: var(--muted);
}
