/* ─────────────────────────────────────────────
   Live: the portfolio as a match broadcast
   ───────────────────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #161616;
  --cream: #e8dcc8;
  --cream-muted: #c4b8a5;
  --vermillion: #e63946;
  --text-primary: #f0ece6;
  --text-secondary: #8a8580;
  --text-muted: #857f79;
  --border: #222222;
  --border-light: #1a1a1a;

  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-accent: "Instrument Serif", serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --bug-h: 2.75rem;
  --ticker-h: 2.5rem;
  --section-gap: clamp(7rem, 16vh, 12rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-padding: calc(var(--bug-h) + 2rem) 0 calc(var(--ticker-h) + 1rem);
  background: var(--bg);
  color-scheme: dark;
  scrollbar-color: #2e2c2a var(--bg);
  -webkit-text-size-adjust: 100%;
  /* Clip on the root too: body's clip alone is handed to the viewport, and Chrome on Android then
     widens the layout viewport to fit the off-screen drag-ins, pushing the fixed ticker below the fold */
  overflow-x: clip;
}
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.lenis) {
    scroll-behavior: smooth;
  }
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  padding-bottom: var(--ticker-h);
}

::selection {
  background: var(--vermillion);
  color: var(--bg);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -200%);
  background: var(--cream);
  color: var(--bg);
  font-weight: 700;
  padding: 0.6rem 1rem;
}
.skip:focus {
  transform: translate(-50%, 0);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ── Broadcast labels (shared) ─────────────── */
.l3-strap,
.bug-live,
.bug-nav a,
.bug-current,
.ticker-label,
.replay-badge,
.stats caption span,
.event-type,
.kickoff,
.cta-top {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

/* ── Score bug ──────────────────────────────── */
.bug {
  position: fixed;
  top: 1rem;
  left: var(--gutter);
  z-index: 100;
  display: flex;
  align-items: stretch;
  height: var(--bug-h);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.8);
}
.bug > * + * {
  border-left: 1px solid var(--border);
}
.bug-logo {
  display: grid;
  place-items: center;
  padding: 0 0.75rem;
  background: var(--bg);
}
.bug-logo img {
  width: 2.25rem;
  height: auto;
}
.bug-live {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.8rem;
  background: var(--vermillion);
  color: var(--bg);
}
.bug-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  .bug-dot {
    animation: pulse 1.6s var(--ease-in-out) infinite;
  }
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.bug-clock {
  display: grid;
  place-items: center;
  width: 4.9rem;
  padding: 0 0.6rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  letter-spacing: 0.02em;
}
.bug-nav ol {
  display: flex;
  height: 100%;
}
.bug-nav li + li {
  border-left: 1px solid var(--border-light);
}
.bug-nav a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.95rem;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease-out-quart);
}
.bug-nav a::after {
  content: "";
  position: absolute;
  left: 0.95rem;
  right: 0.95rem;
  bottom: -1px;
  height: 2px;
  background: var(--vermillion);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out-expo);
}
.bug-nav a:hover {
  color: var(--text-primary);
}
.bug-nav a[aria-current] {
  color: var(--cream);
}
.bug-nav a[aria-current]::after {
  transform: scaleX(1);
}
.bug-menu {
  display: none;
}

.cta-top {
  display: flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0 1.1rem;
  background: var(--cream);
  color: var(--bg);
  transition: background-color 0.2s var(--ease-out-quart);
}
.cta-top:hover {
  background: var(--text-primary);
}

