/* Alpha Rho Darts: the docs/DESIGN.md system, components on the tokens.
   Twin files: tourney/public/system.css and site/public/system.css are
   byte-identical; edit both in the same commit. Tokens: shared/theme.css.
   The 2027 public pages load it (2026-10-17); admin and score still load
   style.css, and the root site's pages move here in their own pass. */
:root {
  --cream: #F5EFDF;
  --cream-dark: #EFE7D2;
  --purple: #4F2D7F;
  --purple-dark: #3E2365;
  --gold: #C9A227;
  --gold-on-purple: #D9B648;
  --gold-ink: #76600B;
  --ink: #1C1820;
  --ink-soft: #6A6274;
  --ink-soft-on-purple: #C9BFA8;
  --red: #B3202E;
  --green: #2E6B3E;
  --hairline: #D9D0BA;

  --font-display: "Zilla Slab", Georgia, serif;
  --font-text: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --s1: clamp(2.25rem, 1.5rem + 3.2vw, 3rem);
  --s2: clamp(1.6rem, 1.2rem + 1.6vw, 2rem);
  --s3: 1.35rem;
  --s4: 1rem;
  --s5: .9rem;
  --s6: .8rem;
  --lh-display: 1.15;
  --lh-text: 1.5;

  --sp1: .5rem;
  --sp2: 1rem;
  --sp3: 1.5rem;
  --sp4: 2rem;
  --sp5: 3rem;
  --sp6: 4rem;

  --container: 62rem;
  --gutter: var(--sp3);
  --section: var(--sp5);
  --radius: 6px;
}
@media (max-width: 640px) {
  :root { --gutter: var(--sp2); --section: var(--sp4); }
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 400 var(--s4)/var(--lh-text) var(--font-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; }
h1 { font: 700 var(--s2)/var(--lh-display) var(--font-display); text-wrap: balance; }
h2 { font-size: var(--s3); font-weight: 600; line-height: 1.3; }
h3, h4 { font-size: var(--s4); font-weight: 600; }
p { max-width: 44rem; }
a { color: var(--purple); text-underline-offset: 3px; }
b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* one container: masthead, main and footer share these edges */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
main { padding: var(--section) 0; }
/* main fills the first screen, so the footer (written by script) starts
   below the fold and a list that loads late cannot push it across the view */
.masthead ~ main { min-height: calc(100vh - 3.5rem); }
@media (max-width: 760px) { .masthead ~ main { min-height: calc(100vh - 5.75rem); } }
.stack > * + * { margin-top: var(--section); }

/* icons: <svg class="i"><use href="#i-pin"/></svg>, symbols from the page's
   <svg hidden> sprite; stroke styles inherit into the <use>. The hidden
   attribute alone does not hide an <svg> (not an HTML element) */
svg[hidden] { display: none; }
.i {
  width: 20px; height: 20px; flex: none; vertical-align: -4px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* masthead and nav: flat purple, wordmark left, five items right; under
   760px the wordmark sits above one nav row spread to the edges. A page
   carries an empty <header class="masthead"> that a script may fill: the
   min-height is the filled height (3.5rem: a 1.5rem wordmark line plus 1rem
   above and below; 5.75rem: .5rem + a 2.5rem wordmark line + the 44px nav),
   fixed line boxes so it holds in the fallback face too. Re-measure after
   any nav change */
.masthead { background: var(--purple); color: var(--cream); min-height: 3.5rem; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp4); }
.wordmark {
  font: 700 var(--s3)/1.5rem var(--font-display); color: var(--cream);
  text-decoration: none; white-space: nowrap; padding: var(--sp2) 0;
}
.wordmark span { color: var(--gold-on-purple); }
.nav { display: flex; gap: var(--sp3); }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--cream); font-size: var(--s5); font-weight: 600; white-space: nowrap;
  text-decoration: underline 2px transparent; text-underline-offset: var(--sp1);
}
.nav a:hover { text-decoration-color: var(--cream); }
.nav a[aria-current="page"] { text-decoration-color: var(--gold); }
@media (max-width: 760px) {
  .masthead { min-height: 5.75rem; }
  .masthead .wrap { display: block; }
  .wordmark { display: block; padding: var(--sp1) 0 0; line-height: 2.5rem; }
  .nav { justify-content: space-between; gap: 0; }
}

/* page head: eyebrow, h1, one line */
.eyebrow { font-size: var(--s5); color: var(--ink-soft); margin-bottom: var(--sp1); }
.pagehead .line { display: flex; align-items: center; gap: var(--sp1); margin-top: var(--sp2); }
.pagehead .line .i { color: var(--ink-soft); }

/* status box: the hub's one box. A fill, no border */
.status { background: var(--cream-dark); border-radius: var(--radius); padding: var(--sp3); }
.state { font: 700 var(--s3)/var(--lh-display) var(--font-display); }
.facts { margin-top: var(--sp2); }
/* facts carry no icons: a label is a word already */
.fact {
  display: grid; grid-template-columns: 7rem 1fr; gap: var(--sp2);
  align-items: baseline; padding: var(--sp1) 0;
}
.fact dt { font-size: var(--s5); color: var(--ink-soft); }
.fact dd { color: var(--ink); }
.act { margin-top: var(--sp3); }
@media (min-width: 641px) { .fact { grid-template-columns: 9rem 1fr; } }
@media (max-width: 640px) { .act .btn { display: flex; width: 100%; } }
/* facts outside a box (rows on the page): a hairline between rows */
.facts.ruled .fact + .fact { border-top: 1px solid var(--hairline); }

