/* FTM Sports Fest draw. Each sport wears its own court: pickleball's blue court on green,
   basketball's maple floor with navy lines. Switching sport swaps the whole floor. */
:root {
  --green: #2F6B48; --court: #235489; --kitchen: #1C4677; --chalk: #F4F5EE; --ball: #DCE64B;
  --gym: #DCE3E0; --mat: #2B7F5E; --mat-2: #24704F; --ink: #15304A; --shuttle: #C9372C;
  --maple: #DDAE6E; --maple-2: #D6A465; --navy: #1D2B4F; --key: #B8452B;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --text: Archivo, system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1100px;
}
body[data-sport="pickleball"] { --bg: var(--green); --fg: var(--chalk); --muted: rgba(244,245,238,.78); --accent: var(--ball); --rule: rgba(244,245,238,.22); --me-bg: var(--ball); --me-fg: #1D3A20; }
body[data-sport="badminton"] { --bg: var(--gym); --fg: var(--ink); --muted: rgba(21,48,74,.74); --accent: var(--shuttle); --rule: rgba(21,48,74,.2); --me-bg: var(--shuttle); --me-fg: #fff; }
body[data-sport="basketball"] { --bg: var(--maple); --fg: var(--navy); --muted: rgba(29,43,79,.78); --accent: var(--key); --rule: rgba(29,43,79,.22); --me-bg: var(--navy); --me-fg: var(--maple); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  min-height: 100vh; font-family: var(--text); color: var(--fg); background: var(--bg);
  transition: background-color .5s ease, color .5s ease; overflow-x: hidden;
}
/* Two floors stacked behind the page; the active one fades in. */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -2; transition: opacity .6s ease; pointer-events: none; }
body::before { background: var(--green) radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 5px 5px; opacity: 1; }
body::after {
  background-color: var(--maple);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(120,72,28,.13) 47px 48px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 96px, transparent 96px 192px, rgba(110,60,20,.05) 192px 240px);
  opacity: 0;
}
body[data-sport="basketball"]::before, body[data-sport="badminton"]::before { opacity: 0; }
body[data-sport="basketball"]::after { opacity: 1; }

/* The three logos repeated faintly across the floor, tilted, behind everything. */
.watermark { position: fixed; inset: -40%; z-index: -1; pointer-events: none; transform: rotate(-14deg);
  background-color: var(--fg); opacity: .05; transition: background-color .5s ease;
  -webkit-mask: url(/img/watermark.png) 0 0 / 660px auto repeat; mask: url(/img/watermark.png) 0 0 / 660px auto repeat; }
body[data-sport="basketball"] .watermark { opacity: .06; }
body[data-sport="badminton"] .watermark { opacity: .055; }
@media (max-width: 640px) { .watermark { -webkit-mask-size: 480px auto; mask-size: 480px auto; } }

a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter); padding-top: max(14px, env(safe-area-inset-top));
  background: var(--bg); border-bottom: 1px solid var(--rule); transition: background-color .5s ease;
}
.brand { display: flex; align-items: center; gap: 12px; font: 800 clamp(20px, 2.4vw, 26px)/1 var(--display); color: var(--accent); letter-spacing: .3px; white-space: nowrap; }
.brand-name { padding-left: 12px; border-left: 2px solid var(--rule); }

/* Logos are single-colour masks, so they take the current sport's colours. */
.logo { display: inline-block; background-color: var(--fg); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; transition: background-color .5s ease; }
.logo.ftm { --src: url(/img/ftm-logo.png); height: clamp(30px, 3.2vw, 38px); aspect-ratio: 453 / 123; }
.logo.tm { --src: url(/img/transformakers.png); aspect-ratio: 1056 / 398; }
.logo.ts { --src: url(/img/trendsetters.png); aspect-ratio: 1053 / 390; }
.tabs { display: flex; gap: 4px; padding: 4px; border: 2px solid var(--fg); border-radius: 999px; }
.tabs button {
  border: 0; background: none; cursor: pointer; padding: 8px 18px; border-radius: 999px;
  font: 800 clamp(17px, 2vw, 20px)/1 var(--display); letter-spacing: .3px;
}
.tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.tabs .ico { width: 26px; height: 26px; display: block; fill: currentColor; }
.tabs .ico.line { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.tabs .ico.line .fill { fill: currentColor; stroke: none; }
.tabs button { display: grid; place-items: center; padding: 8px 20px; }
.tabs button:not([aria-selected="true"]):hover { background: var(--rule); }

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 48px; }

