@font-face { font-family: "Press Start 2P"; src: url("fonts/press-start-2p.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "VT323"; src: url("fonts/vt323.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #121a2e;
  --panel: #1e2840;
  --panel2: #172036;
  --ink: #0a0e18;
  --line: #33405f;
  --text: #f2f5ff;
  --muted: #9aa8c8;
  --accent: #ffcf33;
  --you: #3fa7ff;
  --rival: #ff5d5d;
  --px: "Press Start 2P", monospace;
  --body: "VT323", ui-monospace, monospace;
  --shadow: 4px 4px 0 var(--ink);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  color: var(--text);
  font: 22px/1.25 var(--body);
  min-height: 100vh;
  -webkit-font-smoothing: none;
}
[hidden] { display: none !important; }
h1, h2, h3, legend, button, .kicker, .ovr, .chip, .bar dt, .bar b, .score, kbd, .ri-ovr, .mvp span, .vs, table.box caption, table.box thead th {
  font-family: var(--px); font-weight: 400;
}
h1, h2, h3 { line-height: 1.3; margin: 0; text-wrap: balance; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.portrait { display: block; position: relative; overflow: hidden; flex: none; }
.portrait img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -47%); image-rendering: pixelated; max-width: none; }

#menu { max-width: 1120px; margin: 0 auto; padding: 32px 20px 24px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- title ---------- */
/* The stage: a 560x220 pixel scene drawn at 2x, with sprites, net and ball laid over it, then scaled by --sf
   (set by renderScene in game.js) so it fills the window above the mode picker. */