/* buttons: one filled per screen; everything else is a text button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp1);
  min-height: 44px; padding: 0 var(--sp3); border: 0; border-radius: var(--radius);
  background: var(--purple); color: var(--cream);
  font: 600 var(--s4)/var(--lh-text) var(--font-text); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--purple-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-text {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--purple); font: 600 var(--s4)/var(--lh-text) var(--font-text);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ticker: time · text, a hairline between rows, no outer box */
.ticker { list-style: none; max-width: 44rem; }
.ticker li { display: flex; align-items: baseline; gap: var(--sp2); padding: var(--sp1) 0; }
.ticker li + li { border-top: 1px solid var(--hairline); }
.ticker time { flex: none; min-width: 4rem; font-size: var(--s6); color: var(--ink-soft); }

/* table: plain, no zebra; the head sticks on phones (no scrolling ancestor) */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th {
  text-align: left; font-size: var(--s6); font-weight: 600; color: var(--ink-soft);
  padding: var(--sp1) var(--sp2) var(--sp1) 0; border-bottom: 1px solid var(--hairline);
  background: var(--cream);
}
.table td { padding: var(--sp1) var(--sp2) var(--sp1) 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; width: 1%; white-space: nowrap; } /* number columns shrink to their content */
.table tr.mine td { background: var(--cream-dark); font-weight: 600; }
/* a marked row or box holds its screen-reader "Your team" text: positioned,
   so that 1px box stays inside any sideways scroller instead of widening the page */
.mine, .table tr.mine td { position: relative; }
/* a table wider than a phone scrolls inside its own box (its head then
   does not stick: only a table the phone fits gets a sticky head) */
.scroll { overflow-x: auto; }
@media (max-width: 640px) { .table thead th { position: sticky; top: 0; z-index: 1; } }

/* definition rows */
.defs > div { display: grid; grid-template-columns: 7rem 1fr; gap: var(--sp2); padding: var(--sp1) 0; }
.defs > div + div { border-top: 1px solid var(--hairline); }
.defs dt { font-size: var(--s5); color: var(--ink-soft); }
@media (min-width: 641px) { .defs > div { grid-template-columns: 9rem 1fr; } }

/* form: labels above, 48px inputs at 16px, a purple 2px focus ring. The
   field edge is ink-soft, not the hairline: a boundary needs 3:1 */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-size: var(--s4); font-weight: 600; }
.field { margin-top: var(--sp2); max-width: 28rem; }
.field label { display: block; font-size: var(--s5); font-weight: 600; margin-bottom: var(--sp1); }
.field input {
  display: block; width: 100%; height: 48px; padding: 0 var(--sp2);
  font-size: var(--s4); background: var(--cream); color: var(--ink);
  border: 1px solid var(--ink-soft); border-radius: var(--radius);
}
.field input:focus { outline: 2px solid var(--purple); outline-offset: 0; border-color: var(--purple); }
.field .hint { font-size: var(--s5); color: var(--ink-soft); margin-top: var(--sp1); }
.field .msg { font-size: var(--s5); color: var(--red); margin-top: var(--sp1); }
.field input[aria-invalid="true"] { border-color: var(--red); }

/* a checkbox with its sentence; the box is 24px, the whole label the target */
.check { display: flex; align-items: center; gap: var(--sp1); min-height: 44px; margin-top: var(--sp2); max-width: 28rem; }
.check input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--purple); }

/* segmented choice: two text buttons, the chosen one ink and underlined */
.seg { display: flex; gap: var(--sp3); }
.seg button {
  min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--ink-soft); font: 600 var(--s4)/var(--lh-text) var(--font-text);
  text-decoration: underline 2px transparent; text-underline-offset: var(--sp1);
}
.seg button[aria-pressed="true"] { color: var(--ink); text-decoration-color: currentColor; }

/* "your team" picker (App.teamPicker on the 2027 site): a field with a
   clear button, a status line, choice buttons when several teams match */
.picker { max-width: 28rem; }
.picker label { display: block; font-size: var(--s5); font-weight: 600; margin-bottom: var(--sp1); }
.picker .prow { display: flex; gap: var(--sp1); }
.picker input {
  flex: 1; min-width: 0; height: 48px; padding: 0 var(--sp2);
  font-size: var(--s4); background: var(--cream); color: var(--ink);
  border: 1px solid var(--ink-soft); border-radius: var(--radius);
}
.picker input:focus { outline: 2px solid var(--purple); outline-offset: 0; border-color: var(--purple); }
.picker .pclear {
  flex: none; width: 48px; height: 48px; padding: 0; border: 0; background: none;
  color: var(--ink-soft); font-size: var(--s4); cursor: pointer;
}
.picker .pstat { font-size: var(--s5); color: var(--ink-soft); margin-top: var(--sp1); }
.picker .pchoices { display: flex; flex-direction: column; align-items: flex-start; margin-top: var(--sp1); }
.picker .pchoices button {
  min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  color: var(--purple); font: 600 var(--s4)/var(--lh-text) var(--font-text);
  text-decoration: underline; text-underline-offset: 3px;
}
.picker .pnext { font-weight: 600; margin-top: var(--sp1); }
.picker [hidden] { display: none; }

/* running text (rules): spacing between blocks, lists indented */
.prose > * + * { margin-top: var(--sp2); }
.prose > * + h2 { margin-top: var(--sp4); }
.prose ul, .prose ol { padding-left: var(--sp3); }
.prose li { max-width: 44rem; }
.prose li + li { margin-top: var(--sp1); }

/* empty state: one sentence */
.empty { color: var(--ink-soft); }

/* footer: a hairline on the content edges, two lines */
.footer .wrap > div { border-top: 1px solid var(--hairline); padding: var(--sp3) 0 var(--sp5); }
.footer p { font-size: var(--s6); color: var(--ink-soft); line-height: 1.5rem; } /* 24px link targets */
.footer p + p { margin-top: var(--sp1); }
.footer a { display: inline-block; }
