:root {
  color-scheme: light;
  --ink: #16171c;
  --muted: #646873;
  --line: #d7ddd8;
  --paper: #f4eddc;
  --court: #2ea37e;
  --court-deep: #16785f;
  --kitchen: #e56f57;
  --team-a: #ffd43d;
  --team-b: #51b7ff;
  --panel: #fff9e9;
  --shadow: 0 22px 60px rgba(17, 20, 23, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 212, 61, 0.22), transparent 22%),
    radial-gradient(circle at 84% 4%, rgba(81, 183, 255, 0.2), transparent 24%),
    linear-gradient(90deg, rgba(22, 23, 28, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(22, 23, 28, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  width: min(1180px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0;
  display: grid;
  grid-template-rows: auto auto minmax(360px, 1fr) auto auto;
  gap: 14px;
}

.version-vault,
.vault-stage,
.trainer-panel {
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: 6px 6px 0 var(--ink);
}

.version-vault {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.version-vault h2 {
  margin: 3px 0 4px;
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
  line-height: 1;
}

.version-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.version-tabs button {
  min-height: 48px;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 950;
}

.version-tabs button.active {
  background: #d7ff3f;
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.version-tabs small {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 950;
}

.vault-stage {
  display: none;
  min-height: 650px;
  padding: 10px;
}

.vault-stage.show {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.vault-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vault-stage iframe {
  width: 100%;
  min-height: 620px;
  border: 3px solid var(--ink);
  background: #ffffff;
}

body.vault-open .scorebar,
body.vault-open .court-wrap,
body.vault-open .hud,
body.vault-open .trainer-panel,
body.vault-open .league-panel {
  display: none;
}

.scorebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.team-score,
.serve-pill,
.turn-card,
.side-panel {
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: 6px 6px 0 var(--ink);
}

.team-score {
  min-height: 82px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: transform 160ms ease, background 160ms ease;
}

.team-score::before {
  content: "";
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border: 4px solid var(--ink);
  background:
    linear-gradient(90deg, #ffffff 0 18%, transparent 18% 24%, #ffffff 24% 42%, transparent 42% 58%, #ffffff 58% 76%, transparent 76% 82%, #ffffff 82% 100%),
    linear-gradient(#000000 0 100%);
  box-shadow: 3px 3px 0 var(--ink);
}

.team-score-a {
  border-left: 12px solid var(--team-a);
}

.team-score-b {
  border-right: 12px solid var(--team-b);
}

.team-score-b::before {
  order: 2;
}

.team-label {
  min-width: 0;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.team-score strong {
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.8;
}

.serve-pill {
  min-width: 118px;
  padding: 14px 18px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 950;
}

.court-wrap {
  min-height: 360px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  place-items: stretch;
  perspective: 1450px;
}

.view-switch {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--ink);
}

.view-switch span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.view-switch button {
  min-height: 30px;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.view-switch button.active {
  background: #d7ff3f;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.stadium {
  position: relative;
  min-height: 455px;
  overflow: hidden;
  border: 4px solid var(--ink);
  background:
    radial-gradient(circle at 17% 7%, rgba(255, 235, 148, 0.78), transparent 19%),
    radial-gradient(circle at 84% 10%, rgba(214, 244, 255, 0.82), transparent 20%),
    linear-gradient(#1b2028 0 15%, #46505a 15% 24%, #8fc1ad 24% 26%, #28553f 26% 100%);
  box-shadow: var(--shadow);
}

.stadium::before {
  content: "";
  position: absolute;
  inset: 15% 1% 5%;
  border-radius: 50% / 9%;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(28deg, rgba(22, 23, 28, 0.15) 1px, transparent 1px),
    #244936;
  background-size: 30px 30px;
  transform: perspective(900px) rotateX(58deg);
  transform-origin: center bottom;
}

.stadium::after {
  content: "NOUNS BROADCAST VIEW";
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 9;
  padding: 7px 10px;
  border: 3px solid var(--ink);
  background: #fff9e9;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-view="corner"] .stadium::after {
  content: "NOUNS CORNER CAM";
}

body[data-view="coach"] .stadium::after {
  content: "NOUNS COACH VIEW";
}

.crowd {
  position: absolute;
  left: 0;
  right: 0;
  height: 68px;
  z-index: 1;
  background:
    radial-gradient(circle, #ffd43d 0 4px, transparent 5px) 0 13px / 31px 23px,
    radial-gradient(circle, #51b7ff 0 4px, transparent 5px) 12px 25px / 37px 25px,
    radial-gradient(circle, #e56f57 0 4px, transparent 5px) 22px 11px / 43px 22px,
    radial-gradient(circle, #ffffff 0 3px, transparent 4px) 18px 36px / 49px 22px,
    linear-gradient(90deg, transparent 0 9px, #000000 9px 17px, transparent 17px 23px, #000000 23px 31px, transparent 31px) 4px 7px / 62px 38px,
    #20242b;
  border-bottom: 4px solid var(--ink);
}

.crowd-top {
  top: 0;
}

.crowd-bottom {
  bottom: 0;
  height: 58px;
  border-top: 4px solid var(--ink);
  border-bottom: 0;
  transform: perspective(760px) rotateX(44deg);
  transform-origin: center bottom;
}

.stadium-lights {
  position: absolute;
  top: 52px;
  z-index: 3;
  width: 80px;
  height: 104px;
  border-left: 4px solid var(--ink);
  border-top: 4px solid var(--ink);
  opacity: 0.9;
}

.stadium-lights::before {
  content: "";
  position: absolute;
  left: -17px;
  top: -17px;
  width: 72px;
  height: 22px;
  border: 3px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, #fff7b8 0 10px, #d7ff3f 10px 20px);
  box-shadow: 0 0 35px rgba(255, 247, 184, 0.74);
}

.stadium-lights::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 19px;
  width: 42px;
  height: 18px;
  border: 3px solid #000000;
  background:
    linear-gradient(90deg, #ffffff 0 18%, #000000 18% 27%, #ff3737 27% 45%, #000000 45% 56%, #ffffff 56% 73%, #000000 73% 82%, #3157ff 82% 100%);
  box-shadow: 2px 2px 0 #000000;
}

.lights-left {
  left: 7%;
}

.lights-right {
  right: 7%;
  transform: scaleX(-1);
}

.sideline {
  position: absolute;
  top: 33%;
  bottom: 11%;
  z-index: 2;
  width: 86px;
  background:
    linear-gradient(90deg, transparent 0 12px, rgba(0, 0, 0, 0.9) 12px 18px, transparent 18px 25px, rgba(0, 0, 0, 0.9) 25px 31px, transparent 31px) 8px 12px / 70px 42px,
    linear-gradient(108deg, rgba(22, 23, 28, 0.24) 2px, transparent 2px) 0 0 / 18px 18px,
    #eadfc2;
  border: 3px solid var(--ink);
  transform: perspective(820px) rotateX(58deg);
}

.sideline-left {
  left: 3%;
  transform-origin: right bottom;
}

.sideline-right {
  right: 3%;
  transform-origin: left bottom;
}

.court {
  position: relative;
  overflow: hidden;
  width: min(1010px, 92vw);
  min-height: 320px;
  height: min(40vw, 410px);
  margin: 58px auto 28px;
  border: 4px solid var(--ink);
  background:
    radial-gradient(ellipse at 52% 84%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(112deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(22deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    var(--court);
  background-size: 34px 34px;
  box-shadow:
    0 14px 0 #1b6550,
    0 14px 0 4px var(--ink),
    0 32px 42px rgba(0, 0, 0, 0.3);
  transform: rotate(-1.2deg);
  transform-origin: center bottom;
  z-index: 4;
}

.court::before,
.court::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.court::before {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 18% 82%, rgba(0, 0, 0, 0.12)),
    radial-gradient(ellipse at 50% 102%, rgba(0, 0, 0, 0.16), transparent 42%);
  mix-blend-mode: multiply;
}

.court::after {
  z-index: 9;
  border: 3px solid rgba(255, 255, 255, 0.45);
  inset: 3.7%;
  box-shadow: inset 0 0 0 2px rgba(22, 23, 28, 0.18);
}

.noun-endmark {
  position: absolute;
  left: 13%;
  right: 13%;
  z-index: 3;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(22, 23, 28, 0.72);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.18)),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(22, 23, 28, 0.14) 24px 28px);
  color: rgba(22, 23, 28, 0.72);
  font-size: clamp(1rem, 2.4vw, 1.7rem);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.noun-endmark-top {
  top: 10.5%;
}

.noun-endmark-bottom {
  bottom: 10.5%;
}

.noun-court-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 116px;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 7px 8px;
  border: 4px solid var(--ink);
  background: #fff9e9;
  box-shadow: 5px 5px 0 rgba(22, 23, 28, 0.42);
  transform: translate(-50%, -50%) rotate(3deg);
  pointer-events: none;
}

.noun-court-logo span {
  width: 58px;
  height: 24px;
  border: 4px solid #000000;
  background:
    linear-gradient(90deg, #ffffff 0 17%, #000000 17% 25%, #e6382e 25% 42%, #000000 42% 58%, #ffffff 58% 75%, #000000 75% 83%, #2f5bff 83% 100%);
  box-shadow: 3px 3px 0 #000000;
}

.noun-court-logo strong {
  font-size: 0.84rem;
  line-height: 1;
  letter-spacing: 0;
}

.court.impact {
  animation: court-impact 260ms steps(2, end);
}

.court.rally-glow {
  animation: rally-glow 520ms ease;
}

body[data-view="corner"] .stadium {
  min-height: 440px;
}

body[data-view="corner"] .stadium::before {
  inset: 18% -4% 6%;
  transform: perspective(900px) rotateX(61deg) rotateZ(-4deg);
}

body[data-view="corner"] .sideline {
  transform: perspective(820px) rotateX(60deg) rotateZ(-4deg);
}

body[data-view="corner"] .court {
  width: min(920px, 84vw);
  min-height: 305px;
  height: min(39vw, 390px);
  margin-top: 52px;
  box-shadow:
    -16px 20px 0 #1b6550,
    -16px 20px 0 4px var(--ink),
    0 34px 42px rgba(0, 0, 0, 0.32);
  transform: rotateX(44deg) rotateZ(-6deg) skewX(-3deg);
}

body[data-view="corner"] .court::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 15% 85%, rgba(0, 0, 0, 0.16)),
    radial-gradient(ellipse at 18% 92%, rgba(0, 0, 0, 0.22), transparent 36%);
}

body[data-view="coach"] .stadium {
  min-height: 425px;
}

body[data-view="coach"] .stadium::before,
body[data-view="coach"] .sideline,
body[data-view="coach"] .crowd-bottom {
  transform: none;
}

body[data-view="coach"] .court {
  width: min(960px, 90vw);
  min-height: 330px;
  height: min(38vw, 390px);
  margin-top: 42px;
  transform: none;
  box-shadow:
    0 10px 0 #1b6550,
    0 10px 0 4px var(--ink),
    0 24px 30px rgba(0, 0, 0, 0.22);
}

body[data-view="coach"] .player {
  width: clamp(50px, 6.8vw, 76px);
}

body[data-view="coach"] .noun-endmark,
body[data-view="coach"] .noun-court-logo {
  opacity: 0.78;
}

.court-zone {
  position: absolute;
  left: 5.5%;
  right: 5.5%;
  z-index: 1;
}

.zone-baseline-top {
  top: 7%;
  height: 34%;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 48%),
    #2fa982;
}

.court.zone-serve-top .zone-baseline-top,
.court.zone-rally-top .zone-baseline-top,
.court.zone-serve-bottom .zone-baseline-bottom,
.court.zone-rally-bottom .zone-baseline-bottom,
.court.zone-kitchen .zone-kitchen-top,
.court.zone-kitchen .zone-kitchen-bottom {
  animation: zone-focus 1.1s ease-in-out infinite;
}

.zone-kitchen-top {
  top: 41%;
  height: 9%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 50%),
    color-mix(in srgb, var(--kitchen) 84%, white);
}

.zone-kitchen-bottom {
  top: 50%;
  height: 9%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.25), transparent 50%),
    color-mix(in srgb, var(--kitchen) 76%, white);
}

.zone-baseline-bottom {
  top: 59%;
  height: 34%;
  background:
    linear-gradient(0deg, rgba(255, 255, 255, 0.18), transparent 52%),
    #2aa17d;
}

.court.zone-transition-top .zone-baseline-top,
.court.zone-transition-bottom .zone-baseline-bottom {
  background:
    linear-gradient(to bottom, transparent 0 48%, rgba(255, 240, 166, 0.52) 48% 76%, transparent 76%),
    #4da98f;
  animation: zone-focus 820ms ease-in-out infinite;
}

.court-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(25, 26, 31, 0.12);
}

.center-line {
  width: 3px;
  transform: translateX(-50%);
}

.center-line.top {
  left: 50%;
  top: 7%;
  height: 34%;
}

.center-line.bottom {
  left: 50%;
  top: 59%;
  height: 34%;
}

.sideline-court {
  top: 7%;
  width: 4px;
  height: 86%;
}

.sideline-court.left {
  left: 5.5%;
}

.sideline-court.right {
  right: 5.5%;
}

.baseline {
  left: 5.5%;
  right: 5.5%;
  height: 4px;
}

.baseline.top {
  top: 7%;
}

.baseline.bottom {
  bottom: 7%;
}

.kitchen-top,
.kitchen-bottom {
  left: 5.5%;
  right: 5.5%;
  height: 3px;
}

.kitchen-top {
  top: 41%;
}

.kitchen-bottom {
  bottom: 41%;
}

.net {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 50%;
  z-index: 115;
  height: 20px;
  transform: translateY(-50%);
  background:
    repeating-linear-gradient(90deg, transparent 0 15px, rgba(22, 23, 28, 0.52) 15px 18px),
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(22, 23, 28, 0.24) 7px 9px),
    #f4f1e9;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform-origin: center;
  box-shadow: 0 8px 0 rgba(22, 23, 28, 0.14);
}

.net.ripple {
  animation: net-ripple 360ms cubic-bezier(.2,.75,.22,1);
}

.net-post {
  position: absolute;
  top: 47%;
  z-index: 116;
  width: 12px;
  height: 68px;
  background: #f4f1e9;
  border: 3px solid var(--ink);
  box-shadow: 4px 7px 0 rgba(22, 23, 28, 0.2);
}

.post-left {
  left: 2.4%;
}

.post-right {
  right: 2.4%;
}

.ref-chair {
  position: absolute;
  right: 1.5%;
  top: 41%;
  z-index: 130;
  width: 38px;
  height: 72px;
  border: 3px solid var(--ink);
  background:
    linear-gradient(#fff0a6 0 22px, transparent 22px),
    linear-gradient(90deg, transparent 0 11px, var(--ink) 11px 14px, transparent 14px 24px, var(--ink) 24px 27px, transparent 27px);
  transform: skewY(-7deg);
  box-shadow: 5px 8px 0 rgba(22, 23, 28, 0.2);
}

.broadcast-banner {
  --x: 50%;
  --y: 50%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 170;
  min-width: 124px;
  max-width: 260px;
  padding: 8px 11px;
  border: 3px solid var(--ink);
  background: #fff0a6;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-size: clamp(0.9rem, 1.8vw, 1.25rem);
  font-weight: 950;
  line-height: 1;
  opacity: 0;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) scale(0.72) rotate(-3deg);
  pointer-events: none;
}

.broadcast-banner.show {
  animation: broadcast-pop 920ms cubic-bezier(.2,.75,.22,1);
}

.pressure-meter {
  position: absolute;
  left: 50%;
  bottom: 2.2%;
  z-index: 165;
  width: min(300px, 42%);
  min-height: 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 5px 8px;
  border: 2px solid var(--ink);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.72rem;
  font-weight: 950;
  transform: translateX(-50%);
}

.pressure-meter div {
  position: relative;
  height: 12px;
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, var(--team-a), #ffffff 48% 52%, var(--team-b));
}

.pressure-meter i {
  --advantage: 50%;
  position: absolute;
  left: var(--advantage);
  top: 50%;
  width: 12px;
  height: 22px;
  border: 2px solid var(--ink);
  background: #d7ff3f;
  transform: translate(-50%, -50%);
  transition: left 260ms cubic-bezier(.2,.75,.22,1);
}

.rally-map {
  position: absolute;
  left: 4.5%;
  top: 4%;
  z-index: 165;
  display: flex;
  gap: 5px;
  align-items: center;
  max-width: 43%;
  min-height: 24px;
  padding: 4px 6px;
  border: 2px solid var(--ink);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}

.rally-map span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.58rem;
  font-weight: 950;
  line-height: 1;
}

.rally-map .team-a {
  background: var(--team-a);
}

.rally-map .team-b {
  background: var(--team-b);
}

.target-preview {
  --x: 50%;
  --y: 50%;
  --color: #d7ff3f;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 122;
  width: 62px;
  aspect-ratio: 1;
  border: 3px dashed var(--ink);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 18%, transparent 19%),
    radial-gradient(circle, color-mix(in srgb, var(--color) 66%, white) 0 46%, transparent 47%);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--color) 40%, transparent);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  pointer-events: none;
}

.target-preview.show {
  animation: target-lock 780ms ease-in-out infinite;
  opacity: 1;
}

.court-callout {
  --x: 50%;
  --y: 50%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 168;
  max-width: 150px;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  background: #eef9ff;
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 1;
  opacity: 0;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -150%) rotate(-2deg);
  pointer-events: none;
}

.court-callout.show {
  opacity: 1;
}

.speed-lines {
  --x: 50%;
  --y: 50%;
  --angle: 0deg;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 124;
  width: 132px;
  height: 74px;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--angle));
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255, 255, 255, 0.92) 18% 44%, transparent 44%) 0 13px / 100% 5px no-repeat,
    linear-gradient(90deg, transparent 0 28%, rgba(215, 255, 63, 0.92) 28% 60%, transparent 60%) 0 34px / 100% 5px no-repeat,
    linear-gradient(90deg, transparent 0 12%, rgba(255, 255, 255, 0.82) 12% 34%, transparent 34%) 0 55px / 100% 5px no-repeat;
}

