/* Draftomatic — "Beer League Draft-o-matic" design system.
   Themes: dark (Lights Out, default), light (Rink), terminal (Draft Terminal, presenter default). */

:root {
  --font-display: 'Alfa Slab One', 'Rockwell', Georgia, serif;
  --font-condensed: 'Oswald', 'Arial Narrow', sans-serif;
  --font-sans: 'Libre Franklin', system-ui, sans-serif;
  --font-terminal: 'VT323', ui-monospace, monospace;
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-pill: 999px;
  /* Lights Out (default) */
  --surface-100: #1b1915; --surface-200: #28241e; --ink: #f1e7d2; --ink-muted: #b8ab92; --line: #4a4236;
  --jersey-red: #dc6458; --royal-blue: #7aa2dc; --trophy-gold: #e2b257; --on-accent: #1b1915; --goal-green: #7cc28c;
  --shadow-print: 3px 3px 0 #000000; --on-gold: #1b1915;
  color-scheme: dark;
}
[data-theme='light'] {
  --surface-100: #f4ecda; --surface-200: #e9dcc0; --ink: #1d2b44; --ink-muted: #5b5346; --line: #c9b994;
  --jersey-red: #a5302a; --royal-blue: #24498a; --trophy-gold: #c98f26; --on-accent: #f4ecda; --goal-green: #2e6a3e;
  --shadow-print: 3px 3px 0 #1d2b44; --on-gold: #1d2b44;
  color-scheme: light;
}
[data-theme='terminal'] {
  --surface-100: #140e04; --surface-200: #22180a; --ink: #ffb641; --ink-muted: #c98a2b; --line: #5c4116;
  --jersey-red: #ff7a52; --royal-blue: #ffd27a; --trophy-gold: #ffcf5c; --on-accent: #140e04; --goal-green: #ffe7a3;
  --shadow-print: 0 0 8px #ffb641; --on-gold: #140e04;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--surface-100); color: var(--ink); font: 15px/1.45 var(--font-sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--royal-blue); }
a:hover { color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1, h2, .disp { font-family: var(--font-display); font-weight: 400; }
h1 { font-size: 44px; line-height: 1.05; }
h2 { font-size: 26px; line-height: 1.15; }
h3, .cond { font-family: var(--font-condensed); font-weight: 600; letter-spacing: 0.02em; }
h3 { font-size: 18px; text-transform: uppercase; letter-spacing: 0.06em; }
p { margin-bottom: 0.6em; }
.lbl { font-family: var(--font-condensed); font-weight: 500; font-size: 13px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-muted); opacity: 0.8; }
.small { font-size: 13px; line-height: 18px; }
.term { font-family: var(--font-terminal); text-transform: uppercase; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.mono { font-family: var(--font-condensed); }
.sr { position: absolute; left: -9999px; }

/* sweater hem */
.hem, .rink-line { height: 20px; background: linear-gradient(var(--jersey-red) 0 6px, transparent 6px 8px, var(--royal-blue) 8px 12px, transparent 12px 14px, var(--jersey-red) 14px 20px); }
.rink-line { height: 12px; background: linear-gradient(var(--jersey-red) 0 5px, transparent 5px 7px, var(--royal-blue) 7px 12px); }
.hem-thin { height: 8px; background: linear-gradient(var(--jersey-red) 0 3px, transparent 3px 5px, var(--royal-blue) 5px 8px); }

/* ---------- layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
.topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--surface-100); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.brand span { font-family: var(--font-display); font-size: 24px; line-height: 26px; }
.brand:hover { color: var(--ink); }
.card { background: var(--surface-200); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-print); padding: 20px; }
.card + .card { margin-top: 20px; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-title .step { font-family: var(--font-display); color: var(--jersey-red); font-size: 30px; }

/* ---------- controls ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border-radius: var(--radius-md); border: 2px solid var(--ink); background: var(--surface-200); color: var(--ink);
  font-family: var(--font-condensed); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow-print);
}
button:hover, .btn:hover { color: var(--ink); filter: brightness(1.08); }
button:active, .btn:active { transform: translate(3px, 3px); box-shadow: none; }
button:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; transform: none; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--royal-blue); outline-offset: 3px; }
.btn-primary, .btn-red { background: var(--jersey-red); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--ink-muted); }
.btn-sm { min-height: 36px; padding: 4px 12px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 8px 24px; font-size: 18px; }
.btn-danger { color: var(--jersey-red); }
input, select, textarea {
  font: 16px var(--font-sans); color: var(--ink); background: var(--surface-100);
  border: 2px solid var(--ink-muted); border-radius: var(--radius-sm); padding: 8px 12px; min-height: 44px; width: 100%;
}
textarea { min-height: 180px; resize: vertical; font-family: var(--font-terminal); font-size: 20px; line-height: 22px; }
label.field { display: block; }
label.field > span { display: block; margin-bottom: 6px; font-family: var(--font-condensed); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border: 2px solid var(--ink-muted); border-radius: var(--radius-md); background: var(--surface-100); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 4px; background: transparent; box-shadow: none; font-size: 14px; }
.seg button[aria-pressed='true'], .seg button[aria-selected='true'], .seg button.on { background: var(--royal-blue); color: var(--on-accent); }
.fchip, .filters button { min-height: 36px; padding: 4px 14px; border-radius: var(--radius-pill); border: 2px solid var(--ink-muted); background: transparent; box-shadow: none; font-size: 13px; }
.fchip[aria-pressed='true'], .filters button[aria-pressed='true'] { background: var(--ink); color: var(--surface-100); border-color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-pill); font-family: var(--font-condensed); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; border: 2px solid currentColor; white-space: nowrap; }
.ok { color: var(--goal-green); }
.warn { color: var(--jersey-red); }
.error { color: var(--jersey-red); font-weight: 600; }
.notice { background: var(--surface-100); border: 2px dashed var(--ink-muted); border-radius: var(--radius-md); padding: 10px 14px; font-size: 14px; }

/* position chips */
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); font-family: var(--font-condensed); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; border: 2px solid var(--ink); color: var(--ink); background: var(--surface-100); flex: none; }
.chip.d { background: var(--royal-blue); color: var(--on-accent); border-color: var(--royal-blue); }
.chip.g { background: var(--ink); color: var(--surface-100); }
.chip.s { border-style: dashed; border-color: var(--ink-muted); color: var(--ink-muted); }