/* ---------- Hero ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding: clamp(28px, 6vw, 64px) 0 clamp(20px, 3vw, 32px); }
h1 { font: 900 clamp(60px, 9vw, 112px)/.85 var(--display); letter-spacing: -.01em; margin-left: -.04em; }
.meta { margin-top: 12px; font: 500 clamp(16px, 1.8vw, 20px)/1.3 var(--text); color: var(--muted); }

/* ---------- Finder ---------- */
.controls { display: grid; gap: 22px; margin-bottom: clamp(24px, 3.5vw, 36px); }
@media (min-width: 900px) { .controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; column-gap: clamp(24px, 3vw, 40px); } }
.finder { position: relative; }
.finder label { display: block; font: 800 22px/1 var(--display); margin-bottom: 10px; }
.field { position: relative; }
.finder input {
  width: 100%; padding: 15px 86px 15px 18px; font-size: 18px; border-radius: 10px;
  border: 2px solid var(--fg); background: color-mix(in srgb, var(--bg) 70%, #000 0%);
  -webkit-appearance: none; appearance: none;
}
.finder input::placeholder { color: var(--muted); }
.finder input::-webkit-search-cancel-button { display: none; }
.clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.help { margin: -2px 0 10px; font-size: 15px; color: var(--muted); }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 4; list-style: none; overflow: hidden;
  background: var(--fg); color: var(--bg); border-radius: 10px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.45);
}
.suggest li { padding: 13px 18px; font: 800 22px/1 var(--display); cursor: pointer; }
.suggest li + li { border-top: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); }
.suggest li:hover, .suggest li:focus { background: var(--accent); color: var(--fg); outline: none; }
body[data-sport="pickleball"] .suggest li:hover, body[data-sport="pickleball"] .suggest li:focus { color: #1D3A20; }
.suggest li.none { font: 500 16px/1.4 var(--text); cursor: default; }
.suggest li.none:hover { background: none; color: inherit; }

.card { max-width: 640px; margin: 0 0 clamp(24px, 3.5vw, 36px); padding: 20px 22px; border-radius: 12px; border: 2px solid var(--fg); }
.card h2 { font: 900 40px/.9 var(--display); }
.card .sum { color: var(--muted); margin: 6px 0 14px; }
.card ul { list-style: none; display: grid; gap: 8px; }
.card li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 8px; background: var(--rule); cursor: pointer; font-size: 15px; line-height: 1.35; }
.card li:hover { background: color-mix(in srgb, var(--fg) 28%, transparent); }
.card li b { font: 800 21px/1.05 var(--display); color: var(--accent); }

/* ---------- Draw (shared) ---------- */
.draw { display: grid; gap: clamp(18px, 2.4vw, 26px); outline: none; }
.match { cursor: pointer; transition: opacity .35s ease, filter .35s ease, transform .35s ease; -webkit-tap-highlight-color: transparent; }
.match:focus-visible { outline-offset: 6px; }
.draw.focusing .match:not(.on) { opacity: .32; filter: saturate(.5); }
.match.on { transform: translateY(-4px) scale(1.015); }
.cap { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 8px; font: 600 16px/1 var(--text); color: var(--muted); }
.cap .no { font: 800 24px/1 var(--display); color: var(--accent); }
.cap .ref b { color: var(--fg); font-weight: 600; }
.name { display: inline-block; font: 800 var(--name-size, 31px)/1 var(--display); letter-spacing: .2px; padding: 2px 0; border-radius: 4px; transition: background-color .25s, color .25s, padding .25s; }
.inv { display: block; font: italic 500 var(--inv-size, 13px)/1.15 var(--text); color: var(--accent); margin-top: 1px; }
.slot.me .name, .ref.me b { background: var(--me-bg); color: var(--me-fg); padding: 2px 8px; }
.ref.me { color: var(--fg); }

