/* fantasy1v1 — mobile-first, dark, deliberately light on bytes.

   The brand in one line: a quiet ledger with one loud gesture. Exactly one
   element on a screen raises its voice - usually the names or the button -
   and everything else is bookkeeping. Amber is the currency of attention and
   it is spent once per view; two amber things side by side is a bug.

   Three families, self-hosted (see static/fonts/README.md). Archivo is
   variable on two axes, so the narrow headline caps and the wide block labels
   come out of the same 77 KB file that sets the body text - which is the
   whole reason this needs no second family. Everything loads with
   font-display: swap and a system stack behind it: the page is readable
   before a byte of font arrives, which is the only version acceptable on a
   cheap Android paying for data.
*/

@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/static/fonts/mono.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  /* One word on one surface: the signature on an accepted challenge. Loaded
     only where it is used, because that is how browsers load fonts. */
  font-family: "Signature";
  src: url("/static/fonts/sig.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  /* The palette is the brandbook's, unchanged. */
  --ink: #101318;          /* card and mark grounds, and text on bone */
  --bone: #F2EDE4;         /* the light: text, figures, fields */
  --amber: #FF8A00;        /* the only accent: CTA, the "v", a streak, an unsigned line */
  --ledger-red: #E5484D;   /* negative entries only - a minus, a loss, an overdue */
  --paid-green: #2FA46B;   /* money that actually moved. Never a prize. */

  --bg: #15171C;
  --panel: #1C1F26;
  --line: #232833;
  --muted: #8B93A0;
  --text: #E9EAEC;

  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ledger: "Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --font-sig: "Signature", Georgia, serif;

  --radius: 10px;
  --pad: 20px;

  /* Older names, still referenced in a few places. Mapped rather than
     renamed everywhere at once: a half-finished rename is worse than an
     alias, and these read correctly in both vocabularies. */
  --surface: var(--panel);
  --surface-2: #232833;
  --action: var(--amber);
  --action-dim: #E07C00;
  --gold: var(--amber);
  --loss: var(--ledger-red);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  /* Numbers stand in columns and change in place all over this site - a
     score, a record, a percentage that ticks on Sunday. Proportional figures
     make the whole line jump when one digit changes. */
  font-variant-numeric: tabular-nums;
}

main { display: block; }

section {
  padding: 36px var(--pad);
  max-width: 720px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

section:last-of-type { border-bottom: none; }

.narrow { max-width: 640px; }

h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0 0 12px; }
h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; }
/* Block labels are the wide end of the width axis: they read as headings of a
   ledger rather than as shouting. */
h2 {
  font-size: 1.05rem;
  font-weight: 800;
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}
h3 { font-size: 1.05rem; font-weight: 700; }

/* The loud gesture: a name, narrow and in caps, addressed to somebody. */
.callout {
  font-weight: 800;
  font-stretch: 62%;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
  margin: 0;
}

/* The ledger voice: what a receipt says in small print. */
.ledger {
  font-family: var(--font-ledger);
  font-size: 0.83rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* Money. The figures are the subject; the currency mark is not. */
.money .unit { font-size: 0.85em; color: var(--muted); }
p { margin: 0 0 14px; }

/* Links are text with an underline, not the accent: amber is spent once
   per screen and a paragraph with three links would spend it three times. */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--amber); }
/* A button is not a link with a line under it, whatever element it is made of. */
a.btn, a.btn:hover { text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  font-family: var(--font-ledger);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}

.lede { font-size: 1.06rem; color: #d3d9e6; }
.fine { font-size: 0.83rem; color: var(--muted); }
.error {
  background: rgba(229, 84, 75, 0.12);
  border: 1px solid var(--loss);
  color: #ffc9c5;
  padding: 12px 14px;
  border-radius: var(--radius);
}

code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.8rem;
  word-break: break-all;
}

/* header / footer ------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
  max-width: 720px;
  margin: 0 auto;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand .mark { width: 30px; height: 30px; display: block; border-radius: 7px; }
.brand-word {
  font-weight: 800;
  font-size: 1.1rem;
  font-stretch: 90%;
  letter-spacing: -0.01em;
}
/* The wordmark is one word; the amber lives in the monogram beside it, and
   two amber things in one corner is the mistake the brandbook names. */
.brand-word b { font-weight: 800; }

.site-header nav { display: flex; align-items: center; gap: 14px; }
.site-header nav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a.btn { color: var(--ink); }

.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 26px var(--pad) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer strong { color: var(--text); }

/* hero ------------------------------------------------------------------ */

.hero { padding-top: 44px; }
.hero h1 { font-size: 2.6rem; margin-bottom: 16px; }
.hero em { color: var(--amber); font-style: normal; }

/* buttons --------------------------------------------------------------- */

.btn {
  display: inline-block;
  background: var(--action);
  /* Ink, not white. Measured: white on amber is 2.4:1 and fails AA at any
     size; ink on amber is 7.88:1. The audience reads this outdoors on a phone,
     and it is the one element the whole funnel runs through. */
  color: var(--ink);
  font-weight: 800;
  font-stretch: 110%;
  font-size: 1rem;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--action-dim); text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--bone); outline-offset: 2px; }
