:root {
  --black: #0B0C0E;
  --red: #D50A0A;
  --red-dark: #7A0B08;
  --graphite: #1C2026;
  --steel: #3A424B;
  --silver: #C9D0D8;
  --white: #F4F6F8;
  --navy: #1B3550;
  --display: "Saira Condensed", "Arial Narrow", sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Roboto Mono", "Courier New", monospace;
  --skew: -8deg;
  --hair: rgba(244, 246, 248, 0.4);
  --metal: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, rgba(0, 0, 0, 0.06) 1px 4px), linear-gradient(160deg, #eef2f6 0%, #8f99a3 7%, #3b444e 22%, #6b7580 40%, #1c2026 56%, #4a535d 76%, #cfd6de 100%);
  --metal-dark: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, rgba(0, 0, 0, 0.07) 1px 3px), linear-gradient(180deg, #6d7781 0%, #3d4650 17%, #232a32 55%, #333b44 79%, #5a636d 100%);
  --chrome: linear-gradient(180deg, #ffffff 0%, #dbe2e9 18%, #9aa5b0 38%, #5c6670 50%, #e7edf3 68%, #aeb8c2 84%, #f4f7fa 100%);
  --rail-h: clamp(58px, 8.6vh, 96px);
  --lower-h: clamp(78px, 10.4vh, 118px);
  --ticker-h: clamp(38px, 5.2vh, 58px);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

#app {
  position: relative;
  display: grid;
  grid-template-rows: var(--rail-h) minmax(0, 1fr) var(--lower-h) var(--ticker-h);
  height: 100dvh;
  min-height: 320px;
  isolation: isolate;
}

#app::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../assets/gfx/stadium_real.webp") center 36% / cover no-repeat;
  filter: brightness(0.3) saturate(0.78) contrast(1.05);
  z-index: -2;
}

#app::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(85% 62% at 16% -6%, rgba(27, 53, 80, 0.72), rgba(27, 53, 80, 0) 62%),
    radial-gradient(48% 52% at 98% 58%, rgba(150, 84, 30, 0.2), rgba(0, 0, 0, 0) 72%),
    linear-gradient(180deg, rgba(11, 12, 14, 0.12) 0%, rgba(11, 12, 14, 0.68) 72%, rgba(11, 12, 14, 0.97) 100%);
  z-index: -1;
  pointer-events: none;
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.055) 2px 3px);
  opacity: 0.8;
}

/* ---------- header rail ---------- */

.rail {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1.2vh 3vw 0;
}

.rail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--hair);
}

.lockup {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.16em;
  margin: 0;
  padding: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 4.1vw, 66px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  transform: skewX(var(--skew));
  transform-origin: left center;
  white-space: nowrap;
  filter: drop-shadow(7px 7px 0 rgba(0, 0, 0, 0.52));
}

.lockup-espn {
  display: inline-block;
  padding: 0.05em 0.3em 0.1em 0.28em;
  color: var(--white);
  background: linear-gradient(100deg, #ec1717 0%, #d50a0a 44%, #9d0a08 100%);
  clip-path: polygon(5% 0, 100% 0, 94% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(244, 246, 248, 0.6);
  text-shadow: 2px 2px 0 rgba(70, 5, 4, 0.9);
}

.lockup-2k5 {
  display: inline-block;
  color: transparent;
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1.5px #0a0b0d;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.82));
  font-size: 1.06em;
}

.lockup-rule { display: none; }

.rail-right {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.7vw, 12px);
  flex: 0 0 auto;
}

.rail-btn {
  appearance: none;
  border: 1px solid rgba(201, 208, 216, 0.75);
  background: var(--metal-dark);
  color: var(--white);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(9px, 0.85vw, 13px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 15px;
  cursor: pointer;
  clip-path: polygon(9% 0, 100% 0, 91% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), 4px 4px 0 rgba(0, 0, 0, 0.55);
  transform: skewX(var(--skew));
  transition: background 120ms linear, color 120ms linear;
}

.rail-btn:hover { background: linear-gradient(180deg, #8a949e, #3d4650 60%, #6d7781); }
.rail-btn:active { background: var(--red); }

.back-btn { display: none; }

body.mode-game .back-btn,
body.mode-show .back-btn,
body.mode-panel .back-btn,
body.mode-final .back-btn { display: inline-block; }

.live-well {
  display: flex;
  align-items: center;
  gap: 9px;
  height: clamp(32px, 4.6vh, 48px);
  padding: 0 clamp(11px, 1.2vw, 20px);
  background: var(--metal-dark);
  border: 1px solid rgba(201, 208, 216, 0.8);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 5px 5px 0 rgba(0, 0, 0, 0.52);
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}

.live-clock {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(14px, 1.25vw, 21px);
  letter-spacing: 0.03em;
  color: var(--white);
  min-width: 4.2ch;
  text-align: right;
  text-shadow: 2px 2px 0 #000;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.live-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(8px, 0.7vw, 11px);
  letter-spacing: 0.26em;
  color: var(--silver);
}

/* ---------- main and menu ---------- */

.main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(220px, 27%) minmax(0, 1fr);
  gap: clamp(16px, 2.6vw, 44px);
  align-items: start;
  padding: 1.8vh 3vw;
  min-height: 0;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.2vh, 14px);
  width: 100%;
  max-width: 430px;
  height: min(58vh, 590px);
  justify-content: center;
  justify-self: start;
  padding-left: 4%;
}

.plate {
  position: relative;
  display: block;
  width: 100%;
  flex: 1 1 0;
  min-height: 34px;
  padding: 0;
  border: 0;
  background:
    linear-gradient(180deg, rgba(244, 246, 248, 0.62) 0 1px, rgba(244, 246, 248, 0) 1px),
    var(--metal-dark);
  clip-path: polygon(3.8% 0, 100% 0, 96.2% 100%, 0 100%);
  cursor: pointer;
  text-align: left;
  transform: translateX(0);
  transition: transform 120ms linear;
  filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.55));
}

.plate::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 7.5%;
  background: linear-gradient(90deg, #7a0b08 0%, #d50a0a 58%, #ff382a 100%);
  clip-path: polygon(0 0, 100% 0, 58% 100%, 0 100%);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.55);
}

.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.06) 0 1px, rgba(255, 255, 255, 0) 1.3px) 0 0 / 4px 4px;
  opacity: 0.3;
}