.speed-lines.show {
  animation: speed-lines 420ms ease-out;
}

.court-toast {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 175;
  min-width: 96px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  background: #fff0a6;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  font-weight: 950;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.75) rotate(-3deg);
}

.court-toast.show {
  animation: toast-pop 760ms cubic-bezier(.2,.75,.22,1);
}

.shot-trace {
  --x1: 50%;
  --y1: 50%;
  --x2: 50%;
  --y2: 50%;
  position: absolute;
  left: var(--x1);
  top: var(--y1);
  z-index: 123;
  width: max(36px, var(--trace-length, 120px));
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(215, 255, 63, 0), rgba(215, 255, 63, 0.95), #ffffff);
  box-shadow: 0 0 14px rgba(215, 255, 63, 0.8);
  opacity: 0;
  transform: translate(-2px, -50%) rotate(var(--trace-angle, 0deg));
  transform-origin: left center;
  pointer-events: none;
}

.shot-trace.live {
  animation: trace-flash 520ms ease;
}

.bounce-marker {
  --x: 50%;
  --y: 50%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 124;
  width: 38px;
  aspect-ratio: 1;
  border: 3px solid #d7ff3f;
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.42);
  pointer-events: none;
}

.bounce-marker.show {
  animation: bounce-ring 620ms ease;
}

