:root {
  --red: #e30613;
  --red-deep: #9b0410;
  --white: #f6f1ea;
  --green: #1b8a45;
  --gold: #e6c35a;
  --ink: #140507;
  --panel: rgba(28, 8, 10, 0.88);
  --line: rgba(246, 241, 234, 0.16);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --rack: 92px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  background: #140507;
  color: var(--white);
  font-family: Barlow, "Trebuchet MS", sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 520px at 50% -10%, rgba(227, 6, 19, 0.38), transparent 55%),
    radial-gradient(800px 400px at 110% 80%, rgba(230, 195, 90, 0.12), transparent 50%),
    #140507;
}
img { max-width: 100%; display: block; }
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
.haze {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(118deg, rgba(227, 6, 19, 0.05) 0 12px, transparent 12px 28px),
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.08), transparent 32%);
  mix-blend-mode: screen;
  z-index: 0;
}
.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(8px + var(--safe-t)) 10px calc(var(--rack) + var(--safe-b)) ;
}
.marquee {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 4px 10px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.marquee::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0 34%, #fff 34% 66%, var(--green) 66% 100%);
  box-shadow: 0 0 16px rgba(227, 6, 19, 0.55);
}
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.crest {
  width: 22px;
  height: 42px;
  display: flex;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(230, 195, 90, 0.55), 0 8px 18px rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
}
.crest-bar { flex: 1; }
.crest-bar.r { background: var(--red); }
.crest-bar.w { background: #fff; }
.crest-bar.g { background: var(--green); }
.eyebrow {
  font-family: Oswald, Impact, sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--gold);
}
.brand-copy h1 {
  font-family: Oswald, Impact, sans-serif;
  font-size: clamp(22px, 7vw, 30px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
  white-space: nowrap;
}
.live-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid rgba(230, 195, 90, 0.4);
  background: linear-gradient(180deg, rgba(227, 6, 19, 0.2), rgba(20, 5, 7, 0.6));
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.4s ease-in-out infinite;
  flex: 0 0 auto;
}
.live-strip p {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mute {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(230, 195, 90, 0.55);
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(20, 5, 7, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 18px rgba(230, 195, 90, 0.12);
}
.mute[aria-pressed="true"] { color: var(--white); opacity: 0.7; }
main {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 2px 18px;
  overscroll-behavior: contain;
}
.panel { display: none; }
.panel.on { display: block; }
#screen-floor.on {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.play {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
}
.hud {
  display: grid;
  gap: 8px;
}
.kicker {
  font-family: Oswald, Impact, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
}
.hud-name h2, .sheet h2, .sheet h3, .hero-copy h2 {
  font-family: Oswald, Impact, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.05;
}
.hud-name h2 { font-size: clamp(20px, 6vw, 28px); }
.meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.meter {
  padding: 7px 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(230, 195, 90, 0.12);
  min-width: 0;
}
.meter span, .stat span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 241, 234, 0.62);
}
.meter strong, .stat strong {
  font-family: Oswald, Impact, sans-serif;
  font-size: 18px;
  color: #fff;
}
.meter.clock strong { color: var(--gold); }
.picks {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.picks::-webkit-scrollbar { display: none; }
.pick {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: rgba(20, 5, 7, 0.7);
  color: rgba(246, 241, 234, 0.8);
}
.pick.on {
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(227, 6, 19, 0.45);
}
.pick:disabled { opacity: 0.38; }
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 210px;
  max-height: min(58dvh, 560px);
  background: #1a0a0c;
  border: 1px solid rgba(230, 195, 90, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(227, 6, 19, 0.25),
    0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.stage::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.18), transparent 28%);
  pointer-events: none;
  animation: sweep 6s ease-in-out infinite;
}
#floor {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.note {
  min-height: 18px;
  font-size: 13px;
  color: var(--gold);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  list-style: none;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(246, 241, 234, 0.72);
}
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  vertical-align: -1px;
  border-radius: 50%;
}
.swatch.you { background: var(--red); box-shadow: 0 0 8px var(--red); }
.swatch.mate { background: #fff; }
.swatch.mark { background: #2a3348; }
.swatch.cone { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.controls {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
}
.controls button, .solid, .sheet button {
  min-height: 48px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(230, 195, 90, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(180deg, #2a0c10, #140507);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 16px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
}
.controls b { font-size: 16px; color: var(--gold); }
.solid, .controls .solid, .sheet .solid {
  background: linear-gradient(180deg, #ff3140, var(--red-deep));
  color: #fff;
  border-color: rgba(230, 195, 90, 0.8);
  box-shadow: 0 0 22px rgba(227, 6, 19, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.sheet .solid, .veil .solid {
  display: inline-flex;
  width: auto;
  min-width: min(100%, 220px);
  padding: 0 18px;
  margin-top: 12px;
}
.veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 5, 7, 0.2), rgba(20, 5, 7, 0.92)),
    url("hoop.jpg") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 14px 16px;
  z-index: 3;
}
.veil[hidden] { display: none; }
.veil h2 { font-family: Oswald, Impact, sans-serif; text-transform: uppercase; font-size: clamp(22px, 7vw, 32px); }
.stars { color: var(--gold); letter-spacing: 0.2em; font-size: 18px; }
.veil-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.veil-actions button { flex: 1 1 140px; }
.sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px rgba(230, 195, 90, 0.08), 0 12px 28px rgba(0, 0, 0, 0.22);
}
.sheet h2 { font-size: clamp(22px, 6vw, 30px); margin: 4px 0 8px; }
.sheet h3 { font-size: 18px; margin-bottom: 8px; }
.sheet p, .sheet li, .lead { font-size: 15px; line-height: 1.45; color: rgba(246, 241, 234, 0.9); }
.hero-card {
  padding: 0;
  overflow: hidden;
}
.hero-card img { width: 100%; height: 168px; object-fit: cover; }
.hero-copy { padding: 14px; }
.trio-grid, .pair {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.trio-grid { grid-template-columns: 1fr; }
.pair { grid-template-columns: 1fr; }
.mini { margin: 0; }
.mini img { width: 100%; height: 120px; object-fit: cover; margin-bottom: 10px; }
.steps ol {
  margin: 8px 0 0 18px;
  display: grid;
  gap: 8px;
}
.facts { margin-left: 18px; display: grid; gap: 8px; }
.drill-list { display: grid; gap: 10px; }
.drill-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
}
.drill-card img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border: 1px solid rgba(230, 195, 90, 0.3);
}
.drill-card .meta { min-width: 0; }
.drill-card h3 { margin-bottom: 4px; }
.drill-card p { font-size: 13px; }
.status {
  display: inline-block;
  margin: 4px 0 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.status.lock { color: rgba(246, 241, 234, 0.5); }
.lane-map {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin: 0 0 12px;
  min-height: 120px;
}
.lane-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 10px 8px;
  background:
    linear-gradient(180deg, rgba(227, 6, 19, 0.08), rgba(227, 6, 19, 0.32)),
    url("floor.jpg") center/cover;
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}
.lane-col.mid {
  background:
    linear-gradient(180deg, rgba(230, 195, 90, 0.14), rgba(227, 6, 19, 0.4)),
    url("floor.jpg") center/cover;
  transform: translateY(-8px);
}
.lane-col strong {
  font-family: Oswald, Impact, sans-serif;
  font-size: 18px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  padding: 12px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
}
.stat strong { display: block; font-size: 24px; margin-top: 4px; font-family: Oswald, Impact, sans-serif; }
.ledger { list-style: none; display: grid; gap: 8px; }
.ledger li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.ledger b { color: var(--gold); font-family: Oswald, Impact, sans-serif; }
.rack {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 540px);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 8px calc(8px + var(--safe-b));
  background:
    linear-gradient(180deg, rgba(42, 12, 16, 0.2), rgba(20, 5, 7, 0.96));
  border-top: 1px solid rgba(230, 195, 90, 0.35);
  backdrop-filter: blur(10px);
  z-index: 8;
}
.rail-glow {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--red), var(--gold), transparent);
}
.jersey {
  position: relative;
  min-width: 0;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hanger {
  width: 18px;
  height: 6px;
  border: 1.5px solid var(--gold);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.kit {
  width: 100%;
  max-width: 58px;
  min-height: 54px;
  padding: 8px 2px 6px;
  background: linear-gradient(180deg, #fff 0 16%, var(--red) 16% 100%);
  clip-path: polygon(16% 0, 84% 0, 100% 14%, 90% 100%, 10% 100%, 0 14%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.35);
}
.num {
  font-family: Oswald, Impact, sans-serif;
  font-size: 15px;
  color: #fff;
  line-height: 1;
}
.tag {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jersey.on { transform: translateY(-6px); }
.jersey.on .kit {
  box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(230, 195, 90, 0.55);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}
@keyframes sweep {
  0%, 100% { transform: translateX(-6%); opacity: 0.5; }
  50% { transform: translateX(6%); opacity: 1; }
}
@media (min-width: 400px) {
  .trio-grid { grid-template-columns: 1fr 1fr 1fr; }
  .pair { grid-template-columns: 1fr 1fr; }
  .hero-card img { height: 190px; }
}
@media (max-width: 360px) {
  .brand-copy h1 { font-size: 20px; }
  .live-strip { display: none; }
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meter strong { font-size: 16px; }
  .kit { min-height: 48px; }
  .num { font-size: 13px; }
  .tag { font-size: 7px; }
  .shell { padding-left: 8px; padding-right: 8px; }
  .controls button { min-height: 44px; letter-spacing: 0.06em; }
}
@media (max-height: 680px) {
  .stage { max-height: min(48dvh, 420px); min-height: 180px; }
  .legend { display: none; }
  .hero-card img { height: 132px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .shell { padding-bottom: calc(70px + var(--safe-b)); }
  .marquee { padding-top: 4px; padding-bottom: 8px; }
  .stage { max-height: 46dvh; min-height: 150px; }
  .picks { display: none; }
  .rack { padding-top: 4px; }
  .kit { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, .stage::before { animation: none; }
}