/* Pickleball: a sliding switch between the girls' and boys' matches. */
.switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 2px solid var(--fg); border-radius: 10px; }
.switch .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 7px; background: var(--fg);
  transform: translateX(calc(var(--at) * 100%)); transition: transform .38s cubic-bezier(.2,.8,.2,1); }
.switch button { position: relative; z-index: 1; border: 0; background: none; cursor: pointer; padding: 11px 10px 10px; border-radius: 7px;
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  font: 800 22px/1 var(--display); letter-spacing: .3px; color: var(--fg); transition: color .3s; }
.switch button[aria-pressed="true"] { color: var(--bg); }
.swipe-hint { display: none; margin-top: -8px; font-size: 14px; color: var(--muted); }
@media (hover: none) and (pointer: coarse) { .swipe-hint { display: block; } }
.switch .ico { width: 28px; height: 28px; margin: -3px 0; fill: currentColor; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pane { display: grid; gap: clamp(18px, 2.4vw, 26px); }

/* ---------- Pickleball court ---------- */
/* True pickleball proportions: 44 ft by 20 ft, with a 7 ft kitchen on each side of the net. */
/* Laptops and up: courts sit two by two; an odd last court centres on its own row. */
@media (min-width: 900px) {
  body[data-sport="badminton"] .draw { grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 3vw, 40px); }
  body[data-sport="pickleball"] .pane { grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 3vw, 40px); }
  body[data-sport="pickleball"] .pane > .match:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - clamp(12px, 1.5vw, 20px)); }
}
.pb .court {
  position: relative; display: grid; grid-template-columns: 1fr 15.9% 15.9% 1fr; aspect-ratio: 44 / 20;
  container-type: inline-size; --name-size: max(17px, 5.3cqw);
  background: var(--court); border: 3px solid var(--chalk); color: var(--chalk);
}
.pb .kit { background: var(--kitchen); }
.pb .kit.l { border-left: 3px solid var(--chalk); }
.pb .kit.r { border-right: 3px solid var(--chalk); }
.pb .net { position: absolute; left: 50%; top: -9px; bottom: -9px; border-left: 3px dashed var(--chalk); transform: translateX(-1.5px); }
.pb .net::before, .pb .net::after { content: ""; position: absolute; left: -7px; width: 11px; height: 11px; background: var(--chalk); border-radius: 2px; }
.pb .net::before { top: -4px; } .pb .net::after { bottom: -4px; }
.pb .side { display: grid; grid-template-rows: 1fr 1fr; min-width: 0; }
.pb .slot { display: flex; flex-direction: column; justify-content: center; padding: 8px 3.2cqw; min-width: 0; }
.pb .slot:first-child { border-bottom: 3px solid var(--chalk); }
.pb .side.r .slot { align-items: flex-end; text-align: right; }
.pb .vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--chalk); color: var(--court); font: 900 max(14px, 2.6cqw)/1 var(--display); padding: .7cqw 1cqw .5cqw; border-radius: 3px; }
.pb .slot.me .name { color: #1D3A20; }
.match.on.pb .court { box-shadow: 0 0 0 4px var(--ball), 0 18px 36px -14px rgba(0,0,0,.5); }

/* A ball lobbed over the net when a match opens. */
.pball { position: absolute; left: 22%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--ball); opacity: 0; pointer-events: none; z-index: 2;
  background-image: radial-gradient(circle at 32% 30%, var(--court) 2px, transparent 2.5px), radial-gradient(circle at 68% 40%, var(--court) 2px, transparent 2.5px), radial-gradient(circle at 45% 72%, var(--court) 2px, transparent 2.5px); }
