/* FightBench: fight-night design system.
   Dark venue, spotlit stage, red corner vs teal corner, poster type + mono
   small print. One theme, one accent family, sharp corners throughout. */

:root {
  --ink: #16120e;
  --coal: #1f1913;
  --coal-2: #251e16;
  --paper: #efe3cd;
  --paper-dim: #a5977c;
  --paper-faint: #6f6350;
  --line: rgba(239, 227, 205, 0.16);
  --line-soft: rgba(239, 227, 205, 0.07);
  --red: #cf4326;
  --red-bright: #ff6a4a;
  --teal: #2f9c8e;
  --teal-bright: #45c4b2;
  --gold: #e0aa4b;
  --font-display: "Big Shoulders", "Big Shoulders Display", Impact, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
}

/* The hidden attribute must beat any display the components set. */
[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
}

body {
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Film grain over everything, fixed so it never repaints on scroll. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 0.95;
}

p {
  margin: 0;
}

button {
  font: inherit;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
  appearance: none;
  display: inline-block;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  transition:
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--paper-dim);
  background: var(--line-soft);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn.primary {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.btn.primary:hover {
  background: #fff6e2;
}

.btn.primary.did-copy {
  background: var(--gold);
  border-color: var(--gold);
}

.btn-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.68rem;
}

/* ------------------------------------------------------------------ */
/* Home: the fight poster                                              */
/* ------------------------------------------------------------------ */

.home {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4.5rem) 1.25rem 3rem;
}

.masthead {
  margin-bottom: 1.6rem;
}

.wordmark {
  font-size: clamp(4.2rem, 14vw, 8.5rem);
  font-weight: 800;
  line-height: 0.85;
  color: var(--paper);
  display: flex;
  align-items: center;
  gap: 0.08em;
  text-shadow: 0.045em 0.05em 0 rgba(207, 67, 38, 0.35);
}

.wordmark-x {
  position: relative;
  width: 0.42em;
  height: 0.6em;
  flex: none;
}

.wordmark-x::before,
.wordmark-x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.11em;
  height: 0.62em;
  border-radius: 0.06em;
  translate: -50% -50%;
}

.wordmark-x::before {
  background: var(--red);
  rotate: 24deg;
}

.wordmark-x::after {
  background: var(--teal);
  rotate: -24deg;
}

.tagline {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  color: var(--paper-dim);
  letter-spacing: 0.02em;
}

/* Framed stage plate holding the exhibition canvas. Capped against the
   viewport height so the agent-entry ticket stays close to the fold. */
.stage-card {
  position: relative;
  border: 1px solid var(--line);
  padding: 9px;
  background: rgba(239, 227, 205, 0.025);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  max-width: min(100%, max(540px, calc((100dvh - 21rem) * 1.7778)));
}

.stage-tag {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 1;
  pointer-events: none;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-dim);
  background: rgba(22, 18, 14, 0.6);
  border: 1px solid var(--line-soft);
  padding: 0.2rem 0.55rem;
}

.stage-card canvas,
.stage-stack canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #171209;
  border: 1px solid rgba(0, 0, 0, 0.6);
}

/* The agent-entry ticket, perforated stub and all. */
.ticket {
  display: grid;
  grid-template-columns: 1fr auto;
  margin: 1.75rem 0 2.75rem;
  border: 1px solid var(--line);
  background: var(--coal);
  position: relative;
}

.ticket-main {
  padding: 1.15rem 1.4rem 1.25rem;
  min-width: 0;
}

.ticket-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.agent-url {
  margin: 0.45rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.2vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  word-break: break-all;
  color: var(--paper);
}

.ticket-hint {
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--paper-dim);
  max-width: 52ch;
}

.ticket-stub {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.15rem 1.4rem;
  border-left: 1px dashed var(--line);
  position: relative;
}

.ticket-stub::before,
.ticket-stub::after {
  content: "";
  position: absolute;
  left: -8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--line);
}

.ticket-stub::before {
  top: -9px;
  border-top-color: transparent;
}

.ticket-stub::after {
  bottom: -9px;
  border-bottom-color: transparent;
}

/* Tonight's card: the bout sheet. */
.card-section {
  margin-bottom: 2.75rem;
}

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

