:root {
  --navy: #07111f;
  --header: #061433;
  --ink: #ffffff;
  --blue: #1650b5;
  --blue-deep: #0e3c86;
  --yellow: #ffd000;
  --lime: #c6ff4a;
  --line: rgba(255, 255, 255, 0.16);
  --sans: "Barlow", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(22, 80, 181, 0.45), transparent 55%),
    var(--navy);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

body.lock {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

img { max-width: 100%; }

button, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

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

h1, h2, h3 { font-weight: 600; }

.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;
}

.label {
  margin: 0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.mast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 10px;
  border-bottom: 3px solid var(--yellow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #ffffff;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 32px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 0.95;
}

.brand em {
  display: block;
  margin-top: 2px;
  color: var(--yellow);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  font-weight: 700;
}

.mast-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--lime);
  color: #14223d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #14223d;
}

.ticker {
  overflow: hidden;
  background: #041028;
  border-bottom: 1px solid rgba(198, 255, 74, 0.35);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: tick 22s linear infinite;
}

.ticker span {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: #ffffff;
  padding: 7px 0;
  white-space: nowrap;
}

@keyframes tick {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ribbon {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  background:
    linear-gradient(#0b2450, #0b2450) padding-box,
    repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255, 208, 0, 0.45) 10px, rgba(255, 208, 0, 0.45) 12px);
  border-bottom: 1px solid rgba(255, 208, 0, 0.45);
}

.ribbon button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ribbon button[aria-current="true"] {
  background: var(--yellow);
  color: #14223d;
}