.landing-label {
  --x: 50%;
  --y: 50%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 168;
  min-width: 54px;
  padding: 4px 7px;
  border: 2px solid var(--ink);
  background: #ffffff;
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 950;
  opacity: 0;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%) scale(0.74) rotate(-4deg);
  pointer-events: none;
}

.landing-label.show {
  animation: landing-label 700ms cubic-bezier(.2,.75,.22,1);
}

.player {
  --x: 50%;
  --y: 50%;
  --depth-scale: 1;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 120;
  width: clamp(58px, 8.5vw, 96px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(var(--depth-scale));
  transition: left 280ms cubic-bezier(.2,.75,.22,1), top 280ms cubic-bezier(.2,.75,.22,1), transform 180ms ease, filter 180ms ease;
}

.player::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2%;
  z-index: -1;
  width: 84%;
  height: 20%;
  border-radius: 999px;
  background: rgba(22, 23, 28, 0.28);
  filter: blur(3px);
  transform: translateX(-50%) skewX(-18deg);
}

.player::after {
  content: "";
  position: absolute;
  right: -7%;
  top: 44%;
  width: 16px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 10px 10px 14px 14px;
  background: var(--team-a);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-24deg);
  transform-origin: center 80%;
}

.player-b::after {
  background: var(--team-b);
  left: -7%;
  right: auto;
  transform: rotate(24deg);
}