.plate-label {
  position: absolute;
  left: 15%;
  right: 8%;
  top: 50%;
  transform: translateY(-50%) skewX(var(--skew));
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(13px, 1.45vw, 24px);
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  pointer-events: none;
}

.plate:hover { filter: brightness(1.16) drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.55)); }
.plate:focus-visible { outline: 1px solid var(--white); outline-offset: 3px; }
.plate.is-selected { transform: translateX(3px); }
.plate.is-selected::before {
  width: 8.6%;
  background: linear-gradient(90deg, #d50a0a 0%, #ff2d1f 62%, #ff6a52 100%);
}
.plate.is-selected .plate-label { color: #ffffff; }

/* ---------- spotlight frame ---------- */

.spotlight {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 506;
  max-height: 100%;
  align-self: start;
  margin-top: 3.2vh;
  min-width: 0;
  background: var(--metal);
  clip-path: polygon(2.6% 0, 100% 0, 100% 100%, 0 100%, 0 8.5%);
  padding: clamp(8px, 0.8vw, 13px);
  filter: drop-shadow(10px 12px 0 rgba(0, 0, 0, 0.55));
}

.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.07) 0 1px, rgba(255, 255, 255, 0) 1.3px) 0 0 / 4px 4px;
  opacity: 0.35;
  z-index: 3;
}

.frame-inner {
  position: absolute;
  left: 3.2%;
  right: 2.4%;
  top: 8.5%;
  bottom: 6.5%;
  overflow: hidden;
  background: #050607;
  box-shadow:
    inset 0 0 0 2px var(--red),
    inset 0 0 0 3px rgba(244, 246, 248, 0.55),
    inset 0 0 0 4px rgba(0, 0, 0, 0.8),
    inset 0 0 0 6px rgba(0, 0, 0, 0.55);
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 0 100%, 0 16%);
  z-index: 1;
}

.frame-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.045) 2px 3px);
  opacity: 0.7;
}

.menu-view {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* team plates and down banner */

.team {
  position: absolute;
  top: 1.6%;
  width: 30%;
  height: 14.5%;
  background: linear-gradient(180deg, #ec1717 0%, #c20a0a 46%, #8e0a08 78%, #650705 100%);
  clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(244, 246, 248, 0.55), inset 0 0 0 3px rgba(0, 0, 0, 0.28);
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.5));
}

.team.home { left: 16.5%; }
.team.away { right: 1.5%; background: linear-gradient(180deg, #4a535d 0%, #2c333b 46%, #1c2026 78%, #101318 100%); }

.team-abbr {
  position: absolute;
  left: 26%;
  top: 46%;
  transform: translateY(-50%) skewX(var(--skew));
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(9px, 1.05vw, 18px);
  letter-spacing: 0.12em;
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.team-score {
  position: absolute;
  right: 18%;
  top: 42%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(12px, 1.25vw, 22px);
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.down-banner {
  position: absolute;
  left: 34%;
  top: 1.6%;
  width: 32%;
  height: 12.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--metal-dark);
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(244, 246, 248, 0.75), inset 0 -1px 0 rgba(244, 246, 248, 0.4);
}

.down-banner > span {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(9px, 1.25vw, 21px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 2px 2px 0 #000;
}

/* photographic cut-outs */

.portrait {
  position: absolute;
  left: 3.6%;
  top: 17%;
  width: 16%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 24%;
  background: #050607;
  border: 2px solid #c9d0d8;
  outline: 1px solid #7a0b08;
  outline-offset: -4px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  z-index: 2;
}

.athlete {
  position: absolute;
  right: 6%;
  bottom: 0;
  height: 82%;
  width: auto;
  z-index: 3;
  filter:
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.42))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.22))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.32))
    drop-shadow(7px 6px 0 rgba(0, 0, 0, 0.5));
}

.helmet {
  position: absolute;
  right: 1%;
  top: 17%;
  width: 16.5%;
  height: auto;
  z-index: 2;
  filter:
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.5))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.25))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.4))
    drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.5));
}

.football {
  position: absolute;
  left: 2.5%;
  bottom: 24%;
  width: 17%;
  height: auto;
  z-index: 2;
  transform: rotate(-7deg);
  filter:
    drop-shadow(1px 0 0 rgba(255, 255, 255, 0.42))
    drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.2))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.3))
    drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.5));
}