@media (max-width: 1023px) {
  .bug-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: -1px;
    min-width: 14rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.9);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.4rem);
    transition:
      opacity 0.2s var(--ease-out-quart),
      transform 0.25s var(--ease-out-expo),
      visibility 0s 0.25s;
  }
  .bug.is-open .bug-nav {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition:
      opacity 0.2s var(--ease-out-quart),
      transform 0.3s var(--ease-out-expo);
  }
  .bug > .bug-nav {
    border-left: 1px solid var(--border);
  }
  .bug-nav ol {
    flex-direction: column;
  }
  .bug-nav li + li {
    border-left: 0;
    border-top: 1px solid var(--border-light);
  }
  .bug-nav a {
    height: 2.9rem;
    padding: 0 1rem;
  }
  .bug-nav a::after {
    left: 1rem;
    right: auto;
    width: 1.5rem;
    bottom: 0.7rem;
  }
  .bug-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.8rem;
    background: none;
    border: 0;
    border-left: 1px solid var(--border);
    color: var(--cream);
    cursor: pointer;
  }
  .bug-menu svg {
    width: 0.9rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    transition: transform 0.3s var(--ease-out-expo);
  }
  .bug.is-open .bug-menu svg {
    transform: rotate(180deg);
  }
}
@media (max-width: 560px) {
  :root {
    --bug-h: 2.5rem;
  }
  .bug-live {
    padding: 0 0.6rem;
  }
  .bug-clock {
    width: 4.1rem;
    padding: 0 0.4rem;
    font-size: 0.95rem;
  }
  .bug-logo {
    padding: 0 0.55rem;
  }
  .bug-logo img {
    width: 1.8rem;
  }
  .bug-current {
    display: none;
  }
  .bug-menu {
    padding: 0 0.75rem;
  }
  .cta-top {
    padding: 0 0.7rem;
    margin-left: 0;
  }
}
@media (max-width: 374px) {
  .cta-top {
    display: none;
  }
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--bug-h) + 5rem);
  z-index: 90;
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(10 10 10 / 0.94) 55%, rgb(10 10 10 / 0));
}
[data-chapter] {
  scroll-margin-top: calc(var(--bug-h) + 2rem);
}

/* ── Lower third (shared component) ────────── */
.l3 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(100%, 40rem);
}
.l3-head {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  background: var(--bg);
}
.l3-strap {
  display: flex;
  flex-shrink: 0;
  margin-left: auto;
  background: var(--cream);
  color: var(--bg);
}
.l3-strap span {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
}
.l3-strap span + span {
  border-left: 1px solid rgb(10 10 10 / 0.25);
}
.l3-name {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  padding: 0.6rem 1rem 0.65rem;
  min-width: 0;
}
.l3-desc,
.l3-body {
  background: var(--bg-elevated);
  color: var(--cream-muted);
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-top: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}
.l3-body .l3-desc {
  padding: 0;
  border: 0;
}
.l3-hero {
  width: auto;
}

/* ── 00' Pre-match ──────────────────────────── */
.prematch {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  isolation: isolate;
  overflow: hidden;
}
.stadium {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.flood {
  position: absolute;
  top: -35vh;
  width: 80vw;
  height: 120vh;
  background: radial-gradient(ellipse 50% 50% at 50% 30%, rgb(232 220 200 / 0.28), rgb(232 220 200 / 0.07) 45%, transparent 70%);
}
.flood-l {
  left: -30vw;
  transform: rotate(-18deg);
}
.flood-r {
  right: -30vw;
  transform: rotate(18deg);
}
.haze {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 120vw;
  height: 50vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 50% at 50% 60%, rgb(232 220 200 / 0.07), transparent 70%);
}
.pitch-wrap {
  position: absolute;
  left: 60%;
  top: 60vh;
  top: 60svh;
  /* Broadcast camera: the whole pitch in frame, perspective scaled to its width so it doesn't warp */
  width: clamp(640px, 66vw, 1180px);
  transform: translate(-50%, -50%) perspective(2600px) rotateX(58deg);
  transform-origin: 50% 50%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
}
/* Held back until the script has placed it, so it never flashes flat or half drawn */
.js:not(.is-ready) .pitch-wrap {
  opacity: 0;
}
.pitch {
  width: 100%;
  height: auto;
  overflow: visible;
}
.pitch .lines * {
  fill: none;
  stroke: var(--cream);
  stroke-opacity: 0.42;
  stroke-width: 2.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.pitch .spots circle {
  fill: var(--cream);
  fill-opacity: 0.6;
}

.prematch-inner {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(var(--bug-h) + clamp(3rem, 9vh, 6rem)) var(--gutter) clamp(1.5rem, 4vh, 2.5rem);
}
.headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, min(7.4vw, 11vh), 6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 13ch;
  color: var(--text-primary);
}
.headline .w {
  display: inline-block;
  vertical-align: top;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}