main {
  width: min(1080px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.view[hidden] { display: none !important; }

.intro {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.intro img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  flex: 0 0 auto;
}

.intro h2 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
}

.intro .deck {
  margin: 6px 0 0;
  color: #ffffff;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 12px;
  padding-bottom: 4px;
}

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

.card {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #1b5ec4 0%, #0f3f8c 100%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--yellow);
}

.card.pinned::before { background: var(--lime); }

.card h3 {
  margin: 6px 0;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.05;
}

.card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.card-head img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex: 0 0 auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--lime);
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.kicker {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lede p {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.35;
  color: #ffffff;
}

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

.btn {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 700;
}

.btn.cta {
  background: var(--yellow);
  color: #14223d;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.btn.lime {
  background: var(--lime);
  color: #14223d;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

#desk-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--lime);
  color: #14223d;
  font-size: 12px;
}

#desk-count[hidden] { display: none; }

.filters button[aria-pressed="true"] {
  background: var(--yellow);
  color: #14223d;
}

.split {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

select, textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: #071833;
  color: #ffffff;
}

select {
  min-height: 48px;
  padding: 0 12px;
}

textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

.metrics {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}

.swatch.w { background: var(--lime); }
.swatch.d { background: var(--yellow); }
.swatch.l { background: #9ec2ff; }

canvas.chart,
svg.chart {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: rgba(4, 16, 40, 0.38);
}

canvas.chart { height: 230px; }
canvas.chart.short { height: 180px; }

.fine {
  margin: 8px 0 0;
  color: #ffffff;
  font-size: 14px;
}

.fine li { margin: 4px 0; }

.modes {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.modes button { flex: 1 1 0; }

.score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.score-row strong {
  display: block;
  font-family: var(--display);
  font-size: 42px;
  line-height: 0.9;
  color: var(--yellow);
}

.slots, .pool, .stack { display: grid; gap: 8px; }

.slot {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(5, 16, 40, 0.4);
}

.slot b { color: var(--yellow); }
.slot em { color: var(--lime); font-style: normal; font-weight: 700; }
.slot.shown em { color: #ffffff; }

.pool button {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(5, 16, 40, 0.35);
  color: #ffffff;
  font-weight: 700;
  text-align: left;
}

.pool button.hit {
  background: var(--lime);
  color: #14223d;
  border-color: transparent;
}

.pool button.miss {
  background: transparent;
  border-color: var(--yellow);
  color: var(--yellow);
}

.pool button:disabled { opacity: 1; }

.strikes { display: flex; gap: 6px; align-items: center; }

.strikes span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 7px;
  color: transparent;
  font-weight: 700;
}

.strikes span.on {
  background: var(--yellow);
  color: #14223d;
  border-color: transparent;
}

.pips, .rounds { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.pips span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-weight: 700;
}

.pips span.on {
  background: var(--lime);
  color: #14223d;
  border-color: transparent;
}

.rounds span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.rounds span.clean { background: var(--lime); }
.rounds span.false { background: var(--yellow); }
.rounds span.miss { background: #ffffff; }

.whistle-stage {
  width: 100%;
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 3px solid #2458a8;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 35%, rgba(36, 110, 220, 0.45), rgba(6, 18, 43, 0.15) 62%),
    #071833;
  color: #ffffff;
  touch-action: manipulation;
  user-select: none;
}

.whistle-stage img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  filter: grayscale(1) brightness(0.72);
}

.whistle-stage strong {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.whistle-stage.live {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(198, 255, 74, 0.5), 0 0 36px rgba(255, 208, 0, 0.35);
}

.whistle-stage.live img { filter: none; }

.whistle-stage.early { border-color: var(--yellow); }
.whistle-stage.hit { border-color: var(--lime); }
.whistle-stage.miss { border-color: #ffffff; }

.best strong { color: var(--lime); }

.choice {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(5, 16, 40, 0.35);
  color: #ffffff;
  font-weight: 700;
  text-align: left;
}

.choice.hit { background: var(--lime); color: #14223d; border-color: transparent; }
.choice.miss { border-color: var(--yellow); color: var(--yellow); }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  justify-content: center;
  padding: 12px;
  background: rgba(3, 8, 20, 0.72);
}

.scrim[hidden] { display: none !important; }

.panel {
  width: min(680px, 100%);
  max-height: min(88vh, 860px);
  overflow: auto;
  padding: 18px 18px 22px;
  border: 1px solid var(--line);
  border-radius: 22px 22px 16px 16px;
  background: linear-gradient(180deg, #1a57b8, #0e387c);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.desk-panel { width: min(760px, 100%); }

.sheet-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.sheet-top h2, .panel h2 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
}

.body-copy p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
}

.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0; }

.tabs button[aria-selected="true"] {
  background: var(--yellow);
  color: #14223d;
}

.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.list li, .note, .later-item, .history li {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(5, 16, 40, 0.38);
}

.history li {
  grid-template-columns: 1fr auto;
  align-items: baseline;
}

.history time { color: #ffffff; font-size: 12px; letter-spacing: 0.04em; }

.note p { margin: 0; white-space: pre-wrap; }

.empty { margin: 8px 0; color: #ffffff; }

.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.badge {
  min-height: 72px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 16, 40, 0.35);
  color: #ffffff;
  text-align: left;
}

.badge b { display: block; font-family: var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.badge.held { border-color: var(--lime); box-shadow: inset 4px 0 0 var(--lime); }
.badge small { display: block; margin-top: 4px; color: #ffffff; font-size: 12px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 70;
  max-width: calc(100% - 28px);
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--lime);
  color: #14223d;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: 0.2s ease;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.colophon {
  width: min(1080px, calc(100% - 24px));
  margin: 0 auto 28px;
  color: #ffffff;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
  background: #06122b;
}

#splash[hidden] { display: none !important; }

#splash.off {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#splash .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.splash-copy {
  position: relative;
  padding: 92px 20px 32px;
  background: linear-gradient(180deg, rgba(6, 18, 43, 0) 0%, rgba(6, 18, 43, 0.94) 42%);
}

.splash-copy .mark {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.hero-title {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: clamp(40px, 10vw, 76px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-sub { margin: 8px 0 14px; max-width: 28rem; }

.splash-bar {
  height: 4px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.splash-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--yellow);
  animation: load 1.5s linear forwards;
}

@keyframes load { to { width: 100%; } }

@media (min-width: 720px) {
  .split { grid-template-columns: 1fr 1fr; }
  .pool { grid-template-columns: 1fr 1fr; }
  .badges { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

@media (min-width: 860px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics .wide { grid-column: 1 / -1; }
  .scrim { align-items: center; }
  .panel { border-radius: 22px; }
}

@media (max-width: 420px) {
  .brand h1 { font-size: 20px; }
  .live-pill { padding: 6px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .splash-bar span { animation: none; }
  .splash-bar span { width: 100%; }
  #splash.off { transition: none; }
  html { scroll-behavior: auto; }
}