.stat-grid {
  position: absolute;
  left: 26.5%;
  bottom: 5%;
  width: 24%;
  height: 30%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5%;
  z-index: 2;
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4%;
  min-width: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.tile-dark { background: linear-gradient(180deg, #2c333c 0%, #171b20 52%, #0d1014 100%); }
.tile-red { background: linear-gradient(180deg, #ec1717 0%, #c20a0a 46%, #8e0a08 100%); }
.tile-steel { background: linear-gradient(180deg, #5d6771 0%, #3a424b 46%, #252c34 100%); }
.tile-outline { background: rgba(11, 12, 14, 0.6); box-shadow: inset 0 0 0 1px rgba(244, 246, 248, 0.75), 3px 3px 0 rgba(0, 0, 0, 0.5); }

.stat-k {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(5.5px, 0.56vw, 9px);
  letter-spacing: 0.12em;
  color: var(--silver);
  white-space: nowrap;
  line-height: 1;
}

.stat-v {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(12px, 1.25vw, 21px);
  color: var(--white);
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.tile-red .stat-k, .tile-red .stat-v { color: var(--white); }
.tile-outline .stat-k { color: var(--silver); }

/* ---------- game window ---------- */

.game-window {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 3;
  background: #050607;
  visibility: hidden;
  touch-action: none;
}

.game-window canvas { display: block; }

.game-window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(201, 208, 216, 0.1) 0%, rgba(201, 208, 216, 0) 34%, rgba(0, 0, 0, 0) 62%, rgba(122, 80, 34, 0.1) 100%),
    radial-gradient(120% 88% at 50% 44%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(180deg, rgba(27, 53, 80, 0.16) 0%, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0.3) 100%);
}

body.mode-game .game-window,
body.mode-show .game-window { visibility: visible; }

body.mode-game .menu-view,
body.mode-show .menu-view,
body.mode-panel .menu-view,
body.mode-final .menu-view { display: none; }

.game-hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  pointer-events: none;
}

body.mode-game .game-hud { display: block; }

.live-down {
  position: absolute;
  left: 50%;
  top: calc(var(--rail-h) + 8px);
  width: clamp(150px, 30vw, 340px);
  height: clamp(30px, 5.8vh, 60px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--metal-dark);
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(244, 246, 248, 0.7), inset 0 -1px 0 rgba(244, 246, 248, 0.4), 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.live-down > span {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(9px, 1vw, 17px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 2px 2px 0 #000;
}

.game-tags {
  position: absolute;
  left: 3%;
  top: calc(var(--rail-h) + 10px);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(7px, 0.62vw, 10px);
  letter-spacing: 0.2em;
  color: var(--silver);
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000;
}

.game-tags .sep { width: 1px; height: 11px; background: var(--hair); }

.stamina {
  position: absolute;
  left: 3.2%;
  bottom: calc(var(--lower-h) + var(--ticker-h) + 12px);
  width: 15%;
  height: 14px;
  background: linear-gradient(180deg, #1c2026 0%, #050607 55%, #0d1014 100%);
  border: 1px solid rgba(201, 208, 216, 0.7);
  box-shadow: inset 0 0 0 1px #000, 3px 3px 0 rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.stamina::before {
  content: "WIND";
  position: absolute;
  z-index: 3;
  left: 0;
  top: -17px;
  padding: 2px 5px;
  background: linear-gradient(180deg, #3a424b, #1c2026);
  border: 1px solid rgba(244, 246, 248, 0.42);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
  transform: skewX(var(--skew));
  font-family: var(--display);
  font-weight: 600;
  font-size: 7px;
  letter-spacing: 0.18em;
  color: var(--silver);
  text-shadow: 1px 1px 0 #000;
}

.stamina::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0 8px, rgba(0, 0, 0, 0.5) 8px 9px);
}

.stamina > span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7a0b08 0%, #d50a0a 55%, #ff4a38 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: width 80ms linear;
}

/* ---------- halftime ---------- */

.show-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  pointer-events: none;
}

body.mode-show .show-layer { display: block; }

.show-title {
  position: absolute;
  left: 50%;
  top: calc(var(--rail-h) + 10px);
  transform: translateX(-50%) skewX(var(--skew));
  background: linear-gradient(180deg, #ec1717, #b00a09 60%, #7a0b08);
  padding: 6px 30px 5px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(244, 246, 248, 0.55);
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
}

.show-title > span {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(16px, 2.2vw, 34px);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.65);
  white-space: nowrap;
}

.show-story {
  position: absolute;
  left: 50%;
  top: calc(var(--rail-h) + 58px);
  transform: translateX(-50%);
  width: min(78%, 760px);
  padding: 7px 14px;
  background: rgba(11, 12, 14, 0.66);
  border-left: 3px solid var(--red);
  font-size: clamp(10px, 0.92vw, 14px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--white);
  text-align: center;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
}

.hype-wrap {
  position: absolute;
  left: 4%;
  bottom: calc(var(--lower-h) + var(--ticker-h) + 12px);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hype-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(8px, 0.7vw, 11px);
  letter-spacing: 0.26em;
  color: var(--silver);
  text-shadow: 2px 2px 0 #000;
}

.hype-bar {
  width: clamp(90px, 12vw, 180px);
  height: 8px;
  border: 1px solid var(--hair);
  background: rgba(11, 12, 14, 0.7);
  overflow: hidden;
}

.hype-bar > span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--red);
  transition: width 100ms linear;
}

.show-skip {
  position: absolute;
  right: 4%;
  top: calc(var(--rail-h) + 12px);
  pointer-events: auto;
  appearance: none;
  border: 1px solid var(--hair);
  background: var(--metal-dark);
  color: var(--white);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(8px, 0.72vw, 11px);
  letter-spacing: 0.16em;
  padding: 7px 15px;
  cursor: pointer;
  clip-path: polygon(9% 0, 100% 0, 91% 100%, 0 100%);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
}

.show-skip:hover { background: linear-gradient(180deg, #8a949e, #3d4650 60%, #6d7781); }

/* ---------- tap prompt ---------- */

.tap-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

body.mode-game .tap-layer.is-on { display: flex; }

.tap-layer > span {
  display: inline-block;
  padding: 8px 22px;
  background: rgba(11, 12, 14, 0.8);
  border: 1px solid var(--hair);
  border-left: 4px solid var(--red);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(11px, 1.1vw, 18px);
  letter-spacing: 0.2em;
  color: var(--white);
  text-transform: uppercase;
  transform: skewX(var(--skew));
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55);
  text-shadow: 2px 2px 0 #000;
}

body.mode-game .tap-layer.is-on {
  align-items: flex-end;
  padding-bottom: calc(var(--lower-h) + var(--ticker-h) + 58px);
  justify-content: center;
}

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

.panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  overflow: auto;
  padding: clamp(26px, 4vh, 44px) clamp(18px, 3vw, 40px) clamp(16px, 3vh, 32px) clamp(38px, 5vw, 64px);
  background:
    linear-gradient(112deg, rgba(28, 32, 38, 0.97), rgba(11, 12, 14, 0.985) 42%),
    var(--black);
  border-left: 1px solid var(--hair);
  scrollbar-color: var(--steel) transparent;
}

body.mode-panel .panel,
body.mode-final .panel { display: block; }

.panel .kicker {
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(8px, 0.7vw, 11px);
  letter-spacing: 0.32em;
  color: var(--silver);
  text-transform: uppercase;
}

.panel h2 {
  margin: 2px 0 8px;
  padding-left: 12px;
  border-left: 6px solid var(--red);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 2.4vw, 36px);
  line-height: 0.98;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: skewX(var(--skew));
  transform-origin: left center;
  color: var(--white);
  text-shadow: 3px 3px 0 #000;
}

.panel p {
  margin: 6px 0;
  max-width: 72ch;
  font-size: clamp(11px, 0.95vw, 14px);
  line-height: 1.5;
  color: rgba(244, 246, 248, 0.86);
}

.panel .dim { color: var(--silver); }
.panel .red { color: #ff5a4a; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.kit-btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #ec1717, #c20a0a 55%, #8e0a08);
  color: var(--white);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(11px, 0.95vw, 14px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 22px;
  cursor: pointer;
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  transform: skewX(var(--skew));
}

.kit-btn:hover { background: linear-gradient(180deg, #ff2d1f, #d50a0a 55%, #a00b09); }

.kit-btn.ghost {
  background: var(--metal-dark);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6), inset 0 0 0 1px var(--hair);
}

.kit-btn.ghost:hover { background: linear-gradient(180deg, #8a949e, #3d4650 60%, #6d7781); }

.story-card {
  position: relative;
  margin: 12px 0;
  padding: 14px 16px 14px 18px;
  background: linear-gradient(100deg, rgba(28, 32, 38, 0.97), rgba(11, 12, 14, 0.92));
  border: 1px solid rgba(244, 246, 248, 0.22);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.55);
}

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

.story-card .week {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(9px, 0.75vw, 11px);
  letter-spacing: 0.16em;
  color: var(--silver);
}

.story-card h3 {
  margin: 2px 0 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(18px, 1.8vw, 26px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}

.chapter-list { display: grid; gap: 6px; margin: 10px 0; }

.chapter {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(28, 32, 38, 0.74);
  border-left: 3px solid var(--steel);
}

.chapter.open { border-left-color: var(--red); }
.chapter.current { background: rgba(58, 66, 75, 0.5); }
.chapter.locked { opacity: 0.45; }

.chapter .num { font-family: var(--mono); font-weight: 700; font-size: 16px; color: #ff5a4a; }
.chapter .name { font-family: var(--display); font-weight: 700; font-size: clamp(12px, 1.05vw, 16px); letter-spacing: 0.08em; text-transform: uppercase; color: var(--white); }
.chapter .meta { font-family: var(--body); font-weight: 600; font-size: 9px; letter-spacing: 0.16em; color: var(--silver); text-transform: uppercase; }

.board-table { margin-top: 10px; border-top: 1px solid var(--hair); }

.board-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid rgba(244, 246, 248, 0.16);
}

.board-row.head { font-family: var(--display); font-weight: 600; font-size: 10px; letter-spacing: 0.2em; color: var(--silver); text-transform: uppercase; }
.board-rank { font-family: var(--mono); font-weight: 700; font-size: 14px; color: #ff5a4a; }
.board-name { font-family: var(--body); font-weight: 600; font-size: 13px; color: var(--white); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.board-name:hover { color: #ff5a4a; }
.board-score { font-family: var(--mono); font-weight: 700; font-size: 15px; text-align: right; color: var(--white); }
.board-row.mine { background: rgba(213, 10, 10, 0.14); }

.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 2px; border-bottom: 1px solid rgba(244, 246, 248, 0.16); }
.opt-row .opt-label { font-family: var(--display); font-weight: 700; font-size: clamp(12px, 1vw, 15px); letter-spacing: 0.1em; text-transform: uppercase; }
.opt-row .opt-value { font-family: var(--mono); font-weight: 700; font-size: 13px; color: #ff5a4a; letter-spacing: 0.06em; }
.opt-row .opt-note { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 0.04em; color: var(--silver); }

.final-board { display: flex; align-items: flex-end; gap: clamp(10px, 2vw, 28px); margin: 6px 0 2px; }
.final-score { font-family: var(--mono); font-weight: 700; font-size: clamp(44px, 7vw, 92px); line-height: 0.9; letter-spacing: -0.02em; color: var(--white); text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.7); }
.final-score.away { color: var(--silver); }
.final-dash { font-family: var(--mono); font-weight: 700; font-size: clamp(24px, 3vw, 42px); color: var(--red); padding-bottom: clamp(6px, 1vw, 14px); }
.final-word { display: inline-block; margin-top: 8px; padding: 4px 18px; background: var(--red); clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); font-family: var(--display); font-weight: 800; font-size: clamp(15px, 1.6vw, 24px); letter-spacing: 0.22em; text-transform: uppercase; transform: skewX(var(--skew)); }
.final-word.loss { background: var(--steel); }
.final-athlete { float: right; width: 21%; max-width: 180px; margin: 0 0 10px 16px; filter: drop-shadow(5px 6px 0 rgba(0, 0, 0, 0.5)); }

.controls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 12px 0; }
.control-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(244, 246, 248, 0.14); }
.control-key { min-width: 76px; font-family: var(--mono); font-weight: 700; font-size: 11px; color: #ff5a4a; text-transform: uppercase; }
.control-what { font-size: 12px; color: rgba(244, 246, 248, 0.86); }

/* ---------- wipe ---------- */

.wipe {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  transform: translateX(-115%);
  background: linear-gradient(90deg, rgba(11, 12, 14, 0) 0%, var(--red) 6%, var(--white) 13%, var(--graphite) 15%, var(--graphite) 72%, var(--red-dark) 72%, var(--red) 86%, rgba(11, 12, 14, 0) 94%);
  opacity: 0;
}

.wipe.run { animation: wipeSweep 480ms linear forwards; }

@keyframes wipeSweep {
  0% { transform: translateX(-115%); opacity: 1; }
  100% { transform: translateX(115%); opacity: 1; }
}

/* ---------- lower third ---------- */

.lower {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 0 3vw 0.6vh;
  min-height: 0;
}

.lower-kit {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.8vw, 14px);
  width: min(92vw, 1420px);
  margin: 0 auto;
  padding: 5px clamp(8px, 1vw, 16px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0 1px, rgba(0, 0, 0, 0.1) 1px 2px, rgba(255, 255, 255, 0) 2px),
    linear-gradient(180deg, #333b44 0%, #161a1f 46%, #0c0f13 62%, #272e36 100%);
  border-top: 1px solid rgba(244, 246, 248, 0.6);
  border-bottom: 1px solid rgba(244, 246, 248, 0.4);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.5);
  transform: translateY(130%);
  animation: kitIn 420ms linear 240ms forwards;
}

@keyframes kitIn { to { transform: translateY(0); } }

.kit-logo {
  position: relative;
  flex: 0 0 auto;
  height: clamp(38px, 5.8vh, 58px);
  width: clamp(48px, 5.8vw, 82px);
  display: grid;
  place-items: center;
  background: linear-gradient(100deg, #ec1717, #c20a0a 50%, #8e0a08);
  clip-path: polygon(12% 0, 100% 0, 86% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(244, 246, 248, 0.5);
}

.kit-logo > span {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(14px, 1.5vw, 25px);
  letter-spacing: 0.04em;
  color: var(--white);
  transform: skewX(var(--skew));
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}

.kit-score {
  position: relative;
  flex: 1 1 auto;
  min-width: 120px;
  height: clamp(38px, 5.8vh, 58px);
  display: flex;
  align-items: center;
  padding: 0 clamp(12px, 2vw, 30px);
  border-left: 1px solid rgba(244, 246, 248, 0.25);
  border-right: 1px solid rgba(244, 246, 248, 0.25);
}

.kit-slots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
}

.kit-team { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.kit-team > b { font-family: var(--display); font-weight: 700; font-size: clamp(8px, 0.8vw, 13px); letter-spacing: 0.16em; color: var(--silver); text-transform: uppercase; }
.kit-team > i { font-family: var(--mono); font-weight: 700; font-style: normal; font-size: clamp(16px, 1.6vw, 27px); color: var(--white); text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5); line-height: 1; }

.kit-clock {
  flex: 0 0 auto;
  height: clamp(38px, 5.8vh, 58px);
  width: clamp(76px, 8.4vw, 124px);
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #0a0c0f, #040506);
  border: 1px solid rgba(201, 208, 216, 0.7);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.6);
}

.kit-clock > span {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(15px, 1.5vw, 25px);
  color: var(--white);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.kit-arrow {
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-left: clamp(14px, 1.5vw, 24px) solid var(--red);
  border-top: clamp(9px, 1vw, 15px) solid transparent;
  border-bottom: clamp(9px, 1vw, 15px) solid transparent;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.6));
}

.kit-dots { display: flex; align-items: center; gap: clamp(4px, 0.5vw, 8px); flex: 0 0 auto; }
.kit-dots > span { width: clamp(7px, 0.75vw, 11px); height: clamp(7px, 0.75vw, 11px); border-radius: 50%; border: 1px solid rgba(244, 246, 248, 0.65); background: transparent; }
.kit-dots > span.on { background: var(--white); border-color: var(--white); }

.hint-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(94vw, 1440px);
  margin: 0 auto;
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(7px, 0.62vw, 10px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 246, 248, 0.68);
  white-space: nowrap;
}

.hint-line > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.hint-tag { color: var(--silver); flex: 0 0 auto; }

/* ---------- ticker ---------- */

.ticker {
  position: relative;
  z-index: 6;
  overflow: hidden;
  background: linear-gradient(180deg, #191d22 0%, #070809 46%, #050607 62%, #12161a 100%);
  border-top: 1px solid rgba(244, 246, 248, 0.45);
  border-bottom: 6px solid #050607;
  display: flex;
  align-items: center;
  padding-left: 12px;
}

.ticker::before {
  z-index: 2;
  content: "";
  position: absolute;
  left: 12px;
  top: 4px;
  bottom: 4px;
  width: 9.5%;
  background: linear-gradient(100deg, #ec1717 0%, #d50a0a 48%, #8e0a08 100%);
  clip-path: polygon(0 0, 100% 0, 72% 100%, 0 100%);
  box-shadow: inset -1px 0 0 rgba(244, 246, 248, 0.5);
  z-index: 2;
}

.ticker::after {
  content: "";
  position: absolute;
  left: calc(9.5% + 34px);
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: rgba(244, 246, 248, 0.3);
  z-index: 3;
}

.ticker-window {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 100%;
  margin-left: calc(9.5% + 34px);
  width: calc(100% - (9.5% + 34px));
  overflow: hidden;
}

.ticker-track {
  position: relative;
  z-index: 1;
  display: flex;
  width: max-content;
  animation: crawl 58s linear infinite;
  will-change: transform;
}

.ticker-run {
  padding-right: 44px;
  font-family: var(--body);
  font-weight: 600;
  font-size: clamp(11px, 1.05vw, 18px);
  letter-spacing: 0.04em;
  color: var(--white);
  white-space: nowrap;
  text-shadow: 1px 1px 0 #000;
  font-variant-numeric: tabular-nums;
}

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

/* ---------- touch action ---------- */

.touch-action {
  position: fixed;
  right: 3.4vw;
  bottom: calc(var(--ticker-h) + var(--lower-h) + 10px);
  z-index: 40;
  width: clamp(66px, 8vw, 92px);
  height: clamp(66px, 8vw, 92px);
  appearance: none;
  border: 5px solid transparent;
  color: var(--white);
  background:
    linear-gradient(180deg, #ff3a2a 0%, #d50a0a 46%, #8e0a08 100%) padding-box,
    linear-gradient(145deg, #ffffff 0%, #9aa5b0 16%, #3a424b 38%, #cfd6de 64%, #1c2026 100%) border-box;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(12px, 1.1vw, 17px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.65);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  cursor: pointer;
  touch-action: manipulation;
}

.touch-action > span {
  display: block;
  transform: skewX(var(--skew));
  letter-spacing: 0.12em;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.4);
}

.touch-action::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 8%;
  top: 8%;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.12));
  transform: skewX(var(--skew));
}

.touch-action::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 6%;
  bottom: 8%;
  height: 2px;
  background: rgba(244, 246, 248, 0.6);
}

.touch-action:active {
  background:
    linear-gradient(180deg, #ff5a4a 0%, #ff2d1f 46%, #a00b09 100%) padding-box,
    linear-gradient(145deg, #ffffff 0%, #9aa5b0 16%, #3a424b 38%, #cfd6de 64%, #1c2026 100%) border-box;
}
.touch-action[hidden] { display: none; }

/* ---------- full page game / show ---------- */

body.mode-game .main,
body.mode-show .main {
  grid-template-columns: minmax(0, 1fr);
  padding: 1.2vh 2.4vw;
}

body.mode-game .menu,
body.mode-show .menu { display: none; }

body.mode-game .spotlight,
body.mode-show .spotlight {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  aspect-ratio: auto;
  margin: 0;
  padding: 0;
  max-height: none;
  align-self: stretch;
  background: none;
  clip-path: none;
  filter: none;
  z-index: 1;
}

body.mode-game .spotlight::after,
body.mode-show .spotlight::after { display: none; }

body.mode-game .frame-inner,
body.mode-show .frame-inner {
  position: fixed;
  inset: 0;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: #050607;
  clip-path: none;
  box-shadow: none;
  overflow: hidden;
}

body.mode-game .game-window,
body.mode-show .game-window {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  clip-path: none;
  visibility: visible;
  z-index: 1;
}

body.mode-game .game-hud,
body.mode-show .game-hud { position: fixed; inset: 0; z-index: 4; }

body.mode-panel .main { grid-template-columns: minmax(200px, 24%) minmax(0, 1fr); }
body.mode-panel .spotlight {
  aspect-ratio: auto;
  height: 100%;
  margin-top: 0;
  max-height: none;
  align-self: stretch;
  min-height: 0;
}

body.mode-final .spotlight {
  aspect-ratio: auto;
  height: 100%;
  margin-top: 0;
  max-height: none;
  align-self: stretch;
}

body.mode-final .main { grid-template-columns: minmax(0, 1fr); padding: 1.2vh 2.4vw; }
body.mode-final .menu { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .main {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px 12px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .spotlight { order: 1; margin-top: 0; align-self: start; aspect-ratio: 1024 / 506; }
  body.mode-menu .main { align-content: center; }

  .menu {
    order: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    max-width: none;
    height: auto;
    padding-left: 0;
  }

  .plate { flex: none; height: clamp(32px, 7.4vw, 48px); }
  .plate-label { font-size: clamp(9px, 2.4vw, 13px); left: 14%; }

  body.mode-game .main,
  body.mode-show .main,
  body.mode-final .main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 6px 8px;
  }

  body.mode-game .spotlight,
  body.mode-show .spotlight,
  body.mode-final .spotlight {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    min-height: 0;
  }

  body.mode-panel .main { display: flex; flex-direction: column; overflow: hidden; }
  body.mode-panel .spotlight { flex: 1 1 auto; height: auto; aspect-ratio: auto; min-height: 0; width: 100%; }
  body.mode-panel .menu { display: none; }

  .lower { padding: 0 8px 3px; }
  .lower-kit { width: 100%; gap: 4px; padding: 4px 6px; }
  .kit-logo, .kit-score, .kit-clock { height: clamp(32px, 8vw, 44px); }
  .kit-logo { width: clamp(40px, 10vw, 56px); }
  .kit-clock { width: clamp(62px, 17vw, 96px); }
  .kit-score { min-width: 90px; padding: 0 8px; }
  .kit-dots { display: none; }
  .hint-line { font-size: 7px; letter-spacing: 0.1em; }
  .hint-line .hint-tag { display: none; }

  .ticker { padding-left: 12px; }
  .ticker-window { margin-left: calc(12% + 34px); width: calc(100% - (12% + 34px)); }
  .ticker::before { left: 12px; width: 12%; }
  .ticker::after { left: calc(12% + 34px); }
  .ticker-run { font-size: clamp(10px, 2.7vw, 13px); padding-right: 28px; }

  .touch-action { right: 12px; bottom: calc(var(--ticker-h) + var(--lower-h) + 8px); }

  .lockup { font-size: clamp(22px, 7.2vw, 40px); }
  .rail { padding: 6px 10px 0; gap: 6px; }

  .show-title > span { font-size: clamp(13px, 3.6vw, 22px); }
  .show-story { font-size: clamp(9px, 2.3vw, 12px); width: 86%; }
  .controls-grid { grid-template-columns: 1fr; }
  .panel { padding: 54px 16px 18px 34px; }
  .panel h2 { font-size: clamp(17px, 4.6vw, 26px); }
  .panel p { font-size: 11px; }
  .board-row { grid-template-columns: 30px minmax(0, 1fr) 64px; }
  .final-athlete { width: 30%; }
}

@media (max-width: 460px) {
  .lockup { font-size: 20px; }
  .rail-btn { font-size: 8px; padding: 5px 8px; letter-spacing: 0.08em; }
  .live-well { padding: 0 8px; gap: 5px; height: 28px; }
  .live-clock { font-size: 12px; }
  .live-word { font-size: 7px; letter-spacing: 0.16em; }
  .live-dot { width: 6px; height: 6px; }
  .kit-arrow { display: none; }
  .stat-k { font-size: 5.5px; }
  .stat-v { font-size: 10px; }
  .plate-label { font-size: 9px; letter-spacing: 0.08em; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .main { padding-top: 4px; padding-bottom: 4px; }
  .menu { height: min(72vh, 420px); gap: 4px; }
  .spotlight { margin-top: 0; }
  .lower-kit { height: auto; }
  .hint-line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wipe.run { animation-duration: 1ms; }
  .lower-kit { animation-duration: 1ms; }
  .ticker-track { animation-duration: 120s; }
}

@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  .main {
    display: grid;
    grid-template-columns: minmax(150px, 30%) minmax(0, 1fr);
    gap: 10px;
    padding: 4px 12px;
    overflow: hidden;
    align-content: stretch;
  }
  body.mode-menu .main { align-content: stretch; }
  .menu {
    order: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    height: auto;
    max-width: none;
    padding-left: 0;
  }
  .plate {
    flex: 1 1 0;
    height: auto;
    min-height: 24px;
  }
  .plate-label {
    font-size: clamp(9px, 1.55vw, 14px);
    letter-spacing: 0.1em;
  }
  .spotlight {
    order: 2;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    margin-top: 0;
    align-self: stretch;
    max-height: none;
    min-height: 0;
  }
}

/* ---------- broadcast chrome over the live field ---------- */

.game-frame {
  position: absolute;
  inset: calc(var(--rail-h) + 4px) 6px calc(var(--lower-h) + var(--ticker-h) + 4px) 6px;
  z-index: 1;
  pointer-events: none;
  border-top: 2px solid rgba(201, 208, 216, 0.55);
  border-bottom: 2px solid rgba(201, 208, 216, 0.4);
  border-left: 3px solid var(--steel);
  border-right: 3px solid var(--steel);
  box-shadow:
    inset 0 1px 0 rgba(213, 10, 10, 0.34),
    inset 0 -1px 0 rgba(213, 10, 10, 0.28),
    inset 1px 0 0 rgba(213, 10, 10, 0.28),
    inset -1px 0 0 rgba(213, 10, 10, 0.28);
}

.gf-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 0 solid var(--silver);
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.55));
}
.gf-corner::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(213, 10, 10, 0.72);
}
.gf-corner.tl { left: -1px; top: -1px; border-top-width: 3px; border-left-width: 3px; }
.gf-corner.tr { right: -1px; top: -1px; border-top-width: 3px; border-right-width: 3px; }
.gf-corner.bl { left: -1px; bottom: -1px; border-bottom-width: 3px; border-left-width: 3px; }
.gf-corner.br { right: -1px; bottom: -1px; border-bottom-width: 3px; border-right-width: 3px; }
.gf-corner.tl::after, .gf-corner.tr::after { border-bottom: 0; }
.gf-corner.bl::after, .gf-corner.br::after { border-top: 0; }
.gf-corner.tl::after, .gf-corner.bl::after { border-right: 0; }
.gf-corner.tr::after, .gf-corner.br::after { border-left: 0; }