.player.active {
  filter: drop-shadow(0 0 0.8rem rgba(255, 255, 255, 0.95));
  transform: translate(-50%, -50%) scale(calc(var(--depth-scale) + 0.12));
}

.player.ready {
  animation: player-ready 240ms cubic-bezier(.2,.75,.22,1);
}

.player.cover {
  animation: player-cover 420ms cubic-bezier(.2,.75,.22,1);
}

.player.recover {
  animation: player-recover 360ms cubic-bezier(.2,.75,.22,1);
}

.player.swing {
  animation: player-swing 420ms cubic-bezier(.2,.75,.22,1);
}

.player.swing::after {
  animation: paddle-swing 420ms cubic-bezier(.2,.75,.22,1);
}

.player.smash-swing {
  animation: player-smash 430ms cubic-bezier(.2,.75,.22,1);
}

.player.smash-swing::after {
  animation: paddle-smash 430ms cubic-bezier(.2,.75,.22,1);
}

.player.dink-swing {
  animation: player-dink 420ms cubic-bezier(.2,.75,.22,1);
}

.player.dink-swing::after {
  animation: paddle-dink 420ms cubic-bezier(.2,.75,.22,1);
}

.player.lob-swing {
  animation: player-lob 560ms cubic-bezier(.2,.75,.22,1);
}