.headline .w > span {
  display: inline-block;
}
.headline em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--cream);
  font-size: 1.08em;
}
.prematch-desc {
  margin-top: clamp(1.5rem, 3vh, 2.25rem);
  max-width: 44ch;
  color: var(--cream-muted);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.65;
}
.prematch-foot {
  margin-top: auto;
  padding-top: clamp(3rem, 8vh, 6rem);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}
.kickoff {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--cream);
  padding: 0.75rem 0;
  white-space: nowrap;
}
.kickoff svg {
  width: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
@media (max-width: 640px) {
  .pitch-wrap {
    left: 50%;
    top: 58svh;
    width: 150vw;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 70%, transparent 100%);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .kickoff svg {
    animation: nudge 2.2s var(--ease-in-out) infinite;
  }
}
@keyframes nudge {
  50% {
    transform: translateY(0.3rem);
  }
}

/* ── Chapter heads ──────────────────────────── */
.chapter-head {
  padding: 0 var(--gutter);
  margin-bottom: clamp(3rem, 7vh, 5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.chapter-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 5.2vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.chapter-head p {
  color: var(--text-secondary);
  max-width: 36ch;
}

/* ── 01'–45' First half ─────────────────────── */
.first-half {
  padding-top: var(--section-gap);
}
.replays {
  display: grid;
  gap: clamp(5rem, 14vh, 9rem);
  padding: 0 var(--gutter);
}
.replay-link {
  display: block;
}
.replay-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2544 / 1090;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.replay-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease-out-expo);
}
.replay-link:hover .replay-frame img {
  transform: scale(1.03);
}
.replay-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgb(10 10 10 / 0.88);
  color: var(--cream);
}
.replay-badge-mark {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--vermillion);
  transform: rotate(45deg);
}
.replay-minute {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.35rem 0.6rem;
  background: rgb(10 10 10 / 0.88);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.replay .l3 {
  position: relative;
  margin: -3.25rem 0 0 clamp(0.75rem, 3vw, 2.5rem);
}
.l3-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  margin-top: 0.6rem;
  color: #938d87;
  font-size: 0.8rem;
}
.l3-tags li + li::before {
  content: "/" / "";
  margin: 0 0.5rem;
  color: #4a4642;
}
.l3-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--cream);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid rgb(232 220 200 / 0.35);
  padding-bottom: 0.2rem;
  transition: border-color 0.2s var(--ease-out-quart);
}
.l3-cta svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform 0.35s var(--ease-out-expo);
}
.replay-link:hover .l3-cta {
  border-color: var(--cream);
}
.replay-link:hover .l3-cta svg {
  transform: translate(2px, -2px);
}
@media (min-width: 1100px) {
  .replays {
    padding: 0 calc(var(--gutter) + 4vw);
  }
}
@media (max-width: 640px) {
  .replay-frame {
    aspect-ratio: 4 / 3;
  }
  .replay .l3 {
    margin: -1.75rem 0 0 0.5rem;
  }
  .replay-badge,
  .replay-minute {
    top: 0.6rem;
  }
  .replay-badge {
    left: 0.6rem;
  }
  .replay-minute {
    right: 0.6rem;
  }
}

/* ── HT Half-time ───────────────────────────── */
.half-time {
  padding-top: var(--section-gap);
}
.analysis {
  padding: 0 var(--gutter);
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 5vw, 5rem);
}
.statement {
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  line-height: 1.3;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  max-width: 30ch;
}
.statement strong {
  font-weight: 600;
  color: var(--cream);
}
.statement em {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.1em;
  color: var(--cream);
}
.stats {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  align-self: start;
}
.stats caption {
  text-align: left;
}
.stats caption span {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  background: var(--cream);
  color: var(--bg);
}
.stats tr + tr {
  border-top: 1px solid var(--border);
}
.stats th {
  text-align: left;
  font-weight: 500;
  color: var(--cream-muted);
  padding: 1rem 1.1rem;
  font-size: 0.95rem;
  line-height: 1.35;
}
.stats td {
  text-align: right;
  padding: 1rem 1.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
}
.bio {
  display: grid;
  gap: 1.1rem;
  max-width: 62ch;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}
