/* fantasy1v1 — mobile-first, dark, deliberately light on bytes.
   No web fonts: the audience plays on cheap Android phones and pays for data
   (CLAUDE.md). Weight and spacing carry the typography instead. */

:root {
  --ink: #0f1420;
  --surface: #19202f;
  --surface-2: #212a3d;
  --line: #2c3752;
  --text: #eef1f7;
  --muted: #9aa4bb;
  --action: #4f8cff;
  --action-dim: #3a6fd8;
  --gold: #f5b942;
  --loss: #e5544b;
  --radius: 10px;
  --pad: 20px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

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; }
h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 14px; }

a { color: var(--action); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  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 {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand span { color: var(--gold); }

.site-header nav { display: flex; align-items: center; gap: 14px; }
.site-header nav a { font-size: 0.9rem; color: var(--muted); }
.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(--gold); font-style: normal; }

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

.btn {
  display: inline-block;
  background: var(--action);
  /* Ink, not white. Measured: white on this blue is 3.22:1 and fails AA at
     button size; ink is 5.72:1. The audience reads this outdoors on a phone,
     and the failing colour was on the one element the whole funnel runs
     through. */
  color: var(--ink);
  font-weight: 700;
  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(--gold); 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(--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(--gold);
  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(--gold); }
.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(--gold); }
.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(--gold); }
.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);
  border-left: 3px solid var(--gold);
  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(--gold);
  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);
}
.tag-alive { background: rgba(245, 185, 66, 0.14); color: var(--gold); }

/* 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(--gold);
  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(--gold);
}

/* 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(--gold);
  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); }