.card-head h2 {
  font-size: 2.1rem;
  font-weight: 700;
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.card-list li {
  border-bottom: 1px solid var(--line-soft);
}

.card-empty {
  padding: 1.1rem 0.25rem;
  font-size: 0.78rem;
  color: var(--paper-dim);
}

.bout {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 0.5rem;
  text-decoration: none;
  color: var(--paper);
  transition: background 160ms ease, padding-left 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bout:hover {
  background: var(--line-soft);
  padding-left: 0.85rem;
}

.bout-names {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bout-names .vs {
  color: var(--red-bright);
  font-size: 0.95rem;
  margin: 0 0.35rem;
}

.bout-names em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--paper-dim);
  letter-spacing: 0.04em;
}

.bout-chip {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.bout-chip.is-live {
  color: var(--red-bright);
  border-color: rgba(255, 106, 74, 0.4);
}

.bout-chip.is-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-bright);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.bout-chip.is-open {
  color: var(--gold);
  border-color: rgba(224, 170, 75, 0.4);
}

.bout-go {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-dim);
  transition: color 160ms ease;
}

.bout:hover .bout-go {
  color: var(--paper);
}

/* The record book + rankings ledger. */
.ledger {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2.5rem;
  margin-bottom: 2.75rem;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.25rem;
}

.result-names {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-names b {
  color: var(--gold);
  font-weight: 700;
}

.result-names .vs {
  color: var(--paper-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  margin: 0 0.25rem;
}

.result-names small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--paper-faint);
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.result-when {
  font-size: 0.64rem;
  color: var(--paper-faint);
  white-space: nowrap;
}

.result-row .bout-go {
  color: var(--gold);
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.rank-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto auto;
  align-items: baseline;
  gap: 0.8rem;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.74rem;
}

.rank-no {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--paper-faint);
}

.rank-row:first-child .rank-no {
  color: var(--gold);
}

.rank-model {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--paper);
}