.bio p:first-child {
  color: var(--cream-muted);
}
@media (min-width: 960px) {
  .analysis {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
  .statement {
    grid-column: 1 / -1;
    max-width: 34ch;
  }
  .stats {
    grid-column: 2;
    grid-row: 2;
  }
  .bio {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ── 46'–90' Second half ────────────────────── */
.second-half {
  padding-top: var(--section-gap);
}
.events-bar {
  position: relative;
  height: 2px;
  margin: 0 calc(var(--gutter) + 0.4rem) 3rem;
  background: var(--border);
}
.events-fill {
  position: absolute;
  inset: 0;
  background: var(--cream);
  transform-origin: left;
  transform: scaleX(1);
}
.events-mark,
.events-now {
  position: absolute;
  top: 50%;
  left: calc(var(--at) * 100%);
  transform: translate(-50%, -50%);
}
.events-mark {
  width: 0.7rem;
  height: 0.7rem;
  background: var(--bg);
  border: 2px solid var(--cream);
  transform: translate(-50%, -50%) rotate(45deg);
}
.events-now {
  transform: translate(-100%, -50%);
  padding: 0.35rem 0.6rem;
  background: var(--vermillion);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}
.events {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 0 var(--gutter);
}
.event {
  display: flex;
  flex-direction: column;
  padding: 0 1.25rem 0 0;
}
.event-head {
  order: -1;
}
.event + .event {
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
}
.event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.event-type {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--cream);
}
.event-type svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: var(--cream);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.event-year {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.event-role {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.25;
}
.event-club {
  margin-top: 0.3rem;
  color: var(--cream-muted);
  font-size: 0.9rem;
}
.event-desc {
  margin-top: 0.9rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}
@media (max-width: 1099px) {
  .events-bar {
    display: none;
  }
  .events {
    grid-template-columns: 1fr;
    gap: 0;
    border-left: 2px solid var(--border);
    margin-left: var(--gutter);
    padding: 0;
  }
  .event,
  .event + .event {
    position: relative;
    padding: 0 var(--gutter) 2.75rem 1.75rem;
    border-left: 0;
  }
  .event::before {
    content: "";
    position: absolute;
    left: -0.47rem;
    top: 0.1rem;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--bg);
    border: 2px solid var(--cream);
    transform: rotate(45deg);
  }
  .event-head {
    justify-content: flex-start;
    gap: 1.25rem;
  }
  .event-desc {
    max-width: 60ch;
  }
}

/* ── FT Full time ───────────────────────────── */
.full-time {
  position: relative;
  padding: var(--section-gap) var(--gutter) clamp(3rem, 8vh, 5rem);
  margin-top: var(--section-gap);
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 55% at 50% 0%, rgb(232 220 200 / 0.07), transparent 70%),
    var(--bg);
}
.ft-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 12ch;
  text-wrap: balance;
}
.ft-title em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.ft-sub {
  margin-top: 1.5rem;
  max-width: 42ch;
  color: var(--cream-muted);
  font-size: 1.05rem;
}
.ft-actions {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}
.ft-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1.6rem;
  background: var(--vermillion);
  color: var(--bg);
  font-weight: 700;
  font-size: 1.05rem;
  transition: background-color 0.2s var(--ease-out-quart);
}
.ft-cta svg {
  width: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.35s var(--ease-out-expo);
}
.ft-cta:hover {
  background: #ee4b57;
}
.ft-cta:hover svg {
  transform: translate(2px, -2px);
}
.ft-links {
  display: flex;
  gap: 1.5rem;
}
.ft-links a {
  display: inline-block;
  padding: 0.6rem 0;
  color: var(--cream);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(232 220 200 / 0.35);
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.2s var(--ease-out-quart);
}
.ft-links a:hover {
  text-decoration-color: var(--cream);
}
.ft-copy {
  margin-top: clamp(4rem, 10vh, 6rem);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Ticker ─────────────────────────────────── */
.ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  height: var(--ticker-h);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}
.ticker-label {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 0.9rem 0 var(--gutter);
  background: var(--cream);
  color: var(--bg);
}
.ticker-window {
  flex: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
  mask-image: linear-gradient(to right, transparent, #000 2rem, #000 calc(100% - 2rem), transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  height: 100%;
}
.ticker-track ul {
  display: flex;
  align-items: center;
}
.ticker-track li {
  display: flex;
  align-items: center;
  padding-left: 1.75rem;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.ticker-track li::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 1.75rem;
  background: var(--cream-muted);
  opacity: 0.5;
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: no-preference) {
  .ticker-track {
    animation: ticker 48s linear infinite;
  }
  .ticker:hover .ticker-track,
  .ticker:focus-within .ticker-track,
  .ticker.is-paused .ticker-track {
    animation-play-state: paused;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-window {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .ticker-toggle {
    display: none;
  }
}
.ticker-toggle {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--ticker-h);
  background: none;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--cream);
  cursor: pointer;
}
.ticker-toggle svg {
  width: 0.85rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}
.ticker-toggle .i-play,
.ticker.is-paused .ticker-toggle .i-pause {
  display: none;
}
.ticker.is-paused .ticker-toggle .i-play {
  display: block;
}
.ticker-toggle:hover {
  background: var(--bg-card);
}
@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

/* Keeps the pre-match copy legible over the pitch lines */
@media (min-width: 641px) {
  .stadium::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(10 10 10 / 0.85) 0%, rgb(10 10 10 / 0.45) 28%, transparent 42%);
  }
}

