/* Layout: hooped masthead over a single narrow column; tabs stick under it; everything is one-thumb reachable on a phone. */
:root {
  --bg: #EEF3EF;
  --surface: #FFFFFF;
  --ink: #0D1A13;
  --muted: #56685D;
  --line: #D3DDD6;
  --green: #0B7442;
  --green-soft: #DCEFE3;
  --on-green: #FFFFFF;
  --hoop-white: #FFFFFF;
  --danger: #A8321F;
  --danger-soft: #F7E3DE;
  --gold: #8A6A12;
  --gold-soft: #F4ECD2;
  --shadow: 0 1px 2px rgba(13, 26, 19, .06), 0 4px 16px rgba(13, 26, 19, .05);
  --f-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1410; --surface: #122019; --ink: #E6EFE9; --muted: #92A89A; --line: #223A2D;
    --green: #2DB26C; --green-soft: #173A27; --on-green: #04140B; --hoop-white: #DDE8E1;
    --danger: #F08A73; --danger-soft: #3A1E17; --gold: #E2C064; --gold-soft: #332A10;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1410; --surface: #122019; --ink: #E6EFE9; --muted: #92A89A; --line: #223A2D;
  --green: #2DB26C; --green-soft: #173A27; --on-green: #04140B; --hoop-white: #DDE8E1;
  --danger: #F08A73; --danger-soft: #3A1E17; --gold: #E2C064; --gold-soft: #332A10;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.hoops { height: 14px; background: repeating-linear-gradient(to bottom, var(--green) 0 7px, var(--hoop-white) 7px 14px); }
.mast { background: var(--green); color: var(--on-green); }
.mast-in { max-width: 680px; margin: 0 auto; padding: 22px 16px 20px; display: grid; gap: 6px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
h1 { margin: 0; font-family: var(--f-display); font-weight: 900; font-size: clamp(44px, 12vw, 72px); line-height: .9; letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.comp-line { margin: 4px 0 0; font-weight: 600; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }
.stat { display: grid; }
.stat b { font-family: var(--f-display); font-weight: 800; font-size: 30px; line-height: 1; }
.stat span { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }

.tabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs-in { max-width: 680px; margin: 0 auto; padding-inline: 8px; display: flex; overflow-x: auto; scrollbar-width: none; }
.tab { flex: 0 0 auto; border: 0; background: none; padding: 13px 12px 11px; font-weight: 700; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--green); }

main { max-width: 680px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 64px; }
section { display: grid; gap: 16px; }
h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 28px; line-height: 1.05; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
h3 { margin: 0; font-size: 16px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); min-width: 0; }
.notice { border-radius: 12px; padding: 14px 16px; background: var(--green-soft); display: grid; gap: 4px; }
.notice.warn { background: var(--danger-soft); }
.notice.win { background: var(--gold-soft); }
.notice.win h3 { color: var(--gold); }

.btn { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 700; background: var(--green); color: var(--on-green); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: var(--surface); }
.btn.small { padding: 7px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; justify-content: space-between; }

label.field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.field input, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* Lives: two hooped discs */
.lives { display: inline-flex; gap: 5px; vertical-align: middle; }
.life { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--green); background: repeating-linear-gradient(to bottom, var(--green) 0 3px, var(--hoop-white) 3px 6px); }
.life.lost { background: transparent; border-color: var(--line); }

/* Fixture + pick grid */
.fx-head { display: grid; gap: 2px; }
.fx-opp { font-family: var(--f-display); font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--green-soft); color: var(--green); }
.pill.grey { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.picks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pick { aspect-ratio: 1 / 1.1; width: 100%; min-width: 0; padding: 0; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); font-family: var(--f-display); font-weight: 900; font-size: clamp(26px, 8vw, 40px); line-height: 1; color: var(--ink); }
.pick:hover:not(:disabled) { border-color: var(--green); }
.pick[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--on-green); }
.pick:disabled { cursor: default; }
.pick.locked { opacity: .45; }
.pick.locked[aria-pressed="true"] { opacity: 1; }

/* People list */
.list { display: grid; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); min-width: 0; }
.person:first-child { border-top: 0; }
.person .name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.person .you { font-size: 12px; color: var(--green); font-weight: 700; margin-left: 6px; }

/* Reveal bars */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; height: 120px; }
.bar { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 4px; }
.bar .fill-wrap { width: 100%; display: flex; align-items: flex-end; }
.bar .fill { width: 100%; border-radius: 6px 6px 2px 2px; background: var(--line); min-height: 3px; }
.bar.hit .fill { background: var(--green); }
.bar .n { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.bar .lab { font-family: var(--f-display); font-weight: 800; font-size: 20px; line-height: 1; }
.bar.hit .lab { color: var(--green); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper output { font-family: var(--f-display); font-weight: 900; font-size: 40px; min-width: 2ch; text-align: center; line-height: 1; }
.stepper .btn { width: 44px; height: 44px; padding: 0; font-size: 22px; }

ol.rules { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
ol.rules li::marker { font-family: var(--f-display); font-weight: 800; color: var(--green); }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 20; }
.divider { height: 1px; background: var(--line); }
@media (prefers-reduced-motion: no-preference) { .pick { transition: background .12s, border-color .12s, color .12s; } }
