:root {
  --ink: #08100e;
  --ink-2: #0d1815;
  --ink-3: #14231e;
  --paper: #f3f6ef;
  --muted: #91a29b;
  --line: #263a32;
  --signal: #c8ff31;
  --signal-dark: #182500;
  --danger: #ff5c49;
  --display: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Avenir Next", "Helvetica Neue", sans-serif;
  --mono: "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--ink); color: var(--paper); font-family: var(--body); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.app-shell { width: min(1180px, 100%); min-height: 100vh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 52px) max(30px, env(safe-area-inset-bottom)); }
.site-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 48px; padding: 24px 0 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer nav, .legal-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a, .legal-page a { color: inherit; text-underline-offset: 3px; }
.legal-page { width: min(760px, 100%); min-height: 100vh; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) clamp(20px, 5vw, 48px) max(36px, env(safe-area-inset-bottom)); }
.legal-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 64px; color: var(--paper) !important; font-family: var(--display); font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.legal-page article { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); background: var(--ink-2); }
.legal-page h1 { margin: 8px 0 6px; font-family: var(--display); font-size: clamp(42px, 9vw, 72px); line-height: .95; text-transform: uppercase; }
.legal-page h2 { margin: 36px 0 8px; font-family: var(--display); font-size: 21px; text-transform: uppercase; }
.legal-page p, .legal-page li { color: #c8d2cd; line-height: 1.7; }
.legal-page li + li { margin-top: 10px; }
.legal-updated { color: var(--muted) !important; font-size: 13px; }
.legal-nav { margin-top: 24px; color: var(--muted); font-size: 13px; }
.masthead { display: flex; align-items: center; justify-content: space-between; height: 58px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 0; font-family: var(--display); font-size: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 28px; color: var(--ink); background: var(--signal); font-size: 12px; letter-spacing: -.02em; transform: skew(-8deg); }
.live-badge { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.live-badge i, .on-clock-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 14px var(--signal); }
.screen { padding-top: clamp(38px, 6vw, 82px); }
.eyebrow { margin: 0 0 16px; color: var(--signal); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }

.setup-lead { display: grid; grid-template-columns: 1.5fr 1fr; align-items: end; column-gap: 8vw; margin-bottom: clamp(32px, 4vw, 52px); }
.setup-lead .eyebrow { grid-column: 1 / -1; }
.setup-lead h1 { margin: 0; font-family: var(--display); font-size: clamp(52px, 6.5vw, 82px); line-height: .82; letter-spacing: -.05em; text-transform: uppercase; }
.setup-lead h1 em { color: var(--signal); font-style: normal; }
.lede { max-width: 30ch; margin: 0 0 4px; color: #b8c5bf; font-size: clamp(16px, 2vw, 20px); line-height: 1.45; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.config-panel { min-width: 0; margin: 0; padding: 30px 0 40px; border: 0; border-bottom: 1px solid var(--line); }
.config-panel:nth-child(odd) { padding-right: clamp(20px, 4vw, 52px); border-right: 1px solid var(--line); }
.config-panel:nth-child(even) { padding-left: clamp(20px, 4vw, 52px); }
.config-panel legend { float: left; width: 100%; margin-bottom: 30px; color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.field { display: inline-flex; flex-direction: column; width: calc(50% - 8px); margin-right: 12px; gap: 9px; }
.field.wide { width: 100%; margin: 0 0 26px; }
.field > span { color: #aab8b2; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
input, select { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 0; outline: none; background: var(--ink-2); color: var(--paper); padding: 0 15px; }
input:focus, select:focus { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
#league-name { min-height: 62px; font-family: var(--display); font-size: 25px; font-weight: 800; text-transform: uppercase; }
.segment { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.segment-button { min-height: 44px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.segment-button:last-child { border: 0; }
.segment-button.active { background: var(--signal); color: var(--ink); }
.format-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.format-options label { position: relative; min-height: 96px; padding: 18px; border: 1px solid var(--line); cursor: pointer; }
.format-options label:has(input:checked) { border-color: var(--signal); background: var(--signal-dark); }
.format-options input { position: absolute; top: 12px; right: 12px; width: auto; min-height: 0; accent-color: var(--signal); }
.format-options b, .format-options small { display: block; }
.format-options b { margin-bottom: 8px; font-family: var(--display); font-size: 18px; text-transform: uppercase; }
.format-options small { color: var(--muted); line-height: 1.35; }
.clock-schedule { margin-top: 24px !important; }
.clock-schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 10px; }
.clock-schedule-grid label { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.clock-schedule-grid small, .field-note { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.field-note { margin-top: 2px; letter-spacing: .04em; text-transform: none; }
.teams-panel { grid-column: 1 / -1; padding-right: 0 !important; border-right: 0 !important; }
.team-count-row { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 12px; margin-bottom: 22px; }
.team-count-row span { min-width: 101px; font-family: var(--display); font-size: 23px; text-align: center; text-transform: uppercase; }
.team-count-row strong { display: block; font-size: 34px; line-height: 1; }
.stepper { display: flex; border: 1px solid var(--line); }
.stepper button { width: 50px; height: 44px; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
.stepper button + button { border-left: 1px solid var(--line); }
.team-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.team-row { display: grid; grid-template-columns: 34px 1fr; align-items: center; min-width: 0; background: var(--ink); }
.team-row span { padding-left: 12px; color: var(--signal); font-family: var(--mono); font-size: 11px; }
.team-row input { min-width: 0; border: 0; background: var(--ink-2); }
.launch-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 34px 0 0; }
.launch-kicker { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.primary-button { min-height: 58px; border: 0; background: var(--signal); color: var(--ink); padding: 0 24px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.primary-button span { margin-left: 28px; font-size: 22px; }
.text-button { grid-column: 2; border: 0; background: transparent; color: var(--signal); cursor: pointer; }

.draft-screen { padding-top: 24px; }
.scorebug { display: grid; grid-template-columns: 82px 82px 82px 1fr; min-height: 58px; border: 1px solid var(--line); background: var(--ink-2); }
.scorebug > div { display: flex; flex-direction: column; justify-content: center; padding: 8px 14px; border-right: 1px solid var(--line); }
.scorebug span { color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .11em; text-transform: uppercase; }
.scorebug strong { margin-top: 3px; font-family: var(--display); font-size: 19px; line-height: 1; text-transform: uppercase; }
.scorebug .scorebug-league { align-items: flex-end; border: 0; text-align: right; }
.on-clock-stage { position: relative; overflow: hidden; min-height: min(57vh, 590px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px 32px; border-bottom: 1px solid var(--line); isolation: isolate; }
.stage-lines { position: absolute; inset: 0; z-index: -1; opacity: .35; background: repeating-linear-gradient(90deg, transparent 0 12.4%, rgba(200,255,49,.15) 12.5%, transparent 12.6% 25%); transform: perspective(350px) rotateX(64deg) scale(1.7); transform-origin: center bottom; mask-image: linear-gradient(to top, black, transparent 80%); }
.on-clock-label { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; color: var(--signal); font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.on-clock-stage h1 { max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-size: clamp(38px, 7vw, 82px); line-height: 1; letter-spacing: -.035em; text-transform: uppercase; }
.clock { margin: -2px 0 8px; color: var(--paper); font-family: var(--display); font-size: clamp(112px, 23vw, 250px); font-weight: 900; line-height: .92; letter-spacing: -.075em; font-variant-numeric: tabular-nums; text-shadow: 0 10px 70px rgba(200,255,49,.1); }
.clock.urgent { color: var(--danger); animation: pulse 1s steps(2, end) infinite; }
.timeout-message { color: var(--danger); font-family: var(--mono); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.next-up { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 7px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.next-up strong { color: var(--paper); }
.next-up .divider { margin: 0 6px; color: var(--line); }
.command-deck { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 18px 28px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.pick-entry { display: flex; flex-direction: column; gap: 8px; }
.pick-entry > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pick-entry small { opacity: .6; }
.primary-controls { display: flex; gap: 8px; }
.control-button { min-width: 112px; min-height: 60px; border: 1px solid var(--line); background: transparent; font-weight: 900; text-transform: uppercase; cursor: pointer; }
.pick-button { display: flex; align-items: center; justify-content: space-between; min-width: 174px; border-color: var(--signal); background: var(--signal); color: var(--ink); padding: 0 18px; }
.pick-button b { font-size: 23px; }
.pause-button .control-icon { display: inline-block; margin-right: 7px; }
.secondary-controls { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.secondary-controls button, .secondary-controls a, .ribbon-heading button { display: inline-flex; min-height: 38px; align-items: center; border: 0; background: transparent; color: var(--muted); padding: 0 10px; text-decoration: none; cursor: pointer; }
.secondary-controls button:hover, .secondary-controls a:hover, .ribbon-heading button:hover { color: var(--paper); }
.draft-ribbon { padding: 24px 0; }
.ribbon-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.order-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(142px, 1fr); overflow-x: auto; scrollbar-width: none; border: 1px solid var(--line); }
.order-strip::-webkit-scrollbar { display: none; }
.order-pick { min-height: 76px; padding: 13px; border-right: 1px solid var(--line); background: var(--ink-2); }
.order-pick.current { background: var(--signal); color: var(--ink); }
.order-pick.past { opacity: .38; }
.order-pick small, .order-pick strong { display: block; }
.order-pick small { margin-bottom: 9px; font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
.order-pick strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); text-transform: uppercase; }
.support-link { display: flex; width: 100%; justify-content: space-between; align-items: center; margin: 0; border: 0; border-bottom: 1px solid #405b24; background: #111d0d; color: var(--paper); padding: 11px 14px; text-align: left; text-decoration: none; font-size: 11px; cursor: pointer; }
.support-link span { color: #a8b79a; }
.support-link strong { color: var(--signal); letter-spacing: .05em; text-transform: uppercase; }
.support-dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow-y: auto; background: rgba(8,16,14,.98); padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.support-dialog-inner { width: min(720px, 100%); text-align: center; }
.support-dialog h2 { margin: 0; font-family: var(--display); font-size: clamp(64px, 12vw, 126px); line-height: .82; letter-spacing: -.045em; text-transform: uppercase; }
.support-dialog-inner > p:not(.eyebrow):not(.clock-keeps-running) { max-width: 42ch; margin: 28px auto 34px; color: #b8c5bf; font-size: clamp(16px, 2vw, 20px); line-height: 1.5; }
.support-actions { display: grid; width: min(420px, 100%); margin: 0 auto; gap: 10px; }
.support-actions .primary-button { display: grid; place-items: center; text-decoration: none; }
.donate-button { display: inline-grid; place-items: center; min-height: 58px; text-decoration: none; }
.support-return { min-height: 54px; border: 1px solid var(--line); background: transparent; color: var(--paper); font-weight: 800; cursor: pointer; }
.clock-keeps-running { display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 26px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.clock-keeps-running i { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 14px var(--signal); }
.draft-complete { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; background: rgba(8,16,14,.96); text-align: center; }
.draft-complete h2 { margin: 0; font-family: var(--display); font-size: clamp(60px, 14vw, 130px); line-height: .85; text-transform: uppercase; }
.complete-actions { display: grid; width: min(420px, calc(100vw - 40px)); grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.toast { position: fixed; left: 50%; top: max(76px, calc(env(safe-area-inset-top) + 58px)); z-index: 20; transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 12px 18px; font-size: 13px; font-weight: 800; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.edit-pick-dialog { width: min(520px, calc(100% - 32px)); border: 1px solid var(--line); background: var(--ink-2); color: var(--paper); padding: clamp(24px, 5vw, 42px); }
.edit-pick-dialog::backdrop { background: rgba(8,16,14,.88); }
.edit-pick-dialog h2 { margin: 0 0 28px; font-family: var(--display); font-size: clamp(42px, 8vw, 68px); line-height: .9; text-transform: uppercase; }
.edit-pick-dialog label { display: flex; flex-direction: column; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.edit-pick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.feedback-form { display: grid; gap: 20px; margin-top: 32px; }
.feedback-form label { display: grid; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.feedback-form textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 0; outline: none; background: var(--ink); color: var(--paper); padding: 15px; font: inherit; line-height: 1.5; }
.feedback-form textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.feedback-form .feedback-device { display: flex; align-items: center; gap: 10px; text-transform: none; }
.feedback-device input { width: 20px; min-height: 20px; accent-color: var(--signal); }
.feedback-note { margin: -8px 0 0 !important; color: var(--muted) !important; font-size: 12px; }
.feedback-status { min-height: 24px; margin: -6px 0 0 !important; font-weight: 800; }
.feedback-status.success { color: var(--signal) !important; }
.feedback-status.error { color: #ff8d7a !important; }
.feedback-form button:disabled { cursor: wait; opacity: .65; }
.diagnostic-preview { max-height: 260px; overflow: auto; margin: -8px 0 0; border: 1px solid var(--line); background: var(--ink); color: var(--paper); padding: 14px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.display-page { overflow: hidden; }
.room-display { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; min-height: 100dvh; padding: clamp(18px, 2.5vw, 44px); }
.display-scorebug { display: grid; grid-template-columns: minmax(100px, 9vw) minmax(100px, 9vw) 1fr; border: 1px solid var(--line); background: var(--ink-2); }
.display-scorebug > div { display: flex; flex-direction: column; justify-content: center; min-height: clamp(64px, 7vw, 110px); padding: 12px clamp(14px, 2vw, 32px); border-right: 1px solid var(--line); }
.display-scorebug span { color: var(--muted); font-family: var(--mono); font-size: clamp(9px, .8vw, 14px); letter-spacing: .12em; text-transform: uppercase; }
.display-scorebug strong { font-family: var(--display); font-size: clamp(24px, 3vw, 54px); line-height: 1; text-transform: uppercase; }
.display-scorebug .display-league { align-items: flex-end; border: 0; text-align: right; }
.display-stage { display: flex; min-height: 0; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.display-stage h1 { max-width: 95vw; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-size: clamp(52px, 9vw, 170px); line-height: .9; letter-spacing: -.04em; text-transform: uppercase; }
.display-clock { color: var(--paper); font-family: var(--display); font-size: clamp(150px, 28vw, 520px); font-weight: 900; line-height: .86; letter-spacing: -.075em; font-variant-numeric: tabular-nums; }
.display-clock.urgent { color: var(--danger); animation: pulse 1s steps(2, end) infinite; }
.display-status { margin: 12px 0; color: var(--muted); font-family: var(--mono); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.display-next-up { display: flex; gap: 12px; align-items: baseline; color: var(--muted); font-size: clamp(14px, 1.5vw, 28px); text-transform: uppercase; }
.display-next-up strong { color: var(--paper); font-family: var(--display); font-size: 1.4em; }
.display-footer { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-family: var(--display); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.display-controls { display: flex; gap: 12px; align-items: center; }
.display-footer button { min-height: 44px; border: 1px solid var(--line); background: transparent; padding: 0 16px; cursor: pointer; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }

@keyframes pulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }

@media (max-width: 700px) {
  .app-shell { padding-inline: 16px; }
  .masthead { height: 50px; }
  .brand { font-size: 13px; }
  .live-badge { font-size: 9px; }
  .screen { padding-top: 34px; }
  .setup-lead { display: block; margin-bottom: 32px; }
  .setup-lead h1 { font-size: clamp(48px, 14vw, 62px); }
  .lede { margin-top: 22px; }
  .setup-grid { display: block; }
  .config-panel, .config-panel:nth-child(odd), .config-panel:nth-child(even) { width: 100%; padding: 26px 0 32px; border-right: 0; }
  .segment { grid-template-columns: repeat(2, 1fr); }
  .segment-button:nth-child(2) { border-right: 0; }
  .segment-button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }

  .team-list { grid-template-columns: 1fr; }
  .launch-panel { grid-template-columns: 1fr; }
  .launch-panel .primary-button, .text-button { grid-column: 1; width: 100%; }
  .scorebug { grid-template-columns: 58px 58px 58px 1fr; }
  .scorebug > div { padding: 7px 8px; }
  .scorebug strong { font-size: 16px; }
  .scorebug-league strong { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .on-clock-stage { min-height: 43vh; padding-inline: 0; }
  .clock { font-size: clamp(100px, 30vw, 144px); }
  .command-deck { grid-template-columns: 1fr; }
  .primary-controls { width: 100%; }
  .control-button { flex: 1; }
  .pick-button { flex: 1.4; }
  .secondary-controls { grid-column: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
  .secondary-controls button, .secondary-controls a { justify-content: center; min-height: 44px; background: var(--ink-2); padding-inline: 8px; font-size: 12px; text-align: center; }
  .support-link { gap: 10px; font-size: 10px; }
  .support-link strong { white-space: nowrap; }
}
