:root {
  --yellow: #ffc100;
  --black: #000000;
  --ink: #101010;
  --panel: #161616;
  --muted: #c6c6c6;
  --line: rgba(255, 193, 0, 0.4);
  --turf: #102616;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: #fff;
  font-family: Barlow, "Segoe UI", sans-serif;
  overflow-x: hidden;
  overscroll-behavior: none;
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

img { max-width: 100%; display: block; }

.app {
  width: 100%;
  min-width: 0;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  background:
    radial-gradient(120% 40% at 50% -10%, rgba(255, 193, 0, 0.16), transparent 46%),
    var(--black);
  overflow: hidden;
}

.board {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: var(--yellow);
  color: var(--black);
}

.brand { min-width: 0; }

.brand-mark {
  display: block;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: clamp(28px, 9vw, 42px);
  letter-spacing: 0.03em;
  line-height: 0.82;
}

.brand-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.board-meta {
  margin: 0;
  max-width: 46%;
  text-align: right;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: clamp(16px, 4.6vw, 22px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
}

.chain {
  display: flex;
  gap: 2px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background:
    linear-gradient(180deg, #141414, #050505);
  border-bottom: 3px solid var(--yellow);
  padding: 0 6px;
}

.chain::-webkit-scrollbar { display: none; }

.chain button {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 48px;
  padding: 7px 12px 6px;
  border: 0;
  background: transparent;
  color: #fff;
  border-bottom: 3px solid transparent;
}

.chain button small {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--yellow);
}

.chain button span {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chain button.is-on {
  background: var(--yellow);
  color: var(--black);
  border-bottom-color: var(--black);
}

.chain button.is-on small { color: var(--black); }

main {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.in-drive main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen { display: none; }

.screen.is-active { display: block; }

#drive.is-active {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
}

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  max-width: 100%;
  min-height: 300px;
  overflow: hidden;
  background: #000;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  padding: 72px 14px 14px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.25) 16%, #000 72%);
}

h1, h2, h3, .veil-card h3 {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(34px, 10vw, 54px);
  line-height: 0.88;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 8vw, 42px);
  line-height: 0.9;
}

h3 { margin: 0 0 6px; font-size: 22px; line-height: 0.95; }

p { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }

.lead { color: var(--muted); }

.eyebrow {
  margin: 0 0 6px;
}

.eyebrow span,
.snap span,
.ghost span {
  display: inline-block;
}

.eyebrow span {
  background: var(--yellow);
  color: var(--black);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
  padding: 2px 8px;
  transform: skewX(-10deg);
}

.hero-actions, .veil-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.snap, .ghost, .wipe-ready {
  position: relative;
  min-height: 48px;
  border: 0;
  padding: 12px 16px;
  transform: skewX(-8deg);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 18px;
}

.snap span, .ghost span, .wipe-ready span { transform: skewX(8deg); }

.snap {
  flex: 1 1 150px;
  background: var(--yellow);
  color: var(--black);
  overflow: hidden;
}

.snap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -30%;
  width: 28%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: sheen 2.8s ease-in-out infinite;
}

.ghost, .wipe-ready {
  flex: 1 1 140px;
  background: transparent;
  color: var(--yellow);
  box-shadow: inset 0 0 0 2px var(--yellow);
}

.sheet {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 14px 12px calc(22px + env(safe-area-inset-bottom));
}

.steps {
  display: grid;
  gap: 8px;
}

.slab, .note, .roster-card {
  min-width: 0;
  background:
    linear-gradient(115deg, rgba(255, 193, 0, 0.1), transparent 32%),
    var(--panel);
  border-left: 4px solid var(--yellow);
  padding: 12px;
}

.slab p + p, .note p + p { margin-top: 8px; }

.slab-tight h2 { margin-bottom: 8px; }

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.duo figure, .figure { margin: 0; min-width: 0; }

.duo img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  object-position: center bottom;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 193, 0, 0.2), transparent 55%),
    #070707;
}

.duo figcaption, .figure figcaption {
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.figure img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.drive-list { display: grid; gap: 8px; margin-top: 10px; }

.drive-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  text-align: left;
  background: #0d0d0d;
  border: 0;
  border-left: 4px solid var(--yellow);
}