@media (max-width: 640px) {
  .l3-head {
    flex-wrap: wrap;
  }
  .l3-strap {
    order: -1;
    width: 100%;
    margin-left: 0;
    border-bottom: 1px solid var(--border);
  }
  .l3-strap span {
    padding: 0.45rem 0.75rem;
  }
  .l3-hero {
    width: 100%;
  }
}
.event-type {
  white-space: nowrap;
}

/* ── Build mode: scroll renders each piece from wireframe to on air ──
   Only active with JS and motion allowed (html.is-build). Each target carries
   --r from 0 (draft) to 1 (on air); without JS everything renders at 1. */
.is-build .headline,
.is-build .prematch-desc,
.is-build .l3 {
  position: relative;
}
.wire {
  position: absolute;
  inset: -0.6rem;
  z-index: 3;
  pointer-events: none;
  border: 1px dashed rgb(232 220 200 / 0.45);
  opacity: calc(1 - var(--r, 1));
}
.replay-frame .wire {
  inset: 0.75rem;
}
.wire-tag {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 1px);
  padding: 0.3rem 0.45rem;
  background: var(--cream);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
}
.replay-frame .wire-tag {
  bottom: auto;
  top: -1px;
}
.wire i {
  position: absolute;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--bg);
  border: 1px solid var(--cream);
}
.wire i:nth-of-type(1) { top: -0.25rem; left: -0.25rem; }
.wire i:nth-of-type(2) { top: -0.25rem; right: -0.25rem; }
.wire i:nth-of-type(3) { bottom: -0.25rem; left: -0.25rem; }
.wire i:nth-of-type(4) { bottom: -0.25rem; right: -0.25rem; }

