:root {
  --paper: #e9eddd;
  --paper-deep: #dce2cc;
  --paper-light: #f8f8ef;
  --ink: #12372f;
  --ink-soft: #36564f;
  --ink-faint: #65766e;
  --pitch: #2f6950;
  --pitch-deep: #22533f;
  --lime: #d8ef72;
  --orange: #e36d43;
  --gold: #f4c860;
  --line: #bcc5ae;
  --white: #ffffff;
  --danger: #a83c32;
  --shadow: 0 24px 70px rgb(18 55 47 / 0.13);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 4%, rgb(216 239 114 / 0.35), transparent 24rem),
    linear-gradient(180deg, #f0f1e6 0, var(--paper) 28rem);
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
strong {
  text-wrap: balance;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 {
  max-width: 13ch;
  margin-bottom: 1.1rem;
  font-size: clamp(3.15rem, 7.6vw, 7.3rem);
  letter-spacing: -0.065em;
  line-height: 0.86;
}

h2 {
  margin-bottom: 0.3rem;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.8rem;
  left: 0.8rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-170%);
}

.skip-link:focus {
  transform: translateY(0);
}

.lab-header,
.lab-footer,
#match-lab-main {
  width: min(1540px, calc(100% - 3rem));
  margin-inline: auto;
}

.lab-header {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-lockup img {
  flex: none;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgb(18 55 47 / 0.13);
}

.brand-lockup span {
  display: grid;
  gap: 0.08rem;
}

.brand-lockup small {
  color: var(--ink-faint);
  font-size: 0.66rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-lockup strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.authority-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(248 248 239 / 0.62);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.authority-pill span {
  color: #2b8d5d;
  font-size: 0.8rem;
}

.lab-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  align-items: end;
  gap: clamp(2rem, 7vw, 8rem);
  padding: clamp(4rem, 9vw, 8.5rem) 0 clamp(3rem, 7vw, 6.5rem);
}

.eyebrow {
  margin-bottom: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.intro-copy {
  max-width: 57ch;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.62;
}

.launch-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: rgb(248 248 239 / 0.72);
  box-shadow: var(--shadow);
}

.launch-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.launch-heading span {
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.launch-heading strong {
  color: var(--orange);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
}

.launch-card label {
  display: grid;
  gap: 0.42rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.launch-card input,
.launch-card select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--paper-light);
  font-weight: 650;
}

.primary-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 0.7rem;
  background: var(--ink);
  box-shadow: 0 12px 24px rgb(18 55 47 / 0.19);
  color: var(--white);
  font-weight: 850;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button:not(:disabled):hover {
  box-shadow: 0 16px 30px rgb(18 55 47 / 0.24);
  transform: translateY(-2px);
}

.load-existing {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.load-existing > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.load-existing button {
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ink);
  border-radius: 0.65rem;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 850;
}

.lab-status {
  min-height: 3.2rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgb(248 248 239 / 0.66);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.lab-status.is-error {
  border-color: var(--danger);
  background: #f4ded6;
  color: var(--danger);
}

.viewer-shell {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  border: 1px solid #8fa28c;
  border-radius: clamp(1.2rem, 2.6vw, 2.2rem);
  background: var(--paper-light);
  box-shadow: var(--shadow);
}

.viewer-content {
  display: block;
}

.viewer-shell.is-empty .viewer-content {
  display: none;
}

.empty-viewer {
  display: none;
}

.viewer-shell.is-empty .empty-viewer {
  display: flex;
  min-height: 610px;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  background:
    linear-gradient(135deg, rgb(216 239 114 / 0.22), transparent 45%),
    var(--paper-light);
  text-align: left;
}

.empty-viewer > span {
  color: var(--orange);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5rem, 15vw, 12rem);
  letter-spacing: -0.08em;
  line-height: 0.75;
}

.empty-viewer h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.score-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.2rem, 2.5vw, 2.2rem);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgb(216 239 114 / 0.24), transparent 34% 66%, rgb(227 109 67 / 0.12)),
    var(--paper-light);
}

.team {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.team-away {
  justify-content: flex-end;
  text-align: right;
}

.team > div {
  display: grid;
  min-width: 0;
  gap: 0.22rem;
}

.team small {
  color: var(--ink-faint);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.team strong {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-swatch {
  width: 18px;
  height: 48px;
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
}

.score-core {
  display: grid;
  min-width: 9rem;
  justify-items: center;
}

#match-clock {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.match-score {
  display: flex;
  align-items: baseline;
  gap: 0.42rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 5rem);
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.match-score i {
  color: var(--ink-faint);
  font-size: 0.55em;
  font-style: normal;
}

#match-state-label {
  color: var(--ink-faint);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.68fr);
}