.btn:focus-visible { outline: 3px solid var(--bone); outline-offset: 2px; }
.btn-big { display: block; width: 100%; padding: 16px; font-size: 1.05rem; }
.btn-small { padding: 8px 14px; font-size: 0.87rem; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: var(--panel); border-color: var(--muted); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* steps ----------------------------------------------------------------- */

.steps ol { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 22px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--bone);
  font-weight: 800;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}
.steps p { color: #cfd6e4; margin: 0; }

/* panels, cards, roster -------------------------------------------------- */

.panel { background: var(--surface); }
.panel h2 { color: var(--text); }
.commissioner { background: var(--surface-2); }

.cards, .roster { list-style: none; padding: 0; margin: 18px 0 0; }

.card, .roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card h3, .roster-row strong { margin: 0; display: block; }
.card p { margin: 2px 0 0; }
.roster-row .fine { display: block; }

/* forms ----------------------------------------------------------------- */

.form { margin-top: 18px; }
.form label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
.form input, .form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px 14px;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.form input:focus, .form select:focus {
  outline: none;
  border-color: var(--action);
}
.form .fine { font-weight: 400; margin-top: 6px; display: block; }
.form button { width: 100%; }

@media (min-width: 620px) {
  h1 { font-size: 2.6rem; }
  .hero h1 { font-size: 3.2rem; }
  .btn-big { width: auto; padding: 16px 32px; }
  .form button { width: auto; }
}

/* rivalry ---------------------------------------------------------------- */

.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
}
.side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  min-width: 0;
}
.side strong { display: block; font-size: 1rem; overflow-wrap: anywhere; }
.side .fine { display: block; margin-top: 2px; }
.side.leading { border-color: var(--amber); }
.side .score {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.side.leading .score { color: var(--amber); }
.vs {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.margin-line { font-variant-numeric: tabular-nums; }
.record { font-size: 1.05rem; }
.on-the-line { padding: 14px 16px; border-radius: var(--radius); }

.disclosure {
  color: var(--text);
  /* A rule, not an accent: the disclosure is the ledger speaking, and amber
     is reserved for the one thing being asked for on a screen. */
  border-left: 3px solid var(--muted);
  padding-left: 12px;
}

/* survivor pool ---------------------------------------------------------- */

.lms-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 18px 0;
}

.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin: 4px 0 8px;
}
.progress-bar {
  height: 100%;
  background: var(--amber);
  border-radius: 99px;
}
.progress-label { margin: 0 0 8px; font-variant-numeric: tabular-nums; }

.points { font-variant-numeric: tabular-nums; font-weight: 700; }
.roster-row.knocked { opacity: 0.62; border-color: var(--loss); }

/* Badges. The neutral look belongs in the base rule: it lived further down
   the file as a second `.tag`, which - same specificity, later in the source -
   quietly repainted every gold badge grey. */
.tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
}
/* A fact about somebody still being in, not about a prize. */
.tag-alive { background: rgba(47, 164, 107, 0.14); color: var(--paid-green); }
/* The one badge that is about the prize keeps the accent. */
.tag-prize { background: rgba(255, 138, 0, 0.14); color: var(--amber); }

/* install prompt --------------------------------------------------------- */

.install-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px var(--pad);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.install-bar span { flex: 1 1 220px; }
.install-bar .btn { width: auto; }

/* challenge form, payouts ------------------------------------------------ */

.challenge summary {
  list-style: none;
  display: inline-block;
}
.challenge summary::-webkit-details-marker { display: none; }
.challenge[open] summary { display: none; }
.challenge-form { margin-top: 0; }
.challenge-form label { margin-bottom: 10px; }
.roster-row:has(.challenge[open]) { flex-direction: column; align-items: stretch; }

.payout-amount { display: flex; align-items: center; gap: 8px; }

.steps-plain { padding-left: 20px; margin: 0 0 18px; }
.steps-plain li { margin-bottom: 8px; }
.code-big {
  font-size: 1.05rem;
  padding: 4px 10px;
  color: var(--bone);
  border: 1px solid var(--line);
}

.platform-block { border-radius: var(--radius); margin-bottom: 16px; }
.platform-block h2 { margin-bottom: 4px; }

.pay-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.pay-form input { margin-top: 0; width: 130px; }
.pay-form button { width: auto; }

/* Pitch writer (operator only). Monospace because the text gets pasted into
   chat apps and the operator needs to see exactly where the line breaks. */
.pitch-box {
  width: 100%;
  box-sizing: border-box;
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  resize: vertical;
}

/* Weekly table. Four columns that stay readable at 320px: place, name,
   record, percentage - the name is the only one allowed to grow. */