.game-left {
  position: absolute;
  left: 2.4%;
  top: calc(var(--rail-h) + 36px);
  width: clamp(72px, 23vw, 150px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 5px 5px 7px;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgba(58, 66, 75, 0.96) 0%, rgba(28, 32, 38, 0.97) 34%, rgba(11, 12, 14, 0.98) 100%);
  border: 1px solid rgba(244, 246, 248, 0.42);
  border-left: 3px solid var(--red);
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.55));
}

.game-portrait {
  margin: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #050607;
  border: 2px solid var(--silver);
  outline: 1px solid var(--red-dark);
  outline-offset: -5px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.58);
}

.game-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.game-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
  width: 100%;
}

.game-stat-grid .stat {
  padding: 2px 1px;
  gap: 0;
  min-height: 0;
}
.game-stat-grid .stat-k {
  font-size: clamp(4.5px, 0.6vw, 7px);
  letter-spacing: 0.05em;
}
.game-stat-grid .stat-v {
  font-size: clamp(8px, 1.5vw, 14px);
}

.game-football {
  position: absolute;
  left: 2.4%;
  bottom: calc(var(--lower-h) + var(--ticker-h) + 34px);
  width: clamp(58px, 18vw, 140px);
  height: auto;
  z-index: 2;
  pointer-events: none;
  transform: rotate(-8deg);
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.52));
}