.pitch-column {
  min-width: 0;
  padding: clamp(1rem, 2.5vw, 2.1rem);
  border-right: 1px solid var(--line);
}

.pitch-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.truth-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  font-size: 0.62rem;
  font-weight: 800;
}

.truth-legend span {
  padding: 0.36rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.truth-legend .is-authoritative {
  border-color: var(--ink);
}

.truth-legend .is-reconstructed {
  border-style: dashed;
}

.canvas-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 5 / 3;
  border: 5px solid var(--ink);
  border-radius: 1.05rem;
  background: var(--pitch);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25);
}

#match-pitch {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--pitch);
  forced-color-adjust: none;
}

.pitch-scorebar {
  position: absolute;
  z-index: 3;
  top: 0.65rem;
  left: 50%;
  display: grid;
  width: min(28rem, calc(100% - 1.6rem));
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.38rem 0.75rem 0.42rem;
  transform: translateX(-50%);
  border: 1px solid rgb(255 255 255 / 0.42);
  border-radius: 0.45rem 0.45rem 0.8rem 0.8rem;
  background: rgb(11 45 38 / 0.96);
  box-shadow: 0 0.22rem 0 rgb(216 239 114 / 0.72);
  color: var(--white);
}

.pitch-scorebar > span {
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pitch-scorebar > span:last-child {
  text-align: right;
}

.pitch-scorebar-core {
  display: grid;
  justify-items: center;
}

.pitch-scorebar-core > strong {
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}

.pitch-scorebar-status {
  display: flex;
  justify-content: center;
  gap: 0.28rem;
  margin-top: 0.16rem;
  color: rgb(255 255 255 / 0.8);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pitch-scorebar-status time {
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.event-float {
  position: absolute;
  z-index: 2;
  right: 0.8rem;
  bottom: 0.8rem;
  width: min(16rem, calc(100% - 1.6rem));
  border: 1px solid rgb(255 255 255 / 0.34);
  border-radius: 0.75rem;
  background: rgb(18 55 47 / 0.91);
  color: var(--white);
  backdrop-filter: blur(8px);
}

.event-float-moment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.48rem 0.7rem 0.55rem;
}

.event-float-moment > #event-minute {
  align-self: center;
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.event-float-copy {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.event-float-copy strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-float-copy small {
  overflow: hidden;
  color: rgb(255 255 255 / 0.72);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.authority-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0.8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--paper);
}

.authority-strip > div {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border-right: 1px solid var(--line);
}

.authority-strip > div:last-child {
  border-right: 0;
}

.authority-strip span {
  color: var(--ink-faint);
  font-size: 0.57rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.authority-strip strong {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playback-panel {
  display: grid;
  grid-template-columns: auto auto minmax(150px, 1fr) auto;
  grid-template-areas: "transport speeds scrubber fullscreen";
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
}

.transport-controls {
  grid-area: transport;
}

.speed-controls {
  grid-area: speeds;
}

.transport-controls,
.speed-controls {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

.playback-panel button {
  display: inline-grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 850;
}

.playback-panel button:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.playback-panel .play-button {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.speed-controls button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--lime);
}

.scrubber-label {
  display: grid;
  grid-area: scrubber;
  min-width: 0;
  gap: 0.22rem;
}

.fullscreen-button {
  grid-area: fullscreen;
}

#match-scrubber {
  width: 100%;
  min-width: 0;
  accent-color: var(--orange);
}

.scrubber-times {
  display: flex;
  justify-content: space-between;
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.59rem;
  font-weight: 700;
}

.evidence-column {
  display: grid;
  align-content: start;
  min-width: 0;
  background: var(--paper);
}

.evidence-card {
  min-width: 0;
  padding: clamp(1.15rem, 2.2vw, 1.8rem);
  border-bottom: 1px solid var(--line);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-heading > span {
  flex: none;
  padding: 0.32rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.causal-summary {
  min-height: 4.4rem;
  margin-bottom: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.91rem;
  font-weight: 600;
  line-height: 1.55;
}

.causal-evidence {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.causal-evidence > div {
  display: grid;
  grid-template-columns: minmax(5.5rem, 0.55fr) minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.71rem;
}

.causal-evidence dt {
  color: var(--ink-faint);
  font-weight: 750;
}

.causal-evidence dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
  text-align: right;
}

.stats-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.stats-card th,
.stats-card td {
  padding: 0.54rem 0.15rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.stats-card thead th {
  color: var(--ink-faint);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-card tbody th {
  color: var(--ink-soft);
  font-weight: 650;
}

.stats-card tbody td {
  width: 26%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 700;
}

.timeline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.68fr);
  border-top: 1px solid var(--line);
}

.timeline-card {
  min-width: 0;
  padding: clamp(1.1rem, 2.5vw, 2rem);
  border-right: 1px solid var(--line);
}

.event-timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(145px, 1fr);
  gap: 0.55rem;
  margin: 0;
  padding: 0 0 0.35rem;
  overflow-x: auto;
  list-style: none;
  scrollbar-color: var(--ink-faint) transparent;
}

.event-timeline li {
  min-width: 0;
}

.event-timeline button {
  display: grid;
  width: 100%;
  min-height: 112px;
  align-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  background: var(--paper);
  text-align: left;
}

.event-timeline button[aria-current="true"] {
  border-color: var(--ink);
  background: var(--lime);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.event-timeline time {
  color: var(--orange);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.event-timeline strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.68rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.event-timeline small {
  color: var(--ink-faint);
  font-size: 0.56rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.integrity-card {
  min-width: 0;
  padding: clamp(1.1rem, 2.5vw, 2rem);
  background: var(--ink);
  color: var(--white);
}

.integrity-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  list-style: none;
}

.integrity-card summary::-webkit-details-marker {
  display: none;
}

.integrity-card summary > span:first-child {
  display: grid;
  gap: 0.25rem;
}

.integrity-card summary small {
  color: var(--lime);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.integrity-card[open] summary > span:last-child {
  transform: rotate(45deg);
}

.integrity-card dl {
  display: grid;
  gap: 0;
  margin: 1.2rem 0 0;
}

.integrity-card dl > div {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgb(255 255 255 / 0.2);
  font-size: 0.64rem;
}

.integrity-card dt {
  color: rgb(255 255 255 / 0.63);
}

.integrity-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.integrity-card code {
  font-size: 0.58rem;
}

.lab-footer {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-faint);
  font-size: 0.66rem;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.noscript {
  margin: 1rem;
  padding: 1rem;
  border: 2px solid var(--danger);
  background: #f4ded6;
}

.viewer-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  border: 0;
  border-radius: 0;
}

.viewer-shell:fullscreen .canvas-frame {
  max-height: calc(100vh - 250px);
}

@media (max-width: 1080px) {
  .match-grid,
  .timeline-grid {
    grid-template-columns: 1fr;
  }

  .pitch-column,
  .timeline-card {
    border-right: 0;
  }

  .evidence-column {
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line);
  }

  .evidence-card {
    border-right: 1px solid var(--line);
  }

  .evidence-card:last-child {
    border-right: 0;
  }

  .integrity-card {
    min-height: 9rem;
  }
}

@media (max-width: 760px) {
  .lab-header,
  .lab-footer,
  #match-lab-main {
    width: min(100% - 1.5rem, 1540px);
  }

  .lab-header {
    min-height: 76px;
  }

  .authority-pill {
    padding: 0.5rem;
    font-size: 0;
  }

  .authority-pill span {
    font-size: 0.85rem;
  }

  .lab-intro {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 2rem;
    padding: 3.5rem 0 3rem;
  }

  h1 {
    font-size: clamp(3.15rem, 16vw, 5.5rem);
  }

  .score-ribbon {
    grid-template-columns: minmax(0, 1fr) minmax(6.2rem, auto) minmax(0, 1fr);
    gap: 0.5rem;
    padding: 1rem;
  }

  .team {
    gap: 0.42rem;
  }

  .team-swatch {
    width: 11px;
    height: 35px;
    border-width: 1px;
  }

  .team strong {
    font-size: 0.85rem;
  }

  .score-core {
    min-width: 0;
  }

  .match-score {
    font-size: 2.65rem;
  }

  .pitch-heading {
    display: grid;
    align-items: start;
  }

  .truth-legend {
    justify-content: flex-start;
  }

  .authority-strip {
    grid-template-columns: 1fr 1fr;
  }

  .authority-strip > div:nth-child(2) {
    border-right: 0;
  }

  .authority-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .playback-panel {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "transport speeds speeds"
      "scrubber scrubber fullscreen";
  }

  .evidence-column {
    grid-template-columns: 1fr;
  }

  .evidence-card {
    border-right: 0;
  }

  .lab-footer {
    display: grid;
    align-content: center;
  }
}

@media (max-width: 420px) {
  .lab-header,
  .lab-footer,
  #match-lab-main {
    width: min(100% - 1rem, 1540px);
  }

  .brand-lockup img {
    width: 40px;
    height: 40px;
  }

  .brand-lockup small {
    font-size: 0.58rem;
  }

  .brand-lockup strong {
    font-size: 1rem;
  }

  .lab-intro {
    padding-top: 2.7rem;
  }

  h1 {
    font-size: clamp(2.9rem, 16vw, 4rem);
  }

  .launch-card {
    padding: 1rem;
    border-radius: 1rem;
  }

  .viewer-shell {
    border-radius: 1rem;
  }

  .score-ribbon {
    grid-template-columns: 1fr auto 1fr;
    gap: 0.3rem;
    padding: 0.75rem 0.55rem;
  }

  .team small {
    display: none;
  }

  .team strong {
    max-width: 8ch;
    font-size: 0.72rem;
  }

  #match-clock {
    font-size: 0.61rem;
  }

  .match-score {
    gap: 0.25rem;
    font-size: 2.2rem;
  }

  #match-state-label {
    font-size: 0.5rem;
  }

  .pitch-column {
    padding: 0.72rem;
  }

  .canvas-frame {
    border-width: 3px;
    border-radius: 0.7rem;
  }

  .event-float {
    right: 0.42rem;
    bottom: 0.42rem;
    width: min(14.5rem, calc(100% - 0.84rem));
  }

  .pitch-scorebar {
    top: 0.35rem;
    width: calc(100% - 0.7rem);
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.3rem;
    padding: 0.22rem 0.38rem 0.25rem;
    border-radius: 0.35rem 0.35rem 0.6rem 0.6rem;
    box-shadow: 0 0.14rem 0 rgb(216 239 114 / 0.72);
  }

  .pitch-scorebar > span {
    overflow: visible;
    font-size: 0.48rem;
    line-height: 1.05;
    letter-spacing: 0.025em;
    text-overflow: clip;
    white-space: normal;
  }

  .pitch-scorebar-core > strong {
    font-size: 1.25rem;
  }

  .pitch-scorebar-status {
    gap: 0.12rem;
    margin-top: 0.08rem;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
  }

  .event-float-moment {
    gap: 0.42rem;
    padding: 0.32rem 0.48rem 0.38rem;
  }

  .event-float-moment > #event-minute {
    font-size: 1.05rem;
  }

  .event-float-copy strong {
    font-size: 0.65rem;
  }

  .playback-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "transport transport"
      "speeds speeds"
      "scrubber fullscreen";
    gap: 0.4rem;
  }

  .playback-panel button {
    min-width: 44px;
    min-height: 44px;
  }

  .transport-controls {
    justify-content: space-between;
    gap: 0.22rem;
  }

  .speed-controls {
    gap: 0.22rem;
  }

  .evidence-card,
  .timeline-card,
  .integrity-card {
    padding: 1rem;
  }

  .timeline-grid {
    min-width: 0;
  }

  .event-timeline {
    grid-auto-columns: minmax(132px, 72vw);
  }

  .lab-footer span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .authority-pill,
  .launch-card,
  .lab-status,
  .viewer-shell,
  .authority-strip,
  .event-timeline button,
  .playback-panel button,
  .event-float,
  .pitch-scorebar,
  .truth-legend span {
    border-color: CanvasText;
  }

  .event-float,
  .pitch-scorebar {
    background: Canvas;
    color: CanvasText;
    forced-color-adjust: auto;
  }

  .pitch-scorebar > span,
  .pitch-scorebar-core > strong,
  .pitch-scorebar-status,
  .pitch-scorebar-status time,
  .event-float-moment > #event-minute,
  .event-float-copy small {
    color: CanvasText;
  }

  .primary-button,
  .playback-panel .play-button,
  .integrity-card {
    border: 1px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
  }

  .event-timeline button[aria-current="true"] {
    border: 3px solid Highlight;
    background: Canvas;
    color: CanvasText;
  }

  .team-swatch {
    border-color: CanvasText;
  }
}