.drive-list button b {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-size: 22px;
  color: var(--yellow);
}

.drive-list button strong {
  display: block;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drive-list button em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.drive-list button small {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.drive-list button.is-held {
  opacity: 0.45;
  border-left-color: #4a4a4a;
}

.gate-note {
  margin-top: 8px;
  color: var(--yellow);
  font-size: 14px;
  font-weight: 700;
}

.bug {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 4px 10px;
  background: var(--yellow);
  color: var(--black);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: clamp(14px, 3.8vw, 18px);
}

.bug button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 2px 10px;
  border: 0;
  background: var(--black);
  color: var(--yellow);
  font: inherit;
}

.nights {
  display: flex;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 10px;
  background: #070707;
}

.nights::-webkit-scrollbar { display: none; }

.nights button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #121212;
  color: #fff;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nights button.is-on {
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow);
}

.nights button:disabled { opacity: 0.38; }

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
  background: #07140c;
  touch-action: none;
}

#field {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.28) 40%, rgba(0, 0, 0, 0.72));
}

.veil[hidden] { display: none; }

.veil-card {
  width: 100%;
  max-height: 78%;
  overflow: auto;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.9);
  border-left: 4px solid var(--yellow);
  padding: 12px;
}

.veil-card h3 {
  margin: 0 0 6px;
  font-size: clamp(26px, 7vw, 36px);
}

.veil-card p { color: #eee; font-size: 14px; }

.veil-card input {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--yellow);
  background: #000;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pad {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: #000;
}

.pad button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  overflow: hidden;
  border: 1px solid var(--yellow);
  background: #141414;
  color: var(--yellow);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.pad button b { font-size: clamp(16px, 4.5vw, 20px); }

.pad button small {
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.14em;
}

#burst {
  background: var(--yellow);
  color: var(--black);
}

#burst i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

#burst.is-live { box-shadow: inset 0 0 0 2px #000; }

.lane-demo {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  height: 74px;
}

.lane-demo span {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px 2px;
  background: var(--turf);
  color: #fff;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 4px solid #3c3c3c;
}

.lane-demo .is-open {
  border-top-color: var(--yellow);
  background: #183318;
}

.type-grid {
  display: grid;
  gap: 8px;
}

.roster-card {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  gap: 10px;
  padding: 0 10px 0 0;
  align-items: center;
}

.roster-card img {
  width: 102px;
  height: 132px;
  object-fit: cover;
  object-position: center 18%;
}

.role, .meta {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meta { color: var(--muted); margin-top: 8px; }

.note { display: grid; gap: 8px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.stat {
  min-width: 0;
  padding: 8px;
  background: var(--yellow);
  color: var(--black);
}

.stat b {
  display: block;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-style: italic;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 0.9;
}

.stat span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--yellow);
}

#call-sign-field {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--yellow);
  background: #000;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.run-list { display: grid; }

.run {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 193, 0, 0.28);
  font-size: 14px;
}

.run b { letter-spacing: 0.06em; }

.run span { color: var(--muted); font-size: 12px; }

.empty-marks { color: var(--muted); }

.switch-row {
  display: grid;
  gap: 8px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
}

.switch input {
  width: 20px;
  height: 20px;
  accent-color: var(--yellow);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

button:focus-visible, input:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.pad, .bug, .chain, .nights, .drive-list { user-select: none; }

@media (min-width: 390px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .steps article:last-child { grid-column: 1 / -1; }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .figure img { height: 180px; }
  .duo img { height: 250px; }
}

@media (min-width: 520px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps article:last-child { grid-column: auto; }
  .sheet { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 340px) {
  .duo { grid-template-columns: 1fr; }
  .duo img { height: 200px; }
  .roster-card { grid-template-columns: 84px minmax(0, 1fr); }
  .roster-card img { width: 84px; height: 112px; }
  .chain button { padding-left: 9px; padding-right: 9px; }
  .chain button span { font-size: 14px; }
  .hero { min-height: 280px; }
  h1 { font-size: 32px; }
}

@media (max-height: 640px) {
  .hero { min-height: 250px; }
  .pad button { min-height: 48px; }
  .duo img { height: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  .snap::after { animation: none; }
}

@keyframes sheen {
  0%, 55% { left: -35%; }
  100% { left: 130%; }
}