.game-right {
  position: absolute;
  right: 1.4%;
  top: calc(var(--rail-h) + 34px);
  width: clamp(90px, 24vw, 150px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

.game-helmet {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(5px 5px 0 rgba(0, 0, 0, 0.55));
}

body.mode-game .stamina { left: calc(2.4% + clamp(58px, 18vw, 140px) + 14px); width: 13%; }

@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  .game-left {
    top: calc(var(--rail-h) + 10px);
    width: 74px;
    gap: 3px;
    padding: 4px;
  }
  .game-portrait { width: 64px; }
  .game-stat-grid { gap: 2px; }
  .game-stat-grid .stat-k { font-size: 4px; }
  .game-stat-grid .stat-v { font-size: 8px; }
  .game-football { left: 2.2%; bottom: calc(var(--lower-h) + var(--ticker-h) + 30px); width: 64px; }
  .game-right { top: calc(var(--rail-h) + 8px); width: 58px; gap: 0; }
  .game-right .game-show-thumb, .game-right .game-promo { display: none; }
  .game-tags { display: none; }
  body.mode-game .stamina { left: calc(2.2% + 64px + 12px); width: 13%; }
}

.game-promo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px 4px;
  background: rgba(11, 12, 14, 0.82);
  border: 1px solid rgba(244, 246, 248, 0.34);
  border-left: 2px solid var(--red);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(4.5px, 0.68vw, 7px);
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--silver);
  white-space: nowrap;
}
.game-promo > span { display: flex; align-items: center; gap: 3px; }
.game-promo > span::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  background: var(--red);
}