.match.play .pball { animation: lob 1.1s cubic-bezier(.3,.1,.3,1) forwards; }
@keyframes lob {
  0%   { left: 22%; transform: translateY(0) scale(.9); opacity: 1; }
  50%  { left: 50%; transform: translateY(-78px) scale(1.25); opacity: 1; }
  88%  { left: 78%; transform: translateY(0) scale(.95); opacity: 1; }
  100% { left: 80%; transform: translateY(-10px) scale(.9); opacity: 0; }
}

/* ---------- Basketball court ---------- */
.bb .court { position: relative; container-type: inline-size; aspect-ratio: 960 / 462; color: var(--navy);
  /* Its own floor, so the logo watermark stays off the court. */
  background-color: var(--maple);
  background-image: repeating-linear-gradient(90deg, transparent 0 47px, rgba(120,72,28,.13) 47px 48px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 96px, transparent 96px 192px, rgba(110,60,20,.05) 192px 240px); }
.bb .lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.bb .lines * { fill: none; stroke: var(--navy); stroke-width: 4; }
.bb .lines .key { fill: var(--key); }
.bb .lines .edge { stroke-width: 4; }
.bb .lines .center { fill: var(--maple-2); }
.bb .lines.tall { display: none; }
.bb .team { position: absolute; top: 0; bottom: 0; width: 25%; display: flex; flex-direction: column; justify-content: center; gap: .3cqw; --name-size: 3.6cqw; --inv-size: max(11px, 1.45cqw); }
.bb .team.a { left: 17.5%; }
.bb .team.b { right: 17.5%; align-items: flex-end; text-align: right; }
.bb .slot { padding: .35cqw 0; }
.bb .circle { position: absolute; left: 50%; top: 50%; width: 14.6%; aspect-ratio: 1; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.bb .circle .vs { font: 900 4.4cqw/1 var(--display); }
.bb .circle .ref { font: 500 max(11px, 1.4cqw)/1.2 var(--text); margin-top: .3cqw; }
.bb .circle .ref b { display: block; font: 800 max(15px, 2.3cqw)/1 var(--display); color: var(--key); }
.bb .circle .ref.me b { color: var(--maple); }
.match.on.bb .court { box-shadow: 0 0 0 4px var(--key), 0 18px 36px -14px rgba(60,30,5,.55); }

/* ---------- Badminton court ---------- */
.bd .court { position: relative; aspect-ratio: 44 / 20; container-type: inline-size; background: var(--mat); border: 3px solid #fff; color: #fff;
  --name-size: max(16px, 4.4cqw); }
.bd .lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.bd .lines line { stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; }
.bd .side { position: absolute; top: 7.5%; bottom: 7.5%; width: 29.5%; display: grid; grid-template-rows: 1fr 1fr; }
.bd .side.l { left: 5.7%; } .bd .side.r { right: 5.7%; }
.bd .slot { display: flex; flex-direction: column; justify-content: center; padding: 0 2.4cqw; min-width: 0; }
.bd .side.r .slot { align-items: flex-end; text-align: right; }
.bd .net { position: absolute; left: 50%; top: -9px; bottom: -9px; border-left: 3px solid #fff; transform: translateX(-1.5px); }
.bd .net::before, .bd .net::after { content: ""; position: absolute; left: -7px; width: 11px; height: 11px; background: #fff; border-radius: 50%; }
.bd .net::before { top: -4px; } .bd .net::after { bottom: -4px; }
.bd .vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; color: var(--mat); font: 900 max(14px, 2.6cqw)/1 var(--display); padding: .7cqw 1cqw .5cqw; border-radius: 3px; }
.bd .slot.me .name { color: #fff; }
.match.on.bd .court { box-shadow: 0 0 0 4px var(--shuttle), 0 18px 36px -14px rgba(10,30,20,.45); }
/* A shuttlecock instead of a ball: white feathers, red cork. */
.pball.shuttle { width: 18px; height: 22px; margin: -11px 0 0 -9px; border-radius: 0; background: none;
  background-image: radial-gradient(circle at 50% 86%, var(--shuttle) 0 4.5px, transparent 5px), linear-gradient(#fff, #fff);
  background-size: 100% 100%, 100% 70%; background-repeat: no-repeat; clip-path: polygon(0 0, 100% 0, 72% 72%, 72% 100%, 28% 100%, 28% 72%); }

/* Tip-off: the ball drops into the centre circle and settles. */
.bball { position: absolute; left: 50%; top: 50%; width: 34%; aspect-ratio: 1; margin: -17% 0 0 -17%; border-radius: 50%; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 47%, #3a1a08 47% 53%, transparent 53%), linear-gradient(transparent 47%, #3a1a08 47% 53%, transparent 53%), #D9692A; border: 2px solid #3a1a08; }
.match.play .bball { animation: tip 1.2s cubic-bezier(.3,.1,.3,1) forwards; }
@keyframes tip {
  0%   { transform: translateY(-260%) scale(.7); opacity: 0; }
  15%  { opacity: 1; }
  45%  { transform: translateY(0) scale(1); }
  62%  { transform: translateY(-80%) scale(1); }
  80%  { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(0) scale(1.4); opacity: 0; }
}

/* ---------- Tap emphasis ----------
   The chosen court gets a ring that pulses outward, a floodlight sweep across it,
   and its names pop in one after another. */
.match .court::before, .match .court::after { content: ""; position: absolute; pointer-events: none; opacity: 0; }
.match .court::after { inset: -4px; border: 4px solid var(--accent); z-index: 3; }
.match .court::before { inset: 0; z-index: 3; background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.38) 50%, transparent 62%) 0 0 / 260% 100% no-repeat; }
.match.play .court::after { animation: ring .9s ease-out 2; }
.match.play .court::before { animation: sweep .9s ease-in-out .05s; }
.match.play .name { animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
.match.play .slot:nth-child(2) .name { animation-delay: .07s; }
.match.play .slot:nth-child(3) .name { animation-delay: .14s; }
.match.play .slot:nth-child(4) .name { animation-delay: .21s; }
.match.play .slot:nth-child(5) .name { animation-delay: .28s; }
.match.play .side.r .name, .match.play .team.b .name { animation-delay: .1s; }
.match.play .cap .no { animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes ring { 0% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.05, 1.12); } }
@keyframes sweep { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 1; background-position: -20% 0; } }
@keyframes pop { 0% { transform: scale(.82); opacity: .2; } 100% { transform: none; opacity: 1; } }

/* ---------- Spotlight ---------- */
html.spot-open { overflow: hidden; }
.spot { margin: auto; border: 0; padding: 0; background: none; color: var(--fg); max-width: none; max-height: none;
  width: 100%; height: 100%; display: none; place-content: center; overflow: auto; }
.spot[open] { display: grid; background: rgba(0,0,0,.45); }   /* with the backdrop, hides the page behind */
.spot::backdrop { background: color-mix(in srgb, var(--bg) 30%, #000); opacity: .96; }
.spot[open]::backdrop { animation: fade .3s ease; }
body[data-sport="badminton"] .spot::backdrop { background: #0E1B29; opacity: .96; }
@keyframes fade { from { opacity: 0; } }
.spot-top, .spot-nav { width: var(--spot-w); margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.spot-top { margin-bottom: 14px; }
.spot-title { font: 900 clamp(34px, 5vw, 56px)/.9 var(--display); color: #fff; }
.spot-count { margin-top: 6px; font: 500 15px/1 var(--text); color: rgba(255,255,255,.72); }
.spot button { border: 2px solid #fff; background: none; color: #fff; cursor: pointer; border-radius: 999px; padding: 10px 18px; font: 800 18px/1 var(--display); letter-spacing: .3px; }
.spot button:hover:not(:disabled) { background: #fff; color: #111; }
.spot button:disabled { opacity: .3; cursor: default; }
.spot-nav { margin-top: 18px; }
/* The court as large as the screen allows, kept in its real shape. */
.spot { --ratio: 2.2; --spot-w: min(1100px, calc(100vw - 32px), calc((100dvh - 230px) * var(--ratio))); }
body[data-sport="basketball"] .spot { --ratio: 2.078; }
.spot-body { width: var(--spot-w); margin: 0 auto; }
.spot .match { cursor: default; max-width: none; }
.spot .match .cap .no, .spot .match .cap { color: rgba(255,255,255,.8); }
.spot .match .cap .ref b { color: #fff; }
.spot .match.on { transform: none; }

/* ---------- Footer ---------- */
.foot { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 15px; line-height: 1.6; text-align: center; }
.org-line { font: 500 15px/1 var(--text); color: var(--muted); white-space: nowrap; }
.org-logos { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px clamp(16px, 2.4vw, 28px); margin: 0; }
.org-logos .logo, .org-logos .divider { opacity: .6; }
.org-logos .logo { height: clamp(24px, 2.6vw, 30px); background-color: var(--muted); }
.org-logos .logo.ftm { height: clamp(22px, 2.4vw, 28px); }
.org-logos .divider { width: 2px; align-self: stretch; background: var(--rule); }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  /* Logo left, sport icons right, on one row even on small phones. */
  .bar { gap: 10px; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; }
  .brand { gap: 8px; font-size: 18px; min-width: 0; }
  .brand-name { padding-left: 8px; }
  .logo.ftm { height: 28px; }
  .tabs { gap: 2px; padding: 3px; flex-shrink: 0; border-width: 1.5px; }
  .tabs button { padding: 6px 10px; }
  .tabs .ico { width: 20px; height: 20px; }
  .hero { padding-top: 26px; }
  .meta { padding-bottom: 0; }

  .pb .court { --name-size: max(17px, 6cqw); }
  .bd .court { --name-size: max(16px, 5.2cqw); }
  @keyframes lob {
    0%   { left: 22%; transform: translateY(0) scale(.9); opacity: 1; }
    50%  { left: 50%; transform: translateY(-54px) scale(1.2); opacity: 1; }
    88%  { left: 78%; transform: translateY(0) scale(.95); opacity: 1; }
    100% { left: 80%; transform: translateY(-8px) scale(.9); opacity: 0; }
  }

  /* Basketball turns the court upright: one team per end. */
  .bb .court { aspect-ratio: 462 / 960; }
  .bb .lines.wide { display: none; }
  .bb .lines.tall { display: block; }
  .bb .team { left: 0 !important; right: 0 !important; width: auto; align-items: center !important; text-align: center !important; gap: 0; --name-size: 6.6cqw; --inv-size: 11px; }
  .bb .team.a { top: 17.5%; bottom: auto; height: 24.5%; }
  .bb .team.b { top: auto; bottom: 17.5%; height: 24.5%; }
  .bb .slot { padding: .6cqw 0; }
  .bb .circle { width: 30.3%; }
  .bb .circle .vs { font-size: 8.5cqw; }
  .bb .circle .ref { font-size: 11px; }
  .bb .circle .ref b { font-size: 5cqw; }
}

@media (max-width: 380px) {
  .brand { font-size: 16px; gap: 7px; } .brand-name { padding-left: 7px; } .logo.ftm { height: 26px; }
  .tabs button { padding: 5px 8px; } .tabs .ico { width: 18px; height: 18px; }
}
@media (max-width: 339px) { .brand-name { display: none; } .logo.ftm { height: 30px; } }

@media (max-width: 640px) {
  .org-logos { gap: 12px; flex-wrap: nowrap; }
  .org-line { font-size: 13px; }
  .org-logos .divider { display: none; }
  .org-logos .logo, .org-logos .logo.ftm { height: 20px; }
  body[data-sport="basketball"] .spot { --ratio: .48; }
  .spot { --spot-w: min(calc(100vw - 32px), calc((100dvh - 210px) * var(--ratio))); }
  .spot button { padding: 9px 14px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, body::before, body::after { transition: none !important; animation: none !important; }
}
