:root {
  color-scheme: light;
  --paper: #f6f8fb;
  --ink: #111827;
  --muted: #667085;
  --line: #dbe2ee;
  --panel: #ffffff;
  --panel-strong: #eef4ff;
  --cyan: #0f7f89;
  --green: #0b7f52;
  --gold: #9a6700;
  --red: #c24136;
  --violet: #6957d9;
  --black: #111827;
  --focus: #0b7285;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f6f8fb 0%, #eef3f8 42%, #f8fafc 100%);
}

a { color: inherit; }

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.top-band {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.nav-shell,
.hero,
main,
footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-shell {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(17, 24, 39, .08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--black);
  color: #ffffff;
  font-size: 23px;
}

.nav-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.live-status {
  color: var(--green);
  font-weight: 800;
}

.hero {
  min-height: 164px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  align-items: center;
  gap: 28px;
  padding: 24px 0 22px;
}

.player-hero { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); }

.eyebrow,
.section-head p,
.command-band p {
  margin: 0 0 7px;
  color: var(--cyan);
  font-weight: 850;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .12em;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: .94;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.32;
  font-weight: 650;
}

.hero-side {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.signal-art {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 12px 26px rgba(17, 24, 39, .08);
}

.hero-card {
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 26px rgba(17, 24, 39, .08);
}

.hero-card.solo { min-height: 122px; }
.hero-card span,
.hero-card small { color: var(--muted); font-size: 13px; }
.hero-card strong { font-size: clamp(25px, 3vw, 38px); line-height: 1; overflow-wrap: anywhere; }

main { padding: 18px 0 42px; }

.view-switcher {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.view-tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.view-tab:hover,
.view-tab.active {
  color: #ffffff;
  border-color: var(--black);
  background: var(--black);
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.stat-card,
.panel,
.command-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(17, 24, 39, .07);
}

.stat-card {
  min-height: 110px;
  padding: 15px;
  display: grid;
  align-content: space-between;
  border-top: 5px solid var(--cyan);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.stat-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tone-gold { border-top-color: var(--gold); }
.tone-green { border-top-color: var(--green); }
.tone-red { border-top-color: var(--red); }
.tone-violet { border-top-color: var(--violet); }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.lead-grid { grid-template-columns: minmax(0, 1.75fr) minmax(280px, .85fr); }

.panel {
  padding: 20px;
  overflow: hidden;
}

.feature-panel { min-height: 330px; }
.wide-panel { margin-top: 18px; }
.wide-card { grid-column: span 2; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2,
.command-band h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.score-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--line);
  padding: 0 10px 10px 0;
}

.score-table td {
  border-bottom: 1px solid rgba(102, 112, 133, .18);
  padding: 12px 10px 12px 0;
  vertical-align: middle;
}

.score-table tr:last-child td { border-bottom: 0; }
.score-table td:first-child { color: var(--muted); width: 34px; }
.score-table td:nth-child(3) { font-weight: 850; }

.player-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  text-decoration: none;
  border-bottom: 1px solid rgba(18, 150, 163, .35);
}

.player-link:hover { color: var(--cyan); border-bottom-color: currentColor; }
.player-link:focus-visible { outline-offset: 2px; }

.chase-panel {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: var(--ink);
  border-color: var(--line);
}

.chase-panel .section-head p { color: var(--gold); }

.chase-text {
  font-size: clamp(22px, 3.3vw, 38px);
  line-height: 1.02;
  margin: 12px 0 18px;
  font-weight: 850;
}

.mini-metrics {
  display: grid;
  gap: 8px;
}

.mini-metrics span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(102, 112, 133, .2);
  padding-top: 10px;
  color: var(--muted);
}

.mini-metrics b { color: var(--ink); }

.race-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.race-columns h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.target-list,
.hook-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.target-list li,
.hook-list li {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(105px, 1fr);
  gap: 12px;
  align-items: baseline;
  border-top: 1px solid rgba(102, 112, 133, .16);
  padding-top: 8px;
}

.target-list b,
.hook-list b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.target-list span,
.hook-list span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.event-list,
.compact-list,
.question-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.event-list li,
.compact-list li,
.question-list li {
  display: grid;
  gap: 4px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(102, 112, 133, .18);
}

.event-list li:last-child,
.compact-list li:last-child,
.question-list li:last-child { border-bottom: 0; }

.event-main,
.event-meta,
.compact-list small,
.question-list small {
  color: var(--muted);
}

.event-main { color: var(--ink); }
.compact-list li { grid-template-columns: 1fr auto; align-items: baseline; }
.compact-list small { grid-column: 1 / -1; }

.last-answer {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 750;
}

.histogram {
  height: 132px;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: end;
  gap: 5px;
  padding-top: 8px;
}

.histogram span {
  display: block;
  min-height: 8px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #0f7f89, #0b7f52);
}

.category-bars {
  display: grid;
  gap: 12px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.category-row div {
  height: 10px;
  border-radius: 999px;
  background: #e6ecf5;
  overflow: hidden;
}

.category-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--violet);
}

.question-list strong { color: var(--red); }
.question-list span { line-height: 1.35; }

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.health-grid span {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
}

.health-grid b {
  display: block;
  color: var(--ink);
  font-size: 24px;
}

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

.command-band {
  margin-top: 18px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #eef4ff 100%);
}

.command-band h2 span { color: var(--violet); }

.command-band ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 10px;
}

.command-band li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

footer {
  padding: 0 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

@media (max-width: 1040px) {
  .score-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel-grid,
  .lead-grid { grid-template-columns: 1fr; }
  .wide-card { grid-column: auto; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { max-width: 420px; }
  .score-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-band { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  main {
    display: flex;
    flex-direction: column;
  }

  .view-switcher { order: 1; }
  .lead-grid { order: 2; margin-top: 0; }
  .headline-strip { order: 3; margin: 18px 0 0; }
  .detail-grid { order: 4; }
  .rhythm-panel { order: 5; }
  .support-grid { order: 6; }
  .command-band { order: 7; }

  .nav-shell { padding: 15px 0; align-items: flex-start; flex-direction: column; }
  .hero { min-height: 0; padding: 22px 0; gap: 18px; }
  .hero-side { grid-template-columns: 82px minmax(0, 1fr); }
  .signal-art { width: 82px; height: 82px; }
  .hero-card { min-height: 82px; padding: 12px; }
  .score-strip { grid-template-columns: 1fr; }
  .stat-card { min-height: 92px; }
  .score-table { font-size: 14px; }
  .score-table .hide-sm { display: none; }
  .player-link { min-height: 28px; }
  .category-row { grid-template-columns: 1fr auto; }
  .category-row div { grid-column: 1 / -1; grid-row: 2; }
  .command-band ul { grid-template-columns: 1fr; }
}