.player.lob-swing::after {
  animation: paddle-lob 560ms cubic-bezier(.2,.75,.22,1);
}

.player img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  filter:
    drop-shadow(3px 4px 0 rgba(22, 23, 28, 0.35))
    saturate(1.08);
}

.p0 { --x: 32%; --y: 78%; }
.p1 { --x: 68%; --y: 70%; }
.p2 { --x: 32%; --y: 30%; }
.p3 { --x: 68%; --y: 22%; }

.ball {
  --x: 31%;
  --y: 72%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 150;
  width: clamp(18px, 2.7vw, 28px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d7ff3f;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink), 0 0 22px rgba(215, 255, 63, 0.62);
  transform: translate(-50%, -50%);
  transition: left 220ms ease, top 220ms ease;
  will-change: left, top, transform;
}

.ball.squash {
  animation: ball-squash 210ms cubic-bezier(.2,.75,.22,1);
}

.ball-shadow {
  --x: 31%;
  --y: 72%;
  --scale: 1;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 118;
  width: clamp(22px, 3vw, 34px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(22, 23, 28, 0.3);
  filter: blur(3px);
  transform: translate(-50%, -18%) scale(var(--scale)) skewX(-18deg);
  opacity: 0.8;
  transition: left 220ms ease, top 220ms ease;
  pointer-events: none;
}

.ball::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(215, 255, 63, 0.72), rgba(215, 255, 63, 0));
  opacity: 0;
  transform: scale(0.7);
}

.ball.in-flight {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.66), 2px 2px 0 var(--ink);
}

.ball.in-flight::after {
  animation: ball-glow 520ms ease infinite;
}

.ball.shot-smash {
  background: #fff07a;
}

.ball.shot-lob {
  background: #c8fffb;
}

.ball.shot-drive {
  background: #ffed66;
}

.ball.shot-drop,
.ball.shot-dink {
  background: #d7ff3f;
}

.hud {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(260px, 0.95fr);
  gap: 14px;
  align-items: stretch;
}

.controls {
  grid-column: 1 / -1;
  grid-row: 1;
}

.turn-card {
  grid-column: 1;
  grid-row: 2;
}

.side-panel {
  grid-column: 2;
  grid-row: 2;
}

.turn-card,
.side-panel {
  padding: 14px;
}

.rally-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.shot-planner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.shot-planner strong,
.shot-planner span {
  min-height: 28px;
  display: grid;
  align-items: center;
  padding: 5px 7px;
  border: 2px solid var(--ink);
  background: #eef9ff;
  font-size: 0.74rem;
  font-weight: 950;
  line-height: 1.1;
}