/* team badge: colour + number, never colour alone */
.tb { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: var(--radius-md); font-family: var(--font-condensed); font-weight: 600; font-size: 16px; line-height: 1; border: 2px solid var(--ink); }
.tb.lg { width: 48px; height: 48px; font-size: 24px; }
.tb.xl { width: 180px; height: 180px; border-width: 4px; font-family: var(--font-display); font-weight: 400; font-size: 120px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: transparent; border: 2px solid var(--ink-muted); }
.dot.on { background: var(--goal-green); border-color: var(--goal-green); }

/* ---------- tables (setup) ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--font-condensed); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
td input, td select { min-height: 38px; padding: 6px 8px; }

/* ---------- setup ---------- */
.format-list { display: grid; gap: 10px; }
.format { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius-md); cursor: pointer; background: var(--surface-100); }
.format:has(input:checked) { border-color: var(--ink); box-shadow: var(--shadow-print); }
.format input { width: 20px; min-height: 20px; margin-top: 3px; accent-color: var(--jersey-red); }
.format .name { font-family: var(--font-condensed); font-weight: 600; font-size: 18px; letter-spacing: 0.04em; text-transform: uppercase; }
.format .rec { display: inline-block; margin-left: 8px; vertical-align: 2px; padding: 0 8px; border: 2px solid var(--goal-green); border-radius: var(--radius-pill); color: var(--goal-green); font-size: 11px; letter-spacing: 0.08em; }
.format .score { text-align: right; font-family: var(--font-condensed); font-weight: 600; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.format .score small { display: block; font-weight: 500; font-size: 11px; letter-spacing: 0.08em; color: var(--ink-muted); text-transform: uppercase; }
.preview-grid { overflow-x: auto; }
.preview-grid td, .preview-grid th { text-align: center; padding: 4px 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--royal-blue); }
.players-table { max-height: 440px; overflow: auto; border: 2px solid var(--line); border-radius: var(--radius-md); }
.players-table thead th { position: sticky; top: 0; background: var(--surface-200); z-index: 1; }
details summary { cursor: pointer; font-family: var(--font-condensed); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- landing ---------- */
.landing-nav { position: static; padding-inline: max(20px, calc((100% - 1280px) / 2)); }
.landing-nav .site-nav a { color: var(--ink-muted); text-underline-offset: 4px; }
.landing-nav .site-nav a:hover { color: var(--ink); }
.landing { max-width: 1320px; padding: 0 20px 56px; }
.draft-hero { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: center; gap: clamp(28px, 5vw, 76px); padding-block: clamp(38px, 7vw, 92px); }
.draft-intro h1 { font-size: clamp(48px, 6.8vw, 102px); line-height: 0.94; letter-spacing: -0.045em; }
.draft-intro h1 em { color: var(--jersey-red); font-style: normal; display: block; }
.draft-intro p { font-size: clamp(17px, 1.5vw, 21px); margin: 22px 0; max-width: 36ch; color: var(--ink-muted); }
.draft-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.landing .btn, .landing button { box-shadow: none; border-radius: 2px; }
.draft-join { margin-top: 22px; max-width: 320px; }
.draft-join label { display: block; margin-bottom: 6px; font-weight: 700; }
.join-box { display: flex; gap: 8px; max-width: 440px; }
.join-box input { text-transform: uppercase; letter-spacing: 0.2em; font: 600 24px var(--font-condensed); text-align: center; }
.draft-join input { min-width: 0; letter-spacing: 0.05em; text-align: left; font-size: 17px; }
.draft-join input::placeholder { color: var(--ink-muted); }
.draft-join button { flex: none; }
.draft-preview { margin: 0; min-width: 0; background: var(--surface-200); border: 1px solid var(--line); padding: 8px; }
.draft-preview figcaption { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px 2px; color: var(--ink-muted); font-size: 12px; }
.draft-explainer { padding-block: clamp(26px, 4vw, 50px); border-block: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 24px 56px; align-items: center; }
.draft-explainer p, .draft-details p { max-width: 57ch; margin-top: 10px; color: var(--ink-muted); }
.draft-comparison { table-layout: fixed; }
.draft-comparison caption { text-align: left; color: var(--ink-muted); margin-bottom: 8px; }
.draft-comparison th { width: 90px; padding-left: 0; color: var(--ink); font-size: 15px; }
.draft-comparison td { background: linear-gradient(90deg, var(--surface-200) var(--gap), transparent var(--gap)); text-align: right; font: 600 24px var(--font-condensed); }
.draft-comparison tr:last-child td { color: var(--goal-green); }
.draft-details { max-width: 750px; padding-top: 36px; }
.draft-formats ul { margin: 0; padding-left: 20px; max-width: 70ch; }
.draft-formats li { color: var(--ink-muted); line-height: 1.55; }
.draft-formats li + li { margin-top: 8px; }
.draft-formats b { color: var(--ink); }
.draft-details h2 { margin-bottom: 12px; }
.draft-details details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.draft-details summary { color: var(--ink); font: 700 15px var(--font-sans); text-transform: none; letter-spacing: normal; }
.ad-slot { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--ink-muted); border-radius: var(--radius-sm); color: var(--ink-muted); background: repeating-linear-gradient(135deg, transparent 0 10px, var(--surface-200) 10px 11px); font: 600 12px var(--font-condensed); letter-spacing: 0.1em; text-transform: uppercase; min-height: 56px; }
body:not(.ads-on) .ad-slot { display: none; }