.game-window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.065;
  mix-blend-mode: overlay;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  .game-promo { font-size: 4px; padding-top: 2px; gap: 1px; }
}

.game-scoreboard-mini {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border: 1px solid rgba(244, 246, 248, 0.42);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(5px, 0.72vw, 8px);
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}
.mini-team {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 3px;
  min-width: 0;
}
.mini-team b { font-weight: 700; color: var(--white); }
.mini-team i {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 700;
  font-size: clamp(7px, 1vw, 10px);
  color: var(--white);
}
.mini-team.home { background: linear-gradient(180deg, #d50a0a, #8e0a08); }
.mini-team.away { background: linear-gradient(180deg, #3a424b, #1c2026); color: var(--silver); }

.game-show-thumb {
  margin: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: clamp(56px, 15vw, 92px);
  overflow: hidden;
  background: linear-gradient(180deg, #15131a 0%, #050607 100%);
  border: 1px solid rgba(244, 246, 248, 0.4);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  padding: 2px;
}
.game-show-thumb img {
  display: block;
  width: 33.33%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.6));
}
.show-thumb-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1px 0;
  background: linear-gradient(180deg, #d50a0a, #7a0b08);
  color: var(--white);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(4px, 0.6vw, 6px);
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}
.game-show-thumb { position: relative; }
.game-promo b { font-weight: 700; color: var(--white); }

body.mode-game .game-window canvas {
  filter: contrast(1.06) saturate(0.92) brightness(0.98);
}

/* ---------- side choice, control tip, virtual stick ---------- */

.side-switch {
  position: fixed;
  left: 50%;
  top: calc(var(--rail-h) + 64px);
  transform: translateX(-50%);
  z-index: 41;
  display: none;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.side-switch.is-on { display: flex; }

.side-btn {
  appearance: none;
  border: 1px solid rgba(201, 208, 216, 0.8);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0 1px, rgba(255, 255, 255, 0) 1px),
    linear-gradient(180deg, #3a424b 0%, #1a1f25 55%, #0b0e12 100%);
  color: var(--silver);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(9px, 0.8vw, 12px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  clip-path: polygon(9% 0, 100% 0, 91% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), 4px 4px 0 rgba(0, 0, 0, 0.5);
  transform: skewX(var(--skew));
  transition: background 160ms cubic-bezier(.2, .8, .2, 1), color 160ms linear, box-shadow 160ms ease;
}

.side-btn:hover { color: var(--white); background: linear-gradient(180deg, #56616c 0%, #2a313a 55%, #161b21 100%); }

.side-btn.is-on {
  color: #06101c;
  background: linear-gradient(180deg, #ffffff 0%, #cfe8ff 52%, #8fc9ff 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), 0 0 18px rgba(111, 182, 255, 0.55), 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.side-btn:active { transform: skewX(var(--skew)) scale(0.96); }

.control-tip {
  position: fixed;
  left: 50%;
  bottom: calc(var(--ticker-h) + var(--lower-h) + 54px);
  transform: translateX(-50%) skewX(var(--skew));
  z-index: 40;
  display: none;
  padding: 5px 14px;
  background: rgba(8, 11, 15, 0.82);
  border: 1px solid rgba(201, 208, 216, 0.55);
  border-left: 3px solid #6fb6ff;
  color: var(--white);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(9px, 0.78vw, 12px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 14px rgba(111, 182, 255, 0.18), 3px 3px 0 rgba(0, 0, 0, 0.55);
  pointer-events: none;
  white-space: nowrap;
}

.control-tip.is-on { display: block; }

.stick-layer {
  position: fixed;
  left: 0;
  top: 0;
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  z-index: 39;
  display: none;
  pointer-events: none;
}

.stick-layer.is-on { display: block; }

.stick-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(201, 220, 240, 0.55);
  background: radial-gradient(circle, rgba(10, 14, 20, 0.25) 0%, rgba(10, 14, 20, 0.42) 70%, rgba(10, 14, 20, 0) 72%);
  box-shadow: inset 0 0 18px rgba(111, 182, 255, 0.22), 0 0 14px rgba(0, 0, 0, 0.35);
}

.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.95), rgba(160, 206, 245, 0.75) 46%, rgba(58, 78, 100, 0.9) 100%);
  box-shadow: 0 0 16px rgba(111, 182, 255, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transition: transform 40ms linear;
}

/* ---------- PlayStation 5 style finish ---------- */

.plate {
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1), filter 220ms cubic-bezier(.2, .8, .2, 1);
}

.plate.is-selected {
  transform: translateX(6px);
  filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 0 16px rgba(111, 182, 255, 0.32));
}

.plate.is-selected .plate-label {
  color: #ffffff;
  text-shadow: 2px 2px 0 #000, 0 0 12px rgba(111, 182, 255, 0.65);
}

.plate.is-selected::before {
  background: linear-gradient(90deg, #d50a0a 0%, #ff2d1f 48%, #ffd9c9 100%);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.7), 0 0 12px rgba(255, 45, 31, 0.6);
}

.plate:active { transform: translateX(4px) scale(0.985); }

.rail-btn, .kit-btn, .show-skip {
  transition: background 160ms cubic-bezier(.2, .8, .2, 1), color 160ms linear, box-shadow 160ms ease, transform 140ms cubic-bezier(.2, .8, .2, 1);
}

.kit-btn:active, .rail-btn:active { transform: skewX(var(--skew)) scale(0.96); }
.show-skip:active { transform: scale(0.95); }

.panel { animation: panelIn 220ms cubic-bezier(.2, .8, .2, 1); }

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

body.mode-game .game-hud { animation: hudIn 260ms cubic-bezier(.2, .8, .2, 1); }

@keyframes hudIn {
  from { opacity: 0; transform: scale(1.012); }
  to { opacity: 1; transform: scale(1); }
}

.stamina {
  height: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0 1px, rgba(255, 255, 255, 0) 2px),
    linear-gradient(180deg, #20262d 0%, #050607 55%, #0d1014 100%);
  box-shadow: inset 0 0 0 1px #000, inset 0 0 10px rgba(111, 182, 255, 0.12), 3px 3px 0 rgba(0, 0, 0, 0.55);
}

.stamina > span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0 2px, rgba(255, 255, 255, 0) 3px),
    linear-gradient(90deg, #7a0b08 0%, #d50a0a 45%, #ff4a38 78%, #ffd9c9 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 10px rgba(255, 74, 56, 0.35);
  transition: width 90ms cubic-bezier(.2, .8, .2, 1);
}

.touch-action {
  transition: transform 130ms cubic-bezier(.2, .8, .2, 1), box-shadow 130ms ease, filter 130ms linear;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.65), 0 0 22px rgba(111, 182, 255, 0.26), inset 0 0 18px rgba(255, 255, 255, 0.12);
}

.touch-action:active {
  transform: scale(0.93);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6), 0 0 30px rgba(111, 182, 255, 0.5), inset 0 0 22px rgba(255, 255, 255, 0.2);
}

.live-down {
  box-shadow: inset 0 1px 0 rgba(244, 246, 248, 0.7), inset 0 -1px 0 rgba(244, 246, 248, 0.4), 3px 3px 0 rgba(0, 0, 0, 0.55), 0 0 18px rgba(111, 182, 255, 0.16);
}

body[data-side="defence"] .live-down {
  box-shadow: inset 0 1px 0 rgba(244, 246, 248, 0.7), inset 0 -1px 0 rgba(244, 246, 248, 0.4), 3px 3px 0 rgba(0, 0, 0, 0.55), 0 0 18px rgba(111, 182, 255, 0.35);
}

@media (max-width: 900px) {
  .side-switch { top: calc(var(--rail-h) + 52px); gap: 4px; }
  .side-btn { padding: 7px 12px; font-size: 9px; }
  .control-tip { bottom: calc(var(--ticker-h) + var(--lower-h) + 46px); font-size: 8px; padding: 4px 10px; }
}

body.mode-game #hint,
body.mode-show #hint {
  color: var(--white);
  font-size: clamp(9px, 1.02vw, 12px);
  letter-spacing: 0.12em;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

@media (orientation: landscape) {
  .side-switch.is-on {
    top: auto;
    bottom: calc(var(--ticker-h) + var(--lower-h) + 16px);
  }
  body.mode-game .tap-layer.is-on {
    display: none;
  }
}

/* halftime video replaces the drawn band scene */
.show-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050607;
  z-index: 0;
}

.show-layer .show-title,
.show-layer .show-story,
.show-layer .hype-wrap,
.show-layer .show-skip {
  z-index: 2;
}

@media (max-width: 420px) {
  body.mode-game { --lower-h: clamp(92px, 13.4vh, 118px); }
  body.mode-game .hint-line { white-space: normal; }
  body.mode-game .hint-line > span:first-child { overflow: visible; text-overflow: clip; }
}