.shot-planner strong {
  grid-column: span 2;
  background: #fff0a6;
  text-transform: uppercase;
}

.trainer-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(260px, 0.75fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.trainer-panel h2 {
  margin: 3px 0 4px;
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
  line-height: 1;
}

.trainer-controls {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.trainer-controls select {
  min-height: 42px;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font: inherit;
  font-weight: 950;
}

.trainer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 72px)) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.trainer-stats span,
.trainer-stats p {
  min-height: 50px;
  margin: 0;
  display: grid;
  align-content: center;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  background: #eef9ff;
  color: var(--ink);
  font-weight: 950;
}

.trainer-stats strong,
.trainer-stats small {
  display: block;
  line-height: 1;
}

.trainer-stats small {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.trainer-stats p {
  background: #fff0a6;
  font-size: 0.84rem;
  line-height: 1.08;
}

.trainer-panel .secondary.active,
.controls button.trainer-shot {
  background: #d7ff3f;
}

body.trainer-live .league-panel {
  opacity: 0.72;
}

body.trainer-live .target-preview.trainer-target {
  border-style: solid;
  animation-duration: 560ms;
}

.rally-strip span {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 4px 7px;
  border: 2px solid var(--ink);
  background: #ffffff;
  font-size: 0.76rem;
  font-weight: 950;
}

.rally-strip span.hot {
  background: #d7ff3f;
}

.minor {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 5px 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.02;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

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

.controls button,
.secondary {
  cursor: pointer;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: #ffffff;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 100ms ease, box-shadow 100ms ease, background 100ms ease;
}

.controls button {
  min-height: 74px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  justify-items: start;
  gap: 8px;
  font-weight: 900;
  transform-origin: center;
  text-align: left;
}

.controls .icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--team-a);
  box-shadow: 2px 2px 0 var(--ink);
  line-height: 1;
}

.controls button.recommended {
  background: #fff0a6;
  animation: recommend-pulse 880ms steps(2, end) infinite;
}

.shot-odds {
  min-height: 18px;
  padding: 2px 6px;
  border: 2px solid var(--ink);
  background: #eef9ff;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 950;
  justify-self: end;
  text-align: center;
}

.controls button:hover,
.secondary:hover {
  background: #fff0a6;
  transform: translate(-1px, -1px);
}

.controls button:active,
.secondary:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}

.controls button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.score-pop {
  animation: score-pop 560ms cubic-bezier(.2,.75,.22,1);
}

@keyframes player-swing {
  0% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
  35% { transform: translate(-50%, -54%) scale(1.16) rotate(-6deg); }
  70% { transform: translate(-50%, -48%) scale(1.03) rotate(4deg); }
  100% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
}

@keyframes player-ready {
  0% { transform: translate(-50%, -50%) scale(1); }
  55% { transform: translate(-50%, -45%) scale(1.08, 0.92); }
  100% { transform: translate(-50%, -50%) scale(1.03); }
}

@keyframes player-recover {
  0% { transform: translate(-50%, -50%) scale(1.05) rotate(0deg); }
  45% { transform: translate(-52%, -51%) scale(0.96, 1.08) rotate(-3deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

@keyframes player-cover {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  38% { transform: translate(-46%, -50%) scale(1.06, 0.96); }
  68% { transform: translate(-54%, -48%) scale(0.98, 1.05); }
}

@keyframes player-smash {
  0% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
  20% { transform: translate(-50%, -62%) scale(1.14, 0.95) rotate(7deg); }
  52% { transform: translate(-50%, -42%) scale(1.22, 1.05) rotate(-10deg); }
  72% { transform: translate(-50%, -48%) scale(1.08) rotate(5deg); }
  100% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
}

@keyframes player-dink {
  0% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
  30% { transform: translate(-50%, -52%) scale(1.08, 0.96) rotate(-2deg); }
  62% { transform: translate(-50%, -47%) scale(1.02, 1.08) rotate(3deg); }
  100% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
}

@keyframes player-lob {
  0% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
  25% { transform: translate(-50%, -54%) scale(1.06, 0.96) rotate(-5deg); }
  56% { transform: translate(-50%, -60%) scale(1.15) rotate(7deg); }
  100% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
}

@keyframes paddle-swing {
  0%, 100% { transform: rotate(-24deg); }
  50% { transform: translate(10px, -5px) rotate(48deg); }
}

@keyframes paddle-smash {
  0% { transform: translate(0, 0) rotate(-62deg); }
  44% { transform: translate(11px, -18px) rotate(18deg); }
  72% { transform: translate(13px, 7px) rotate(68deg); }
  100% { transform: translate(0, 0) rotate(-24deg); }
}

@keyframes paddle-dink {
  0%, 100% { transform: rotate(-24deg); }
  58% { transform: translate(8px, 4px) rotate(8deg); }
}

@keyframes paddle-lob {
  0%, 100% { transform: rotate(-24deg); }
  46% { transform: translate(3px, -15px) rotate(-78deg); }
  72% { transform: translate(8px, -19px) rotate(-38deg); }
}

@keyframes court-impact {
  0%, 100% { transform: rotateX(7deg) translate(0, 0); }
  25% { transform: rotateX(7deg) translate(3px, -2px); }
  50% { transform: rotateX(7deg) translate(-2px, 2px); }
  75% { transform: rotateX(7deg) translate(2px, 1px); }
}

@keyframes rally-glow {
  0%, 100% { filter: brightness(1); }
  48% { filter: brightness(1.08) saturate(1.14); }
}

@keyframes zone-focus {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16) saturate(1.15); }
}

@keyframes net-ripple {
  0%, 100% { transform: translateY(-50%) scaleY(1); }
  26% { transform: translateY(-50%) scaleY(1.5) skewX(-5deg); }
  62% { transform: translateY(-50%) scaleY(0.78) skewX(4deg); }
}

@keyframes ball-glow {
  0%, 100% { opacity: 0.18; transform: scale(0.78); }
  50% { opacity: 0.75; transform: scale(1.28); }
}

@keyframes ball-squash {
  0% { transform: translate(-50%, -50%) scale(1); }
  38% { transform: translate(-50%, -50%) scale(1.35, 0.58); }
  68% { transform: translate(-50%, -58%) scale(0.82, 1.3); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes trace-flash {
  0% { opacity: 0; transform: translate(-2px, -50%) rotate(var(--trace-angle, 0deg)) scaleX(0.12); }
  22% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(-2px, -50%) rotate(var(--trace-angle, 0deg)) scaleX(1); }
}

@keyframes speed-lines {
  0% { opacity: 0; transform: translate(-62%, -50%) rotate(var(--angle)) scaleX(0.2); }
  24% { opacity: 1; }
  100% { opacity: 0; transform: translate(-18%, -50%) rotate(var(--angle)) scaleX(1.12); }
}

@keyframes target-lock {
  0%, 100% { transform: translate(-50%, -50%) scale(0.74); }
  50% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes bounce-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.36); }
  28% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}