.rank-rec {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.rank-kos {
  font-size: 0.62rem;
  color: var(--paper-dim);
  font-variant-numeric: tabular-nums;
}

.rank-note {
  margin-top: 0.7rem;
  font-size: 0.62rem;
  color: var(--paper-faint);
  line-height: 1.6;
}

@media (max-width: 720px) {
  .ledger {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .result-row {
    grid-template-columns: 1fr auto;
    row-gap: 0.2rem;
  }

  .result-when {
    display: none;
  }
}

.small-print {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  font-size: 0.7rem;
  line-height: 1.7;
  color: var(--paper-dim);
  max-width: 72ch;
}

.small-print .colophon {
  margin-top: 0.7rem;
  color: var(--paper-faint);
}

.small-print .colophon a {
  color: var(--paper-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  margin-left: 0.4rem;
}

.small-print .colophon a:hover {
  color: var(--paper);
}

/* ------------------------------------------------------------------ */
/* Watch: the broadcast                                                */
/* ------------------------------------------------------------------ */

/* The broadcast is one screen on desktop: topbar, then a deck of
   arena column + side rail. Only the rail scrolls. */
.page-watch {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.deck {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 1.1rem;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1.25rem 1rem;
}

.rail {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  scrollbar-width: thin;
  scrollbar-color: var(--paper-faint) transparent;
  padding-bottom: 0.25rem;
}

.rules-card {
  border: 1px solid var(--line);
  background: var(--coal);
  padding: 1rem 1.15rem;
  flex: none;
}

.rules-card h2 {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
}

.rule-rows {
  display: flex;
  flex-direction: column;
}

.rule-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.72rem;
  color: var(--paper-dim);
}

.rule-row b {
  color: var(--paper);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rules-foot {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(224, 170, 75, 0.4);
  padding-bottom: 0.1rem;
}

.rules-foot:hover {
  color: #f2c15e;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.25rem;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.brand-link {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--paper);
  text-decoration: none;
}

.matchup {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.live-chip {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper-faint);
}

.live-chip[data-state="live"] .live-dot {
  background: var(--red-bright);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.live-chip[data-state="reconnecting"] .live-dot {
  background: var(--gold);
  animation: pulse-dot 0.7s ease-in-out infinite;
}

.live-chip[data-state="replay"] .live-dot {
  background: var(--gold);
}

.result-actions {
  margin-top: 1.1rem;
}

.broadcast {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.stage-area {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

/* HUD ---------------------------------------------------------------- */

.hud {
  display: grid;
  grid-template-columns: 1fr minmax(96px, auto) 1fr;
  gap: clamp(0.75rem, 3vw, 2rem);
  align-items: start;
  padding: 0.5rem 0 0.85rem;
}

.corner {
  min-width: 0;
}

.corner-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  min-width: 0;
}

.corner-b .corner-head {
  justify-content: flex-end;
}

.fighter-name {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.8vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.corner-a .fighter-name {
  color: var(--red-bright);
}

.corner-b .fighter-name {
  color: var(--teal-bright);
}

.corner.winner .fighter-name {
  color: var(--gold);
}

.corner.loser {
  opacity: 0.62;
}

.model-chip {
  flex: none;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--paper-dim);
  border: 1px solid var(--line);
  padding: 0.08rem 0.4rem;
  white-space: nowrap;
}

.bar-shell {
  position: relative;
  height: 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line);
  overflow: hidden;
}

.corner-a .bar-shell {
  transform: skewX(-14deg);
  transform-origin: bottom left;
}

.corner-b .bar-shell {
  transform: skewX(14deg);
  transform-origin: bottom right;
}

.bar-fill,
.bar-ghost {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

.corner-a .bar-fill,
.corner-a .bar-ghost {
  left: 0;
}

.corner-b .bar-fill,
.corner-b .bar-ghost {
  right: 0;
}

/* The ghost lags behind the real fill: the classic drain trail. */
.bar-ghost {
  background: rgba(224, 170, 75, 0.75);
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1) 380ms;
}

.bar-fill {
  transition: width 130ms ease-out;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.corner-a .bar-fill {
  background: linear-gradient(180deg, var(--red-bright), var(--red));
}

.corner-b .bar-fill {
  background: linear-gradient(180deg, var(--teal-bright), var(--teal));
}

.corner.low .bar-fill {
  animation: bar-throb 0.9s ease-in-out infinite;
}

.corner-foot {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.4rem;
  font-size: 0.68rem;
  color: var(--paper-dim);
}

.corner-b .corner-foot {
  justify-content: flex-end;
}

.pips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.pip {
  width: 7px;
  height: 7px;
  rotate: 45deg;
  border: 1px solid var(--line);
  flex: none;
}

.corner-a .pip.on {
  background: var(--red-bright);
  border-color: var(--red-bright);
}

.corner-b .pip.on {
  background: var(--teal-bright);
  border-color: var(--teal-bright);
}

.super-lamp {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(224, 170, 75, 0.55);
  padding: 0.1rem 0.4rem;
  box-shadow: 0 0 10px rgba(224, 170, 75, 0.25);
}

.super-lamp.spent {
  color: var(--paper-faint);
  border-color: var(--line-soft);
  box-shadow: none;
}

.hp-num {
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.corner-b .hp-num {
  margin-left: 0;
  margin-right: auto;
}

.clock {
  text-align: center;
  padding-top: 0.1rem;
}

.clock-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
  white-space: nowrap;
}

.clock-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
  min-height: 2.5rem;
}

.clock[data-mood="hot"] .clock-value {
  color: var(--gold);
}

.clock[data-mood="danger"] .clock-label,
.clock[data-mood="danger"] .clock-value {
  color: var(--red-bright);
}

.clock[data-mood="danger"] .clock-value {
  animation: pulse-soft 0.8s ease-in-out infinite;
}

/* Stage -------------------------------------------------------------- */

.stage-stack {
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.stage-note {
  position: absolute;
  top: 14%;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  animation: rise 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.note-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0.04em 0.045em 0 rgba(207, 67, 38, 0.4);
}

.note-sub {
  margin-top: 0.4rem;
  font-size: 0.74rem;
  color: var(--paper-dim);
  max-width: 44ch;
  margin-inline: auto;
}

.note-solo {
  background: rgba(22, 18, 14, 0.65);
  display: inline-block;
  padding: 0.3rem 0.8rem;
}

.result-banner {
  position: absolute;
  inset: 0;
  display: grid;
  justify-content: center;
  align-content: start;
  text-align: center;
  padding: clamp(1rem, 6%, 3.5rem) 1.5rem 1.5rem;
  background: linear-gradient(180deg, rgba(13, 9, 6, 0.72), rgba(13, 9, 6, 0.38) 60%, rgba(13, 9, 6, 0.1));
  /* Hold back a beat so the KO flash lands first, then the verdict rises. */
  animation: rise 420ms cubic-bezier(0.16, 1, 0.3, 1) 550ms both;
  z-index: 2;
}

.result-plate {
  min-width: min(88%, 26rem);
  padding: 1.6rem 2.2rem 1.8rem;
  border: 1px solid var(--line);
  outline: 1px solid var(--line-soft);
  outline-offset: 5px;
  background: rgba(22, 18, 14, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* Winner splash: kicker fades, the name slams in like a fight-poster
   stamp, then the details trail behind it. Timings pair with the
   stage jolt in watch.js (slamStage). */
.result-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  animation: fade-up 320ms ease-out 640ms both;
}

.result-banner[data-kind="ko"] .result-kicker {
  color: var(--red-bright);
}

.result-banner[data-kind="draw"] .result-kicker,
.result-banner[data-kind="abort"] .result-kicker {
  color: var(--paper-dim);
}

.result-title {
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 4.8rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 0.9;
  color: var(--paper);
  overflow-wrap: break-word;
  text-shadow: 0.045em 0.05em 0 rgba(0, 0, 0, 0.45);
  transform-origin: 50% 38%;
  animation: result-slam 640ms cubic-bezier(0.16, 1, 0.3, 1) 800ms both;
}

/* Corner colors bleed into the stamp. */
.result-plate[data-side="a"] .result-title {
  text-shadow: 0.045em 0.05em 0 rgba(207, 67, 38, 0.6);
}

.result-plate[data-side="b"] .result-title {
  text-shadow: 0.045em 0.05em 0 rgba(47, 156, 142, 0.6);
}

.result-sub {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--paper);
  animation: fade-up 360ms ease-out 1220ms both;
}

.result-reason {
  margin-top: 0.65rem;
  font-size: 0.74rem;
  color: var(--paper-dim);
  max-width: 40ch;
  margin-inline: auto;
  animation: fade-up 360ms ease-out 1360ms both;
}

.result-actions {
  animation: fade-up 360ms ease-out 1500ms both;
}

/* Draws and no-contests get a quiet entrance — nothing to celebrate. */
.result-banner[data-kind="draw"] .result-title,
.result-banner[data-kind="abort"] .result-title {
  animation: fade-up 420ms ease-out 800ms both;
}

/* The whole arena jolts when the verdict lands (class toggled by watch.js). */
.stage-stack.result-slam {
  animation: stage-slam 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97) 1150ms both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(0.7rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes result-slam {
  0% {
    opacity: 0;
    transform: scale(2.4) rotate(-3deg);
  }
  55% {
    opacity: 1;
    transform: scale(0.93) rotate(0.8deg);
  }
  75% {
    transform: scale(1.05) rotate(-0.4deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes stage-slam {
  0%,
  100% {
    transform: translate(0, 0);
  }
  15% {
    transform: translate(-7px, 4px);
  }
  35% {
    transform: translate(6px, -5px);
  }
  55% {
    transform: translate(-5px, -2px);
  }
  75% {
    transform: translate(4px, 3px);
  }
  90% {
    transform: translate(-2px, -1px);
  }
}

/* Turn strip --------------------------------------------------------- */

.turn-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 0.8rem;
  padding: 0.7rem 1rem;
  background: var(--coal);
  border: 1px solid var(--line);
  transition: border-color 250ms ease, background 250ms ease;
}

.turn-strip.danger {
  border-color: rgba(255, 106, 74, 0.5);
  background: #271611;
}

.turn-cell {
  min-width: 0;
  animation: rise 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.turn-b {
  text-align: right;
}

.turn-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.turn-a .turn-name {
  color: var(--red-bright);
}

.turn-b .turn-name {
  color: var(--teal-bright);
}

.turn-status {
  font-size: 0.7rem;
  color: var(--paper-dim);
}

.is-thinking .turn-status {
  animation: pulse-soft 1.3s ease-in-out infinite;
}

.is-thinking .ellipsis::after {
  content: "...";
}

.is-ready .turn-status {
  color: var(--paper);
  font-weight: 600;
}

.is-stalling .turn-status {
  color: var(--red-bright);
  font-weight: 600;
  animation: pulse-soft 0.65s ease-in-out infinite;
}

.turn-mid {
  text-align: center;
}

.turn-title {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  white-space: nowrap;
}

.turn-title.danger {
  color: var(--red-bright);
}

.turn-hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.64rem;
  color: var(--paper-dim);
  white-space: nowrap;
}

.turn-plan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.turn-b .turn-plan {
  justify-content: flex-end;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.12rem 0.5rem;
  font-size: 0.68rem;
  color: var(--paper);
  white-space: nowrap;
}

.chip-link {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.chip-empty,
.chip-auto {
  border-style: dashed;
  color: var(--paper-dim);
  background: transparent;
}

/* Rail panels -------------------------------------------------------- */

.nego-panel,
.pbp,
.tape {
  border: 1px solid var(--line);
  background: var(--coal);
  padding: 1rem 1.15rem;
  flex: none;
}

.nego-panel h2,
.pbp h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.nego-sub {
  font-size: 0.7rem;
  color: var(--paper-dim);
  margin-bottom: 0.5rem;
}

.nego-log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  color: var(--paper-dim);
  max-height: 150px;
  overflow: auto;
}

.nego-log li {
  padding: 0.2rem 0;
  line-height: 1.5;
}

.nego-log b {
  color: var(--paper);
}

.nego-log b.nego-a {
  color: var(--red-bright);
}

.nego-log b.nego-b {
  color: var(--teal-bright);
}

.nego-log em {
  color: var(--paper-dim);
  font-style: italic;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  color: var(--paper-dim);
}

.log li {
  padding: 0.38rem 0;
  border-bottom: 1px solid var(--line-soft);
  animation: rise 240ms ease both;
  line-height: 1.5;
}

.log b {
  color: var(--paper);
}

.pbp-a {
  color: var(--red-bright);
}

.pbp-b {
  color: var(--teal-bright);
}

.log-hit b {
  color: var(--gold);
}

.log-ko {
  color: var(--red-bright);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.fight-ended .log {
  opacity: 0.55;
}

/* Tale of the tape --------------------------------------------------- */

.tape h2 {
  font-size: 1.7rem;
  margin-bottom: 0.75rem;
}

.tape-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: 0.9rem;
  row-gap: 0.34rem;
  align-items: center;
}

.tape-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  padding-bottom: 0.5rem;
}

.tape-name small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--paper-dim);
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.tape-name.a {
  color: var(--red-bright);
  text-align: right;
}

.tape-name.b {
  color: var(--teal-bright);
}

.crown {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.tape-vs {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--paper-faint);
  align-self: start;
  padding-top: 0.4rem;
}

.tv {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}

.tv.a {
  text-align: right;
}

.tv.best {
  color: var(--gold);
  font-weight: 700;
}

.tk {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper-dim);
  text-align: center;
  white-space: nowrap;
}

.tape-note {
  margin-top: 0.8rem;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--paper-dim);
}

/* ------------------------------------------------------------------ */
/* Motion                                                              */
/* ------------------------------------------------------------------ */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes bar-throb {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 960px) {
  /* Small screens go back to a normal scrolling page. */
  .page-watch {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .deck {
    grid-template-columns: 1fr;
  }

  .rail {
    overflow-y: visible;
  }

  .stage-stack {
    width: 100% !important;
  }
}

@media (max-width: 880px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
  }

  .live-chip span:last-child {
    display: none;
  }

  .turn-strip {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .turn-mid {
    order: -1;
    text-align: left;
  }

  .turn-b {
    text-align: left;
  }

  .turn-b .turn-plan {
    justify-content: flex-start;
  }

  .clock-value {
    font-size: 1.9rem;
    min-height: 1.9rem;
  }

  .ticket {
    grid-template-columns: 1fr;
  }

  .ticket-stub {
    flex-direction: row;
    border-left: none;
    border-top: 1px dashed var(--line);
  }

  .ticket-stub::before,
  .ticket-stub::after {
    left: auto;
    top: -8px;
    width: 15px;
    height: 15px;
  }

  .ticket-stub::before {
    left: -8px;
  }

  .ticket-stub::after {
    right: -8px;
    bottom: auto;
  }

  .bout {
    grid-template-columns: 1fr auto;
  }

  .bout-go {
    display: none;
  }
}

@media (max-width: 540px) {
  .hud {
    gap: 0.6rem;
  }

  .corner-foot {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .model-chip {
    display: none;
  }

  .result-banner {
    padding: 0.75rem;
  }

  .result-plate {
    min-width: 0;
    padding: 0.9rem 1.1rem 1rem;
  }

  .result-title {
    font-size: 2rem;
  }

  .result-reason {
    display: none;
  }
}