/* Draft ink: copy starts as greyed placeholder text */
.is-build .headline {
  color: color-mix(in srgb, var(--text-primary) calc(var(--r, 1) * 100%), #4a4642);
}
.is-build .headline em {
  color: color-mix(in srgb, var(--cream) calc(var(--r, 1) * 100%), #4a4642);
}
.is-build .prematch-desc {
  color: color-mix(in srgb, var(--cream-muted) calc(var(--r, 1) * 100%), #4a4642);
}

/* Lower thirds: boxes fill in, strap gets its colour, CTA arrives last */
.is-build .l3-head {
  background-color: color-mix(in srgb, var(--bg) calc(var(--r, 1) * 100%), transparent);
}
.is-build .l3-body,
.is-build .l3 > .l3-desc {
  background-color: color-mix(in srgb, var(--bg-elevated) calc(var(--r, 1) * 100%), transparent);
}
.is-build .l3-strap {
  background-color: color-mix(in srgb, var(--cream) calc(var(--r, 1) * 100%), transparent);
  color: color-mix(in srgb, var(--bg) calc(var(--r, 1) * 100%), #6b6660);
}
.is-build .l3-name {
  color: color-mix(in srgb, var(--text-primary) calc(var(--r, 1) * 100%), #4a4642);
}
.is-build .l3-desc {
  color: color-mix(in srgb, var(--cream-muted) calc(var(--r, 1) * 100%), #4a4642);
}
.is-build .replay .l3-cta {
  opacity: clamp(0, calc(var(--r, 1) * 3 - 2), 1);
}

/* Replay frames: a crossed placeholder box, then the cover wipes in behind a stinger edge */
.is-build .replay-frame {
  background-image:
    linear-gradient(to top right, transparent calc(50% - 1px), #2c2a27 50%, transparent calc(50% + 1px)),
    linear-gradient(to bottom right, transparent calc(50% - 1px), #2c2a27 50%, transparent calc(50% + 1px));
}
.is-build .replay-frame img {
  clip-path: inset(0 calc((1 - var(--r, 1)) * 100%) 0 0);
}
.is-build .replay-frame::after {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: calc(var(--r, 1) * 100%);
  width: 0.9rem;
  margin-left: -0.45rem;
  background: var(--vermillion);
  transform: skewX(-14deg);
  opacity: clamp(0, calc(min(var(--r, 1), 1 - var(--r, 1)) * 30), 1);
  pointer-events: none;
}
.is-build .replay-badge,
.is-build .replay-minute {
  opacity: clamp(0, calc(var(--r, 1) * 4 - 3), 1);
}

/* Score bug in rehearsal until the pre-match is built */
.bug.is-draft .bug-live {
  background: transparent;
  color: var(--text-secondary);
}
.bug.is-draft .bug-dot {
  background: var(--text-secondary);
  animation: none;
}
.bug-live {
  transition: background-color 0.3s var(--ease-out-quart), color 0.3s var(--ease-out-quart);
}

/* ── 90+3' Extra time (easter egg) ─────────── */
.extra {
  margin-top: clamp(4rem, 10vh, 6rem);
}
.extra-board {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0.9rem 0.55rem 1rem;
  background: #050505;
  border: 1px solid var(--border);
  color: var(--cream-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out-quart);
}
.extra-board:hover,
.extra.is-open .extra-board {
  border-color: var(--cream-muted);
}
.extra-board-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--vermillion);
  text-shadow: 0 0 14px rgb(230 57 70 / 0.55);
  -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 58%);
  mask-image: radial-gradient(circle, #000 52%, transparent 58%);
  -webkit-mask-size: 4px 4px;
  mask-size: 4px 4px;
}
.is-build .extra:not(.is-called) .extra-board:not(:focus-visible) {
  opacity: 0;
  transform: translateY(1.5rem);
}
.is-build .extra-board {
  transition:
    opacity 0.5s var(--ease-out-quart),
    transform 0.8s var(--ease-out-expo),
    border-color 0.2s var(--ease-out-quart);
}
.extra-panel {
  margin-top: 2.5rem;
}
.extra-panel[hidden] {
  display: none;
}
.extra-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.extra-intro {
  margin-top: 0.75rem;
  color: var(--text-secondary);
}
.extra-list {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
}
.extra-list .l3 {
  width: auto;
}
.extra-list .l3-name {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}
@media (min-width: 900px) {
  .extra-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Drag and drop: components carried onto the canvas ── */
.is-build .replay {
  position: relative;
}
.drag-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  pointer-events: none;
  transform-origin: 4px 3px;
  will-change: transform;
}
.drag-cursor svg {
  width: 1.4rem;
  height: 1.4rem;
  margin: -3px 0 0 -4px;
  fill: var(--cream);
  stroke: var(--bg);
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 6px rgb(0 0 0 / 0.6));
}
.drag-cursor-tag {
  margin: 0.95rem 0 0 -0.2rem;
  padding: 0.25rem 0.5rem;
  background: var(--vermillion);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
/* Lifted while dragged: deeper shadow, selection frame turns solid */
.is-build .replay-frame,
.is-build .l3 {
  box-shadow: 0 calc(var(--lift, 0) * 28px) calc(var(--lift, 0) * 56px) calc(var(--lift, 0) * -12px) rgb(0 0 0 / calc(var(--lift, 0) * 0.85));
}
.is-build .prematch-desc .wire,
.is-build .l3 .wire,
.is-build .replay-frame .wire {
  border-color: color-mix(in srgb, var(--cream) calc(var(--lift, 0) * 100%), rgb(232 220 200 / 0.45));
}