@keyframes landing-label {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.68) rotate(-6deg); }
  18% { opacity: 1; transform: translate(-50%, -70%) scale(1.06) rotate(3deg); }
  68% { opacity: 1; transform: translate(-50%, -84%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -118%) scale(0.9) rotate(4deg); }
}

@keyframes broadcast-pop {
  0% { opacity: 0; transform: translate(-50%, -42%) scale(0.68) rotate(-5deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); }
  76% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(0.9) rotate(4deg); }
}

@keyframes toast-pop {
  0% { opacity: 0; transform: translate(-50%, -44%) scale(0.7) rotate(-4deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); }
  72% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(0.9) rotate(2deg); }
}

@keyframes score-pop {
  0% { transform: translate(0, 0); background: var(--panel); }
  35% { transform: translate(-2px, -4px) scale(1.025); background: #dfff3c; }
  100% { transform: translate(0, 0); background: var(--panel); }
}

@keyframes recommend-pulse {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-1px, -2px); }
}

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

.icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--team-a);
  font-weight: 950;
}

.side-panel {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  min-height: 140px;
}

.mode-switch,
.difficulty-switch,
.watch-speed {
  display: grid;
  gap: 8px;
}

.mode-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.difficulty-switch,
.watch-speed {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-switch button,
.difficulty-switch button,
.watch-speed button {
  min-height: 38px;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.mode-switch button.active,
.difficulty-switch button.active,
.watch-speed button.active,
.secondary.active {
  background: #d7ff3f;
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.secondary {
  min-height: 44px;
  padding: 8px 12px;
  font-weight: 950;
}

.log {
  min-height: 76px;
  max-height: 136px;
  overflow: auto;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
}

.log div + div {
  margin-top: 6px;
}

.league-panel {
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 14px;
}

.league-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.season-progress {
  grid-column: 1 / -1;
  min-height: 32px;
  display: grid;
  align-items: center;
  padding: 6px 9px;
  border: 2px solid var(--ink);
  background: #eef9ff;
  font-size: 0.86rem;
  font-weight: 950;
}

.league-header h2 {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 2.4vw, 2.2rem);
  line-height: 1;
}

.league-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.league-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr 0.85fr;
  gap: 12px;
}

.league-card-wide {
  grid-column: span 2;
}

.league-card {
  min-height: 170px;
  border: 2px solid var(--ink);
  background: #ffffff;
  padding: 12px;
}

.league-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1;
  text-transform: uppercase;
}

.standing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 28px;
  border-top: 1px solid rgba(25, 26, 31, 0.14);
  font-size: 0.9rem;
}

.standing-row:first-child {
  border-top: 0;
}

.standing-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 850;
}

.standing-row strong,
.standing-row small {
  font-weight: 950;
}

.season-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.team-overview-card {
  min-height: 116px;
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
  border: 2px solid var(--ink);
  background: #f6efd9;
  overflow: hidden;
}

.team-overview-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 9px;
  background: var(--team-a);
}

.team-overview-card:nth-child(even)::before {
  background: var(--team-b);
}