.standings { list-style: none; margin: 0 0 12px; padding: 0; counter-reset: none; }
.standing-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.standing-row:last-child { border-bottom: 0; }
.standing-place { width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
.standing-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.standing-record { color: var(--muted); font-variant-numeric: tabular-nums; }
.standing-pct { width: 3.2em; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.standing-mine { background: var(--surface-2); border-radius: var(--radius); }

/* Share cards. The SVG is drawn at 1200x630 - the size every social platform
   crops from - and scaled down to whatever the screen is. */
.card-frame {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.card-frame svg { display: block; width: 100%; height: auto; }

/* A checkbox is not a text field: the shared `.form input` rule stretched it
   to the full width of the page. */
.form .check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  color: var(--text);
}
.form .check input {
  width: auto;
  margin: 2px 0 0;
  padding: 0;
  min-width: 22px;
  min-height: 22px;
  accent-color: var(--action);
}

.portrait {
  float: right;
  margin: 0 0 12px 16px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.won-bar {
  background: rgba(245, 185, 66, 0.12);
  border-bottom: 1px solid var(--amber);
}

/* Said aloud, never drawn. Used for the one heading a page needs and the
   design does not. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard focus, everywhere - not only on buttons. Somebody tabbing through
   the page could not see where they were. */
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

/* A finger is about 44px wide. Small buttons were 33px tall, which is a miss
   on the first tap and a mis-tap on the second - on the phone that is most of
   our traffic. */
.btn-small { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.site-header nav a { min-height: 44px; display: inline-flex; align-items: center; }

/* The duel page's score line had no style of its own and inherited a
   paragraph. */
.scoreboard {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.scoreboard span:nth-child(2) { color: var(--muted); font-size: 1.2rem; }

/* Lineups -----------------------------------------------------------------
   Two columns on a phone would be two columns of four-point type, so they
   stack until there is room. */
.lineups { display: grid; gap: 16px; margin: 18px 0; }
@media (min-width: 620px) {
  .lineups {
    grid-template-columns: 1fr 1fr;
    /* Wider than the column of prose it sits in. Two lineups inside a 640px
       measure leave 290px each, and every third name wraps onto a second line
       - a nine-row list that ragged is harder to read than the same table
       given room. */
    width: min(920px, calc(100vw - 2 * var(--pad)));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}
.lineup {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.lineup h3 { margin: 0 0 10px; font-size: 1rem; overflow-wrap: anywhere; }
.lineup-rows { list-style: none; margin: 0; padding: 0; }
.lineup-rows li {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.lineup-rows li:last-child { border-bottom: 0; }
.lineup-slot {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lineup-name { overflow-wrap: anywhere; }
.lineup-name .fine { margin-left: 6px; }
.lineup-points { font-variant-numeric: tabular-nums; font-weight: 600; }
.lineup-total { font-weight: 700; border-top: 1px solid var(--line); }
.lineup-total .lineup-name { color: var(--muted); font-weight: 400; }
.lineup-adjustment .lineup-points { color: var(--loss); }

/* The receipt ------------------------------------------------------------
   The challenge as a piece of paper: a service line, a tear across the
   middle, the tape of what has happened between these two before, the
   conditions in small print, and two signature lines. The empty one is the
   mechanic - it sits in front of the whole league with his name under it. */

.receipt {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  margin: 18px 0;
}
.receipt-service {
  font-family: var(--font-ledger);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.receipt .rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
/* The tear line. A dashed rule is the cheapest way to say "receipt" and the
   only decoration in the whole system. */
.receipt .perforation {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 18px 0;
}

.receipt-names { text-align: center; padding: 26px 0 8px; }
.receipt-names .callout.from {
  font-size: clamp(1.5rem, 8vw, 2.3rem);
  color: var(--muted);
}
.receipt-names .callout.to {
  font-size: clamp(2.1rem, 12vw, 3.4rem);
  color: var(--bone);
  margin-top: 4px;
}
.receipt-names .vs {
  font-family: var(--font-sig);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--amber);
  margin: 2px 0;
}

.tape {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--ink);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.tape > div { display: flex; flex-direction: column; gap: 2px; }
.tape-label {
  font-family: var(--font-ledger);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tape-value { font-weight: 800; font-size: 1.3rem; }
.accent { color: var(--amber); }

.signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 20px;
}
.sig { display: flex; flex-direction: column; }
.sig-name {
  font-family: var(--font-sig);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--bone);
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sig-line { display: block; height: 1px; margin: 4px 0 6px; }
.sig-line.signed { background: var(--muted); }
.sig-line.waiting { border-top: 1px dashed var(--amber); }
.sig-label {
  font-family: var(--font-ledger);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The service line as two centred lines: the offer, then who it is for. Two
   facts of different kinds read worse strung together with a dot between
   them than stacked. */
.eyebrow-stack {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

/* On a narrow phone the header ran ten pixels past the edge: the mark, the
   word, two links and a button do not fit in 375. The word goes - that is what
   a monogram is for, and the link keeps its label for a screen reader. */
@media (max-width: 430px) {
  .brand-word { display: none; }
  .site-header nav { gap: 10px; }
}