:root { --sf: 1; --stage-dy: 0px; --stage-h: calc(440px * var(--sf) + var(--stage-dy)); }
.title-hero {
  --art-h: calc(440px * var(--sf));
  position: relative; height: var(--stage-h); overflow: hidden;
  /* the stage art, then its two edge columns stretched out to the sides of the window; --stage-dy (phones) moves
     both down under a tall title, and the venue's top colour fills the strip above */
  background: var(--v-sky, #3c9fe4) center top / auto var(--art-h) no-repeat; background-size: auto var(--art-h), 100% var(--art-h);
  background-position: center var(--stage-dy), 0 var(--stage-dy); image-rendering: pixelated;
  margin-inline: calc(50% - 50vw); border-bottom: 3px solid var(--ink);
}
/* the title screen's page is the venue floor carrying on under the stage (a patch of the stage's own sand or
   arena floor, drawn at the same 2x pixel size), fading into the night so the menu text stays readable */
body.on-title {
  overflow-x: clip;
  background:
    linear-gradient(color-mix(in srgb, var(--bg) 30%, transparent) var(--stage-h), color-mix(in srgb, var(--bg) 82%, transparent) calc(var(--stage-h) + 200px), var(--bg) calc(var(--stage-h) + 380px)) 0 0 / 100% 100% no-repeat,
    var(--v-tile, none) 50% var(--stage-h) / calc(64px * var(--sf)) calc(64px * var(--sf)) repeat,
    var(--v-floor, var(--bg));
  image-rendering: pixelated;
}
body.on-title #menu { padding-top: 0; }
.hero-copy { position: relative; z-index: 5; text-align: center; padding: 28px 16px 0; }
.kicker { color: var(--accent); font-size: 12px; margin: 0 0 16px; text-shadow: 2px 2px 0 var(--ink); }
.hero-copy h1 { font-size: clamp(36px, 7.4vw, 76px); letter-spacing: -2px; color: #fbfcff; text-shadow: 4px 4px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); }
.hero-copy h1 span { color: var(--accent); }
.lede { color: #fbfcff; font-size: 26px; max-width: 44ch; text-wrap: balance; margin: 14px auto 0; text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); }

.scene { position: absolute; inset: var(--stage-dy) 0 auto; height: 440px; pointer-events: none; transform: scale(var(--sf)); transform-origin: 50% 0; }
.mon { position: absolute; left: 50%; top: 0; transform-origin: 0 0; }
.mon img { display: block; image-rendering: pixelated; }
.far .mon { z-index: 1; }
.near .mon { z-index: 3; }
/* the net is placed by renderScene in game.js, from the same camera as the court */
.net {
  position: absolute; z-index: 2;
  background:
    repeating-linear-gradient(90deg, rgba(16, 20, 31, 0.6) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(0deg, rgba(16, 20, 31, 0.6) 0 2px, transparent 2px 6px);
  border-top: 4px solid #fbfcff; border-bottom: 2px solid #fbfcff; box-shadow: 0 -2px 0 var(--ink);
}
.net i { position: absolute; top: -6px; left: -8px; width: 8px; height: var(--post, 50px); background: #d8dde8; border: 2px solid var(--ink); }
.net i + i { left: auto; right: -8px; }
.ball-x, .ball-shadow { position: absolute; left: 50%; top: 0; }
.ball-x { z-index: 4; }
.ball { display: block; width: 24px; height: 24px; margin: -12px 0 0 -12px; background: var(--ball) 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.ball-shadow { z-index: 2; width: 22px; height: 6px; margin: -3px 0 0 -11px; border-radius: 50%; background: rgba(10, 14, 24, 0.35); }
/* the demo rally (game.js, Rally) moves the ball and players from script; this keeps the ball spinning */
@media (prefers-reduced-motion: no-preference) { .live .ball { animation: ball-spin 0.48s steps(4) infinite; } }
@keyframes ball-spin { to { rotate: 360deg; } }
.burst { position: absolute; left: 50%; top: 0; z-index: 2; width: 44px; height: 14px; margin: -7px 0 0 -22px; opacity: 0; border: 3px solid #fbfcff; border-radius: 50%; }

/* broadcast scoreboard on the stage, the same design as the one in a match */
.bug { position: absolute; z-index: 6; top: 14px; left: max(14px, calc(50% - 546px)); display: flex; background: #f4f6fb; color: #141c33; box-shadow: 4px 4px 0 rgba(5, 8, 16, 0.45); }
.bug-logo { position: relative; display: grid; place-items: center; width: 52px; border-right: 2px solid #c5ccd9; }
.bug-logo img { image-rendering: pixelated; }
.bug-logo b { position: absolute; font: 10px/1 var(--px); color: #fff; text-shadow: 2px 0 0 #0e1a3a, -2px 0 0 #0e1a3a, 0 2px 0 #0e1a3a, 0 -2px 0 #0e1a3a; }
.bug-rows { display: grid; }
.bug-row { --cc: #8a93a8; display: grid; grid-template-columns: 6px 20px 50px 40px; align-items: center; height: 28px; font: 12px/1 var(--px); }
.bug-row + .bug-row { border-top: 2px solid #c5ccd9; }
.bug-row i { align-self: stretch; background: var(--cc); }
.bug-row s { justify-self: center; width: 8px; height: 8px; }
.bug-row.serving s { background: var(--accent); box-shadow: 0 0 0 2px #c99a0c; }
.bug-row b { font-weight: 400; background: #e2e6ef; align-self: stretch; display: grid; align-items: center; padding-left: 4px; }
.bug-row em { font-style: normal; text-align: center; align-self: stretch; display: grid; place-items: center; transition-property: background-color; transition-duration: 150ms; transition-timing-function: ease-out; }
.bug-row.pt em { background: var(--accent); }
.demo-tag { position: absolute; z-index: 6; top: 14px; right: max(14px, calc(50% - 546px)); display: flex; align-items: center; gap: 8px; padding: 8px 10px; font: 9px/1 var(--px); color: #fbfcff; background: rgba(10, 14, 24, 0.72); }
.demo-tag::before { content: ""; width: 8px; height: 8px; background: var(--rival); }

/* first load only: title, stage, then the menu, 100 ms apart */
@media (prefers-reduced-motion: no-preference) {
  .intro .hero-copy > *, .intro .scene, .intro .setup > * { animation: rise 300ms ease-out both; }
  .intro .lede { animation-delay: 100ms; }
  .intro .scene { animation-delay: 200ms; }
  .intro .setup > * { animation-delay: 300ms; }
}
@media (prefers-reduced-motion: reduce) { .intro .setup > * { animation: fade 300ms ease-out both; } }
@keyframes rise { from { opacity: 0; filter: blur(4px); translate: 0 12px; } }

.panel, .setup, .card, .team-panel, .mu-team, table.box, .dialog {
  background: linear-gradient(180deg, #222d4b, #19223a); border: 3px solid var(--ink);
  box-shadow: var(--shadow), inset 0 0 0 2px var(--line), inset 0 6px 0 rgba(255, 255, 255, 0.03);
}
.setup { margin: 20px auto 0; padding: 20px; max-width: 920px; }
.setup legend { font-size: 13px; color: var(--accent); text-shadow: 2px 2px 0 var(--ink); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the title screen's only choice: the game mode, two big cards with a court diagram */
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-pick button {
  position: relative; border: 3px solid var(--ink); background: var(--panel2); color: var(--text); font: inherit; cursor: pointer;
  box-shadow: var(--shadow), inset 0 0 0 2px var(--line); -webkit-tap-highlight-color: transparent;
  transition-property: background-color, box-shadow; transition-duration: 120ms; transition-timing-function: ease-out;
}
@media (hover: hover) { .mode-pick button:hover { background: #2b3a5e; box-shadow: var(--shadow), inset 0 0 0 3px var(--accent); } }
.mode-pick button:active { translate: 4px 4px; box-shadow: 0 0 0 var(--ink), inset 0 0 0 3px var(--accent); }
.mode-pick button[aria-pressed="true"] { background: #2b3a5e; color: #fbfcff; box-shadow: var(--shadow), inset 0 0 0 3px var(--accent); }
.mode-pick button[aria-pressed="true"]::after { /* a pixel check in the corner, so the choice does not rest on colour alone */
  content: "✓"; position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px;
  font: 12px/1 var(--px); color: #231b00; background: var(--accent); box-shadow: 2px 2px 0 var(--ink);
}
#btn-mode-next { display: block; max-width: 460px; margin: 20px auto 0; }
#btn-mode-next span { margin: 0 0 0 10px; }
.mode-pick button { display: grid; gap: 10px; justify-items: center; align-content: center; padding: 16px 12px 14px; min-width: 0; }
.mode-pick svg { width: 64px; height: 36px; fill: currentColor; stroke: currentColor; stroke-width: 2; }
.mode-pick svg rect, .mode-pick svg path { fill: none; }
.mode-pick svg circle { stroke: none; }
.mode-pick b { font-size: 18px; }
.mode-pick span { font: 20px/1 var(--body); }
@media (min-width: 861px) { .mode-pick button { min-height: 150px; } }
/* on wide, tall-enough screens the picker is one row (two cards and Continue), so the stage above can be bigger */
@media (min-width: 861px) and (min-height: 700px) {
  .setup { display: grid; grid-template-columns: 1fr 240px; gap: 14px; align-items: end; padding-block: 16px 18px; }
  .mode-pick button { height: 116px; min-height: 0; padding-block: 12px; gap: 8px; }
  #btn-mode-next { max-width: none; margin: 0; height: 116px; }
}
.quick-row { display: flex; align-items: center; gap: 14px; }
#btn-quick { flex: none; white-space: nowrap; }
.cta.big { width: 100%; font-size: 15px; min-height: 60px; }
.start-hint { margin: 0; font-size: 19px; line-height: 1.1; color: var(--muted); }
.cta.big span { margin-right: 8px; }
.ghost.small { font-size: 10px; min-height: 44px; padding: 10px 14px; box-shadow: 3px 3px 0 var(--ink), inset 0 0 0 2px var(--line); }
@media (max-width: 860px) { .setup { padding: 18px; } }
@media (max-width: 560px) {
  .lede { font-size: 22px; }
  .cta.big { font-size: 12px; padding-inline: 10px; }
  .hero-copy { padding-top: 72px; }
  .bug { top: 10px; left: 10px; }
  .demo-tag { top: 10px; right: 10px; }
}
/* team screen and venue screen */
/* club picker: every crest on show */
.crest { image-rendering: pixelated; display: block; flex: none; }
.club-set { width: 100%; }
.club-name { display: none; margin: 8px 0 0; font: 20px/1 var(--body); color: var(--accent); }
.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.club-tile {
  --cc: #5b6a92;
  display: grid; justify-items: center; gap: 6px; padding: 12px 8px 10px; min-height: 44px;
  border: 3px solid var(--ink); background: var(--panel2); color: var(--muted);
  box-shadow: inset 0 0 0 2px var(--line), inset 0 -4px 0 var(--cc);
  transition-property: background-color; transition-duration: 120ms; transition-timing-function: ease-out;
  -webkit-tap-highlight-color: transparent;
}
.club-tile b { font-size: 10px; color: var(--text); }
.club-tile i { display: none; font: normal 9px/1 "Press Start 2P", monospace; color: var(--text); }
.club-tile span { font: 18px/1 var(--body); }
.club-tile[aria-pressed="true"] { background: #2b3a5e; box-shadow: inset 0 0 0 3px var(--accent), inset 0 -6px 0 var(--cc); }
.club-tile[aria-pressed="true"] span { color: var(--accent); }
.club-tile:disabled { opacity: 0.4; }
.club-tile.random { grid-column: 1 / -1; grid-template-columns: auto auto auto; align-items: center; justify-content: center; gap: 14px; padding: 8px 12px; }
.club-tile.random .crest { width: 36px; height: auto; }
@media (hover: hover) { .club-tile:not(:disabled):not([aria-pressed="true"]):hover { background: #26314d; } }
@media (max-width: 560px) {
  .club-grid { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .club-tile { padding: 7px 0 8px; gap: 4px; }
  .club-tile .crest { width: 40px; height: auto; }
  .club-tile b, .club-tile span { display: none; }
  .club-tile i { display: block; }
  .club-name { display: block; }
  .club-tile.random { grid-template-columns: auto auto; }
  .club-tile.random b { display: block; }
}
fieldset { border: 0; padding: 0; margin: 0; text-align: center; }
legend { color: var(--muted); font-size: 10px; margin: 0 auto 10px; }
.seg { display: inline-flex; gap: 6px; }
.seg button {
  border: 3px solid var(--ink); background: var(--panel2); padding: 12px 16px; font-size: 12px; color: var(--muted);
  min-width: 84px; min-height: 44px; box-shadow: inset 0 0 0 2px var(--line);
}
.seg button[aria-pressed="true"] { background: var(--accent); color: #231b00; box-shadow: inset 0 -4px 0 #c99a0c; }
@media (hover: hover) { .seg button[aria-pressed="false"]:hover { color: var(--text); background: #26314d; } }

.cta, .ghost {
  border: 3px solid var(--ink); font-size: 13px; min-height: 48px; padding: 14px 22px; line-height: 1.2;
  transition-property: translate, box-shadow; transition-duration: 80ms; transition-timing-function: steps(1, end);
}
.cta { background: var(--accent); color: #231b00; box-shadow: var(--shadow), inset 0 -4px 0 #c99a0c; }
.ghost { background: var(--panel2); color: var(--text); box-shadow: var(--shadow), inset 0 0 0 2px var(--line); }
@media (hover: hover) {
  .cta:hover { background: #ffdb5c; }
  .ghost:not(:disabled):hover { background: #26314d; }
}
.cta:not(:disabled):active, .ghost:not(:disabled):active { translate: 4px 4px; box-shadow: 0 0 0 var(--ink); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.howto { max-width: 760px; margin: 8px auto 0; color: var(--muted); }
.howto summary { list-style: none; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 44px; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: "+"; font: 16px "Press Start 2P", monospace; color: var(--accent); }
.howto[open] summary::after { content: "-"; }
.howto summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.howto h2 { color: var(--text); font-size: 14px; margin: 0; }
.howto[open] summary { margin-bottom: 16px; }
@media (hover: hover) { .howto summary:hover h2 { color: var(--accent); } }
.keys { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.keys li { display: grid; grid-template-columns: 250px 1fr; align-items: center; gap: 12px; }
.keys .k { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: 18px; }
.keys .k kbd { white-space: nowrap; }
@media (max-width: 760px) { .keys li { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
kbd { display: inline-block; min-width: 28px; text-align: center; padding: 6px 7px 5px; background: var(--panel2); border: 2px solid var(--ink); box-shadow: inset 0 -3px 0 var(--line); font-size: 10px; color: var(--text); }
.howto b { color: var(--text); }
/* the tutorial: its own small mode picker at the top of How to play */
.tut { background: var(--panel); border: 3px solid var(--ink); box-shadow: var(--shadow), inset 0 0 0 2px var(--line); padding: 20px; margin-bottom: 24px; display: grid; gap: 12px; justify-items: start; }
.tut h3, .keys-h { color: var(--accent); font-size: 13px; text-shadow: 2px 2px 0 var(--ink); }
.tut p { margin: 0; }
.tut fieldset { border: 0; padding: 0; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tut legend { float: left; font-size: 10px; color: var(--text); margin-right: 4px; }
.tut-roles { color: var(--text); }
.keys-h { margin-bottom: 14px; }

/* the tutorial's coach panel, over the left side of the court */
.coach {
  position: absolute; left: 1.2%; top: 21%; width: min(330px, 30%); max-height: 74%; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px; display: grid; gap: 10px; align-content: start;
  background: rgba(20, 27, 46, 0.92); border: 3px solid var(--ink); box-shadow: var(--shadow), inset 0 0 0 2px var(--line);
  font-size: 20px; line-height: 1.15;
}
.coach p { margin: 0; }
.coach h2 { font-size: 13px; color: var(--text); }
.coach-kicker { font: 8px/1.5 var(--px); color: var(--muted); }
.coach-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.coach-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.coach-steps i { font: normal 8px/1 var(--px); width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid var(--line); flex: none; }
.coach-steps li.now { color: var(--text); }
.coach-steps li.now i { border-color: var(--accent); color: var(--accent); }
.coach-steps li.done i { background: #2f9e63; border-color: #2f9e63; color: #fff; }
.coach-steps li.skipped { text-decoration: line-through; }
.coach-now { color: var(--text); padding: 8px 10px; background: rgba(255, 207, 51, 0.1); border-left: 3px solid var(--accent); }
.coach-done { font: 10px/1.4 var(--px); color: #7dffb0; }
.coach b { color: var(--accent); font-weight: 400; }
.coach-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.coach .cta.small { font-size: 10px; min-height: 44px; padding: 10px 14px; box-shadow: 3px 3px 0 var(--ink), inset 0 -4px 0 #c99a0c; }
@media (max-width: 760px) { .coach { width: 44%; top: 24%; font-size: 17px; padding: 10px; } .coach-steps { display: none; } }

/* ---------- headers ---------- */
.bar-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.bar-head > div { flex: 1; min-width: 200px; }
.bar-head h2 { font-size: 22px; text-shadow: 3px 3px 0 var(--ink); }
.sub { color: var(--muted); margin: 8px 0 0; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card { display: block; text-align: left; width: 100%; padding: 0; color: var(--text); }
button.card { transition-property: translate, box-shadow; transition-duration: 80ms; transition-timing-function: steps(1, end); }
button.card:not(:disabled):active { translate: 4px 4px; box-shadow: 0 0 0 var(--ink), inset 0 0 0 2px var(--line); }
@media (hover: hover) {
  button.card:hover { box-shadow: var(--shadow), inset 0 0 0 3px var(--tc); }
}
.card.legend { box-shadow: var(--shadow), inset 0 0 0 3px var(--accent); }
.card-top {
  position: relative; display: flex; justify-content: center; padding: 6px 0 0;
  background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--tc) 30%, transparent) 0 4px, color-mix(in srgb, var(--tc) 22%, transparent) 4px 8px);
  border-bottom: 3px solid var(--ink);
}
.ovr { position: absolute; top: 8px; right: 8px; text-align: center; background: var(--ink); padding: 7px 7px 5px; line-height: 1; }
.ovr b { display: block; font-size: 18px; font-weight: 400; }
.ovr span { font-size: 7px; color: var(--muted); }
.card-body { padding: 12px 14px 14px; }
.card h3 { font-size: 13px; line-height: 1.5; }
.dex { color: var(--muted); font-size: 9px; }
.star { color: var(--accent); }
.chips { display: flex; gap: 6px; margin: 8px 0 12px; }
.chip { font-size: 8px; padding: 5px 7px 4px; background: var(--c); color: #fff; border: 2px solid var(--ink); text-shadow: 1px 1px 0 var(--ink); }
.bars { margin: 0; display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; }
.bar dt { font-size: 8px; color: var(--muted); }
.bar dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.track { flex: 1; height: 10px; background: var(--ink); border: 2px solid var(--ink); }
.fill { display: block; height: 100%; -webkit-mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px); mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 8px); }
.fill.b1 { background: #ff6b6b; } .fill.b2 { background: #ffb547; } .fill.b3 { background: #6bd88a; } .fill.b4 { background: #4fd2ff; }
.bar b { width: 24px; text-align: right; font-size: 9px; }
.boost { flex: none; width: 3ch; font-size: 18px; color: var(--accent); white-space: nowrap; }
.base { margin: 12px 0 0; font: 19px/1.1 var(--body); color: var(--muted); }

/* ---------- draft ---------- */
.draft-wrap { display: grid; grid-template-columns: 1fr 290px; gap: 22px; align-items: start; }
.offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.team-panel { padding: 16px; position: sticky; top: 16px; }
.team-panel h3 { font-size: 13px; }
#roster { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.roster-item, .mu-list li { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 0; background: var(--panel2); border: 2px solid var(--ink); }
.roster-item.empty { justify-content: center; min-height: 68px; color: var(--muted); border: 2px dashed var(--line); background: transparent; }
.ri-text { flex: 1; display: grid; line-height: 1.1; }
.ri-text b { font-weight: 400; font-size: 22px; }
.ri-text span { font-size: 18px; color: var(--muted); }
.ri-ovr { font-size: 14px; }

/* ---------- matchup ---------- */
.matchup { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.mu-team { padding: 16px; }
.mu-team.you { border-top: 6px solid var(--you); }
.mu-team.rival { border-top: 6px solid var(--rival); }
.mu-team h3 { justify-content: space-between; margin-bottom: 14px; }
.mu-ovr { font-size: 8px; color: var(--muted); }
.mu-name { display: inline-flex; align-items: center; gap: 10px; }
.mu-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

.pos-pick { margin: 0 auto 26px; max-width: 760px; }
.pos-pick .seg { flex-wrap: wrap; justify-content: center; }
.role-desc { color: var(--muted); margin: 12px auto 0; max-width: 56ch; text-align: center; }
.role-tag { font-family: var(--px); font-size: 9px; padding: 5px 6px 4px; background: var(--ink); color: var(--accent); }
.rot-court { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 14px; padding: 4px; background: #e9d49b; border: 3px solid var(--ink); }
.rot-net { grid-column: 1 / -1; text-align: center; font-family: var(--px); font-size: 8px; padding: 5px 0 4px; background: var(--ink); color: #fff; letter-spacing: 4px; }
.rot-cell { position: relative; display: grid; justify-items: center; padding: 8px 4px 6px; background: #f6e7bd; color: #2a2200; line-height: 1.1; }
.rot-cell i { position: absolute; top: 3px; left: 5px; font-style: normal; font-family: var(--px); font-size: 7px; color: #9c8550; }
.rot-cell b { font-family: var(--px); font-weight: 400; font-size: 10px; }
.rot-cell span { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rot-cell.you { background: var(--accent); box-shadow: inset 0 0 0 2px var(--ink); }
.rot-cell.lib { background: #dcc6ff; }
.rot-cell.lib.you { background: var(--accent); }
.rot-note { color: var(--muted); font-size: 18px; margin: 8px 0 0; }

/* ---------- result ---------- */
.result-head { text-align: center; margin: 12px 0 18px; }
.result-head h2 { font-size: clamp(24px, 5vw, 40px); text-shadow: 4px 4px 0 var(--ink); }
.score { font-size: 32px; margin: 16px 0 0; color: var(--accent); text-shadow: 3px 3px 0 var(--ink); }
.mvp { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.mvp div { display: grid; gap: 4px; line-height: 1.2; }
.mvp span { font-size: 10px; color: var(--accent); }
.mvp b { font-size: 30px; font-weight: 400; }
.mvp small { color: var(--muted); font-size: 18px; }
.box-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; }
table.box { width: 100%; border-collapse: collapse; }
table.box caption { text-align: left; font-size: 11px; padding: 0 0 10px; }
table.box th, table.box td { padding: 6px 10px; text-align: center; border-bottom: 2px solid var(--line); }
table.box th[scope="row"] { text-align: left; font-weight: 400; }
table.box thead th { color: var(--muted); font-size: 9px; }
table.box tr.you th, table.box tr.you td { color: var(--accent); }
.actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.foot { color: #6d7a99; font-size: 18px; text-align: center; margin-top: 44px; }

/* ---------- match stage ---------- */
#stage { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #080b14; }
.canvas-wrap { position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; }
#court { display: block; width: 100%; height: 100%; touch-action: none; image-rendering: pixelated; }
.icon-btn { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 3px solid var(--ink); background: var(--panel); font-family: var(--px); font-size: 10px; box-shadow: inset 0 0 0 2px var(--line); }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; }
.dialog { display: grid; gap: 14px; min-width: 280px; padding: 26px; text-align: center; }
.dialog h2 { font-size: 20px; margin-bottom: 6px; }
.tabstats { pointer-events: none; background: rgb(8 11 20 / 0.45); }
.tabstats .dialog { width: min(900px, 92%); max-height: 92%; overflow: auto; text-align: left; }
.tabstats h2 { display: flex; justify-content: space-between; gap: 16px; font-size: 16px; }
.tabstats .box-wrap { margin-bottom: 0; }
.tabstats table.box td { font-variant-numeric: tabular-nums; }
.tab-hint { color: var(--muted); font-size: 12px; text-align: center; }

.touch { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 12px; user-select: none; -webkit-user-select: none; }
.pad { display: flex; gap: 10px; align-items: center; }
/* the movement stick: drag the knob anywhere in the circle */
.stick { position: relative; flex: none; width: 140px; height: 140px; border-radius: 50%; touch-action: none;
  background: radial-gradient(circle, transparent 0 34%, rgb(255 255 255 / 0.06) 34% 35%, transparent 35%), var(--panel);
  border: 3px solid var(--ink); box-shadow: inset 0 0 0 3px var(--line), inset 0 -5px 0 rgb(0 0 0 / 0.25); }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  background: var(--panel2); border: 3px solid var(--ink); box-shadow: inset 0 -4px 0 var(--line); pointer-events: none; }
.stick.on .stick-knob { background: var(--accent); box-shadow: inset 0 -4px 0 #b88a00; }
.touch button { width: 68px; height: 68px; border: 3px solid var(--ink); background: var(--panel); font-family: var(--px); font-size: 10px; box-shadow: inset 0 -4px 0 var(--line); touch-action: none; }
.touch button.small { width: 52px; height: 52px; }
.touch button.down { background: var(--accent); color: #231b00; }
/* small phones: the stick and the four buttons fit on one row */
@media (max-width: 420px) {
  .touch { flex-wrap: nowrap; gap: 8px; padding-inline: 10px; }
  .pad { gap: 6px; }
  .touch .pad button:not(.small) { width: 58px; height: 58px; }
  .touch .pad button.small { width: 50px; height: 50px; font-size: 8px; }
  .stick { width: 116px; height: 116px; }
  .stick-knob { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
}
@media (max-width: 370px) { .stick { width: 104px; height: 104px; } .stick-knob { width: 46px; height: 46px; margin: -23px 0 0 -23px; } .touch .pad button.small { width: 46px; height: 46px; } }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .draft-wrap { grid-template-columns: 1fr; }
  .team-panel { position: static; }
  .offers { grid-template-columns: 1fr; }
  .matchup { grid-template-columns: 1fr; }
  .box-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  #menu { padding: 18px 14px; }
  .seg button { min-width: 0; padding: 12px 10px; font-size: 10px; }
  .bar-head h2 { font-size: 16px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  #stage { flex-direction: row; }
  .touch { position: absolute; inset: auto 0 0 0; pointer-events: none; }
  .touch button, .touch .stick { pointer-events: auto; opacity: 0.85; }
  /* the stick and the buttons sit low in the corners, clear of the court */
  .touch { align-items: flex-end; padding: 0 max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .touch .pad { align-items: flex-end; }
}
/* How to play: the numbered basics and the folded extra tips */
.basics { margin: 0 0 24px; padding-left: 2.5em; display: grid; gap: 8px; }
.basics li::marker { color: var(--accent); }
.tips { margin-top: 8px; }
.tips summary { justify-content: flex-start; color: var(--text); }
.tips summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .tips summary:hover { color: var(--accent); } }
.tips ul { margin: 4px 0 0; padding-left: 2.5em; display: grid; gap: 6px; }

/* ---------- main screen: the arena match behind, the title and menu on the left ---------- */
/* the stage becomes the background: the canvas covers the window, behind a dark fade on the left for the menu */
#stage.demo-bg { position: fixed; inset: 0; z-index: 0; min-height: 0; pointer-events: none; }
#stage.demo-bg .canvas-wrap { width: 100%; height: 100%; aspect-ratio: auto; }
#stage.demo-bg #court { object-fit: cover; }
#stage.demo-bg .icon-btn, #stage.demo-bg .coach, #stage.demo-bg .touch, #stage.demo-bg .overlay { display: none !important; }
body.on-title { background: #080b14; }
body.on-title::before {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 9, 18, 0.92) 0, rgba(6, 9, 18, 0.78) 26%, rgba(6, 9, 18, 0.3) 48%, rgba(6, 9, 18, 0) 64%),
    linear-gradient(0deg, rgba(6, 9, 18, 0.6) 0, rgba(6, 9, 18, 0) 22%);
}
body.on-title #menu { position: relative; z-index: 2; padding-top: 0; padding-bottom: 0; }
body.on-title .foot { display: none; }

#scr-title { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; }
.title-wrap { width: min(440px, 100%); padding: 40px 0; display: grid; gap: 34px; }
.brand .kicker { margin-bottom: 12px; }
.brand h1 {
  font-size: clamp(38px, 4.4vw, 56px); letter-spacing: -2px; color: #fbfcff;
  text-shadow: 4px 4px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
}
.brand h1 span { color: var(--accent); }
.brand .lede { margin: 14px 0 0; max-width: 30ch; font-size: 24px; color: #d9e0f2; text-wrap: pretty; }

/* the menu: big stacked entries; the one under the pointer or keyboard gets a gold bar and a pointer arrow */
.main-menu { display: grid; gap: 6px; }
.mm {
  position: relative; display: grid; gap: 6px; width: 100%; padding: 12px 16px 12px 30px; text-align: left;
  color: #fbfcff; background: transparent; border: 0; border-left: 4px solid transparent;
  transition-property: background-color, border-color, color; transition-duration: 150ms; transition-timing-function: ease-out;
}
.mm::before { /* the pointer arrow */
  content: ""; position: absolute; left: 10px; top: 17px; width: 0; height: 0;
  border-block: 6px solid transparent; border-left: 8px solid var(--accent); opacity: 0; transition: opacity 150ms ease-out;
}
.mm-t { display: flex; align-items: center; gap: 10px; font: 18px/1.1 var(--px); text-shadow: 3px 3px 0 var(--ink); }
.mm-d { font: 20px/1 var(--body); color: var(--muted); }
.mm:focus-visible { outline: none; }
.mm:is(:focus-visible, [aria-expanded="true"]), .mm:not([aria-disabled="true"]):hover {
  background: linear-gradient(90deg, rgba(255, 207, 51, 0.16), rgba(255, 207, 51, 0)); border-left-color: var(--accent); color: var(--accent);
}
.mm:is(:focus-visible, [aria-expanded="true"])::before, .mm:not([aria-disabled="true"]):hover::before { opacity: 1; }
@media (hover: none) { .mm:not([aria-disabled="true"]):hover { background: transparent; border-left-color: transparent; color: #fbfcff; } .mm:hover::before { opacity: 0; } }
.mm:not([aria-disabled="true"]):active { scale: 0.98; }
.mm[aria-disabled="true"] { cursor: default; color: #8792ad; }
.mm[aria-disabled="true"]:focus-visible { border-left-color: #5b6684; }
.soon { padding: 4px 6px 3px; font: 8px/1 var(--px); font-style: normal; color: #231b00; background: var(--accent); text-shadow: none; }
@media (prefers-reduced-motion: reduce) { .mm:active { scale: none; } }

/* Quick play opens two mini courts under it */
.qp { padding: 10px 0 14px 34px; }
.qp .mode-pick { grid-template-columns: 1fr 1fr; gap: 14px; }
.qp .mode-pick button {
  display: grid; gap: 8px; justify-items: center; align-content: start; height: auto; min-height: 0; padding: 0; color: #fbfcff; background: none; border: 0; box-shadow: none;
  transition-property: translate; transition-duration: 150ms; transition-timing-function: ease-out;
}
.qp .mode-pick button::after { display: none; }
.qp .mode-pick svg {
  width: 100%; height: auto; aspect-ratio: 64 / 36; stroke: #fbfcff; stroke-width: 1.5;
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
  transition-property: box-shadow; transition-duration: 150ms; transition-timing-function: ease-out;
}
.qp .mode-pick svg rect, .qp .mode-pick svg path { fill: none; }
.qp [data-v="2"] svg rect { fill: #f0dba2; }
.qp [data-v="6"] svg rect { fill: #e0904c; }
.qp .mode-pick svg circle { fill: #ff5d5d; stroke: var(--ink); stroke-width: 1; }
.qp [data-v="2"] svg circle:nth-of-type(-n+2), .qp [data-v="6"] svg circle:nth-of-type(-n+6) { fill: #3fa7ff; }
.qp .mode-pick b { font: 14px/1 var(--px); text-shadow: 2px 2px 0 var(--ink); }
.qp .mode-pick span { font: 20px/1 var(--body); color: var(--muted); }
.qp .mode-pick button:focus-visible { outline: none; }
.qp .mode-pick button:is(:hover, :focus-visible) { translate: 0 -4px; background: none; box-shadow: none; }
.qp .mode-pick button:is(:hover, :focus-visible) svg { box-shadow: 0 0 0 3px var(--accent), 4px 8px 0 rgba(0, 0, 0, 0.4); }
.qp .mode-pick button:is(:hover, :focus-visible) b { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .qp .mode-pick button:is(:hover, :focus-visible) { translate: none; } }

/* How to play and Settings open as dialogs over the match */
.dlg {
  width: min(780px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); padding: 0; color: var(--muted);
  background: var(--bg); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink), inset 0 0 0 2px var(--line);
  overscroll-behavior: contain;
}
.dlg::backdrop { background: rgba(5, 8, 16, 0.6); }
.dlg-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 24px; background: #0d1322; border-bottom: 3px solid var(--ink); }
.dlg-head h2 { font-size: 14px; color: var(--text); }
.dlg-x { display: grid; place-items: center; width: 44px; height: 44px; color: var(--text); background: var(--panel2); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.dlg-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; }
@media (hover: hover) { .dlg-x:hover { color: var(--accent); } }
.dlg-body { padding: 24px; }
.dlg-body.howto { max-width: none; margin: 0; }
.settings-note { margin: 4px 0 0; font-size: 20px; }

/* Settings: a tab rail on the left, the tab's settings on the right, a reset bar along the bottom */
.set-dlg { width: min(940px, calc(100vw - 24px)); height: min(700px, calc(100dvh - 48px)); overflow: hidden; }
.set-dlg[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.set-wrap { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 0; }
.set-tabs { display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; background: #0d1322; border-right: 3px solid var(--ink); }
.set-tab {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 14px; border: 0; background: transparent;
  color: var(--muted); font-size: 10px; text-align: left;
  transition-property: background-color, color; transition-duration: 120ms; transition-timing-function: ease-out;
}
.set-tab svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.set-tab[aria-selected="true"] { color: var(--accent); background: var(--panel); box-shadow: inset 4px 0 0 var(--accent), inset 0 0 0 2px var(--line); }
@media (hover: hover) { .set-tab[aria-selected="false"]:hover { color: var(--text); background: var(--panel2); } }
.set-tab:focus-visible { outline-offset: -3px; }
.set-pans { overflow-y: auto; overscroll-behavior: contain; padding: 4px 28px 28px; }
.set-pan:focus-visible { outline: none; }
.set-title { margin: 20px 0 2px; font-size: 14px; color: var(--text); }
.set-group { margin: 24px 0 0; padding-bottom: 10px; font-size: 9px; color: var(--accent); border-bottom: 3px solid var(--line); }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; padding: 14px 0; border-bottom: 2px solid #1c2640; }
.set-name { display: block; margin-bottom: 6px; font-family: var(--px); font-size: 10px; color: var(--text); }
.set-desc { margin: 0; max-width: 46ch; font-size: 19px; line-height: 1.2; color: var(--muted); text-wrap: pretty; }
.set-row .seg { flex-wrap: wrap; justify-content: flex-end; }
.set-row .seg button { min-width: 0; padding: 10px 14px; font-size: 10px; white-space: nowrap; }
.set-row .seg button:disabled { opacity: 0.4; }
.set-lock { margin: 12px 0 0; padding: 10px 14px; font-size: 19px; color: var(--muted); background: var(--panel2); box-shadow: inset 4px 0 0 var(--line); }
/* a volume or distance slider: a chunky bar that fills in gold, with the value beside it */
.set-slider { display: flex; align-items: center; gap: 14px; width: 280px; }
.set-slider output { min-width: 4ch; font-family: var(--px); font-size: 10px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.set-slider input { flex: 1; min-width: 0; height: 44px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.set-slider input::-webkit-slider-runnable-track { height: 14px; background: linear-gradient(90deg, var(--accent) var(--fill, 50%), var(--panel2) var(--fill, 50%)); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.set-slider input::-moz-range-track { height: 8px; background: var(--panel2); border: 3px solid var(--ink); }
.set-slider input::-moz-range-progress { height: 8px; background: var(--accent); }
.set-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 26px; margin-top: -9px; background: var(--text); border: 3px solid var(--ink); box-shadow: inset 0 -4px 0 var(--muted); }
.set-slider input::-moz-range-thumb { width: 10px; height: 20px; background: var(--text); border: 3px solid var(--ink); border-radius: 0; box-shadow: inset 0 -4px 0 var(--muted); }
.set-slider input:focus-visible { outline: none; }
.set-slider input:focus-visible::-webkit-slider-thumb { background: var(--accent); }
.set-slider input:focus-visible::-moz-range-thumb { background: var(--accent); }
.set-slider:focus-within { box-shadow: 0 0 0 3px var(--accent); }
/* Controls: action, key, alternate */
.keys-note { margin: 20px 0 0; padding: 12px 14px; font-size: 19px; color: var(--text); background: var(--panel2); box-shadow: inset 4px 0 0 var(--accent); }
.keys-head, .key-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px; align-items: center; gap: 10px; }
.keys-head { margin-top: 18px; font-family: var(--px); font-size: 8px; color: var(--muted); }
.keys-head span:not(:first-child) { text-align: center; }
.key-row { padding: 6px 0; border-bottom: 2px solid #1c2640; }
.key-act { font-size: 20px; color: var(--text); }
.key-bind {
  min-height: 44px; padding: 4px; border: 0; background: var(--panel2); box-shadow: 3px 3px 0 var(--ink), inset 0 0 0 2px var(--line);
  transition-property: background-color, translate, box-shadow; transition-duration: 80ms; transition-timing-function: ease-out;
}
.key-bind kbd { min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; font-size: 9px; }
.key-bind.empty kbd { color: var(--muted); }
.key-bind.listening { background: #2a2610; box-shadow: 3px 3px 0 var(--ink), inset 0 0 0 3px var(--accent); }
.key-bind.listening kbd { color: var(--accent); }
@media (hover: hover) { .key-bind:not(.listening):hover { background: #26314d; } }
.key-bind:active { translate: 3px 3px; box-shadow: 0 0 0 var(--ink), inset 0 0 0 2px var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .key-bind.listening kbd { animation: key-wait 1s steps(2, jump-none) infinite; }
  @keyframes key-wait { 50% { opacity: 0.35; } }
}
.chat-note { margin-top: 12px; }
.chat-row { grid-template-columns: minmax(0, 1fr) 330px; }
.chat-row .key-act { display: flex; align-items: center; gap: 10px; }
.chat-row select {
  min-height: 44px; padding: 0 36px 0 12px; font: 10px var(--px); color: var(--text); background: var(--panel2);
  border: 0; border-radius: 0; box-shadow: 3px 3px 0 var(--ink), inset 0 0 0 2px var(--line); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-size: 6px 6px; background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-repeat: no-repeat;
  transition-property: background-color; transition-duration: 80ms; transition-timing-function: ease-out;
}
@media (hover: hover) { .chat-row select:hover { background-color: #26314d; } }
.chat-row select option { font-family: var(--body); font-size: 20px; background: var(--panel2); }
/* Tutorial: pick a format, see the drills, start */
.tut-dlg { width: min(720px, calc(100vw - 24px)); }
.tut-lede { margin: 0; font-size: 22px; color: var(--text); text-wrap: pretty; }
.tut-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 20px; }
.tut-pick .set-name { margin: 0; }
.tut-pick .seg button { min-width: 0; padding: 12px 16px; font-size: 10px; white-space: nowrap; }
.tut-plan { list-style: none; margin: 0; padding: 0; counter-reset: pos; }
.tut-plan li { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: start; gap: 8px 16px; padding: 12px 0; border-bottom: 2px solid #1c2640; counter-increment: pos; }
.tut-pos { font-family: var(--px); font-size: 10px; line-height: 1.6; color: var(--text); }
.tut-pos::before { content: counter(pos) "."; display: inline-block; min-width: 3ch; color: var(--accent); }
.tut-drills { display: flex; flex-wrap: wrap; gap: 6px; }
.tut-drills span { padding: 4px 10px 3px; font-size: 18px; color: var(--muted); background: var(--panel2); box-shadow: inset 0 0 0 2px var(--line); }
.tut-go { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin-top: 24px; }
.tut-go .cta { width: auto; }
.tut-keys { margin: 0; font-size: 19px; color: var(--muted); }
.tut-link { padding: 0; border: 0; background: none; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { .tut-link:hover { color: #ffdb5c; } }
@media (max-width: 760px) { .tut-plan li { grid-template-columns: minmax(0, 1fr); } .tut-pick .seg button { padding: 12px 10px; font-size: 9px; } }
.keys-hrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.keys-hrow .keys-h { margin: 0; }
.keys-fixed { margin: 0; }
.keys-fixed > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 2px solid #1c2640; }
.keys-fixed dt { font-size: 20px; color: var(--text); }
.keys-fixed dd { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 19px; }
.keys-touch { margin-top: 16px; }
.set-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px 12px 24px; background: #0d1322; border-top: 3px solid var(--ink); }
.set-foot p { margin: 0; font-size: 19px; color: var(--muted); }
#set-reset.armed { color: var(--accent); box-shadow: 3px 3px 0 var(--ink), inset 0 0 0 3px var(--accent); }
@media (max-width: 760px) {
  .set-dlg { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: none; }
  .set-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .set-tabs { flex-direction: row; gap: 4px; padding: 8px; border-right: 0; border-bottom: 3px solid var(--ink); }
  .set-tab { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; min-height: 56px; padding: 8px 4px; font-size: 8px; text-align: center; }
  .set-tab[aria-selected="true"] { box-shadow: inset 0 -4px 0 var(--accent), inset 0 0 0 2px var(--line); }
  .set-pans { padding: 0 16px 20px; }
  .set-row { grid-template-columns: minmax(0, 1fr); }
  .set-row .seg { justify-content: flex-start; }
  .set-slider { width: 100%; }
  .keys-head, .key-row { grid-template-columns: minmax(0, 1fr) 96px 96px; gap: 8px; }
  .key-act { font-size: 18px; }
  .chat-row { grid-template-columns: minmax(0, 1fr); }
  .set-foot { padding: 10px 12px; }
  .set-foot p { display: none; }
}

@media (max-width: 760px) {
  body.on-title::before { background: linear-gradient(0deg, rgba(6, 9, 18, 0.94) 0, rgba(6, 9, 18, 0.8) 55%, rgba(6, 9, 18, 0.35) 100%); }
  #scr-title { align-items: flex-end; }
  .title-wrap { gap: 24px; padding-bottom: 28px; }
}
/* first load: the title, then the menu entries, 100 ms apart */
@media (prefers-reduced-motion: no-preference) {
  .intro .brand, .intro .main-menu > * { animation: rise 300ms ease-out both; }
  .intro .main-menu > :nth-child(1) { animation-delay: 100ms; }
  .intro .main-menu > :nth-child(2) { animation-delay: 150ms; }
  .intro .main-menu > :nth-child(3) { animation-delay: 200ms; }
  .intro .main-menu > :nth-child(4) { animation-delay: 250ms; }
  .intro .main-menu > :nth-child(5) { animation-delay: 300ms; }
}

/* ---------- Road to Glory ---------- */
.rtg-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rtg-slot { display: grid; gap: 14px; align-content: start; padding: 18px; }
.rtg-slot.empty { box-shadow: var(--shadow), inset 0 0 0 2px var(--line); background: var(--panel2); }
.rtg-slot-n { margin: 0; font: 10px/1 var(--px); color: var(--accent); text-shadow: 2px 2px 0 var(--ink); }
.rtg-slot-empty { margin: 0; color: var(--muted); }
.rtg-slot-who { display: flex; align-items: center; gap: 12px; }
.rtg-slot-who .ri-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.rtg-slot-who .ri-text b { font: 11px/1.3 var(--px); overflow-wrap: anywhere; }
.rtg-slot-who .ri-text span { color: var(--muted); font-size: 19px; line-height: 1; }
.rtg-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cta.danger { background: var(--rival); color: #fff; box-shadow: var(--shadow), inset 0 -4px 0 #b83636; }
@media (hover: hover) { .cta.danger:hover { background: #ff7a7a; } }
.rtg-confirm { width: min(520px, calc(100vw - 24px)); }
.rtg-confirm p { margin: 0 0 20px; color: var(--text); }

.rtg-new { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.rtg-new h3, .rtg-hub h3 { font-size: 13px; color: var(--accent); text-shadow: 2px 2px 0 var(--ink); }
.rtg-dex { display: grid; gap: 12px; padding: 18px; }
.rtg-dex-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rtg-search input, .rtg-name input {
  width: 100%; min-height: 44px; padding: 8px 12px; font: 22px/1 var(--body); color: var(--text);
  background: var(--ink); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line);
}
.rtg-search input:focus-visible, .rtg-name input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.rtg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.rtg-mon { display: grid; place-items: center; padding: 2px; min-height: 60px; background: var(--panel2); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.rtg-mon[aria-pressed="true"] { background: #2b3a5e; box-shadow: inset 0 0 0 3px var(--accent); }
@media (hover: hover) { .rtg-mon[aria-pressed="false"]:hover { background: #26314d; } }
.rtg-mon:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.rtg-none { grid-column: 1 / -1; margin: 8px 0; color: var(--muted); }
.rtg-side { display: grid; gap: 20px; }
.rtg-step { display: grid; gap: 14px; padding: 18px; }
.rtg-step fieldset { text-align: left; }
.rtg-step legend { margin: 0 0 10px; text-align: left; }
.rtg-step .seg { flex-wrap: wrap; }
.rtg-step .seg button { min-width: 0; padding-inline: 12px; }
.rtg-step .role-desc, .rtg-step .settings-note { margin: 0; color: var(--muted); font-size: 20px; }
.rtg-builds { display: grid; gap: 8px; }
.rtg-build { display: grid; gap: 4px; padding: 12px 14px; text-align: left; color: var(--muted); background: var(--panel2); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.rtg-build b { font: 11px/1.3 var(--px); color: var(--text); }
.rtg-build span { font: 20px/1.05 var(--body); }
.rtg-build .rtg-build-perk { color: var(--accent); }
.rtg-build[aria-pressed="true"] { background: #2b3a5e; box-shadow: inset 0 0 0 3px var(--accent); }
@media (hover: hover) { .rtg-build[aria-pressed="false"]:hover { background: #26314d; } }
.rtg-custom { display: grid; gap: 8px; }
.rtg-left { margin: 0; font: 10px/1.4 var(--px); color: var(--accent); }
.rtg-step-row, .rtg-up { display: grid; grid-template-columns: 48px 44px 3ch 44px; align-items: center; gap: 10px; }
.rtg-step-row b, .rtg-up b { font: 12px/1 var(--px); text-align: center; }
.rtg-stat { font: 9px/1 var(--px); color: var(--muted); }
.rtg-pm { width: 44px; height: 44px; font: 16px/1 var(--px); color: var(--text); background: var(--panel2); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
@media (hover: hover) { .rtg-pm:not(:disabled):hover { color: var(--accent); background: #26314d; } }
.rtg-name { display: grid; gap: 8px; }
.rtg-name span { font: 10px/1 var(--px); color: var(--muted); }

.rtg-preview { position: sticky; top: 20px; display: grid; gap: 16px; padding: 0 0 16px; }
.rtg-preview .cta { margin: 0 16px; width: auto; }
.rtg-preview .cta.big { font-size: 13px; white-space: nowrap; }
.rtg-card .card-top { position: relative; display: grid; place-items: center; height: 150px; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 35%, var(--panel2)), var(--panel2)); border-bottom: 3px solid var(--ink); }
.rtg-card h3 { font-size: 14px; line-height: 1.4; color: var(--text); text-shadow: none; overflow-wrap: anywhere; }
.rtg-role { margin: 4px 0 0; color: var(--muted); }
.rtg-perk { margin: 12px 0 0; font-size: 20px; line-height: 1.1; color: var(--muted); }
.rtg-perk b { font-weight: 400; color: var(--accent); }
.cap-bars .track { position: relative; }
.cap-bars .cap { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); }
.cap-n { flex: none; width: 4ch; font-size: 18px; color: var(--muted); }

.rtg-hub { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 920px; margin-inline: auto; }
.rtg-hub .rtg-preview { padding-bottom: 0; }
.rtg-up-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rtg-xp { margin: 0; color: var(--muted); }
.rtg-xp b { font: 14px/1 var(--px); color: var(--accent); margin-right: 6px; }
.rtg-ups { display: grid; gap: 8px; }
.rtg-up { grid-template-columns: 48px 4ch 4ch auto; justify-content: start; }
.rtg-up .ghost.small { min-width: 132px; }
.rtg-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 0; }
.rtg-facts dt { font: 9px/1 var(--px); color: var(--muted); margin-bottom: 6px; }
.rtg-facts dd { margin: 0; color: var(--text); }

/* the league: next match, standings and your schedule */
.rtg-next .cta.big { white-space: nowrap; }
.rtg-round { margin: 0 0 10px; font: 10px/1.4 var(--px); color: var(--muted); }
.rtg-vs { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 0 10px; }
.rtg-vs b { font: 16px/1 var(--px); text-shadow: 2px 2px 0 var(--ink); }
.rtg-vs span { color: var(--muted); font-size: 24px; }
.rtg-champ { display: flex; align-items: center; gap: 14px; }
.rtg-champ p { display: grid; gap: 6px; margin: 0; }
.rtg-champ b { font: 13px/1.3 var(--px); color: var(--accent); text-shadow: 2px 2px 0 var(--ink); }
.rtg-champ span { color: var(--muted); }
.rtg-toast { margin: 0 0 12px; padding: 8px 10px; color: var(--text); background: rgba(255, 207, 51, 0.1); border-left: 3px solid var(--accent); }
.rtg-club { display: inline-flex; align-items: center; gap: 8px; }
.rtg-club .crest { width: 20px; height: auto; }
.rtg-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
table.rtg-table { box-shadow: none; border: 0; background: none; }
table.rtg-table caption { color: var(--text); }
table.rtg-table td { font-variant-numeric: tabular-nums; }
table.rtg-table tr.cut th, table.rtg-table tr.cut td { border-bottom: 3px dashed var(--accent); }
.rtg-sched { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.rtg-sched li { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 2px solid var(--line); color: var(--muted); }
.rtg-sched .rtg-club { color: var(--text); min-width: 0; }
.rtg-wk { font: 8px/1 var(--px); white-space: nowrap; }
.rtg-r { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rtg-r b { font: 9px/1 var(--px); margin-right: 6px; }
.rtg-sched li.w .rtg-r b { color: #6bd88a; }
.rtg-sched li.l .rtg-r b { color: var(--rival); }
.rtg-sched li.now { color: var(--accent); }
.rtg-sched li.now .rtg-wk::before { content: "▶ "; }
.rtg-res { margin: 12px 0 0; color: var(--muted); }
.rtg-res b { font: 14px/1 var(--px); color: var(--accent); text-shadow: 2px 2px 0 var(--ink); margin-right: 6px; }
@media (max-width: 760px) {
  .rtg-tables, .rtg-sched { grid-template-columns: 1fr; }
  .rtg-sched li { grid-template-columns: 88px minmax(0, 1fr); grid-template-areas: "wk club" "wk r"; gap: 4px 10px; }
  .rtg-wk { grid-area: wk; } .rtg-sched .rtg-club { grid-area: club; } .rtg-r { grid-area: r; }
  .rtg-r:empty { display: none; }
  table.rtg-table th, table.rtg-table td { padding: 6px; }
}

@media (max-width: 1060px) {
  .rtg-new { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rtg-preview { position: static; }
  .rtg-new .rtg-preview { grid-column: 1 / -1; grid-row: 1; grid-template-columns: 260px 1fr; align-items: center; padding: 0; }
  .rtg-new .rtg-preview .cta { margin: 16px; }
}
@media (max-width: 760px) {
  .rtg-slots, .rtg-new, .rtg-hub { grid-template-columns: 1fr; }
  .rtg-new .rtg-preview { grid-row: auto; grid-template-columns: 1fr; padding-bottom: 16px; } /* after the choices, next to the Start button's job */
  .rtg-new .rtg-preview .cta { margin: 0 16px; }
  .rtg-grid { max-height: 300px; }
}

/* Road to Glory: the bar over the match while you wait on the bench */
.bench-bar {
  position: absolute; left: 50%; top: 10px; translate: -50% 0; display: flex; align-items: center; gap: 16px;
  max-width: calc(100% - 24px); padding: 10px 12px 10px 16px; background: rgba(10, 14, 24, 0.85); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line);
}
.bench-bar p { display: grid; gap: 4px; margin: 0; }
.bench-bar b { font: 10px/1.2 var(--px); color: var(--accent); }
.bench-bar span { font-size: 19px; line-height: 1; color: var(--muted); }
.bench-bar .ghost.small { white-space: nowrap; }
.bench-bar .ghost[aria-pressed="true"] { box-shadow: 3px 3px 0 var(--ink), inset 0 0 0 3px var(--accent); }
@media (max-width: 760px) { .bench-bar { top: auto; bottom: 8px; gap: 10px; } .bench-bar span { display: none; } } /* the scoreboard fills the top on small screens */
.rtg-facts .rtg-status { grid-column: 1 / -1; }
.rtg-res .rtg-up-msg { font: inherit; color: #6bd88a; text-shadow: none; margin: 0; }
.rtg-res .rtg-trust-loss { color: #ff8a8a; }
.rtg-bench-note b { color: var(--accent); font-weight: 400; }

/* Road to Glory: draft show, awards, coach goals and the career page */
.rtg-draft { max-width: 760px; margin: 0 auto; padding: 18px; display: grid; gap: 16px; }
.rtg-picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rtg-pick { display: grid; grid-template-columns: 3ch minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 12px; min-height: 52px; padding: 4px 10px; background: var(--panel2); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.rtg-pick-n { font: 12px/1 var(--px); color: var(--muted); text-align: right; }
.rtg-pick-who { display: flex; align-items: center; gap: 8px; min-width: 0; opacity: 0; }
.rtg-pick-who > span { display: grid; gap: 2px; min-width: 0; }
.rtg-pick-who b { font: 10px/1.3 var(--px); overflow-wrap: anywhere; }
.rtg-pick-who i { font-style: normal; color: var(--muted); font-size: 19px; line-height: 1; }
.rtg-pick.shown .rtg-pick-who { opacity: 1; }
.rtg-pick.you.shown { background: #2b3a5e; box-shadow: inset 0 0 0 3px var(--accent); }
.rtg-pick.you.shown i { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .rtg-pick-who { transition: opacity 200ms ease-out; } }
.rtg-draft-res { margin: 0; min-height: 1.3em; font: 12px/1.5 var(--px); color: var(--accent); text-shadow: 2px 2px 0 var(--ink); text-align: center; }
.rtg-draft .rtg-actions { justify-content: center; }
.rtg-goal { margin: 0; padding: 8px 10px; color: var(--text); background: rgba(255, 207, 51, 0.1); border-left: 3px solid var(--accent); }
.rtg-goal b { font-weight: 400; color: var(--accent); }
.rtg-aw-h { margin: 16px 0 8px; font: 10px/1 var(--px); color: var(--text); }
.rtg-awards, .rtg-trophies { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rtg-awards li, .rtg-trophies li { display: grid; gap: 2px; padding: 6px 10px; background: var(--panel2); border-left: 3px solid var(--line); }
.rtg-awards b, .rtg-trophies b { font: 9px/1.4 var(--px); color: var(--text); }
.rtg-awards span, .rtg-trophies span { color: var(--muted); font-size: 19px; line-height: 1.05; }
.rtg-awards li.you, .rtg-trophies li { border-left-color: var(--accent); }
.rtg-awards li.you b, .rtg-trophies li.champ b { color: var(--accent); }
.rtg-trophies { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.rtg-trophies li.none { grid-column: 1 / -1; border-left-color: var(--line); color: var(--muted); }
.rtg-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
table.rtg-stats { box-shadow: none; border: 0; background: none; min-width: 640px; }
table.rtg-stats td { font-variant-numeric: tabular-nums; }
table.rtg-stats td.rtg-club { display: table-cell; }
table.rtg-stats td.rtg-club .crest { display: inline-block; vertical-align: middle; margin-right: 6px; }
table.rtg-stats tfoot th, table.rtg-stats tfoot td { color: var(--accent); border-bottom: 0; }
@media (max-width: 560px) { .rtg-pick-who b { font-size: 8px; } .rtg-pick { gap: 8px; } }
.rtg-offers { display: grid; gap: 8px; margin-top: 4px; }
.rtg-offers .rtg-build b { display: flex; align-items: center; gap: 8px; }
.rtg-offers .crest { width: 20px; height: auto; }
.rtg-hof-wrap { margin-top: 28px; }
.rtg-hof-wrap h3 { font-size: 13px; color: var(--accent); text-shadow: 2px 2px 0 var(--ink); margin-bottom: 12px; }
.rtg-hof { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rtg-hof-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.rtg-hof-row .ri-text { display: grid; gap: 4px; min-width: 0; }
.rtg-hof-row .ri-text b { font: 11px/1.3 var(--px); overflow-wrap: anywhere; }
.rtg-hof-row .ri-text span { color: var(--muted); font-size: 19px; line-height: 1.05; }
.rtg-hof-row .rtg-hof-tro { color: var(--accent); }
.coach-steps li.low { color: var(--text); } .coach-steps li.low i { border-color: var(--rival); color: var(--rival); }

/* =====================================================================================================
   Menu screens (everything after the main menu): a blurred still of the arena behind, a sticky broadcast
   header with the setup steps, panels with a gold marker on their headings, and a row of buttons for the next step.
   ===================================================================================================== */
.menu-bg { display: none; position: fixed; inset: -48px; z-index: 0; pointer-events: none; background: #0b1020 center / cover no-repeat; filter: blur(16px) saturate(1.25) brightness(0.5); }
body.on-menu { background: #080b14; overflow-x: clip; }
body.on-menu .menu-bg { display: block; }
body.on-menu::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(90% 60% at 50% 0%, rgba(63, 167, 255, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(8, 11, 20, 0.5), rgba(8, 11, 20, 0.82) 60%, rgba(8, 11, 20, 0.94));
}
body.on-menu #menu { position: relative; z-index: 1; padding-top: 0; }

/* the header: full width, sticky, with the back button, the title and the steps */
body.on-menu .bar-head {
  position: sticky; top: 0; z-index: 6; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 22px;
  margin: 0 calc(50% - 50vw) 26px; padding: 16px max(20px, calc(50vw - 540px));
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.94), rgba(10, 14, 26, 0.82)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--ink); box-shadow: 0 3px 0 rgba(255, 207, 51, 0.28), 0 14px 28px rgba(0, 0, 0, 0.35);
}
body.on-menu .bar-head > div { min-width: 0; }
.bar-head h2 { font-size: 20px; color: #fbfcff; }
.bar-head .sub { max-width: 72ch; margin-top: 6px; font-size: 20px; line-height: 1.1; }
.eyebrow { margin: 0 0 8px; font: 9px/1.2 var(--px); color: var(--accent); letter-spacing: 1px; text-shadow: 2px 2px 0 var(--ink); }
.ghost.back { font-size: 10px; min-height: 44px; padding: 10px 14px 10px 12px; box-shadow: 3px 3px 0 var(--ink), inset 0 0 0 2px var(--line); }
.ghost.back span { font-size: 8px; margin-right: 6px; color: var(--accent); }

.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.flow li { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; font: 8px/1 var(--px); color: var(--muted); background: rgba(23, 32, 54, 0.9); border: 2px solid var(--ink); }
.flow i { display: grid; place-items: center; width: 20px; height: 20px; font-style: normal; color: var(--muted); background: var(--ink); }
.flow li.done { color: var(--text); }
.flow li.done i { color: #fff; background: #2f9e63; }
.flow li.now { color: #231b00; background: var(--accent); box-shadow: inset 0 -3px 0 #c99a0c; }
.flow li.now i { color: var(--accent); background: #231b00; }

/* panel headings: a gold block, then the name */
.panel-h, .rtg-new h3, .rtg-hub h3, .rtg-hof-wrap h3 {
  display: flex; align-items: center; gap: 10px; font-size: 11px; line-height: 1.3; color: var(--text); text-shadow: 2px 2px 0 var(--ink);
}
.panel-h::before, .rtg-new h3::before, .rtg-hub h3::before, .rtg-hof-wrap h3::before {
  content: ""; flex: none; width: 10px; height: 10px; background: var(--accent); box-shadow: 2px 2px 0 var(--ink);
}
legend.panel-h { float: left; width: 100%; margin: 0 0 14px; padding: 0; }
legend.panel-h + * { clear: both; }

/* the dock: the next step, a plain row of buttons under the panels */
.dock {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px 20px;
  margin: 28px 0 0; padding: 0 0 env(safe-area-inset-bottom);
}
.dock .cta.big { width: auto; min-width: 320px; }
.dock .cta.big span { margin: 0 0 0 10px; }
.dock .cta.big span:first-child { margin: 0 10px 0 0; }
.dock .quick-row { margin-right: auto; }
.dock.actions { justify-content: center; }
body.on-menu .foot { position: relative; z-index: 1; }

/* screens come in: the content under the header rises, 100 ms apart */
@media (prefers-reduced-motion: no-preference) {
  .screen > :not(.bar-head):not(.dock):not(dialog) { animation: rise 300ms ease-out both; }
  .screen > :nth-child(3) { animation-delay: 100ms; }
  .screen > :nth-child(n+4) { animation-delay: 200ms; }
}
@media (prefers-reduced-motion: reduce) { .screen > :not(.bar-head):not(.dock):not(dialog) { animation: fade 200ms ease-out both; } }
#scr-title > * { animation: none; }

/* buttons in a choice: quick colour changes only */
.seg button { transition-property: background-color, color; transition-duration: 120ms; transition-timing-function: ease-out; }
.seg.tabs { flex-wrap: wrap; }

/* ---------- teams: a face-off banner over the two club pickers ---------- */
.faceoff, .mu-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); margin-bottom: 20px; border: 3px solid var(--ink); box-shadow: var(--shadow); }
.fo-side, .mub-side {
  position: relative; display: flex; align-items: center; gap: 18px; min-width: 0; padding: 18px 22px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 10px, transparent 10px 20px),
    linear-gradient(90deg, color-mix(in srgb, var(--cc) 62%, #10162a), color-mix(in srgb, var(--cc) 18%, #10162a));
}
.fo-side.rival, .mub-side.rival {
  flex-direction: row-reverse; text-align: right;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 10px, transparent 10px 20px),
    linear-gradient(270deg, color-mix(in srgb, var(--cc) 62%, #10162a), color-mix(in srgb, var(--cc) 18%, #10162a));
}
.fo-side .crest, .mub-side .crest { width: 88px; height: auto; filter: drop-shadow(4px 4px 0 rgba(5, 8, 16, 0.5)); }
.fo-side p, .mub-side p { display: grid; gap: 10px; margin: 0; min-width: 0; }
.fo-side small, .mub-side small { font: 9px/1 var(--px); color: rgba(255, 255, 255, 0.78); }
.fo-side b, .mub-side p b { font: 18px/1.3 var(--px); font-weight: 400; color: #fff; text-shadow: 3px 3px 0 var(--ink); overflow-wrap: break-word; }
.fo-vs, .mub-vs { display: grid; place-items: center; padding: 0 20px; font: 24px/1 var(--px); color: var(--accent); background: var(--ink); text-shadow: 3px 3px 0 #000; }
.mub-ovr { display: grid; justify-items: center; gap: 6px; margin-left: auto; padding: 10px 12px 8px; background: rgba(10, 14, 24, 0.7); border: 2px solid var(--ink); }
.mub-side.rival .mub-ovr { margin-left: 0; margin-right: auto; }
.mub-ovr b { font: 26px/1 var(--px); color: var(--accent); text-shadow: 2px 2px 0 var(--ink); }
.mub-ovr small { font-size: 8px; }

.club-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.club-panel { display: grid; gap: 14px; padding: 18px; }
.club-panel.you { box-shadow: var(--shadow), inset 0 0 0 2px var(--line), inset 0 5px 0 var(--you); }
.club-panel.rival { box-shadow: var(--shadow), inset 0 0 0 2px var(--line), inset 0 5px 0 var(--rival); }
.club-panel .panel-h { padding-top: 4px; }
.club-panel .club-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.club-panel .club-tile { position: relative; padding: 10px 4px 9px; gap: 5px; min-width: 0; }
.club-panel .club-tile .crest { width: 48px; height: auto; }
.club-panel .club-tile b { font-size: 8px; }
.club-panel .club-tile span { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.club-panel .club-tile.random .crest { width: 30px; }
.club-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--cc) 28%, #1b2440); }
.club-tile[aria-pressed="true"]::after, .venue-card[aria-pressed="true"]::after, .rtg-build[aria-pressed="true"]::after { /* a pixel check, so the choice is not colour alone */
  content: "✓"; position: absolute; z-index: 3; top: 5px; right: 5px; display: grid; place-items: center; width: 20px; height: 20px;
  font: 10px/1 var(--px); color: #231b00; background: var(--accent); box-shadow: 2px 2px 0 var(--ink);
}
.club-tile.random[aria-pressed="true"]::after { top: 50%; translate: 0 -50%; right: 10px; }

/* ---------- venue: picture cards, then the rules ---------- */
.venue-layout { display: grid; gap: 20px; }
.venue-panel, .rules-panel { display: grid; gap: 16px; padding: 20px; }
.panel-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.time-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.time-pick legend { float: left; margin: 0; font-size: 9px; }
.venue-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.venue-card {
  position: relative; display: grid; padding: 0; text-align: left; overflow: hidden;
  background: var(--panel2); border: 3px solid var(--ink); box-shadow: var(--shadow);
  transition-property: translate, box-shadow; transition-duration: 150ms; transition-timing-function: ease-out;
}
.venue-card::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; box-shadow: inset 0 0 0 2px var(--line); }
.venue-card[aria-pressed="true"]::before { box-shadow: inset 0 0 0 3px var(--accent); }
.vc-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 3px solid var(--ink); background: #0d1322; }
.vc-img img { display: block; width: 100%; height: 100%; object-fit: cover; outline: 1px solid oklch(1 0 0 / 0.1); outline-offset: -1px; filter: saturate(0.6) brightness(0.7); transition-property: filter; transition-duration: 150ms; transition-timing-function: ease-out; }
.venue-card b { padding: 12px 14px 13px; font: 10px/1.3 var(--px); color: var(--muted); }
.venue-card[aria-pressed="true"] img { filter: none; }
.venue-card[aria-pressed="true"] b { color: var(--accent); }
@media (hover: hover) { .venue-card:hover img { filter: saturate(0.9) brightness(0.92); } .venue-card:hover b { color: var(--text); } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .venue-card:hover { translate: 0 -4px; box-shadow: 4px 8px 0 var(--ink); } }
.venue-card:active { translate: 4px 4px; box-shadow: 0 0 0 var(--ink); }
.venue-desc { margin: 14px 0 0; color: var(--muted); text-align: left; max-width: 80ch; }
.rules-panel { grid-template-columns: repeat(3, auto); justify-content: space-between; align-items: start; }
.rules-panel .panel-h { grid-column: 1 / -1; }
.rules-panel fieldset { text-align: left; }
.rules-panel legend { margin: 0 0 10px; }

/* ---------- position and draft: player cards with a tier frame ---------- */
.card { --tier: #c07f4f; position: relative; overflow: hidden; box-shadow: var(--shadow), inset 0 0 0 2px color-mix(in srgb, var(--tier) 60%, var(--line)); }
.card.tier-silver { --tier: #c9d2e3; }
.card.tier-gold { --tier: var(--accent); }
.card .card-top {
  align-items: flex-end; height: 156px; padding: 0;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.07) 48%, transparent 58%),
    radial-gradient(55% 70% at 50% 62%, color-mix(in srgb, var(--tc) 75%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--tc) 38%, #141b30), #141b30);
}
.card .card-top::after { content: ""; position: absolute; left: 50%; bottom: 14px; width: 104px; height: 14px; margin-left: -52px; border-radius: 50%; background: rgba(5, 8, 16, 0.4); }
.card .card-top .portrait { z-index: 1; margin-bottom: 4px; }
.card .ovr { z-index: 2; box-shadow: inset 0 0 0 2px var(--tier), 2px 2px 0 rgba(0, 0, 0, 0.4); }
.card .ovr b { color: var(--tier); }
.card.tier-bronze .ovr b { color: #ffb47a; }
button.card { transition-property: translate, box-shadow; transition-duration: 150ms; transition-timing-function: ease-out; }
@media (hover: hover) { button.card:hover { box-shadow: var(--shadow), inset 0 0 0 3px var(--tc); } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { button.card:not(:disabled):hover { translate: 0 -6px; box-shadow: 4px 10px 0 var(--ink), inset 0 0 0 3px var(--tc); } }
.pos-pick { display: grid; gap: 12px; max-width: none; margin: 0 0 24px; padding: 18px 20px; text-align: left; }
.pos-pick .seg { justify-content: flex-start; }
.pos-pick .role-desc { margin: 0; text-align: left; max-width: 80ch; }
.offers-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; min-height: 44px; }
.team-panel { top: 120px; display: grid; gap: 10px; }
.team-rating { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.team-rating b { font: 30px/1 var(--px); color: var(--accent); text-shadow: 3px 3px 0 var(--ink); }
.team-rating span { color: var(--muted); font-size: 19px; }
.meter { height: 14px; background: var(--ink); border: 2px solid var(--ink); }
.meter span { display: block; height: 100%; background: var(--accent); -webkit-mask: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 10px); mask: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 10px); transition-property: width; transition-duration: 300ms; transition-timing-function: ease-out; }
#roster { margin: 4px 0 0; }
#roster li:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.roster-item, .mu-list li { background: rgba(14, 20, 36, 0.7); }

/* ---------- matchup ---------- */
.mu-team { padding: 18px; }
.mu-team h3 .mu-name { font-size: 11px; }
.mu-list li { transition-property: background-color; transition-duration: 120ms; transition-timing-function: ease-out; }
.rot-note { font-size: 18px; line-height: 1.1; }

/* ---------- result: a full-width banner with the scoreboard ---------- */
.result-head {
  margin: 0 calc(50% - 50vw) 26px; padding: 40px max(20px, calc(50vw - 540px)) 30px;
  background: radial-gradient(70% 130% at 50% 0%, rgba(255, 207, 51, 0.26), transparent 70%), linear-gradient(180deg, rgba(10, 14, 26, 0.3), rgba(10, 14, 26, 0.8));
  border-bottom: 3px solid var(--ink); box-shadow: 0 3px 0 rgba(255, 207, 51, 0.28);
}
.result-head.loss { background: radial-gradient(70% 130% at 50% 0%, rgba(255, 93, 93, 0.22), transparent 70%), linear-gradient(180deg, rgba(10, 14, 26, 0.3), rgba(10, 14, 26, 0.8)); box-shadow: 0 3px 0 rgba(255, 93, 93, 0.3); }
.result-head .eyebrow { margin-bottom: 14px; }
.result-head h2 { font-size: clamp(26px, 5vw, 48px); color: #fbfcff; }
.result-head.win h2 { color: var(--accent); }
.res-board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; max-width: 1000px; margin: 26px auto 0; }
.res-team { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; opacity: 0.6; }
#res-t1 { flex-direction: row-reverse; }
.res-team.won { opacity: 1; }
.res-team .crest { width: 64px; height: auto; filter: drop-shadow(3px 3px 0 rgba(5, 8, 16, 0.5)); }
.res-team b { font: 12px/1.4 var(--px); font-weight: 400; text-align: right; overflow-wrap: break-word; text-shadow: 2px 2px 0 var(--ink); }
#res-t1 b { text-align: left; }
.res-board .score { margin: 0; padding: 14px 22px 12px; font-size: clamp(30px, 5.4vw, 58px); line-height: 1; white-space: nowrap; background: var(--ink); box-shadow: 4px 4px 0 #000, inset 0 0 0 2px var(--line); }
.res-sets { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.res-sets:empty { display: none; }
.res-sets span { padding: 6px 9px; font: 8px/1 var(--px); color: var(--muted); background: rgba(10, 14, 24, 0.75); border: 2px solid var(--ink); }
.res-sets b { margin-left: 6px; font-weight: 400; color: var(--text); }
.res-sets .w b { color: var(--accent); }
.result-head .sub { margin-top: 14px; }
.res-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.mvp.panel { display: grid; justify-items: center; gap: 0; margin: 0; padding: 0 0 18px; text-align: center; overflow: hidden; }
.mvp.panel .portrait { width: 100% !important; height: 160px !important; background: radial-gradient(50% 60% at 50% 65%, rgba(255, 207, 51, 0.32), transparent 72%), linear-gradient(180deg, #2b3a5e, #141b30); border-bottom: 3px solid var(--ink); }
.mvp.panel > div { justify-items: center; gap: 8px; padding: 16px 14px 0; }
.mvp.panel span { font-size: 9px; }
.mvp .mvp-line { color: var(--text); }
.res-body .box-wrap { grid-template-columns: 1fr; margin: 0; }
table.box thead th { background: rgba(10, 14, 24, 0.6); }
table.box tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
table.box tr.you { background: rgba(255, 207, 51, 0.08); }

/* ---------- pause ---------- */
#pause { background: rgba(8, 11, 20, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#pause .dialog { min-width: min(380px, 90%); padding: 28px 26px 26px; box-shadow: var(--shadow), inset 0 0 0 2px var(--line), inset 0 5px 0 var(--accent); }
.pause-score { margin: -4px 0 6px; color: var(--muted); font-size: 21px; line-height: 1.1; }

/* ---------- dialogs ---------- */
.dlg { background: linear-gradient(180deg, #1a2340, #121a2e); }
.dlg::backdrop { background: rgba(5, 8, 16, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* ---------- Road to Glory ---------- */
.rtg-slot { position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 380px; padding: 0 0 18px; overflow: hidden; }
.rtg-slot-n { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 6px 8px 5px; background: var(--ink); }
.rtg-slot-top { position: relative; display: grid; place-items: center; height: 170px; border-bottom: 3px solid var(--ink);
  background: radial-gradient(55% 70% at 50% 62%, color-mix(in srgb, var(--tc) 75%, transparent), transparent 72%), linear-gradient(180deg, color-mix(in srgb, var(--tc) 38%, #141b30), #141b30); }
.rtg-slot-top .ovr b { color: var(--accent); }
.rtg-slot-who { display: grid; gap: 6px; padding: 0 18px; }
.rtg-slot-who b { margin-bottom: 4px; font: 13px/1.3 var(--px); font-weight: 400; overflow-wrap: anywhere; }
.rtg-slot-who span { color: var(--muted); font-size: 20px; line-height: 1; }
.rtg-slot-who .rtg-club { color: var(--text); }
.rtg-slot > .rtg-actions, .rtg-slot > .cta { margin: auto 18px 0; }
.rtg-slot.empty { align-items: center; justify-content: center; padding: 48px 18px 18px; text-align: center; background: rgba(23, 32, 54, 0.55); border-style: dashed; border-color: var(--line); box-shadow: none; }
.rtg-slot.empty > .cta { align-self: stretch; margin: auto 0 0; }
.rtg-slot-plus { display: grid; place-items: center; width: 76px; height: 76px; margin-top: auto; font: 30px/1 var(--px); color: var(--accent); border: 3px dashed var(--line); }
.rtg-slot-empty { max-width: 24ch; }
.rtg-hub { max-width: none; }
.rtg-next { box-shadow: var(--shadow), inset 0 0 0 3px var(--accent); background: radial-gradient(80% 60% at 50% 0%, rgba(255, 207, 51, 0.14), transparent 70%), linear-gradient(180deg, #222d4b, #19223a); }
.rtg-vs .crest { width: 56px; height: auto; }
.rtg-vs b { font-size: 20px; }
#hub-train { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rtg-card h3 { font-size: 14px; }
.rtg-card h3::before, .mu-team h3::before { display: none; }
.rtg-build { position: relative; }
.rtg-drill { align-content: start; }
.drill-stat { justify-self: start; margin-bottom: 4px; padding: 5px 6px 4px; font: 8px/1 var(--px); font-style: normal; color: var(--accent); background: var(--ink); }
.rtg-draft { max-width: 820px; }

/* ---------- phones and narrow windows ---------- */
@media (max-width: 1060px) {
  body.on-menu .bar-head { grid-template-columns: auto minmax(0, 1fr); }
  .flow { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .club-cols { grid-template-columns: 1fr; }
  .res-body { grid-template-columns: 1fr; }
  .mvp.panel { grid-template-columns: 140px 1fr; justify-items: start; text-align: left; padding: 0; }
  .mvp.panel .portrait { width: 140px !important; height: 100% !important; min-height: 120px; border-bottom: 0; border-right: 3px solid var(--ink); }
  .mvp.panel > div { justify-items: start; padding: 14px; }
  .rules-panel { grid-template-columns: 1fr; }
  .team-panel { top: auto; }
}
@media (max-width: 720px) {
  .venue-cards { grid-template-columns: 1fr; gap: 10px; }
  .venue-card { grid-template-columns: 132px minmax(0, 1fr); align-items: center; }
  .vc-img { border-bottom: 0; border-right: 3px solid var(--ink); }
  .fo-side, .mub-side { gap: 10px; padding: 12px; }
  .fo-side .crest, .mub-side .crest { width: 48px; }
  .fo-side b, .mub-side p b { font-size: 9px; line-height: 1.5; }
  .fo-side small, .mub-side small { font-size: 7px; }
  .fo-vs, .mub-vs { padding: 0 10px; font-size: 14px; }
  .mub-side { flex-wrap: wrap; }
  .mub-ovr { margin-left: 0; padding: 6px 8px; }
  .mub-ovr b { font-size: 16px; }
  .res-board { gap: 10px; }
  .res-team { flex-direction: column-reverse; justify-content: center; gap: 8px; }
  #res-t1 { flex-direction: column-reverse; }
  .res-team b, #res-t1 b { font-size: 9px; text-align: center; }
  .res-team .crest { width: 44px; }
}
@media (max-width: 560px) {
  body.on-menu .bar-head { gap: 10px 12px; margin-bottom: 18px; padding: 10px 14px; }
  .bar-head h2 { font-size: 14px; }
  .bar-head .sub { font-size: 18px; }
  .eyebrow { font-size: 8px; margin-bottom: 6px; }
  .flow li:not(.now) span { display: none; }
  .flow li:not(.now) { padding-right: 5px; }
  .dock { flex-wrap: wrap; gap: 10px; margin-top: 20px; }
  .dock .cta.big { flex: 1 1 100%; min-width: 0; }
  .dock .quick-row { order: 2; margin: 0; }
  .club-panel { padding: 12px; }
  .club-panel .club-grid { gap: 5px; }
  .club-panel .club-tile .crest { width: 40px; }
  .club-tile[aria-pressed="true"]::after { width: 14px; height: 14px; font-size: 7px; top: 3px; right: 3px; }
  .venue-card { grid-template-columns: 110px minmax(0, 1fr); }
  .venue-panel, .rules-panel { padding: 14px; }
  .rtg-slot { min-height: 0; }
}

/* ---------- Road to Glory hub: a season strip and tabs beside the player card ---------- */
.hub-main { display: grid; gap: 16px; align-content: start; min-width: 0; }
.hub-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hub-strip li { display: grid; gap: 6px; padding: 9px 12px 8px; background: rgba(14, 20, 36, 0.8); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.hub-strip small { font: 7px/1 var(--px); color: var(--muted); }
.hub-strip b { font-weight: 400; font-size: 21px; line-height: 1; color: var(--text); white-space: nowrap; }
.hub-strip li:last-child b { color: var(--accent); }
.hub-tabs { display: flex; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border-bottom: 3px solid var(--ink); box-shadow: 0 2px 0 var(--line); }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tabs [role="tab"] {
  flex: none; display: flex; align-items: center; min-height: 48px; padding: 12px 16px 10px; font-size: 10px; white-space: nowrap;
  color: var(--muted); background: rgba(23, 32, 54, 0.85); border: 3px solid var(--ink); border-bottom: 0; box-shadow: inset 0 0 0 2px var(--line);
  transition-property: background-color, color; transition-duration: 120ms; transition-timing-function: ease-out;
}
.hub-tabs [role="tab"][aria-selected="true"] { color: #231b00; background: var(--accent); box-shadow: inset 0 -4px 0 #c99a0c; }
@media (hover: hover) { .hub-tabs [role="tab"][aria-selected="false"]:hover { color: var(--text); background: #26314d; } }
.hub-tabs [role="tab"]:focus-visible { outline-offset: -5px; }
.tab-badge { margin-left: 8px; padding: 4px 5px 3px; font: 7px/1 var(--px); font-style: normal; color: #231b00; background: var(--accent); box-shadow: 2px 2px 0 var(--ink); }
[aria-selected="true"] > .tab-badge { color: var(--accent); background: #231b00; box-shadow: none; }
.hub-pane { display: grid; gap: 20px; align-content: start; }
.hub-pane > .rtg-toast { margin: 0; }
.rtg-retire-btn { justify-self: start; }
.rtg-hub .rtg-preview { top: 120px; }
@media (max-width: 760px) {
  .rtg-hub { display: flex; flex-direction: column; }
  .rtg-hub #hub-card { order: 2; }
  .rtg-hub:not([data-tab="home"]):not([data-tab="up"]) #hub-card { display: none; }
  .hub-strip li { padding: 7px 9px 6px; }
  .hub-strip b { font-size: 19px; }
  .hub-tabs [role="tab"] { padding-inline: 12px; font-size: 9px; }
}

/* Home: this week's tasks, numbered, with a check once done */
.rtg-week { box-shadow: var(--shadow), inset 0 0 0 3px var(--accent); background: radial-gradient(80% 50% at 50% 0%, rgba(255, 207, 51, 0.12), transparent 70%), linear-gradient(180deg, #222d4b, #19223a); }
.rtg-week-n { margin: 0; font: 9px/1.3 var(--px); color: var(--accent); }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: task; }
.task { counter-increment: task; display: grid; gap: 12px; padding: 14px; background: rgba(14, 20, 36, 0.7); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.task-head { display: flex; align-items: center; gap: 12px; }
.task-head p { display: grid; gap: 6px; margin: 0; }
.task-head b { font: 11px/1.3 var(--px); font-weight: 400; color: var(--text); }
.task-head span { color: var(--muted); font-size: 19px; line-height: 1; }
.task-box { flex: none; display: grid; place-items: center; width: 28px; height: 28px; font: 10px/1 var(--px); font-style: normal; color: var(--accent); background: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.task-box::before { content: counter(task); }
.task.done .task-box { color: #fff; background: #2f9e63; box-shadow: none; }
.task.done .task-box::before { content: "✓"; }
.task.done .task-head span { color: #6bd88a; }
.task-body { display: grid; gap: 12px; }
.task-body .rtg-goal, .task-body .settings-note { margin: 0; }
#task-play .task-body .cta.big { white-space: normal; text-wrap: balance; line-height: 1.5; } /* long labels ("Advance to next week") wrap inside the column */

/* Stats: your season line and the league leaders */
.my-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.my-line li { display: grid; gap: 8px; justify-items: center; padding: 12px 6px 10px; background: rgba(14, 20, 36, 0.7); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.my-line small { font: 7px/1 var(--px); color: var(--muted); }
.my-line b { font: 18px/1 var(--px); font-weight: 400; color: var(--accent); text-shadow: 2px 2px 0 var(--ink); font-variant-numeric: tabular-nums; }
.leaders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.leader { display: grid; gap: 10px; align-content: start; padding: 12px; background: rgba(14, 20, 36, 0.7); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.leader h4 { margin: 0; font: 10px/1.3 var(--px); font-weight: 400; color: var(--accent); }
.leader ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.leader li { display: grid; grid-template-columns: 22px 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 6px; color: var(--text); border-bottom: 2px solid var(--line); }
.leader li:last-child { border-bottom: 0; }
.leader li i { font: 9px/1 var(--px); font-style: normal; color: var(--muted); }
.leader li:first-child i { color: var(--accent); }
.leader li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader li b { font: 11px/1 var(--px); font-weight: 400; font-variant-numeric: tabular-nums; }
.leader li.you { background: rgba(255, 207, 51, 0.1); box-shadow: inset 3px 0 0 var(--accent); }
.leader li.you span, .leader li.you b { color: var(--accent); }
.leader .crest { width: 20px; height: auto; }
.leader-you { margin: 0; font-size: 18px; line-height: 1.1; color: var(--accent); }
@media (max-width: 560px) { .my-line { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.task-body .rtg-round { display: none; } /* the week is already in the panel heading */
@media (max-width: 560px) {
  #hub-train { grid-template-columns: 1fr 1fr; gap: 6px; }
  #hub-train .rtg-build { padding: 10px; }
  #hub-train .rtg-build span { font-size: 17px; }
}

/* ---------- Road to Glory hub, fitted: the hub fills the window and every tab fits without scrolling ---------- */
body:has(#scr-rtg-hub:not([hidden])) .foot { display: none; }
body:has(#scr-rtg-hub:not([hidden])) #menu { padding-bottom: 0; }
#scr-rtg-hub:not([hidden]) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#scr-rtg-hub .bar-head { flex: none; margin-bottom: 14px; padding-block: 10px; }
#scr-rtg-hub .bar-head .eyebrow { margin-bottom: 5px; }
#scr-rtg-hub .bar-head h2 { font-size: 18px; }
#scr-rtg-hub .bar-head .sub { margin-top: 4px; font-size: 19px; }
.rtg-hub { flex: 1; min-height: 0; position: relative; align-items: stretch; padding-bottom: 14px; }
.rtg-hub #hub-card { position: static; align-self: start; }
.rtg-hub .rtg-card .card-top { height: 128px; }
.rtg-hub .rtg-card .card-body { padding: 10px 14px 14px; }
.rtg-hub .rtg-card .bars { gap: 5px; }
.hub-main { grid-template-rows: auto auto minmax(0, 1fr); gap: 10px; min-height: 0; }
.hub-strip li { padding: 7px 10px 6px; gap: 5px; }
.hub-strip b { font-size: 19px; }
.hub-tabs { gap: 3px; overflow: visible; flex-wrap: wrap; }
.hub-tabs [role="tab"] { flex: 1 1 auto; justify-content: center; min-height: 44px; padding: 10px 10px 8px; font-size: 9px; }
.tab-badge { margin-left: 6px; }
/* the pane takes the height that is left; it only scrolls as a last resort on a very small window */
.hub-pane { min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 10px; }
.rtg-hub .rtg-step { gap: 10px; padding: 14px 16px; }
.rtg-hub .rtg-step .settings-note { font-size: 19px; line-height: 1.05; }

/* Home: the two tasks side by side on wide windows; drills as compact rows */
.tasks { gap: 10px; grid-template-columns: minmax(0, 1fr); }
.task, .task-body, #hub-next-info { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.task { gap: 10px; padding: 12px; align-content: start; }
.task-head p { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.task-head span { font-size: 18px; }
.ml-abbr { display: none; }
.task-body { gap: 10px; }
#hub-train { grid-template-columns: 1fr; gap: 6px; }
#hub-train .rtg-drill { grid-template-columns: 44px auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; }
#hub-train .rtg-drill .drill-stat { margin: 0; justify-self: stretch; text-align: center; }
#hub-train .rtg-drill span { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.rtg-vs { padding: 0; }
.rtg-vs .crest { width: 44px; }
.rtg-vs b { font-size: 18px; }
#hub-next-info { display: grid; gap: 8px; }
#hub-next-info .rtg-goal { padding: 6px 10px; line-height: 1.05; }
#task-play .cta.big { min-height: 52px; }
@media (min-width: 1000px) { .tasks:not(:has(#task-train[hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; } }
/* the off-season: the champion, the awards in a grid and the offers side by side */
#hub-next-info .rtg-aw-h { margin: 4px 0 0; }
.rtg-week:has(#task-train[hidden]) > .rtg-up-head { display: none; } /* off-season: the task names the next season */
#hub-awards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
#hub-awards li { padding: 8px 10px; gap: 4px; }
#hub-next-info .rtg-offers { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 8px; margin: 0; }
#hub-next-info .rtg-offers .rtg-aw-h { grid-column: 1 / -1; }
#hub-next-info .rtg-offers .rtg-build { padding: 8px 10px; }
#hub-next-info .rtg-offers .rtg-build span { font-size: 18px; }
.rtg-champ .crest { width: 40px; }

/* Upgrades: each stat with its bar and cap notch */
.rtg-up { grid-template-columns: 48px minmax(80px, 1fr) 3ch 4ch auto; justify-content: stretch; gap: 12px; }
.rtg-up .track { position: relative; height: 14px; }
.rtg-up .cap { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text); }
.rtg-up .ghost.small { min-width: 124px; }
.hub-perk { margin: 0; font-size: 19px; }

/* Standings and schedule */
.rtg-hub table.rtg-table th, .rtg-hub table.rtg-table td { padding: 6px 8px; }
.rtg-hub table.rtg-table .rtg-club { white-space: nowrap; }
.rtg-sched { gap: 0 20px; grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 8), auto); }
.rtg-sched li { grid-template-columns: 4ch minmax(0, 1fr) auto; gap: 8px; padding: 5px 2px; }
.rtg-wk { font: 9px/1 var(--px); }
.rtg-sched .rtg-club { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtg-sched .rtg-r { white-space: nowrap; }
.sc-abbr { display: none; }
/* played weeks show the club's short name so the set scores fit beside it */
.rtg-sched li.w .sc-full, .rtg-sched li.l .sc-full { display: none; }
.rtg-sched li.w .sc-abbr, .rtg-sched li.l .sc-abbr { display: inline; }
.rtg-sched li.now .rtg-wk::before { content: "▶"; margin-right: 2px; }

/* Stats: one row of five leader boards on wide windows */
.my-line li { padding: 9px 6px 8px; gap: 6px; }
.leaders { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.leader { gap: 6px; padding: 10px 8px; }
.leader h4 { font-size: 9px; }
.leader li { grid-template-columns: 10px 16px minmax(0, 1fr) auto; gap: 6px; padding: 4px 2px; font-size: 19px; }
.leader .crest { width: 16px; }
.leader-you { font-size: 17px; }
@media (max-width: 1180px) { .leaders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1181px) and (max-width: 1500px) { .leader li { grid-template-columns: 10px minmax(0, 1fr) auto; } .leader li .crest { display: none; } }

/* Career: difficulty and retire on one row, trophies grouped by kind, a page of seasons */
.car-top { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.car-top h3, .car-top > .settings-note:not(.vh) { grid-column: 1; }
.car-top .car-row { grid-column: 2; grid-row: 1 / span 2; }
.car-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.car-row .seg button { min-height: 40px; }
.rtg-trophies { display: flex; flex-wrap: wrap; gap: 6px; }
.rtg-trophies li { display: flex; align-items: baseline; gap: 8px; }
.rtg-trophies li.none { flex: 1; }
.car-row legend { margin: 0 0 8px; font-size: 10px; color: var(--muted); }
.rtg-trophies li { padding: 5px 9px; }
.rtg-trophies span { font-size: 18px; }
.rtg-hub table.rtg-stats { min-width: 0; }
.rtg-hub table.rtg-stats th, .rtg-hub table.rtg-stats td { padding: 5px 6px; }
.rtg-hub table.rtg-stats abbr { text-decoration: none; }
.hist-pager { display: flex; align-items: center; gap: 8px; }
.hist-pager span { color: var(--muted); font-size: 18px; white-space: nowrap; }
.hist-pager .ghost.small { min-height: 36px; padding: 7px 10px; font-size: 8px; }
.hist-note { font-size: 17px !important; }
.hub-toast { position: absolute; left: 50%; bottom: 24px; z-index: 4; translate: -50% 0; width: max-content; max-width: min(560px, calc(100% - 24px)); margin: 0; background: #2a2510; box-shadow: 3px 3px 0 var(--ink); }

/* Every tab has the same footprint: the hub always spans the full width (it used to shrink to its content, so it slid
   sideways between tabs) and each tab's panel fills the height that is left, so switching tabs never moves anything.
   The hub is also wider on big screens, and the standings and schedule spread their rows over the whole panel. */
body:has(#scr-rtg-hub:not([hidden])) #menu { max-width: 1480px; }
.rtg-hub { align-self: stretch; width: 100%; }
@media (min-width: 1240px) { .rtg-hub { grid-template-columns: 320px minmax(0, 1fr); } }
.hub-pane { display: flex; flex-direction: column; }
.hub-pane > .panel { flex: none; }
.hub-pane > .panel:last-child { flex: 1 0 auto; align-content: start; }
#hub-league, #hub-sched-wrap { display: flex; flex-direction: column; }
#hub-league .rtg-tables, #hub-sched { flex: 1; }
.rtg-tables { align-items: stretch; grid-auto-rows: minmax(0, 1fr); --cap: 26px; }
.rtg-hub .rtg-tables table.rtg-table caption { box-sizing: border-box; height: var(--cap); padding: 0; } /* fixed so the table can fill the rest */
.rtg-tables table.rtg-table { height: calc(100% - var(--cap)); }
#hub-sched { grid-template-rows: repeat(var(--rows, 8), minmax(0, 1fr)); }
#hub-sched li { align-content: center; }
@media (min-width: 1240px) {
  .rtg-hub table.rtg-table caption { font-size: 12px; }
  .rtg-hub table.rtg-table thead th { font-size: 9px; }
  .rtg-hub table.rtg-table tbody th, .rtg-hub table.rtg-table td { font-size: 27px; padding: 6px 12px; }
  .rtg-hub table.rtg-table .crest { width: 26px; }
  #hub-sched li { font-size: 27px; gap: 12px; padding-inline: 4px; }
  #hub-sched .rtg-wk { font-size: 11px; }
  #hub-sched .crest { width: 26px; }
  .rtg-hub .rtg-step .settings-note { font-size: 21px; }
  .leader h4 { font-size: 11px; }
  .leader li { font-size: 23px; }
}
/* Filling the panel with content, not gaps: where a tab has room to spare its pieces grow as solid tiles (drills,
   stat rows, leader cards, trophy slots) instead of spreading loose text down an empty panel. Each tile keeps its
   natural height as a minimum, so a short window still fits and only scrolls as a last resort. */
.drill-track, .rtg-up .track { position: relative; }
.drill-track .cap, .rtg-up .cap { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text); }
#hub-train .drill-track { grid-column: 1 / -1; flex: none; height: 12px; }
.up-name { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 4px 12px; min-width: 0; }
.up-name .rtg-stat { grid-row: span 2; justify-self: start; padding: 5px 6px 4px; font-size: 8px; color: var(--accent); background: var(--ink); }
.rtg-up .up-name b { font: 11px/1.2 var(--px); text-align: left; color: var(--text); }
.up-name small { font-size: 18px; line-height: 1; color: var(--muted); }
.rtg-up { grid-template-columns: minmax(170px, 260px) minmax(80px, 1fr) 3ch 4ch auto; }
.ml-rank { font-size: 16px; line-height: 1; color: var(--muted); text-align: center; }
.leader li { background: var(--panel2); box-shadow: inset 3px 0 0 var(--line); padding: 6px 8px; }
.leader li:nth-child(1) { box-shadow: inset 3px 0 0 var(--accent); }
.leader li:nth-child(2) { box-shadow: inset 3px 0 0 #c3cad8; }
.leader li:nth-child(3) { box-shadow: inset 3px 0 0 #c98a4f; }
.leader li.you { background: rgba(255, 207, 51, 0.12); }
.leader ol { gap: 6px; }
.rtg-trophies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rtg-trophies li { display: grid; align-content: center; gap: 6px; padding: 10px 12px; border-left: 3px solid var(--accent); }
.rtg-trophies li.locked { background: transparent; border: 2px dashed var(--line); border-left-width: 2px; }
.rtg-trophies li.locked b { color: var(--muted); }
.rtg-trophies li.won { background: rgba(255, 207, 51, 0.1); }
.rtg-trophies li.won b { color: var(--accent); }
@media all {
  /* Home: both tasks run the full height; the drills share it and the matchup sits in the middle of its card */
  .rtg-week { display: flex; flex-direction: column; }
  .rtg-week > .tasks { flex: 1 0 auto; }
  .rtg-week > .tasks:not(:has(#task-train[hidden])) { align-items: stretch; }
  .task, .task-body { display: flex; flex-direction: column; }
  .task-body { flex: 1 0 auto; }
  #hub-train:has(.rtg-drill) { flex: 1 0 auto; grid-auto-rows: 1fr; }
  #hub-train .rtg-drill { align-content: center; row-gap: 8px; }
  #hub-next-info { flex: 1 0 auto; display: flex; flex-direction: column; }
  #hub-next-info .rtg-vs { flex: 1 0 auto; }
  /* Upgrades: each stat is a tile, and the five share the panel */
  #pane-up > .rtg-step { display: flex; flex-direction: column; }
  #hub-ups { flex: 1 0 auto; grid-auto-rows: 1fr; }
  .rtg-up { padding: 10px 14px; background: rgba(14, 20, 36, 0.7); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
  /* Stats: the boards share the panel's height and their three rows are cards */
  #leaders-wrap { grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
  .leader { grid-template-rows: auto minmax(0, 1fr) auto; }
  .leader ol { grid-auto-rows: minmax(min-content, 1fr); }
  .leader li { align-content: center; }
  /* Career: the trophy case takes the room the season table does not need yet */
  #pane-career > .panel:last-child { flex: none; }
  #pane-career > .panel:has(#stats-trophies) { flex: 1 0 auto; display: flex; flex-direction: column; }
  #stats-trophies { flex: 1 0 auto; grid-auto-rows: 1fr; }
}
@media (min-width: 1240px) and (min-height: 821px) {
  #hub-train .rtg-drill b { font-size: 13px; }
  #hub-train .rtg-drill span { font-size: 22px; }
  #hub-train .rtg-drill .drill-stat { font-size: 9px; }
  #hub-next-info .rtg-vs .crest { width: 88px; }
  #hub-next-info .rtg-vs b { font-size: 28px; }
  #hub-next-info .rtg-vs span { font-size: 30px; }
  .rtg-up .up-name b { font-size: 13px; }
  .up-name small { font-size: 21px; }
  .rtg-up .track { height: 18px; }
  .rtg-up > b { font-size: 16px; }
  .rtg-up .cap-n { font-size: 21px; }
  .my-line b { font-size: 30px; }
  .my-line small { font-size: 9px; }
  .ml-rank { font-size: 19px; }
  .rtg-trophies b { font-size: 11px; }
  .rtg-trophies span { font-size: 21px; }
}
/* tall wide windows: each leader is a stacked card with a big number */
@media (min-width: 1240px) and (min-height: 860px) {
  .leader li { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "r crest val" "name name name"; gap: 6px 8px; padding: 10px 12px; }
  .leader li i { grid-area: r; font-size: 11px; }
  .leader li .crest { grid-area: crest; display: block; width: 30px; justify-self: start; }
  .leader li span { grid-area: name; }
  .leader li b { grid-area: val; font-size: 22px; }
}
/* the matchup: each club stacked as crest, short name and its team OVR */
.vs-team { display: grid; justify-items: center; gap: 8px; min-width: 0; }
.vs-team small { display: flex; align-items: baseline; gap: 6px; padding: 5px 8px 4px; font: 8px/1 var(--px); color: var(--muted); background: var(--ink); }
.vs-team em { font: 14px/1 var(--px); font-style: normal; color: var(--accent); font-variant-numeric: tabular-nums; }
.rtg-vs { gap: 20px; }
@media (min-width: 1240px) and (min-height: 821px) {
  .vs-team { gap: 12px; }
  .vs-team small { padding: 7px 10px 6px; font-size: 10px; }
  .vs-team em { font-size: 22px; }
  .rtg-vs { gap: 36px; }
}
/* short windows: the tiles drop their extras so every tab still fits */
@media (min-width: 761px) and (max-height: 820px) {
  #hub-train .drill-track { display: none; }
  .up-name small { display: none; }
  .rtg-up { padding: 4px 12px; }
  .ml-rank { font-size: 14px; }
  .my-line li { gap: 4px; padding-block: 6px; }
  .rtg-trophies li { gap: 2px; padding: 5px 10px; }
  .rtg-trophies span { font-size: 16px; }
  .rtg-trophies { gap: 5px; }
  .leader ol { gap: 3px; }
  .leader li { padding-block: 4px; }
}
@media (max-width: 760px) {
  /* phones: the drills stay one compact row and the match card takes the rest */
  #hub-train:has(.rtg-drill) { flex: none; }
  .rtg-week > .tasks:not(:has(#task-train[hidden])) { grid-template-rows: auto minmax(min-content, 1fr); }
  #hub-train .drill-track { display: none; }
  .rtg-up { padding: 4px 10px; }
  #hub-next-info .vs-team .crest { width: 52px; }
  #hub-next-info .vs-team b { font-size: 18px; }
  .up-name { grid-template-columns: 38px; }
  .up-name b, .up-name small { display: none; }
  .ml-rank { font-size: 13px; }
  .rtg-trophies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* phones: the schedule keeps its natural row height (stretched rows read as gaps on a narrow screen) */
@media (max-width: 760px) { #hub-sched { grid-template-rows: repeat(var(--rows, 8), auto); align-content: start; } }

/* phones: the card and strip shrink away, the tabs wrap into rows of three */
@media (max-width: 760px) {
  #scr-rtg-hub .bar-head { margin-bottom: 8px; padding-block: 8px; }
  #scr-rtg-hub .bar-head .eyebrow { display: none; }
  #scr-rtg-hub .bar-head h2 { font-size: 13px; }
  #scr-rtg-hub .bar-head .sub { font-size: 17px; }
  .rtg-hub { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
  .rtg-hub #hub-card, .rtg-hub:not([data-tab="home"]):not([data-tab="up"]) #hub-card { display: none; }
  .hub-main { flex: 1; gap: 8px; }
  .hub-strip { display: block; font-size: 17px; line-height: 1.1; color: var(--muted); }
  .hub-strip li { display: inline; padding: 0; background: none; border: 0; box-shadow: none; }
  .hub-strip li + li::before { content: " · "; }
  .hub-strip small { display: none; }
  .hub-strip b { display: inline; font-size: 17px; color: var(--text); white-space: normal; }
  .hub-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; border-bottom: 0; box-shadow: none; }
  .hub-tabs [role="tab"] { min-height: 40px; padding: 8px 4px 6px; font-size: 8px; border-bottom: 3px solid var(--ink); }
  .tab-badge { margin-left: 4px; padding: 3px 3px 2px; font-size: 6px; }
  /* seven tabs in the off-season: four across, badges under the names */
  .hub-tabs:has(#tab-awards:not([hidden])) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hub-tabs:has(#tab-awards:not([hidden])) [role="tab"] { flex-direction: column; gap: 3px; padding-inline: 2px; font-size: 7px; }
  .hub-tabs:has(#tab-awards:not([hidden])) .tab-badge { margin: 0; }
  .rtg-hub .rtg-step { gap: 8px; padding: 10px; }
  .rtg-hub .rtg-step .settings-note { font-size: 17px; }
  .rtg-hub h3 { font-size: 10px; }
  .rtg-week > .rtg-up-head { display: none; }
  .tasks { gap: 8px; }
  .task { gap: 8px; padding: 9px; }
  .task-head { gap: 8px; }
  .task-head p { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .task-head b { font-size: 9px; }
  .task-head span { font-size: 16px; }
  .task-box { width: 22px; height: 22px; font-size: 8px; }
  #hub-train-wrap > .settings-note { display: none; }
  #hub-train { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  #hub-train .rtg-drill { grid-template-columns: 1fr; justify-items: center; gap: 4px; padding: 6px 2px; text-align: center; }
  #hub-train .rtg-drill .drill-stat { justify-self: center; padding: 3px 4px 2px; font-size: 7px; }
  #hub-train .rtg-drill b { font-size: 7px; }
  #hub-train .rtg-drill span { font-size: 15px; text-align: center; }
  #scr-rtg-hub .bar-head .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #hub-next-info { gap: 6px; }
  #hub-next-info .settings-note, #hub-next-info .rtg-goal { font-size: 16px; }
  .rtg-vs .crest { width: 32px; }
  .rtg-vs b { font-size: 14px; }
  #task-play .task-body .cta.big { min-height: 46px; font-size: 10px; white-space: normal; }
  .rtg-champ span { line-height: 1; }
  .rtg-up { grid-template-columns: 38px minmax(40px, 1fr) 3ch 3.5ch auto; gap: 8px; }
  .rtg-up .ghost.small { min-width: 0; padding-inline: 8px; font-size: 8px; }
  .hub-perk { font-size: 17px; }
  .rtg-tables { grid-template-columns: 1fr; gap: 8px; --cap: 18px; }
  .rtg-hub table.rtg-table caption { padding-bottom: 4px; font-size: 9px; }
  .rtg-hub table.rtg-table th, .rtg-hub table.rtg-table td { padding: 3px 5px; font-size: 17px; }
  .rtg-hub table.rtg-table thead th { font-size: 7px; }
  .rtg-hub table.rtg-table .crest { width: 16px; }
  .rtg-sched { grid-template-columns: 1fr 1fr; gap: 0 10px; }
  /* two columns; each match is two lines: week, opponent and W or L, then the set scores */
  .rtg-sched li { grid-template-columns: 3.4ch minmax(0, 1fr) auto; grid-template-areas: none; gap: 0 5px; padding: 3px 0; font-size: 16px; line-height: 1; }
  .rtg-sched li .rtg-wk, .rtg-sched li .rtg-club { grid-area: auto; }
  .rtg-sched .rtg-r { display: contents; }
  .rtg-sched .sc-pts { grid-column: 1 / -1; font-size: 15px; color: var(--muted); }
  .rtg-sched li:not(.w):not(.l)::after { content: ""; grid-column: 1 / -1; height: 15px; }
  .sc-full { display: none; } .sc-abbr { display: inline; }
  .rtg-sched .crest { width: 16px; }
  .my-line { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .my-line li { padding: 6px 2px 5px; gap: 5px; }
  .ml-full { display: none; } .ml-abbr { display: inline; }
  .my-line b { font-size: 13px; }
  .leaders { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .leader { padding: 6px 5px; gap: 3px; }
  .rtg-hub .rtg-up-head { flex-wrap: nowrap; }
  .rtg-hub .rtg-up-head .rtg-week-n { font-size: 7px; white-space: nowrap; }
  .leader h4 { font-size: 8px; }
  .leader li { grid-template-columns: 7px minmax(0, 1fr) auto; gap: 4px; padding: 2px 4px 2px 8px; font-size: 15px; }
  .leader li .crest { display: none; }
  .leader li b { font-size: 9px; }
  .leader-you { font-size: 15px; }
  .rtg-trophies { gap: 4px; }
  .rtg-trophies li { padding: 3px 6px; gap: 6px; }
  .rtg-trophies b { font-size: 7px; }
  .rtg-trophies span { font-size: 15px; }
  .car-top { grid-template-columns: 1fr; }
  .car-top h3, .car-top > .settings-note:not(.vh), .car-top .car-row { grid-column: 1; grid-row: auto; }
  .car-row legend { display: none; }
  .car-row { flex-wrap: nowrap; gap: 8px; }
  .car-row .seg { gap: 4px; }
  .car-row .seg button { min-height: 38px; padding: 6px 7px; font-size: 9px; }
  .car-row .rtg-retire-btn { min-height: 38px; padding-inline: 9px; font-size: 9px; }
  .hist-note { display: none; }
  .rtg-hub table.rtg-stats th, .rtg-hub table.rtg-stats td { padding: 3px 3px; font-size: 16px; }
  .rtg-hub table.rtg-stats thead th { font-size: 6px; }
  .rtg-hub table.rtg-stats td.rtg-club .crest { display: none; }
  .rtg-hub .hist-rec { display: none; }
  .hist-pager span { font-size: 15px; }
  .rtg-stats-wrap > .rtg-up-head { flex-wrap: wrap; }
  .hist-pager { width: 100%; justify-content: space-between; }
  .hist-pager .ghost.small { min-height: 34px; padding: 5px 8px; }
  .rtg-hub .rtg-xp { white-space: nowrap; font-size: 16px; }
  .rtg-hub .rtg-xp b { font-size: 11px; }
  .hub-toast { bottom: 12px; }
  #hub-awards { grid-template-columns: 1fr; gap: 5px; }
  #hub-awards li { padding: 5px 8px; }
  #hub-next-info .rtg-offers .rtg-build { padding: 6px 8px; }
  #hub-next-info .rtg-offers .rtg-build b { font-size: 9px; }
  #hub-next-info .rtg-offers .rtg-build span { font-size: 15px; }
  .rtg-champ { gap: 8px; }
  .rtg-champ .crest { width: 32px; }
  .rtg-champ b { font-size: 10px; }
  .rtg-champ span { font-size: 16px; }
}
/* short phones: the season strip goes (its facts are on the tabs: the week on Home, the record on Schedule, the place on
   Standings, trust on Home and XP on Upgrades) and the tabs get shorter */
@media (max-width: 760px) and (max-height: 760px) {
  .hub-strip { display: none; }
  .hub-main { grid-template-rows: auto minmax(0, 1fr); } /* without the strip, the pane still takes the row that fills */
  .hub-tabs [role="tab"] { min-height: 34px; padding-block: 6px 4px; }
  .rtg-hub table.rtg-table th, .rtg-hub table.rtg-table td { padding-block: 2px; }
  .rtg-hub .rtg-step { padding-block: 7px; }
  .rtg-tables { gap: 4px; }
  #scr-rtg-hub .bar-head { padding-block: 6px; }
  #scr-rtg-hub .bar-head .back { min-height: 40px; padding-block: 6px; }
}

/* until the browser lets the page play sound */
#sound-hint {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; margin: 0; pointer-events: none;
  padding: 8px 14px; background: var(--panel2); color: var(--accent); border: 2px solid var(--ink); box-shadow: var(--shadow);
  font-family: var(--px); font-size: 10px; letter-spacing: 0.04em; white-space: nowrap;
}

/* The press start screen: over the title's demo match on each page load, so the first click or key both opens
   the menu and lets the browser start the music. It comes in in stages (kicker, logo, team, prompt, hint),
   and leaves quickly. */
#press-start {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; margin: 0; padding: 24px; border: 0; cursor: pointer;
  background: radial-gradient(ellipse at center, rgba(10, 14, 24, 0.5), rgba(10, 14, 24, 0.9)); color: #fbfcff;
  font-family: var(--px); -webkit-tap-highlight-color: transparent;
}
#press-start[hidden] { display: none; }
#press-start:focus, #press-start:focus-visible { outline: none; } /* the whole screen is the button */
body.pressing #menu { visibility: hidden; } /* the title menu waits underneath, only the demo match shows */
.ps-box { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ps-box > * { display: block; }
.ps-box .kicker { margin-bottom: 14px; }
.ps-logo {
  font-size: clamp(26px, 8.4vw, 96px); letter-spacing: -3px; line-height: 1; white-space: nowrap;
  text-shadow: 5px 5px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink);
}
.ps-logo span { color: var(--accent); }
/* six Pokémon on a strip of court, a fresh line-up each visit, each with its position under the line;
   the shiny one is the libero */
.ps-team { --sz: clamp(44px, 8vw, 96px); display: flex; justify-content: center; margin-top: clamp(20px, 4vh, 36px); }
.ps-mon { display: flex; flex-direction: column; align-items: center; width: calc(var(--sz) + clamp(4px, 1.4vw, 16px)); }
.ps-spot { display: flex; justify-content: center; align-items: flex-end; align-self: stretch; height: var(--sz); overflow: visible; border-bottom: 4px solid var(--accent); box-shadow: 0 4px 0 var(--ink); }
.ps-team img { width: var(--sz); height: auto; image-rendering: pixelated; margin-bottom: calc(var(--sz) * var(--g, 0) / -96 - 2px); flex: none; /* --g: empty rows under the sprite, so each one stands on the line */ filter: drop-shadow(2px 2px 0 var(--ink)); }
.ps-mon .role-tag { margin-top: 12px; font-size: clamp(7px, 1.1vw, 9px); }
.ps-press {
  margin-top: clamp(28px, 5vh, 48px); padding: 10px 16px 9px; font-size: clamp(16px, 2.4vw, 24px); color: var(--accent);
  text-transform: uppercase; text-shadow: 3px 3px 0 var(--ink);
  transition-property: scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
#press-start:active .ps-press { scale: 0.96; }
.ps-sub { margin-top: 10px; font-size: 10px; color: #c9d2e8; text-shadow: 2px 2px 0 var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .ps-box > * { animation: ps-in 300ms ease-out both; }
  .ps-box > :nth-child(2) { animation-delay: 100ms; }
  .ps-box > :nth-child(3) { animation-delay: 200ms; }
  .ps-box > :nth-child(4) { animation: ps-in 300ms ease-out 300ms both, ps-blink 1.1s steps(1) 1.4s infinite; }
  .ps-box > :nth-child(5) { animation-delay: 400ms; }
  .ps-team img { animation: ps-bob 0.9s steps(2) infinite; }
  .ps-mon:nth-child(2n) img { animation-delay: -0.45s; }
  #press-start.go { animation: ps-fade 150ms ease-out forwards; }
  #press-start.go .ps-box { animation: ps-out 150ms ease-out forwards; }
}
@media (prefers-reduced-motion: reduce) { /* a plain fade in and out, nothing moves */
  .ps-box { animation: ps-fade-in 300ms ease-out both; }
  #press-start.go { animation: ps-fade 150ms ease-out forwards; }
}
@keyframes ps-in { from { opacity: 0; filter: blur(4px); translate: 0 12px; } }
@keyframes ps-out { to { opacity: 0; filter: blur(4px); translate: 0 -12px; } }
@keyframes ps-fade { to { opacity: 0; } }
@keyframes ps-fade-in { from { opacity: 0; } }
@keyframes ps-blink { 50% { opacity: 0; } }
@keyframes ps-bob { 50% { translate: 0 -3px; } }

/* ---------- Franchise ---------- */
.fr-new { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.fr-clubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.fr-club { display: grid; gap: 6px; padding: 12px 14px; text-align: left; font: inherit; color: var(--muted); background: var(--panel2); border: 3px solid var(--ink); border-top: 6px solid var(--cc); box-shadow: var(--shadow), inset 0 0 0 2px var(--line); transition-property: background-color, box-shadow; transition-duration: 120ms; transition-timing-function: ease-out; }
@media (hover: hover) { .fr-club:hover { background: #2b3a5e; } }
.fr-club[aria-pressed="true"] { background: #2b3a5e; box-shadow: var(--shadow), inset 0 0 0 3px var(--accent); }
.fr-club-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.fr-club-top > span:nth-child(2) { display: grid; gap: 6px; flex: 1; min-width: 0; }
.fr-club-top b { font: 10px/1.3 var(--px); color: var(--text); }
.fr-club-ovr { display: grid; justify-items: center; gap: 4px; }
.fr-club-ovr b { font: 16px/1 var(--px); color: var(--accent); text-shadow: 2px 2px 0 var(--ink); }
.fr-club-ovr small { font: 7px/1 var(--px); }
.fr-club-line { font-size: 19px; line-height: 1.05; }
.fr-ol { justify-self: start; font: 7px/1 var(--px); font-style: normal; padding: 4px 5px 3px; color: #231b00; background: #9aa8c8; }
.fr-ol-c { background: var(--accent); } .fr-ol-m { background: #6bd88a; } .fr-ol-r { background: #c48bff; }
.fr-new-side { position: sticky; top: 16px; }
.fr-new-side .cta.big { margin-top: 4px; }
.fr-new-side .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fr-new-side .seg button { padding-inline: 4px; }
.fr-new-side .cta:disabled { opacity: 0.55; cursor: not-allowed; }

.fr-title { display: flex; align-items: center; gap: 12px; }
.fr-title .crest { width: 32px; height: auto; }
.fr-hub { display: grid; gap: 16px; max-width: 1040px; margin-inline: auto; position: relative; }
.fr-pane { display: grid; gap: 16px; min-width: 0; outline: none; }
.fr-pane h3 { font-size: 12px; }
.fr-pane h4 { margin: 0; font: 10px/1.3 var(--px); font-weight: 400; color: var(--accent); }
.fr-toast { position: fixed; left: 50%; bottom: 16px; translate: -50% 0; z-index: 5; margin: 0; max-width: calc(100vw - 32px); background: #1b2440; box-shadow: var(--shadow); }
.fr-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
table.fr-table { box-shadow: none; border: 0; background: none; min-width: 640px; }
table.fr-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.fr-table th[scope="row"] { padding-block: 4px; }
.fr-acts { text-align: right !important; }
.fr-acts .ghost.small, .fr-acts .cta.small { margin-left: 6px; }
.cta.small { font-size: 10px; min-height: 44px; padding: 10px 14px; box-shadow: 3px 3px 0 var(--ink), inset 0 -4px 0 #c99a0c; }
.cta:disabled, .ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.fr-row { display: block; width: 100%; padding: 2px 4px; text-align: left; font: inherit; color: inherit; background: none; border: 0; }
@media (hover: hover) { .fr-row:hover b { color: var(--accent); } }
.fr-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fr-who > span:last-child { display: grid; gap: 2px; min-width: 0; }
.fr-who b { font: 9px/1.3 var(--px); color: var(--text); white-space: nowrap; }
.fr-who i { font-style: normal; color: var(--muted); font-size: 18px; line-height: 1; white-space: nowrap; }
.fr-meter { display: inline-block; vertical-align: middle; width: 64px; height: 10px; background: var(--ink); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.fr-meter i { display: block; height: 100%; background: #6bd88a; }
.fr-meter.mid i { background: var(--accent); } .fr-meter.lo i { background: var(--rival); }
.fr-meter.big { width: 100%; height: 14px; }
.fr-inj { color: #ff8a8a; }
.fr-st { color: #6bd88a; } .fr-bn { color: var(--muted); }
.fr-notes { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--muted); }
.fr-notes b { font-weight: 400; }
.fr-match { display: grid; gap: 10px; }
.fr-match .cta.big { white-space: normal; text-wrap: balance; line-height: 1.5; }
.fr-md { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fr-md-opt { display: grid; gap: 10px; align-content: start; padding: 14px; background: rgba(14, 20, 36, 0.7); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.fr-md-opt > b { font: 11px/1.3 var(--px); color: var(--text); }
.fr-md-opt > span { color: var(--muted); font-size: 19px; line-height: 1.05; }
.fr-md-opt .cta { align-self: end; }
.fr-sel { display: grid; gap: 6px; }
.fr-sel > span:not(.vh) { font: 8px/1 var(--px); color: var(--muted); }
.fr-sel select { width: 100%; min-height: 44px; padding: 6px 8px; font: 20px/1 var(--body); color: var(--text); background: var(--panel2); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.fr-sel select:disabled { opacity: 0.6; }
.fr-lu th[scope="row"] { display: grid; gap: 4px; }
.fr-lu th[scope="row"] b { font: 9px/1.2 var(--px); font-weight: 400; }
.fr-lu th[scope="row"] small { color: var(--muted); font-size: 17px; }
.fr-lu td:nth-child(2) { min-width: 260px; }
.fr-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fr-slot { display: grid; gap: 10px; align-content: start; padding: 14px; box-shadow: none; }
.fr-tr-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.fr-tr-row .fr-sel { flex: 1; min-width: 160px; }
.fr-int button { min-height: 44px; }
.fr-sc { white-space: normal !important; text-align: left !important; color: var(--accent); letter-spacing: 2px; }
.fr-sc small { display: block; letter-spacing: 0; color: var(--muted); font-size: 17px; line-height: 1.05; min-width: 240px; }
.fr-star { min-width: 44px; font-size: 14px !important; }
.fr-board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.fr-board li { display: grid; grid-template-columns: 3ch 64px minmax(0, 1fr); align-items: center; gap: 10px; padding: 4px 0; border-bottom: 2px solid var(--line); color: var(--text); }
.fr-board li.you { color: var(--accent); }
.fr-board li.now { box-shadow: inset 3px 0 0 var(--accent); padding-left: 6px; }
.fr-trade { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fr-picks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.fr-pick { display: flex; align-items: center; gap: 8px; padding: 4px 8px; min-height: 44px; background: rgba(14, 20, 36, 0.7); border: 2px solid var(--ink); cursor: pointer; }
.fr-pick:has(input:checked) { box-shadow: inset 0 0 0 3px var(--accent); background: #2b3a5e; }
.fr-pick input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.fr-pick .fr-who { flex: 1; }
.fr-pick-n { display: grid; justify-items: end; font: 10px/1 var(--px); color: var(--text); }
.fr-pick-n small { font: 17px/1 var(--body); color: var(--muted); white-space: nowrap; }
.fr-verdict { display: grid; gap: 8px; }
.fr-verdict p { margin: 0; color: var(--text); }
.fr-pl-dlg { width: min(640px, calc(100vw - 24px)); }
.fr-pl-dlg .dlg-body { display: grid; gap: 14px; }
.fr-pl-top { display: flex; align-items: center; gap: 16px; }
.fr-pl-top p { margin: 0 0 6px; }
.fr-pl-top b { font: 12px/1 var(--px); color: var(--accent); }
.fr-pl-dlg .track { position: relative; }
.fr-pl-dlg .track .cap { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); }
.fr-pos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fr-pos li { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; background: rgba(14, 20, 36, 0.7); border: 2px solid var(--ink); }
.fr-pos li.you { box-shadow: inset 0 0 0 2px var(--accent); }
.fr-pos small { font: 7px/1 var(--px); color: var(--muted); }
.fr-pos b { font: 12px/1 var(--px); }
.ghost.danger-t { color: #ff8a8a; }
@media (max-width: 860px) { .fr-new { grid-template-columns: 1fr; } .fr-new-side { position: static; } .fr-md { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .fr-slots, .fr-trade, .fr-board { grid-template-columns: 1fr; }
  .fr-pos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fr-pl-top { flex-direction: column; align-items: flex-start; }
}

/* ---------- screen help: the ? button and its guide ---------- */
.help-q {
  position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 8px; padding: 0; vertical-align: middle;
  font: 10px/1 var(--px); color: #231b00; background: var(--accent); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  transition-property: scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.help-q::after { content: ""; position: absolute; inset: -9px; } /* a 44px target */
.help-q:not(:disabled):active { scale: 0.96; }
@media (hover: hover) { .help-q:hover { background: #ffe07a; } }
.sub .help-q, .rot-note .help-q { margin-left: 4px; }
.help-dlg { width: min(520px, calc(100vw - 24px)); }
.help-dlg .dlg-body { display: grid; gap: 18px; overscroll-behavior: contain; }
.help-list { display: grid; gap: 12px; margin: 0; }
.help-list div { display: grid; gap: 4px; padding: 0 0 12px; border-bottom: 2px solid var(--line); }
.help-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.help-list dt { font: 10px/1.4 var(--px); color: var(--accent); }
.help-list dd { margin: 0; color: var(--text); font-size: 21px; line-height: 1.15; }
.help-dlg .cta { justify-self: end; }
/* wide tables scroll inside their own box instead of stretching the page on phones */
.fr-pane .rtg-step, .fr-hub, .fr-pane, .fr-new { grid-template-columns: minmax(0, 1fr); }
.fr-scroll { max-width: 100%; position: relative; } /* so visually hidden headers stay inside the scroller */
@media (min-width: 861px) { .fr-new { grid-template-columns: minmax(0, 1fr) 300px; } }

/* Franchise lineup: the court seen from behind your baseline, net at the top. The players stand on the floor;
   the floor is the game's court colour; the ground around it is your club's colour, darkened, like your home arena (set inline). */
.lu-floor { --fz: #24407a; --court: #e0904c; --front: #e89c5a; --line-w: #fff; --wood-ink: #2b1608; --wood-soft: #4a2a12;
  display: grid; grid-template-columns: minmax(0, 1fr) 176px; grid-template-areas: "tip tip" "court bench" "res res"; gap: 14px 18px;
  margin: 4px 0 18px; padding: 14px 18px 22px; background: var(--fz); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.lu-tip { grid-area: tip; margin: 0; min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--wood-ink); font-size: 19px; line-height: 1.1; }
.lu-tip b { color: var(--accent); background: var(--wood-ink); padding: 0 6px; font-weight: 400; }
.lu-court { display: grid; background: var(--court); border: 3px solid var(--line-w); border-top: 0; box-shadow: 0 0 0 2px rgba(43, 22, 8, .25); }
.lu-net { display: flex; align-items: center; height: 20px; margin: 0 -9px; position: relative;
  background: repeating-linear-gradient(90deg, rgba(16, 20, 31, .55) 0 1px, transparent 1px 7px), repeating-linear-gradient(0deg, rgba(16, 20, 31, .55) 0 1px, transparent 1px 7px), rgba(16, 20, 31, .12);
  border-block: 3px solid var(--line-w); }
.lu-net i { width: 6px; height: 30px; background: #d8392f; border: 2px solid var(--ink); flex: none; }
.lu-net span { margin: auto; font: 8px/1 var(--px); color: var(--ink); background: var(--line-w); padding: 3px 7px; }
.lu-row { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px 6px 14px; }
.lu-row.front { background: var(--front); border-bottom: 3px solid var(--line-w); } /* the attack line */
.lu-row-h { position: absolute; left: -32px; top: 50%; translate: 0 -50%; rotate: 180deg; writing-mode: vertical-rl; font: 7px/1 var(--px); color: var(--wood-soft); white-space: nowrap; }
.lu-floor { padding-left: 40px; }

.lu-spot { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 6px 4px 8px;
  background: none; border: 0; color: var(--wood-ink); font: inherit; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lu-zone { position: absolute; top: 2px; left: 6px; font: 18px/1 var(--px); color: rgba(43, 22, 8, .16); pointer-events: none; }
.lu-courtwrap { grid-area: court; display: grid; gap: 8px; min-width: 0; }
.lu-baseline { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lu-baseline span { grid-column: 3; justify-self: center; font: 7px/1 var(--px); color: var(--ink); background: var(--accent); padding: 4px 6px; position: relative; }
.lu-baseline span::before { content: ""; position: absolute; left: 50%; bottom: 100%; translate: -50% 0; border: 5px solid transparent; border-bottom-color: var(--accent); }
.lu-token { position: relative; display: grid; place-items: center; width: 84px; height: 76px; }
.lu-token::before { content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 20px; border-radius: 50%;
  background: rgba(90, 40, 10, .3); box-shadow: 0 0 0 3px transparent; transition: box-shadow .15s ease, background-color .15s ease; }
.lu-token .portrait { position: relative; margin-bottom: 8px; }
.lu-spot b { font: 9px/1.3 var(--px); font-weight: 400; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-spot small { color: var(--wood-soft); font-size: 18px; line-height: 1; white-space: nowrap; }
.lu-spot small em { font-style: normal; color: #fff; background: var(--wood-ink); padding: 0 5px; margin-left: 2px; font-variant-numeric: tabular-nums; }
.lu-spot .lu-en { width: 60px; height: 8px; }
.lu-tag { font-style: normal; font-size: 16px; line-height: 1; padding: 2px 6px; color: var(--ink); }
.lu-tag.warn { background: var(--wood-ink); color: var(--accent); } .lu-tag.bad { background: var(--rival); }
.lu-none { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 8px; font: 18px var(--px); color: var(--wood-soft);
  border: 2px dashed rgba(43, 22, 8, .45); border-radius: 50%; }

/* States: the picked player gets a gold ring under their feet, the others show they can be tapped. */
@media (hover: hover) { .lu-spot:hover .lu-token::before { box-shadow: 0 0 0 3px rgba(255, 255, 255, .85); } }
.lu-floor.picking .lu-spot.target .lu-token::before { box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.lu-spot.picked .lu-token::before { background: rgba(255, 207, 51, .55); box-shadow: 0 0 0 3px var(--wood-ink), 0 0 0 6px var(--accent); }
.lu-spot.picked b { color: var(--accent); background: var(--wood-ink); padding: 1px 4px; }
.lu-spot.inj .portrait { filter: grayscale(.7); opacity: .75; }
.lu-spot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .lu-spot { transition: scale .15s ease-out; }
  .lu-spot:active { scale: .96; }
  .lu-spot.swapped .lu-token { animation: lu-land .35s cubic-bezier(.23, 1, .32, 1) both; }
}
.lu-spot.swapped .lu-token::before { animation: lu-glow .9s ease-out both; }
@keyframes lu-land { from { translate: 0 -10px; opacity: .4; } }
@keyframes lu-glow { from { box-shadow: 0 0 0 3px var(--wood-ink), 0 0 0 6px var(--accent); background: rgba(255, 207, 51, .55); } }

.lu-bench { grid-area: bench; display: grid; align-content: start; gap: 8px; padding: 10px 6px; border: 2px dashed rgba(43, 22, 8, .35); }
.lu-bench-h { margin: 0; display: grid; gap: 4px; text-align: center; font: 8px/1 var(--px); color: var(--wood-ink); }
.lu-bench-h small { font: 16px/1 var(--body); color: var(--wood-soft); }
@media (max-width: 760px) {
  .lu-floor { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tip" "court" "bench" "res"; padding: 10px 8px 14px; gap: 10px; }
  .lu-row-h { display: none; }
  .lu-tip { font-size: 18px; }
  .lu-row { padding: 8px 0 10px; }
  .lu-token { width: 64px; height: 60px; }
  .lu-token::before { left: 6px; right: 6px; height: 16px; }
  .lu-token .portrait { width: 48px !important; height: 48px !important; margin-bottom: 6px; }
  .lu-token .portrait img { width: 72px; height: 72px; }
  .lu-spot b { font-size: 8px; }
  .lu-spot small { font-size: 16px; }
  .lu-spot .lu-en { width: 48px; }
  .lu-tag { font-size: 14px; padding: 1px 4px; }
  .lu-zone { font-size: 14px; left: 2px; }
  .lu-bench { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px 10px; }
  .lu-bench-h { text-align: left; }
  .lu-bench .lu-spot { grid-template-columns: auto auto; justify-content: start; justify-items: start; column-gap: 10px; text-align: left; }
  .lu-bench .lu-token { grid-row: span 4; }
}

.lu-acts { display: flex; gap: 8px; flex: none; }
.lu-reserves { grid-area: res; display: grid; gap: 8px; padding-top: 12px; border-top: 2px dashed rgba(43, 22, 8, .35); }
.lu-res-h { margin: 0; font: 8px/1 var(--px); color: var(--wood-ink); display: flex; gap: 10px; align-items: baseline; }
.lu-res-h small { font: 16px/1 var(--body); color: var(--wood-soft); }
.lu-res-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.lu-res { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 10px 4px 4px; background: rgba(255, 236, 214, .35); border: 2px solid transparent;
  color: var(--wood-ink); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease, border-color .15s ease; }
.lu-res > span { display: grid; gap: 3px; min-width: 0; }
.lu-res b { font: 8px/1.3 var(--px); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lu-res small { color: var(--wood-soft); font-size: 17px; line-height: 1; white-space: nowrap; }
.lu-res small em { font-style: normal; color: #fff; background: var(--wood-ink); padding: 0 5px; }
.lu-res .lu-tag { font-size: 14px; padding: 0 4px; }
.lu-res .lu-en { width: 56px; height: 7px; }
@media (hover: hover) { .lu-res:hover { background: rgba(255, 236, 214, .55); border-color: rgba(43, 22, 8, .5); } }
.lu-floor.picking .lu-res:not(.picked) { border-color: rgba(43, 22, 8, .3); }
.lu-res.picked { border-color: var(--wood-ink); background: var(--accent); }
.lu-res.picked b { color: var(--wood-ink); }
.lu-res.inj .portrait { filter: grayscale(.7); opacity: .75; }
.lu-res:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .lu-res { transition-property: background-color, border-color, scale; } .lu-res:active { scale: .96; } }
.lu-res-none { margin: 0; color: var(--wood-ink); font-size: 18px; }
.lu-details { margin-top: 4px; }
.lu-details > summary { cursor: pointer; width: fit-content; font: 8px/1 var(--px); color: var(--muted); padding: 8px 0; }
@media (hover: hover) { .lu-details > summary:hover { color: var(--text); } }
.lu-details[open] > summary { margin-bottom: 8px; }
/* Desktop: bigger players, the court has the room. */
@media (min-width: 761px) {
  .lu-token { width: 104px; height: 96px; }
  .lu-token .portrait { width: 80px !important; height: 80px !important; }
  .lu-token .portrait img { width: 120px; height: 120px; }
  .lu-token::before { height: 24px; }
  .lu-spot b { font-size: 10px; }
}
@media (max-width: 760px) {
  .lu-tip { flex-wrap: wrap; }
  .lu-res-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lu-res small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; white-space: normal; }
/* Text on the club-coloured ground is light; the wood court and the reserve cards keep dark text. */
.lu-tip, .lu-bench-h, .lu-res-h, .lu-res-none { color: #fff; }
.lu-bench-h small, .lu-res-h small, .lu-row-h { color: rgba(255, 255, 255, .75); }
.lu-tip b { background: none; padding: 0; }
.lu-bench, .lu-reserves { border-color: rgba(255, 255, 255, .3); }
.lu-bench .lu-spot { color: #fff; }
.lu-bench .lu-spot small { color: rgba(255, 255, 255, .8); }
.lu-bench .lu-token::before { background: rgba(0, 0, 0, .3); }
.lu-bench .lu-spot.picked b { background: none; padding: 0; }
.lu-floor.picking .lu-res:not(.picked) { border-color: rgba(255, 255, 255, .45); }
.lu-res { background: var(--court); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
@media (hover: hover) { .lu-res:hover { background: var(--front); border-color: var(--wood-ink); } }
.lu-floor.picking .lu-res:not(.picked) { border-color: rgba(43, 22, 8, .45); }
.lu-res.picked { background: var(--accent); }

/* =====================================================================================================
   Menu polish (every screen but the title, which stays as it is).
   ===================================================================================================== */
/* The setup steps: a slim track of numbered stops; only the current step is named. */
.flow { flex-wrap: nowrap; align-items: center; gap: 0; }
.flow li { position: relative; gap: 8px; padding: 0; background: none; border: 0; box-shadow: none; color: var(--muted); }
.flow li + li::before { content: ""; width: 16px; height: 2px; margin-right: 0; background: var(--line); }
.flow li i { width: 22px; height: 22px; border: 2px solid var(--line); background: rgba(10, 14, 24, .7); color: var(--muted); }
.flow li.done i { background: #2f9e63; border-color: #2f9e63; color: #fff; }
.flow li.done + li::before { background: #2f9e63; }
.flow li.now { background: none; box-shadow: none; color: var(--accent); padding-right: 0; }
.flow li.now i { background: var(--accent); border-color: var(--accent); color: #231b00; box-shadow: 0 0 0 3px rgba(255, 207, 51, .22); }
.flow li:not(.now) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.flow li.now span { margin: 0 6px 0 2px; }

/* Player cards: no wall of numbers, one captain ribbon, and a holo foil that follows the pointer. */
.cap-ribbon { position: absolute; z-index: 2; left: 0; top: 10px; padding: 5px 9px 4px 8px; font: 8px/1 var(--px); color: #231b00; background: var(--accent);
  box-shadow: 2px 2px 0 var(--ink); }
.cap-ribbon b { font-weight: 400; }
.card .card-top::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; mix-blend-mode: color-dodge;
  background:
    radial-gradient(40% 55% at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(115deg, transparent 20%, rgba(255, 90, 170, .35) 36%, rgba(80, 220, 255, .35) 50%, rgba(255, 230, 90, .35) 64%, transparent 80%) var(--fx, 50%) 0 / 220% 100%;
  transition: opacity .2s ease; }
.card.tier-bronze .card-top::before, .card.tier-silver .card-top::before { background: radial-gradient(40% 55% at var(--mx, 50%) var(--my, 30%), rgba(255, 255, 255, .45), transparent 70%); }
@media (hover: hover) and (pointer: fine) {
  button.card:hover .card-top::before, button.card:focus-visible .card-top::before { opacity: 1; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .offers button.card { transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition-property: translate, box-shadow, transform; }
  .offers button.card.tilting { transition-duration: 150ms, 150ms, 60ms; }
}
@media (prefers-reduced-motion: no-preference) { button.card:not(:disabled):active { scale: .96; translate: 0 0; } button.card { transition-property: translate, box-shadow, scale, transform; } }

/* Teams: each club tile wears its colours; the banner side you change swaps in with a little drop. */
.club-tile { transition-property: background-color, box-shadow; }
@media (hover: hover) { .club-tile:not(:disabled):not([aria-pressed="true"]):hover { background: color-mix(in srgb, var(--cc) 20%, #1b2440); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cc) 70%, var(--line)), inset 0 -4px 0 var(--cc); } }
.club-tile[aria-pressed="true"] { background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 45%, #1b2440), color-mix(in srgb, var(--cc) 18%, #1b2440)); }
.club-tile .crest { transition: translate .15s ease-out; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .club-tile:not(:disabled):hover .crest { translate: 0 -3px; } }
@media (prefers-reduced-motion: no-preference) {
  .club-tile:not(:disabled):active { scale: .96; } .club-tile { transition-property: background-color, box-shadow, scale; transition-duration: 150ms; }
  .fo-side.fresh .crest { animation: crest-drop .35s cubic-bezier(.23, 1, .32, 1) both; }
  .fo-side.fresh b { animation: name-in .3s ease-out .05s both; }
}
@media (prefers-reduced-motion: reduce) { .fo-side.fresh .crest, .fo-side.fresh b { animation: fade .2s ease-out both; } }
@keyframes crest-drop { from { translate: 0 -16px; scale: .9; opacity: 0; } }
@keyframes name-in { from { opacity: 0; translate: 0 6px; filter: blur(4px); } }

/* Venue: the picture leans in under the pointer. */
.vc-img img { transition-property: filter, scale; transition-duration: 150ms, 300ms; transition-timing-function: ease-out, cubic-bezier(.23, 1, .32, 1); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .venue-card:hover img { scale: 1.06; } }
@media (prefers-reduced-motion: no-preference) { .venue-card:active { translate: 0 0; scale: .98; } .venue-card { transition-property: translate, box-shadow, scale; } }

/* Matchup: the two sides slide in from the edges and the VS stamps down, once per visit. */
@media (prefers-reduced-motion: no-preference) {
  #scr-matchup:not([hidden]) .mub-side.you { animation: side-l .4s cubic-bezier(.23, 1, .32, 1) both; }
  #scr-matchup:not([hidden]) .mub-side.rival { animation: side-r .4s cubic-bezier(.23, 1, .32, 1) .1s both; }
  #scr-matchup:not([hidden]) .mub-vs { animation: vs-stamp .3s cubic-bezier(.23, 1, .32, 1) .25s both; }
  #scr-matchup:not([hidden]) .mub-ovr b { animation: name-in .3s ease-out .35s both; }
}
@keyframes side-l { from { translate: -32px 0; opacity: 0; } }
@keyframes side-r { from { translate: 32px 0; opacity: 0; } }
@keyframes vs-stamp { from { scale: 1.6; opacity: 0; } }
.mu-banner, .faceoff { overflow: hidden; }

/* Save slots: an empty slot is one quiet dashed button; the plus turns gold and spins a quarter turn under the pointer. */
button.rtg-slot.empty { width: 100%; min-height: 260px; gap: 10px; padding: 40px 18px 28px; font: inherit; color: var(--text); cursor: pointer;
  border: 3px dashed var(--line); background: rgba(16, 22, 40, .55); transition: background-color .15s ease, border-color .15s ease; -webkit-tap-highlight-color: transparent; }
button.rtg-slot.empty .rtg-slot-n { background: none; color: var(--muted); text-shadow: none; }
button.rtg-slot.empty .rtg-slot-plus { width: 64px; height: 64px; margin: auto 0 6px; font-size: 24px; color: var(--muted); border: 3px dashed var(--line);
  transition: color .15s ease, border-color .15s ease, rotate .3s cubic-bezier(.23, 1, .32, 1); }
.rtg-slot-go { font: 11px/1.3 var(--px); font-weight: 400; }
button.rtg-slot.empty .rtg-slot-empty { margin-bottom: auto; color: var(--muted); font-size: 19px; }
@media (hover: hover) { button.rtg-slot.empty:hover { background: rgba(28, 38, 66, .75); border-color: var(--accent); }
  button.rtg-slot.empty:hover .rtg-slot-plus { color: var(--accent); border-color: var(--accent); } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { button.rtg-slot.empty:hover .rtg-slot-plus { rotate: 90deg; } }
button.rtg-slot.empty:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) { button.rtg-slot.empty:active { scale: .98; } button.rtg-slot.empty { transition-property: background-color, border-color, scale; } }
@media (max-width: 760px) { button.rtg-slot.empty { min-height: 0; padding: 18px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 16px; text-align: left; align-items: center; }
  button.rtg-slot.empty .rtg-slot-n { position: static; grid-column: 2; padding: 0; order: 0; }
  button.rtg-slot.empty .rtg-slot-plus { grid-row: 1 / span 3; margin: 0; width: 52px; height: 52px; }
  button.rtg-slot.empty .rtg-slot-go, button.rtg-slot.empty .rtg-slot-empty { grid-column: 2; margin: 0; } }

/* Franchise club pick: two faces per club instead of three lines of text; the settings stay in reach. */
.fr-club { --cc: #5b6a92; gap: 10px; transition-property: background-color, box-shadow, scale; }
.fr-club-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fr-key { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 2px 8px 2px 2px; background: rgba(10, 14, 24, .45); }
.fr-key > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; flex: 1; }
.fr-key small { font: 7px/1 var(--px); color: var(--muted); }
.fr-key b { font: 17px/1 var(--body); font-weight: 400; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-key em { font: 10px/1 var(--px); font-style: normal; color: var(--accent); }
.fr-club-line { font-size: 17px; color: var(--muted); }
@media (hover: hover) { .fr-club:hover { background: color-mix(in srgb, var(--cc) 16%, #1b2440); } }
.fr-club[aria-pressed="true"] { background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 36%, #1b2440), color-mix(in srgb, var(--cc) 12%, #1b2440)); }
@media (prefers-reduced-motion: no-preference) { .fr-club:active { scale: .98; } }
@media (min-width: 861px) { .fr-new-side { position: sticky; top: 130px; } }
@media (max-width: 760px) {
  .fr-new-side { position: static; order: -1; }
  #scr-fr-new { padding-bottom: 84px; }
  #fr-create { position: fixed; z-index: 8; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
}
@media (max-width: 760px) { #scr-fr-new > .fr-new { animation: none; } } /* a transform left by "rise" would unpin the fixed Coach button */
.fr-club-line.over { color: #ff8a8a; }
@media (max-width: 760px) { body:has(#scr-fr-new:not([hidden])) .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* =====================================================================================================
   Hub navigation (Road to Glory and Franchise): a scoreboard whose numbers are links, a dock of grouped pages
   (a rail on the left on wide screens, a bar along the bottom on phones), a small switcher when a group has more
   than one page, and the week rail on Home.
   ===================================================================================================== */
.nav-ico { width: 18px; height: 18px; flex: none; fill: currentColor; shape-rendering: crispEdges; }

/* the dock */
.dock-nav { display: grid; gap: 4px; align-content: start; padding: 8px; background: rgba(12, 17, 31, .88); border: 3px solid var(--ink); box-shadow: var(--shadow), inset 0 0 0 2px var(--line); }
.dock-btn { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; font: 9px/1 var(--px); color: var(--muted);
  background: none; border: 0; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease, color .15s ease; }
.dock-btn::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 4px; background: transparent; transition: background-color .15s ease; }
.dock-btn[aria-current="page"] { color: var(--accent); background: rgba(255, 207, 51, .1); }
.dock-btn[aria-current="page"]::before { background: var(--accent); }
@media (hover: hover) { .dock-btn:not([aria-current="page"]):hover { color: var(--text); background: rgba(255, 255, 255, .05); } }
.dock-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.dock-badge { margin-left: auto; padding: 4px 5px 3px; font: 7px/1 var(--px); font-style: normal; color: #231b00; background: var(--accent); box-shadow: 2px 2px 0 var(--ink); }
@media (prefers-reduced-motion: no-preference) { .dock-btn:active { scale: .96; } .dock-btn { transition-property: background-color, color, scale; } }

/* the scoreboard: one dark LED panel; every linked number opens its page */
.hub-strip.sb { display: flex; flex-wrap: wrap; gap: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px), #070a12;
  border: 3px solid var(--ink); box-shadow: var(--shadow), inset 0 0 0 2px #1d2640; }
.hub-strip.sb li { flex: 1 1 auto; display: block; padding: 0; background: none; border: 0; box-shadow: none; }
.hub-strip.sb li + li { box-shadow: inset 2px 0 0 #1d2640; }
.sb-cell { display: grid; gap: 7px; width: 100%; height: 100%; padding: 10px 14px 9px; text-align: left; font: inherit; color: inherit; background: none; border: 0; }
.sb-cell small { font: 7px/1 var(--px); color: #8592b4; white-space: nowrap; }
.sb-cell b { font: 400 22px/1 var(--body); color: #ffd75e; text-shadow: 0 0 8px rgba(255, 207, 51, .35); white-space: nowrap; }
button.sb-cell { cursor: pointer; transition: background-color .15s ease; -webkit-tap-highlight-color: transparent; }
button.sb-cell small::after { content: " ›"; color: transparent; transition: color .15s ease; }
@media (hover: hover) { button.sb-cell:hover { background: rgba(255, 207, 51, .07); } button.sb-cell:hover small { color: var(--text); } button.sb-cell:hover small::after { color: var(--accent); } }
button.sb-cell:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* the page switcher inside a group: quiet text tabs with a gold underline, not a second row of boxes */
.hub-tabs.subnav { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--line); box-shadow: none; }
.hub-tabs.subnav [role="tab"] { flex: none; min-height: 40px; padding: 10px 14px 9px; font-size: 9px; color: var(--muted); background: none; border: 0; box-shadow: inset 0 -3px 0 transparent; }
.hub-tabs.subnav [role="tab"][aria-selected="true"] { color: var(--accent); background: none; box-shadow: inset 0 -3px 0 var(--accent); }
@media (hover: hover) { .hub-tabs.subnav [role="tab"][aria-selected="false"]:hover { color: var(--text); background: none; box-shadow: inset 0 -3px 0 var(--line); } }
.hub-tabs.subnav [role="tab"].off-group { display: none; }
.hub-tabs.subnav[hidden] { display: none; }

/* the week rail: stops joined by a line, each with its state; the match is the goal at the end */
.wk-rail { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; }
.wr-stop { position: relative; min-width: 0; }
.wr-stop + .wr-stop::before { content: ""; position: absolute; z-index: 0; top: 17px; right: calc(50% + 20px); left: calc(-50% + 20px); height: 3px; background: var(--line); }
.wr-stop.done + .wr-stop::before, .wr-stop.off + .wr-stop.done::before { background: #2f9e63; }
.wr-btn { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; width: 100%; padding: 0 4px 6px; font: inherit; color: var(--text); background: none; border: 0; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wr-dot { display: grid; place-items: center; width: 36px; height: 36px; font: 11px/1 var(--px); font-style: normal; color: var(--muted); background: #0e1424; border: 3px solid var(--line); transition: border-color .15s ease, background-color .15s ease; }
.wr-btn b { font: 9px/1.2 var(--px); font-weight: 400; }
.wr-btn small { font-size: 17px; line-height: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wr-stop.done .wr-dot { color: #fff; background: #2f9e63; border-color: #2f9e63; }
.wr-stop.todo .wr-dot { color: var(--accent); border-color: var(--accent); }
.wr-stop.todo small { color: var(--accent); }
.wr-stop.warn .wr-dot { color: #fff; background: var(--rival); border-color: var(--rival); }
.wr-stop.warn small { color: #ff8a8a; }
.wr-stop.off { opacity: .55; }
.wr-stop.goal .wr-dot { width: 40px; height: 40px; margin-top: -2px; color: #231b00; background: var(--accent); border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 207, 51, .25); }
.wr-stop.goal b { color: var(--accent); }
@media (hover: hover) { .wr-btn:hover .wr-dot { border-color: var(--text); } .wr-stop.goal .wr-btn:hover .wr-dot { border-color: var(--ink); background: #ffe07a; } }
.wr-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .wr-btn:active .wr-dot { scale: .96; } .wr-dot { transition-property: border-color, background-color, scale; } }
.fr-match { scroll-margin-top: 130px; }
#task-train, #task-play { scroll-margin-top: 130px; }

/* layout: Franchise gets a left column for the dock; Road to Glory puts it under the player card */
.fr-hub.hub-nav { display: grid; grid-template-columns: 184px minmax(0, 1fr); grid-template-areas: "dock sb" "dock tabs" "dock pane" "dock toast"; gap: 14px 20px; align-items: start; }
.fr-hub.hub-nav > .dock-nav { grid-area: dock; position: sticky; top: 130px; }
.fr-hub.hub-nav > .hub-strip { grid-area: sb; margin: 0; }
.fr-hub.hub-nav > .hub-tabs { grid-area: tabs; margin: 0; }
.fr-hub.hub-nav > .fr-pane { grid-area: pane; min-width: 0; }
.fr-hub.hub-nav > .fr-toast { grid-area: toast; }
.rtg-side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.rtg-hub .hub-main { display: flex; flex-direction: column; }
.rtg-hub .hub-main > .hub-pane:not([hidden]) { flex: 1; min-height: 0; }

/* phones: the dock becomes a bar along the bottom, where the thumb is */
@media (max-width: 760px) {
  .fr-hub.hub-nav { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sb" "tabs" "pane" "toast"; }
  #scr-fr-hub > .fr-hub, #scr-rtg-hub > .rtg-hub { animation: none; } /* a transform left by the entrance would unpin the bar */
  .dock-nav, .fr-hub.hub-nav > .dock-nav { position: fixed; z-index: 9; top: auto; left: 0; right: 0; bottom: 0; display: flex; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: rgba(9, 13, 24, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 0; border-top: 3px solid var(--ink); box-shadow: 0 -3px 0 rgba(255, 207, 51, .22); }
  .dock-btn { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 6px; min-height: 56px; padding: 6px 2px; font-size: 7px; text-align: center; }
  .dock-btn::before { left: 20%; right: 20%; top: -4px; bottom: auto; width: auto; height: 3px; }
  .dock-btn .nav-ico { width: 20px; height: 20px; }
  .dock-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; padding: 3px 4px 2px; }
  #scr-fr-hub, #scr-rtg-hub { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body:has(#scr-fr-hub:not([hidden])) .foot { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .hub-strip.sb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-strip.sb li + li { box-shadow: none; }
  .hub-strip.sb li { box-shadow: inset 2px 0 0 #1d2640, inset 0 2px 0 #1d2640; }
  .sb-cell { padding: 8px 9px 7px; gap: 5px; }
  .sb-cell b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
  .rtg-side { order: 2; }
  .wr-dot { width: 30px; height: 30px; font-size: 9px; } .wr-stop.goal .wr-dot { width: 34px; height: 34px; }
  .wr-stop + .wr-stop::before { top: 14px; }
  .wr-btn b { font-size: 8px; } .wr-btn small { font-size: 15px; }
}
@media (max-width: 760px) { /* undo the older one-line phone strip for the scoreboard */
  .hub-strip.sb li { display: block; }
  .hub-strip.sb li + li::before { content: none; }
  .hub-strip.sb small { display: block; }
  .hub-strip.sb b { display: block; font-size: 18px; color: #ffd75e; white-space: nowrap; }
}

/* =====================================================================================================
   Menu background in your club's colours (every screen after the title; the title keeps the live arena).
   Panels on these screens are lighter: see-through glass with a soft shadow, so the backdrop shows around them.
   ===================================================================================================== */
.menu-theme { display: none; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: #0d1426; }
.menu-theme i { position: absolute; inset: 0; opacity: 0; image-rendering: pixelated; transition: opacity .3s cubic-bezier(.2, 0, 0, 1); }
.menu-theme i.on { opacity: 1; }
body.on-menu .menu-theme { display: block; }
body.on-menu .menu-bg { display: none; }
body.on-menu::before { background: radial-gradient(120% 90% at 50% 35%, transparent 55%, rgba(0, 0, 0, .45)); }

body.on-menu {
  --glass: rgba(14, 19, 34, .74);
  --glass-line: rgba(255, 255, 255, .09);
  --soft: 0 12px 32px rgba(0, 0, 0, .38), 0 2px 0 rgba(0, 0, 0, .25);
}
body.on-menu :is(.panel, .card, .mu-team, table.box) {
  background: var(--glass); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border-color: rgba(4, 7, 14, .55);
}
/* the plain panel frame: a hairline and a soft shadow instead of the heavy pixel slab (panels with their own accents keep them) */
body.on-menu .panel:not(.club-panel):not(.rtg-week):not(.rtg-next):not(.rtg-slot) { box-shadow: var(--soft), inset 0 0 0 1px var(--glass-line); }
body.on-menu .club-panel.you { box-shadow: var(--soft), inset 0 0 0 1px var(--glass-line), inset 0 4px 0 var(--you); }
body.on-menu .club-panel.rival { box-shadow: var(--soft), inset 0 0 0 1px var(--glass-line), inset 0 4px 0 var(--rival); }
body.on-menu .rtg-week { background: linear-gradient(180deg, rgba(255, 207, 51, .07), transparent 140px), var(--glass); box-shadow: var(--soft), inset 0 0 0 2px var(--accent); }
body.on-menu button.rtg-slot.empty { background: rgba(14, 19, 34, .45); }
/* the sticky header: glass, tinted by the backdrop behind it */
body.on-menu .bar-head { background: linear-gradient(180deg, rgba(6, 9, 18, .78), rgba(6, 9, 18, .55)); box-shadow: 0 1px 0 rgba(255, 207, 51, .3), 0 12px 28px rgba(0, 0, 0, .3); border-bottom-color: rgba(4, 7, 14, .6); }
body.on-menu .dock-nav { background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--soft), inset 0 0 0 1px var(--glass-line); border-color: rgba(4, 7, 14, .55); }
body.on-menu .hub-strip.sb { box-shadow: var(--soft), inset 0 0 0 1px rgba(255, 255, 255, .06); }
body.on-menu .foot { color: rgba(220, 228, 250, .55); }
@media (max-width: 760px) { body.on-menu .dock-nav { background: rgba(9, 13, 24, .94); } }
@media (max-width: 760px) { body.on-menu aside.panel.fr-new-side { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(14, 19, 34, .9); } } /* a backdrop filter would unpin the fixed Coach button inside it */
.fr-slot-top .crest { width: 104px; height: auto; filter: drop-shadow(4px 4px 0 rgba(5, 8, 16, .5)); }

/* =====================================================================================================
   Hub pages and dialogs: lighter tables, clean stat tiles, quiet placeholders, glass dialogs.
   ===================================================================================================== */
/* tables: a soft line between rows instead of a heavy rule, a hover highlight, your row marked by a gold edge */
body.on-menu table.box th, body.on-menu table.box td { border-bottom: 1px solid rgba(255, 255, 255, .07); }
body.on-menu table.box thead th { background: rgba(6, 9, 18, .55); border-bottom: 1px solid rgba(255, 255, 255, .12); letter-spacing: .5px; }
body.on-menu table.box tbody tr { transition: background-color .12s ease; }
@media (hover: hover) { body.on-menu table.box tbody tr:hover { background: rgba(255, 255, 255, .045); } }
body.on-menu table.box tr.you { background: rgba(255, 207, 51, .09); box-shadow: inset 3px 0 0 var(--accent); }
body.on-menu table.rtg-table tr.cut th, body.on-menu table.rtg-table tr.cut td { border-bottom: 2px dashed rgba(255, 207, 51, .7); }
body.on-menu table.box td { font-variant-numeric: tabular-nums; }

/* your season: plain number tiles */
body.on-menu .my-line li { background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .08); box-shadow: none; }
body.on-menu .my-line b { text-shadow: none; }
body.on-menu .my-line li > span { color: var(--muted); }

/* league leaders: light cards, with a quiet empty state */
body.on-menu .leader { background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08); box-shadow: none; }
body.on-menu .leader h4 { color: var(--text); }
body.on-menu .leader .settings-note { color: rgba(170, 182, 210, .6); }

/* trophy case: trophies still to win are dim outlines; won ones glow gold */
body.on-menu .rtg-trophies li { border-left: 0; }
body.on-menu .rtg-trophies li.locked { background: transparent; border: 1px dashed rgba(255, 255, 255, .14); opacity: .7; }
body.on-menu .rtg-trophies li.won { background: linear-gradient(180deg, rgba(255, 207, 51, .16), rgba(255, 207, 51, .05)); border: 1px solid rgba(255, 207, 51, .45); box-shadow: 0 0 18px rgba(255, 207, 51, .12); }

/* training slots: light cards */
body.on-menu .fr-slot { background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .09); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* dialogs (Settings, player cards, confirmations): dark glass with a soft shadow instead of a heavy slab */
.dlg { background: rgba(14, 19, 34, .94); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 2px 0 rgba(0, 0, 0, .3); }
.dlg-head { background: rgba(6, 9, 18, .6); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.dlg-x { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .dlg[open] { animation: dlg-in .2s cubic-bezier(.23, 1, .32, 1) both; }
  .dlg-x:active { scale: .96; }
}
@keyframes dlg-in { from { opacity: 0; scale: .97; } }

/* =====================================================================================================
   Phones: play in landscape only, and a compact coach panel that keeps clear of the stick and the buttons.
   ===================================================================================================== */
.rotate { display: none; position: fixed; inset: 0; z-index: 50; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px;
  text-align: center; color: var(--text); background: radial-gradient(80% 60% at 50% 40%, #1d2a4d, #0a0e1a); }
.rotate svg { width: 88px; height: 88px; fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.rotate b { font: 13px/1.4 var(--px); font-weight: 400; }
.rotate span { color: var(--muted); font-size: 20px; max-width: 26ch; }
@media (orientation: portrait) and (pointer: coarse) and (max-width: 600px) {
  #stage:not([hidden]):not(.demo-bg) .rotate { display: flex; }
  #stage:not([hidden]):not(.demo-bg) .touch, #stage:not([hidden]):not(.demo-bg) .coach { visibility: hidden; }
}
@media (orientation: portrait) and (pointer: coarse) and (max-width: 600px) and (prefers-reduced-motion: no-preference) {
  .rotate svg { animation: rot-hint 2.4s cubic-bezier(.77, 0, .175, 1) infinite; }
}
@keyframes rot-hint { 0%, 30% { rotate: 0deg; } 55%, 85% { rotate: -90deg; } 100% { rotate: 0deg; } }

/* phones held sideways: the coach sits top right, small, out of the way of the stick (bottom left) and the buttons */
@media (orientation: landscape) and (max-height: 520px) {
  .coach { left: auto; right: 60px; top: 8px; width: min(310px, 38%); max-height: calc(100% - 150px); padding: 8px 10px; gap: 6px; font-size: 15px; line-height: 1.12; }
  .coach h2 { font-size: 10px; }
  .coach-kicker { font-size: 7px; }
  .coach-steps { display: none; }
  .coach-now { padding: 6px 8px; }
  .coach-actions .ghost.small, .coach .cta.small { min-height: 36px; padding: 7px 10px; font-size: 8px; }
  .coach-checks { margin: 0; padding: 0; list-style: none; display: flex; gap: 10px; flex-wrap: wrap; font-size: 15px; }
}
.coach-checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--muted); }
.coach-checks li.done { color: #7dffb0; }
@media (orientation: landscape) and (max-height: 520px) {
  /* a column, so the instructions scroll inside the panel and its buttons always show */
  .coach { display: flex; flex-direction: column; width: min(290px, 34%); max-height: calc(100% - 140px); overflow: hidden; font-size: 13px; }
  .coach > * { flex: none; }
  .coach-now { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .coach .coach-actions { flex-wrap: nowrap; gap: 6px; }
  .coach .coach-actions .ghost.small, .coach .coach-actions .cta.small { min-height: 32px; padding: 6px 8px; font-size: 7px; white-space: nowrap; }
}

/* Phones held sideways: little height, plenty of width. The dock becomes a slim rail down the left, the header and
   the scoreboard shrink to one line each, so the page itself gets the screen. */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  body.on-menu .bar-head { padding-block: 6px; gap: 6px 14px; margin-bottom: 10px; }
  body.on-menu .bar-head h2 { font-size: 13px; }
  body.on-menu .bar-head .sub { font-size: 15px; margin-top: 2px; }
  body.on-menu .bar-head .eyebrow { margin-bottom: 3px; font-size: 7px; }
  body.on-menu .ghost.back { min-height: 36px; padding: 6px 10px; font-size: 8px; }
  .flow { grid-column: auto; }

  .dock-nav, .fr-hub.hub-nav > .dock-nav { top: 0; bottom: 0; left: 0; right: auto; width: 64px; flex-direction: column; justify-content: center;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)) calc(4px + env(safe-area-inset-left)); border-top: 0; border-right: 3px solid var(--ink); box-shadow: 3px 0 0 rgba(255, 207, 51, .22); }
  .dock-btn { flex: 0 0 auto; min-height: 50px; }
  .dock-btn::before { left: -4px; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
  #scr-fr-hub, #scr-rtg-hub { padding-bottom: 0; padding-left: calc(64px + env(safe-area-inset-left)); }
  body:has(#scr-fr-hub:not([hidden])) .foot { padding-bottom: 0; padding-left: 64px; }

  .hub-strip.sb { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sb-cell { padding: 5px 7px 4px; gap: 3px; }
  .sb-cell small { font-size: 6px; }
  .sb-cell b { font-size: 15px; }
  #scr-rtg-hub:not([hidden]) { height: auto; }
}
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .sb-cell small { overflow: hidden; text-overflow: ellipsis; }
  body.on-menu .bar-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  body.on-menu .bar-head .ghost.back { width: auto; justify-self: start; }
}

/* phones held sideways: the pause menu fits the short screen, and the touch pad hides behind it */
#stage:has(#pause:not([hidden])) .touch { visibility: hidden; }
@media (orientation: landscape) and (max-height: 520px) {
  #pause .dialog { padding: 14px 18px 16px; gap: 8px; max-height: calc(100% - 16px); overflow-y: auto; overscroll-behavior: contain; }
  #pause .dialog h2 { font-size: 18px; margin: 0; }
  #pause .pause-score { margin: 0; font-size: 17px; }
  #pause .dialog button { padding-block: 9px; }
}

/* phones: the coach folded to a slim bar while you play */
.coach.mini { width: auto; padding: 4px; }
.coach-mini { display: flex; align-items: center; gap: 4px; }
.coach-mini .ghost.small { min-height: 36px; min-width: 36px; padding: 6px 10px; font-size: 9px; }
@media (orientation: landscape) and (max-height: 520px) {
  .coach:not(.mini) .coach-kicker:first-child { display: none; }
  .coach:not(.mini) .coach-now { padding: 6px 8px; max-height: 6.8em; overflow-y: auto; overscroll-behavior: contain; }
  .coach .cta.small { min-height: 36px; padding: 8px 12px; font-size: 9px; }
}

/* any phone or tablet held sideways: the pad is pinned to the bottom of what is actually on screen
   (dvh and fixed follow the visible area when the browser's bars come and go; vh does not) */
@media (pointer: coarse) and (orientation: landscape) {
  #stage { min-height: 100dvh; }
  .canvas-wrap { width: min(100vw, calc(100dvh * 16 / 9)); }
  .touch { position: fixed; inset: auto 0 0 0; z-index: 4; pointer-events: none; flex-wrap: nowrap; align-items: flex-end;
    padding: 0 max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .touch .pad { align-items: flex-end; }
  .touch button, .touch .stick { pointer-events: auto; opacity: 0.85; }
}

/* words for a touch screen or for a mouse and keys */
html:not(.touch-ui) .touch-only, html.touch-ui .desk-only { display: none !important; }
/* touch: nothing to reset on the Controls tab (keys only matter with a keyboard) */
html.touch-ui #settings-dlg:has(#pan-keys:not([hidden])) #set-reset { visibility: hidden; }

/* Settings: back up and restore */
.save-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.save-btns .armed { background: var(--accent); color: #231b00; }
.save-note:empty { display: none; }

/* Quick play open: the two courts sit side by side as compact rows (court, then name), so the menu still fits
   the screen without scrolling. Only the open state changes; the title screen itself looks as before. */
.qp { padding: 8px 0 10px 34px; }
.qp .mode-pick { gap: 12px; }
.qp .mode-pick button { grid-template-columns: 112px auto; justify-items: start; align-items: center; column-gap: 12px; row-gap: 0; text-align: left; }
.qp .mode-pick svg { grid-row: span 2; width: 112px; }
.qp .mode-pick b { align-self: end; }
.qp .mode-pick span { align-self: start; font-size: 18px; }
.qp .mode-pick button:is(:hover, :focus-visible) { translate: 0 -2px; }
.title-wrap:has(#mm-quick[aria-expanded="true"]) { gap: 24px; padding-block: 24px; }
/* short screens (a phone held sideways): with Quick play open, drop the descriptions so the menu fits */
@media (max-height: 560px) {
  .title-wrap:has(#mm-quick[aria-expanded="true"]) { gap: 10px; padding-block: 10px; }
  .title-wrap:has(#mm-quick[aria-expanded="true"]) :is(.brand .lede, .brand .kicker, .mm-d) { display: none; }
  .title-wrap:has(#mm-quick[aria-expanded="true"]) .brand h1 { font-size: 30px; }
  .title-wrap:has(#mm-quick[aria-expanded="true"]) .mm { padding-block: 6px; }
}