.team-overview-card strong,
.team-overview-card span,
.team-overview-card small,
.team-overview-card em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-overview-card strong {
  font-size: 1rem;
  line-height: 1;
}

.team-overview-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.team-overview-card small {
  font-size: 0.75rem;
  font-weight: 850;
}

.team-overview-card em {
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.team-overview-card b {
  position: absolute;
  right: 7px;
  bottom: 5px;
  color: rgba(25, 26, 31, 0.18);
  font-size: 2.6rem;
  line-height: 1;
}

.season-timeline {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px;
}

.season-timeline button {
  cursor: pointer;
  min-height: 50px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 950;
}

.season-timeline button.active {
  background: #d7ff3f;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.season-timeline small {
  font-size: 0.65rem;
  font-weight: 900;
}

.league-today {
  display: grid;
  gap: 8px;
}

.league-match {
  cursor: pointer;
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 2px solid var(--ink);
  background: #f6efd9;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900;
}

.league-match.featured {
  background: #d7ff3f;
}

.league-match span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mint-card {
  min-height: 128px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 12px;
  border: 2px dashed var(--ink);
  background: #eef9ff;
}

.team-spotlight,
.tomorrow-card,
.trophy-case,
.story-card,
.playoff-card {
  display: grid;
  gap: 8px;
}

.story-card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-card div,
.playoff-seeds,
.playoff-row {
  min-height: 42px;
  padding: 7px;
  border: 2px solid var(--ink);
  background: #f6efd9;
  font-size: 0.86rem;
  font-weight: 900;
}

.story-card strong,
.story-card span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.story-card strong {
  text-transform: uppercase;
}

.playoff-seeds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.playoff-seeds span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.playoff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.playoff-card p {
  margin: 0;
  font-weight: 900;
}

#teamSpotlightSelect {
  width: 100%;
  min-height: 38px;
  margin-bottom: 10px;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
}

.team-spotlight {
  min-height: 108px;
  padding: 10px;
  border: 2px solid var(--ink);
  background: #f6efd9;
  font-size: 0.92rem;
}

.team-spotlight strong {
  font-size: 1.2rem;
}

.watch-speed {
  margin-bottom: 10px;
}

.watch-speed button {
  min-height: 30px;
  font-size: 0.76rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.tomorrow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 5px 7px;
  border: 2px solid var(--ink);
  background: #eef9ff;
  font-size: 0.9rem;
  font-weight: 900;
}

.trophy-case {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.trophy-case span {
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 2px solid var(--ink);
  background: #f1f1f1;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-align: center;
}

.trophy-case span.unlocked {
  background: #fff0a6;
  color: var(--ink);
}

.mint-card p,
.mint-card strong,
.mint-card small {
  margin: 0;
}

.mint-card strong {
  font-size: 2rem;
  line-height: 1;
}

.secondary:disabled,
.mode-switch button:disabled,
.difficulty-switch button:disabled {
  cursor: default;
  opacity: 0.55;
}

@media (max-width: 820px) {
  .game-shell {
    width: min(100vw - 18px, 640px);
    grid-template-rows: auto auto minmax(330px, 46vh) auto auto;
  }

  .hud,
  .league-grid,
  .version-vault,
  .trainer-panel,
  .league-header {
    grid-template-columns: 1fr;
  }

  .trainer-controls,
  .trainer-stats {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-column: auto;
    grid-row: auto;
  }

  .turn-card,
  .side-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .scorebar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
  }

  .league-card-wide {
    grid-column: span 1;
  }

  .season-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .season-timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .version-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shot-planner,
  .story-card,
  .playoff-seeds {
    grid-template-columns: 1fr;
  }

  .shot-planner strong {
    grid-column: span 1;
  }

  .league-header {
    align-items: stretch;
    flex-direction: column;
  }

  .serve-pill {
    min-width: 86px;
    padding: 10px 9px;
    font-size: 1rem;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls button {
    min-height: 72px;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .shot-odds {
    grid-column: 2;
    justify-self: start;
  }

  .team-score {
    min-height: 62px;
    padding: 8px 10px;
    gap: 8px;
  }

  .team-label {
    font-size: clamp(0.88rem, 4vw, 1.2rem);
  }

  .team-score strong {
    font-size: clamp(2rem, 10vw, 3.4rem);
  }

  .stadium {
    min-height: 430px;
  }

  body[data-view="corner"] .stadium,
  body[data-view="coach"] .stadium {
    min-height: 430px;
  }

  .court {
    width: min(760px, 91vw);
    min-height: 325px;
    height: min(62vw, 410px);
    margin-top: 58px;
  }

  body[data-view="corner"] .court,
  body[data-view="coach"] .court {
    width: min(760px, 91vw);
    min-height: 325px;
    height: min(62vw, 410px);
    margin-top: 58px;
  }
}

@media (max-width: 460px) {
  .scorebar {
    grid-template-columns: 1fr;
  }

  .serve-pill {
    width: 100%;
  }

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

  .view-switch {
    justify-self: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }
}