/* ---------- draft room ---------- */
.room-head .meta { display: flex; flex-direction: column; min-width: 0; }
.room-head .meta b { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-head .count { display: flex; align-items: baseline; gap: 10px; margin-left: auto; }
.room-head .me { display: flex; align-items: center; gap: 10px; padding-left: 24px; border-left: 1px solid var(--line); }
.clock { font-family: var(--font-condensed); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.room { display: flex; flex-direction: column; gap: 20px; padding: 20px 24px 24px; }
.room-top { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }

.turn { display: flex; align-items: center; gap: 20px; padding: 16px 24px; border-radius: var(--radius-md); border: 3px solid var(--ink); flex: 999 1 600px; min-width: 0; }
.turn--clock { background: var(--jersey-red); color: var(--on-accent); box-shadow: var(--shadow-print); }
.turn--deck { background: var(--trophy-gold); color: var(--on-gold); }
.turn--wait { background: var(--surface-200); color: var(--ink); border-color: var(--ink-muted); border-style: dashed; }
.turn--paused { background: var(--surface-200); color: var(--ink); border-style: dashed; }
.turn .ttl { font-family: var(--font-condensed); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1; font-size: 40px; }
.turn .sub { font-size: 15px; line-height: 20px; font-weight: 600; }
.turn .text { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.turn .clockbox { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: 150px; flex: none; }
.turn .clockbox .lbl { color: inherit; }
.turn .clock { font-size: 56px; }
.turn .tbar { width: 100%; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.25); overflow: hidden; }
.turn .tbar i { display: block; height: 100%; background: currentColor; transition: width 0.25s linear; }
.turn svg { flex: none; }
.clock.low { animation: blink 1s steps(1) infinite; }
.clock.out { animation: blink 0.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.ticker { flex: 1 1 340px; min-width: 0; background: var(--surface-100); font-family: var(--font-terminal); font-size: 22px; line-height: 26px; text-transform: uppercase; color: var(--ink); border: 2px solid var(--ink-muted); border-radius: var(--radius-md); padding: 12px 16px; overflow: hidden; }
[data-theme='terminal'] .ticker { background-image: repeating-linear-gradient(transparent 0 3px, var(--surface-200) 3px 4px); box-shadow: var(--shadow-print); }
.ticker p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker .dim { color: var(--ink-muted); }
.cursor { animation: blink 1s steps(1) infinite; }

.split { flex: 1; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > section { flex: 1 1 500px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pane-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pane-title h2 { font-size: 28px; line-height: 32px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tools input { flex: 1 1 200px; width: auto; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.list { background: var(--surface-200); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.list-head { display: flex; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.prow { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 60px; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow .pname { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pos { width: 40px; flex: none; }
.prow .rating { font-family: var(--font-condensed); font-weight: 600; font-size: 20px; width: 40px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.prow .act { width: 112px; display: flex; justify-content: flex-end; flex: none; }
.prow.ineligible .pname { color: var(--ink-muted); }
.prow.sel { background: var(--surface-100); outline: 3px solid var(--jersey-red); outline-offset: -3px; }
.prow.queued .pname::after { content: ' ★'; color: var(--trophy-gold); }
.confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; background: var(--jersey-red); color: var(--on-accent); }
.confirm-row span { flex: 1 1 240px; font-weight: 600; font-size: 17px; }
.confirm-row .yes { background: var(--surface-100); color: var(--ink); }
.confirm-row .no { background: transparent; color: var(--on-accent); border-color: var(--on-accent); box-shadow: none; }

.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.team-card { border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--surface-200); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.team-card.me { border: 3px solid var(--jersey-red); box-shadow: var(--shadow-print); }
.team-card.clock-on { border-style: dashed; border-color: var(--ink); }
.team-card header { display: flex; align-items: center; gap: 10px; }
.team-card .tname { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-card ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rline { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 18px; min-width: 0; }
.rline .n { font-family: var(--font-condensed); font-weight: 500; color: var(--ink-muted); width: 38px; flex: none; font-variant-numeric: tabular-nums; }
.rline .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rline.has-contact { flex-wrap: wrap; }
.rline .contact { flex-basis: 100%; padding-left: 46px; }
.contact { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; line-height: 18px; min-width: 0; }
.contact a { overflow-wrap: anywhere; }
.prow .contact { flex: 1 1 260px; justify-content: flex-end; }

.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 24px; border-bottom: 1px solid var(--line); }
.controls .lbl { margin-right: 4px; }
.chug-panel { flex-basis: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding: 14px; border: 3px solid var(--ink); border-radius: var(--radius-md); background: var(--trophy-gold); color: var(--on-gold); box-shadow: var(--shadow-print); }
.chug-panel .lbl { color: inherit; }
.chug-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.chug-teams button { justify-content: flex-start; text-align: left; text-transform: none; letter-spacing: 0; min-height: 52px; background: var(--surface-100); color: var(--ink); }
.chug-teams button.placed { opacity: 0.6; }
.chug-teams .place { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--jersey-red); color: var(--on-accent); font: 600 18px var(--font-condensed); flex: none; }
.chug-teams .cn { display: flex; flex-direction: column; min-width: 0; font-family: var(--font-sans); }
.chug-teams .cn b, .chug-teams .cn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chug-panel .btn-ghost { color: var(--on-gold); border-color: var(--on-gold); }
.tabs { display: none; }
.your-line { display: none; }

/* ---------- presenter ---------- */
.present { height: 100dvh; min-height: 420px; display: flex; flex-direction: column; }
[data-theme='terminal'] .present {
  --surface-100: #1b1915; --surface-200: #28241e; --ink: #f1e7d2; --ink-muted: #b8ab92; --line: #4a4236;
  --jersey-red: #dc6458; --royal-blue: #7aa2dc; --trophy-gold: #ffbd59; --on-accent: #1b1915; --on-gold: #1b1915;
  --shadow-print: none;
  background: var(--surface-100); color: var(--ink);
}
.p-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding: 12px clamp(12px, 2.6vw, 40px); }
.p-head .brand span { font-size: clamp(20px, 2vw, 34px); line-height: 1.05; }
.p-league { display: grid; min-width: 0; }
.p-league strong { overflow-wrap: anywhere; }
.p-head .watch { margin-left: auto; display: grid; color: var(--ink); overflow-wrap: anywhere; }
.p-head .watch .lbl { text-decoration: none; }
.present > .score-strip { margin-inline: clamp(12px, 2.6vw, 40px); }
.score-strip { display: grid; grid-template-columns: minmax(0, 1.45fr) auto minmax(0, 1fr); background: #171714; color: #f4ecda; border: 1px solid #49443a; }
.score-item { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: clamp(8px, 1.1vw, 20px); }
.score-item + .score-item { border-left: 1px solid #49443a; }
.score-item .lbl, .score-item small { color: #c8bca6; }
.score-item strong { font: 600 clamp(17px, 2.5vw, 46px)/1.06 var(--font-condensed); overflow-wrap: anywhere; }
.score-item small { margin-top: 4px; }
.score-item .has-team::before { content: ''; display: inline-block; background: var(--team-color, transparent); width: 0.33em; height: 0.67em; margin-right: 0.27em; }
.score-time { text-align: center; min-width: clamp(66px, 11vw, 188px); }
.score-item .score-digits { color: #ffbd59; font: clamp(32px, 5.7vw, 102px)/0.8 var(--font-terminal); white-space: nowrap; padding-block: 0.08em; }
.score-digits:empty::before { content: '—'; }
.score-digits.low, .score-digits.out { color: #ff927c; }
.draft-preview .score-item strong { font-size: clamp(16px, 2vw, 28px); }
.draft-preview .score-item .score-digits { font-size: clamp(30px, 4vw, 52px); }
.draft-preview .score-time { min-width: 0; }

.p-main { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 12px clamp(12px, 2.6vw, 40px) 0; }
.p-main .board { flex: 1; min-height: 0; overflow: auto; }
.p-main .board:focus-visible { outline: 2px solid var(--royal-blue); outline-offset: 2px; }
.p-last { margin: 0; padding: 8px 2px; color: var(--ink); font: 600 clamp(15px, 1.4vw, 24px)/1.2 var(--font-condensed); overflow-wrap: anywhere; }
.p-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px clamp(12px, 2.6vw, 40px); border-top: 1px solid var(--line); }

.board table { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.board th, .board td { padding: clamp(5px, 0.75vw, 13px); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.board tr > :first-child { border-left: 1px solid var(--line); }
.board thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-100); border-top: 4px solid var(--tc, var(--line)); color: var(--ink); font: 600 clamp(13px, 1.1vw, 21px)/1.15 var(--font-condensed); text-transform: uppercase; }
.board .rd { width: clamp(34px, 4vw, 70px); text-align: center; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.p-main .board table { min-width: var(--board-min-width, 0); }
.board td { height: clamp(42px, 4vw, 72px); background: var(--surface-200); vertical-align: middle; }
.board td b { font: 600 clamp(15px, 1.45vw, 29px)/1.1 var(--font-condensed); }
.pick-position { display: inline-block; margin-left: 0.45em; color: var(--ink-muted); font: 600 12px var(--font-condensed); }
.board .goalie-row .rd { color: var(--royal-blue); }
.board .open { color: var(--ink-muted); background: var(--surface-100); font-variant-numeric: tabular-nums; }
.board .now { background: var(--jersey-red); color: var(--on-accent); font: 600 clamp(12px, 1.1vw, 21px)/1.1 var(--font-condensed); text-transform: uppercase; }
.board .stamped { background: var(--trophy-gold); color: var(--on-gold); }
.board .stamped .pick-position { color: inherit; }
.p-main .board .stamped b { display: inline-block; animation: stamp-pick 320ms ease-out both; }
@keyframes stamp-pick { from { opacity: 0; transform: translateY(-0.4em) scale(1.12); } to { opacity: 1; transform: none; } }
.board .empty-note { text-align: center; margin-top: 24px; }
.demo-board th, .demo-board td { padding: clamp(4px, 0.7vw, 10px); }
.demo-board thead th { position: static; }
.demo-board td { height: clamp(39px, 4.5vw, 66px); }
.demo-board td b { font-size: clamp(13px, 1.5vw, 23px); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 7, 2, 0.86); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; overflow: hidden; }
.burst { position: absolute; width: 140vmax; height: 140vmax; opacity: 0.18; background: var(--trophy-gold); clip-path: polygon(50% 0, 60% 30%, 85% 15%, 72% 42%, 100% 50%, 72% 58%, 85% 85%, 60% 70%, 50% 100%, 40% 70%, 15% 85%, 28% 58%, 0 50%, 28% 42%, 15% 15%, 40% 30%); animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pick-in { 0% { transform: scale(0.6) rotate(-4deg); opacity: 0; } 60% { transform: scale(1.06) rotate(1deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
.anim-pick { animation: pick-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.announce { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; width: min(1180px, 100%); }
.announce .kicker { font-family: var(--font-display); font-size: clamp(56px, 7vw, 140px); line-height: 1; color: var(--trophy-gold); text-shadow: 0 0 24px var(--trophy-gold); }
.announce .card { width: 100%; padding: 0; overflow: hidden; background: var(--surface-200); }
.announce .card .inner { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); padding: clamp(18px, 2.5vw, 36px) clamp(18px, 3vw, 48px); text-align: left; }
.announce .what { font: 600 clamp(16px, 1.6vw, 30px) var(--font-condensed); letter-spacing: 0.1em; text-transform: uppercase; }
.announce .player { font-family: var(--font-display); font-size: clamp(40px, 5vw, 92px); line-height: 1.04; overflow-wrap: anywhere; }
.announce .posrow { display: flex; align-items: center; gap: 16px; font: 600 clamp(18px, 1.5vw, 28px) var(--font-condensed); }
.announce .posrow .chip { height: 40px; min-width: 56px; font-size: 22px; }
.announce .next { font-family: var(--font-terminal); font-size: clamp(24px, 2vw, 36px); text-transform: uppercase; color: var(--ink); }
.toast-pick { position: fixed; left: 12px; right: 12px; top: 72px; margin: 0 auto; max-width: 560px; padding: 14px 16px; background: var(--goal-green); color: var(--surface-100); border-radius: var(--radius-md); border: 2px solid var(--ink); font-weight: 600; display: flex; gap: 10px; align-items: center; z-index: 90; }

.roll { position: fixed; inset: 0; background: var(--surface-100); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(20px, 4vh, 48px); padding: 32px; z-index: 100; overflow: auto; }
.roll .kicker { font: 600 clamp(18px, 1.6vw, 30px) var(--font-condensed); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
.roll h2 { font-size: clamp(48px, 6vw, 120px); line-height: 1; text-align: center; }
.roll .slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: clamp(10px, 1.3vw, 24px); width: min(1680px, 100%); }
.roll .slot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.roll .slot .clock { font-size: clamp(24px, 2.2vw, 44px); color: var(--ink-muted); }
.roll .box { width: 100%; max-width: 180px; aspect-ratio: 180 / 220; border: 3px solid var(--ink); border-radius: var(--radius-md); position: relative; overflow: hidden; }
.roll .box > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 6px; text-align: center; }
.roll .q { font-family: var(--font-display); font-size: clamp(48px, 5vw, 96px); color: var(--line); animation: fadeout 0.2s forwards; animation-delay: var(--d); }
.roll .team { opacity: 0; animation: pick-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: var(--d); }
.roll .team .num { font-family: var(--font-display); font-size: clamp(48px, 5vw, 96px); line-height: 1; }
.roll .team .nm { font: 600 clamp(14px, 1.15vw, 22px) var(--font-condensed); text-transform: uppercase; letter-spacing: 0.06em; overflow-wrap: anywhere; }
@keyframes fadeout { to { opacity: 0; } }
.roll .log { font-family: var(--font-terminal); font-size: clamp(22px, 2vw, 38px); text-transform: uppercase; }

.modal { background: var(--surface-100); border: 3px solid var(--ink); border-radius: var(--radius-md); padding: 22px; width: min(460px, 100%); box-shadow: var(--shadow-print); position: relative; }
.modal h2 { font-size: 30px; line-height: 1.1; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--surface-200); border: 2px solid var(--ink); padding: 10px 18px; border-radius: var(--radius-md); box-shadow: var(--shadow-print); z-index: 95; font-weight: 600; max-width: calc(100vw - 32px); }

/* lobby */
.code { font: 600 30px var(--font-condensed); letter-spacing: 0.18em; }
.lobby-team { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lobby-team:last-child { border-bottom: 0; }
.lobby-team input { min-height: 40px; font-weight: 600; }
.order-line { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.theme-btn { min-height: 36px; padding: 4px 10px; font-size: 12px; box-shadow: none; border-color: var(--ink-muted); background: transparent; }

/* ---------- guide / content pages ---------- */
.guide { max-width: 820px; }
.guide article > section { margin: 36px 0; }
.guide h1 { font-size: clamp(36px, 5.5vw, 58px); line-height: 1.04; }
.guide h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 12px; }
.guide p, .guide li { font-size: 17px; line-height: 1.65; }
.guide ul, .guide ol { padding-left: 22px; }
.guide li + li { margin-top: 8px; }
.lede { font-size: 20px !important; line-height: 1.55 !important; }
.tldr { border: 2px dashed var(--ink-muted); border-radius: var(--radius-md); padding: 12px 16px; background: var(--surface-200); }
.crumbs { margin-bottom: 18px; }
.toc ol { margin: 8px 0 0; columns: 2 260px; }
.toc li { font-size: 15px !important; }
.table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: var(--radius-md); }
.fmt-table th, .fmt-table td { padding: 10px 12px; font-size: 15px; vertical-align: top; }
.fmt-table tbody th { text-transform: none; letter-spacing: 0; font: 700 15px var(--font-sans); color: var(--ink); white-space: nowrap; }
.fmt-table td:nth-child(3), .fmt-table td:nth-child(4) { font: 600 18px var(--font-condensed); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fmt-table tr.best { background: color-mix(in srgb, var(--goal-green) 14%, transparent); }
.guide details, .card details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.guide details summary, .card details summary { font: 600 17px var(--font-sans); text-transform: none; letter-spacing: 0; color: var(--ink); }
.guide details p, .card details p { margin-top: 8px; }
.cta { margin-top: 40px; }

/* ---------- roadmap ---------- */
.roadmap { max-width: 1100px; margin: 0 auto; padding: 48px 24px 40px; display: flex; flex-direction: column; gap: 32px; }
.roadmap h1 { font-size: clamp(42px, 6vw, 64px); line-height: 1; max-width: 820px; }
.roadmap h2 { font-size: clamp(24px, 3vw, 28px); }
.pill.muted { color: var(--ink-muted); }
.roadmap .pill { align-self: flex-start; }
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.phase { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px 0 0; border-top: 8px solid var(--line); }
.phase .cond { font-size: clamp(16px, 1.8vw, 22px); }
.phase.live { border-top-color: var(--goal-green); }
.phase.next { border-top-color: var(--jersey-red); }
.phase.later { border-top-style: dashed; border-top-color: var(--ink-muted); }
.rm-p1 { display: flex; flex-wrap: wrap; gap: 24px; padding: 24px 28px; background: var(--surface-200); border: 1px solid var(--line); border-radius: var(--radius-md); }
.rm-p1-head { flex: 1 1 260px; }
.ticks { flex: 2 1 480px; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.ticks li { position: relative; padding: 10px 0 10px 24px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.ticks li::before { content: '✓'; position: absolute; left: 0; color: var(--goal-green); font-weight: 700; }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pillar { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface-100); border: 2px solid var(--ink-muted); border-radius: var(--radius-md); }
.pillar-title { display: flex; align-items: center; gap: 10px; color: var(--jersey-red); }
.pillar-title .cond { font-size: 22px; color: var(--ink); }
.pillar ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sources { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sources span { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px 12px; border: 2px solid var(--ink-muted); border-radius: var(--radius-md); background: var(--surface-100); font: 600 16px var(--font-condensed); letter-spacing: 0.04em; text-align: center; }
.free-note { display: flex; gap: 16px; align-items: center; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-100); }
.rm-later { display: flex; flex-wrap: wrap; gap: 24px; padding: 24px 28px; border: 2px dashed var(--ink-muted); border-radius: var(--radius-md); }
.later-list { flex: 2 1 480px; margin: 0; padding-left: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; font-size: 14px; }
.rm-notify { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
@media (max-width: 820px) {
  .phases, .pillars, .ticks, .later-list { grid-template-columns: 1fr; }
  .phases { gap: 14px; }
  .sources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- site nav / footer / credits ---------- */
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-left: auto; align-items: center; font-weight: 600; }
.site-foot { border-top: 1px solid var(--line); padding: 24px; display: flex; flex-wrap: wrap; gap: 12px 24px; max-width: 1080px; margin: 0 auto; }
.credits { max-width: 1040px; margin: 0 auto; padding: 48px 24px 40px; display: flex; flex-direction: column; gap: 32px; }
.credits-hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.crest-card { width: 200px; height: 220px; flex: none; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-200); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: var(--shadow-print); }
.crest-letter { flex: 1; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 120px; line-height: 1; color: var(--jersey-red); }
.credits-name { font-size: clamp(44px, 6vw, 64px); line-height: 1; }
.credits-blurb { font-size: 19px; line-height: 28px; max-width: 560px; }
.tips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tip { flex-direction: column; gap: 4px; padding: 14px 10px; min-height: 96px; border: 2px solid var(--ink-muted); background: var(--surface-100); box-shadow: none; text-transform: none; letter-spacing: 0; }
.tip .clock { font-size: 36px; }
.tip.on { border: 3px solid var(--jersey-red); box-shadow: var(--shadow-print); }
.handle { font-size: 20px; font-weight: 400; text-transform: none; }
.feedback-row { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.feedback { flex: 999 1 480px; background: var(--surface-200); }
@media (max-width: 820px) {
  .site-nav { gap: 4px 14px; font-size: 14px; }
  .tips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crest-card { width: 120px; height: 132px; }
  .crest-letter { font-size: 72px; }
  .feedback-row .ad-slot { width: 100% !important; }
}

/* ---------- phone ---------- */
@media (max-width: 820px) {
  h1 { font-size: 34px; }
  .topbar { padding: 8px 12px; gap: 10px; }
  .brand span { font-size: 18px; line-height: 20px; }
  .room-head { flex-wrap: nowrap; }
  .room-head .meta, .room-head .me .who, .room-head .online, .room-head .theme-btn,
  .room-head .count .lbl:first-child, .room-head #hdrRound, .room-head #hdrOf { display: none; }
  .room-head .count .clock { font-size: 22px !important; }
  .room-head .me { padding-left: 0; border-left: 0; }
  .tools [data-sort='list'] { display: none; }
  .room { padding: 10px 12px 0; gap: 10px; }
  .turn { flex-wrap: wrap; padding: 12px 14px; gap: 10px; flex-basis: 100%; }
  .turn .ttl { font-size: 24px; flex: 1; }
  .turn .clockbox { width: auto; flex-direction: row; align-items: center; }
  .turn .clockbox .lbl { display: none; }
  .turn .clock { font-size: 40px; }
  .turn .tbar { order: 3; flex-basis: 100%; }
  .turn .text { display: contents; }
  .turn .sub { order: 4; flex-basis: 100%; font-size: 14px; line-height: 18px; }
  .turn svg { width: 32px; height: 32px; }
  .ticker { flex-basis: 100%; font-size: 19px; line-height: 22px; padding: 6px 10px; border: 0; background: var(--surface-200); border-radius: var(--radius-sm); }
  .ticker p:not(:last-child) { display: none; }
  .ticker .head { display: none; }
  .tabs { display: flex; width: 100%; }
  .split > section { flex-basis: 100%; }
  .split > section.off { display: none; }
  .split > section .pane-title { display: none; }
  .prow .act { width: auto; }
  .prow .pos { width: auto; order: -1; }
  .list-head { display: none; }
  .your-line { display: flex; position: sticky; bottom: 0; border-top: 2px solid var(--ink); background: var(--surface-200); padding: 8px 12px; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; z-index: 12; margin: 0 -12px; }
  .your-line .lbl { color: var(--ink); flex: none; }
  .draft-hero, .draft-explainer { grid-template-columns: minmax(0, 1fr); }
  .draft-intro h1 { font-size: clamp(46px, 9vw, 76px); }
  .p-head .watch { margin-left: 0; }
  .p-foot .grow, .p-foot .grow + span { display: none; }
  .demo-board .pick-position { margin-left: 0.25em; }
  .lobby-team { grid-template-columns: auto 1fr; }
  .lobby-team > :last-child { grid-column: 1 / -1; }
  .overlay.sheet { align-items: flex-end; padding: 0; }
  .overlay.sheet .modal { width: 100%; border-radius: 14px 14px 0 0; border-width: 3px 0 0; padding: 10px 20px 28px; animation: pick-in 0.4s both; }
  .overlay.sheet .modal::before { content: ''; display: block; width: 48px; height: 5px; border-radius: 3px; background: var(--ink-muted); margin: 0 auto 10px; }
  .controls { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
}

/* ---------- print (final rosters) ---------- */
@media print {
  :root, [data-theme] { --surface-100: #fff; --surface-200: #fff; --ink: #000; --ink-muted: #444; --line: #bbb; --shadow-print: none; }
  .topbar, .controls, .no-print, .tabs, .turn, .ad-slot, .theme-btn { display: none !important; }
  .present { height: auto; }
  .p-main .board { overflow: visible; }
  .p-main .board table { min-width: 0; }
  .team-card { break-inside: avoid; }
  .teams-grid { grid-template-columns: repeat(3, 1fr); }
}
