  :root {
    color-scheme: dark;
    --ink: #e7ebf1;
    --bg: #0f141c;
    --surface: #171f2b;
    --surface-2: #1c2531;
    --accent: #8fb0e8;
    --accent-strong: #b7cdf2;
    --accent-soft: rgba(143, 176, 232, 0.16);
    --line: #2a3342;
    --win: #55b980;
    --draw: #dba553;
    --loss: #e2807e;
    --home-role: #62c6c4;
    /* Every Watch replay link: a dark pill with a bright blue outline and
       play icon, and white text. */
    --video-accent: #3b8cf6;
    --video-bg: #121923;
    --video-ink: #ffffff;
    --video-border: var(--video-accent);
    --team-card-bg: linear-gradient(110deg, rgba(255, 215, 90, 0.06), transparent 65%), var(--surface-2);
    --muted: #8b96a8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.6);
    --match-bg: radial-gradient(90% 60% at 50% 115%, rgba(40, 118, 205, 0.38), transparent 62%), radial-gradient(38% 32% at 6% -4%, rgba(140, 195, 255, 0.24), transparent 72%), radial-gradient(38% 32% at 94% -4%, rgba(140, 195, 255, 0.24), transparent 72%), linear-gradient(180deg, #0a1930, #0c2446 55%, #091a34);
    --match-thread: rgba(150, 200, 255, 0.045);
    --match-ink: #f2f7ff;
    --match-heading: #ffffff;
    --match-line: #2b5286;
    --match-eyebrow-line: #4aa8ff;
    --match-crest: #f8faff;
    --crest-tile-bg: transparent;
    --pv-tile-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line);
    --pv-crest-shadow: none;
    --nm-tile-shadow: 0 0 0 1px color-mix(in srgb, var(--match-blue) 25%, transparent), 0 0 30px -4px var(--match-glow), 0 16px 34px rgba(6, 20, 45, 0.2);
    --nm-crest-shadow: none;
    --nm-crest-pad: 0px;
    --match-logo-glow: 0.72;
    --match-muted: #9fbde2;
    --match-vs-bg: #0a1d3b;
    --match-vs-ink: #ffffff;
    --match-meta-bg: rgba(7, 21, 43, 0.72);
    --match-icon-bg: #1d5eae;
    --match-red: #f06b7d;
    --match-blue: #4aa8ff;
    --match-paint-base: #0c2446;
    --match-glow: rgba(64, 156, 255, 0.5);
    --match-accent-2: #9ad6ff;
    --match-vignette: rgba(2, 8, 22, 0.5);
    --scene-photo-opacity: 1;
    --scene-ball-opacity: 1;
    --scene-horizon: rgba(74, 168, 255, 0.3);
    --scene-shade: radial-gradient(70% 42% at 50% 40%, rgba(8, 22, 48, 0.82), transparent), linear-gradient(180deg, rgba(10, 25, 48, 0.97) 0%, rgba(10, 28, 56, 0.86) 42%, rgba(9, 28, 58, 0.45) 68%, rgba(6, 18, 38, 0.2) 84%, rgba(4, 12, 28, 0.5) 100%);
    --bg-weave-thread: rgba(210, 231, 255, 0.16);
    --toggle-active-bg: #eef3fa;
    --toggle-active-ink: #0f141c;
    /* Page backdrop for the homepage and team pages, the
       night stadium photo under a navy shade that is darkest behind the
       content. Team pages add the club's crest and color glow on top. */
    --stadium-img: url("/images/soccer-stadium-bg.jpg");
    --stadium-size: 100% auto;
    --stadium-backdrop:
      radial-gradient(ellipse 60% 64% at 50% 48%, rgba(5, 10, 18, 0.84), rgba(5, 10, 18, 0.5) 72%, rgba(5, 10, 18, 0.3) 100%),
      linear-gradient(180deg, rgba(5, 12, 22, 0.3), rgba(5, 12, 22, 0.55)),
      var(--stadium-img) center top / var(--stadium-size) no-repeat,
      #050c16;
  }


  * { box-sizing: border-box; }

  body {
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-family: "Libre Franklin", system-ui, sans-serif;
    line-height: 1.45;
  }

  img { max-width: 100%; }

  body { background: var(--bg); }

  .team-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    /* Team pages: shade only behind the content column, so the stadium and
       the close-up turf stay crisp around it. The photo fills the screen,
       anchored to the bottom so the grass always shows. (The homepage keeps
       the darker --stadium-backdrop.) */
    background:
      radial-gradient(ellipse 42% 75% at 50% 45%, rgba(5, 10, 18, 0.72), rgba(5, 10, 18, 0.28) 65%, rgba(5, 10, 18, 0) 100%),
      linear-gradient(180deg, rgba(5, 12, 22, 0.18), transparent 35%),
      var(--stadium-img) center bottom / cover no-repeat,
      #050c16;
  }

  /* Club Overview: a wider dashboard, so the bright turf lines and floodlights
     around it are dimmed (over the photo, under the crest and glow). */
  body.club-mode .team-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 70% 85% at 50% 45%, rgba(5, 10, 18, 0.6), rgba(5, 10, 18, 0.48) 75%, rgba(5, 10, 18, 0.4) 100%);
  }

  .team-bg-glow {
    position: absolute;
    inset: -20%;
    background:
      radial-gradient(circle at 78% 6%, var(--team-glow, transparent) 0%, transparent 60%),
      radial-gradient(circle at 22% 6%, var(--team-glow-2, var(--team-glow, transparent)) 0%, transparent 60%);
    opacity: 0.2;
    transition: background 0.8s ease;
  }

  .team-bg-crest {
    position: absolute;
    top: -10%;
    width: min(58vw, 680px);
    height: min(58vw, 680px);
    object-fit: contain;
    opacity: 0;
    filter: saturate(1.15);
    transition: opacity 1s ease;
  }

  .team-bg-crest.visible { opacity: 0.16; }

  .team-bg-crest--right {
    right: -12%;
    transform: rotate(-8deg);
    -webkit-mask-image: radial-gradient(circle at 62% 42%, black 0%, black 32%, transparent 70%);
    mask-image: radial-gradient(circle at 62% 42%, black 0%, black 32%, transparent 70%);
  }

  .team-bg-crest--left {
    left: -12%;
    transform: rotate(8deg);
    -webkit-mask-image: radial-gradient(circle at 38% 42%, black 0%, black 32%, transparent 70%);
    mask-image: radial-gradient(circle at 38% 42%, black 0%, black 32%, transparent 70%);
  }

  .team-bg-weave {
    position: absolute;
    opacity: .1;
    inset: 0;
    background:
      repeating-linear-gradient(45deg, transparent 0 3px, var(--bg-weave-thread) 3px 4px, transparent 4px 7px),
      repeating-linear-gradient(-45deg, transparent 0 3px, var(--bg-weave-thread) 3px 4px, transparent 4px 7px);
  }

  :root .team-bg-glow { opacity: 0.2; }
  :root .team-bg-crest.visible { opacity: 0.36; }

  /* Tablets and phones: the two crests are wide enough to meet behind the
     header and compete, so only the right-hand one shows. */
  @media (max-width: 1024px) {
    .team-bg-crest--left { display: none; }
  }

  @media (max-width: 640px) {
    .team-bg-crest { width: min(80vw, 480px); height: min(80vw, 480px); }
  }

  .page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px 64px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .sticky-header {
    position: sticky;
    top: 0;
    z-index: 14;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  header.masthead {
    margin: -8px -12px 0;
    padding: 22px 12px;
    /* At the top of the page: a see-through dark card, so the night photo
       shows through but the heading (light text in both themes) stays
       readable. Once it's pinned over content (.sticky-header.scrolled) it
       turns into the theme's solid card so content scrolls under it. */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(12, 17, 25, 0.45);
    backdrop-filter: blur(6px);
    transition: background-color .2s, border-color .2s, box-shadow .2s;
  }
  .sticky-header.scrolled header.masthead {
    border-color: var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
  }

  .eyebrow {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 4px;
  }


  /* .heading-1: the H1 look whatever the tag. Each page has exactly one H1:
     the picker's heading on the homepage (as written here), the team or club
     name on their pages (api/page.js swaps the two). */
  h1, .heading-1 {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 6vw, 46px);
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin: 0;
    color: var(--accent-strong);
    text-wrap: balance;
  }

  .team-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
  }

  .team-heading .crest, .team-heading .crest-fallback {
    width: clamp(56px, 14vw, 100px);
    height: clamp(56px, 14vw, 100px);
    font-size: clamp(18px, 4vw, 28px);
    border-radius: 18px;
    flex: none;
  }

  /* Desktop: a big 200px crest at the top of the page. The header is
     sticky, so once the page scrolls it shrinks to a compact crest
     (.shrunk, set by updateHeaderShrink) to keep the page visible. */
  @media (min-width: 900px) {
    .team-heading .crest, .team-heading .crest-fallback {
      width: 200px; height: 200px; font-size: 48px; border-radius: 28px;
      transition: width 0.25s ease, height 0.25s ease, border-radius 0.25s ease;
    }
    .team-heading { gap: 22px; }
    .sticky-header.shrunk .team-heading .crest, .sticky-header.shrunk .team-heading .crest-fallback {
      width: 120px; height: 110px; font-size: 32px; border-radius: 20px;
    }
    .sticky-header.shrunk .team-heading { gap: 18px; }
    /* Crest images come in their own shape (headerCrestUrl): full width,
       height follows, capped so tall crests stay within the box. */
    .team-heading img.crest:not(.plate) {
      height: auto; max-height: 200px;
      transition: width 0.25s ease, max-height 0.25s ease;
    }
    .sticky-header.shrunk .team-heading img.crest:not(.plate) { height: auto; max-height: 110px; }
    /* More room at the sides (the crest's glow), less at the top and bottom. */
    header.masthead { padding: 16px 24px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .team-heading .crest, .team-heading .crest-fallback { transition: none; }
  }

  .team-heading-text { min-width: 0; }
  .eyebrow-short { display: none; }
  /* The division stands out from the rest of the eyebrow: an outlined label
     in the ink color, so it's clear which division the page is. */
  .eyebrow-division { display: inline-block; margin: 0 2px; padding: 1px 8px; border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent); border-radius: 999px; color: var(--ink); font-weight: 700; }
  /* A subtle hint of which division: a cool outline and wash for Academy,
     a warm one for Homegrown. The text stays the ink color. */
  .eyebrow-division.div-academy, .share-chip.div-academy { border-color: rgba(94, 200, 230, 0.7); background: rgba(94, 200, 230, 0.1); }
  .eyebrow-division.div-homegrown, .share-chip.div-homegrown { border-color: rgba(224, 165, 90, 0.75); background: rgba(224, 165, 90, 0.12); }
  .eyebrow-division.div-pathway { border-color: rgba(176, 148, 240, 0.75); background: rgba(176, 148, 240, 0.12); }
  @media (max-width: 640px) {
    #team-eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.05em; font-size: 11.5px; }
    #team-eyebrow .eyebrow-long { display: none; }
    #team-eyebrow .eyebrow-short { display: inline; }
  }
  /* Tight stack: eyebrow, club name, conference line. The big condensed
     title's default line height left large gaps above and below it. */
  .team-heading-text #page-title { line-height: 0.95; margin: 3px 0 2px; }
  .team-heading-text .team-division { line-height: 1.15; margin-top: 0; }

  .team-division {
    font-size: clamp(16px, 2.2vw, 21px);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink);
    margin-top: 4px;
  }

  /* Club name in bright white on the dark header. */
  :root #page-title { color: #fff; }
  /* Until the header card fades in (.scrolled), the heading sits right on
     the night photo, so it keeps light text (like the rest
     of the text on the photo). */
  .sticky-header:not(.scrolled) .team-heading-text { --ink: #e7ebf1; --muted: #b9c8da; }
  .sticky-header:not(.scrolled) #page-title { color: #fff; }
  #page-title, .team-heading-text .eyebrow, .team-heading-text .team-division { transition: color .2s; }


  /* Age groups, the League | Flex switch and "Updated" share one row in the header card. */
  .age-row {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 2px 12px 2px 2px;
  }
  .age-row #age-toggle { flex: 1 1 auto; justify-content: flex-start; background: none; border: none; }
  /* With the League | Flex switch shown, it sits right after the ages. */
  .age-row:has(.comp-switch-row:not([hidden])) #age-toggle { flex-grow: 0; }
  /* Ages on the left; the switches (Academy | Homegrown, then League | Flex)
     together at the right end. On phones: ages on one line, the switches
     side by side under them. */
  .age-row #division-switch-row,
  .age-row #division-switch-row[hidden] + .comp-switch-row { margin-left: auto; }
  @media (max-width: 640px) {
    .age-row #age-toggle { flex-basis: 100%; }
    .age-row .comp-switch-row { flex-basis: auto; }
    .age-row #division-switch-row,
    .age-row #division-switch-row[hidden] + .comp-switch-row { margin-left: 0; }
    /* Both switches must fit one phone line: tighter tabs, "Flex" alone. */
    .age-row .comp-switch-row .schedule-tab { padding: 6px 9px; }
    .age-row .comp-long { display: none; }
  }
  .team-sync {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
  }
  .team-sync strong { font-weight: 500; color: var(--ink); }
  @media (max-width: 640px) {
    .age-row { padding: 2px; justify-content: center; }
    .age-row #age-toggle { justify-content: center; }
    .team-sync { margin: 0 auto 4px; }
  }

  .sync-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: var(--shadow);
    font-size: 13px;
    color: var(--muted);
  }

  .sync-bar strong { color: var(--ink); font-weight: 600; }

  .next-match {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
      repeating-linear-gradient(45deg, transparent 0 3px, var(--match-thread) 3px 4px, transparent 4px 7px),
      repeating-linear-gradient(-45deg, transparent 0 3px, var(--match-thread) 3px 4px, transparent 4px 7px),
      var(--match-bg);
    border: 1px solid color-mix(in srgb, var(--match-blue) 55%, transparent);
    border-radius: 28px;
    /* Extra bottom padding balances the heading above, so the teams row sits
       in the middle of the card. */
    padding: 14px 30px 24px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--match-blue) 12%, transparent), 0 0 34px -6px var(--match-glow), 0 18px 44px rgba(6, 20, 45, 0.28);
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--match-ink);
  }
  .next-match[hidden] { display: none; }
  .next-match:not([hidden]) { animation: next-match-enter 420ms ease-out both; }

  @keyframes next-match-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes next-match-crest-enter {
    from { opacity: 0; transform: translateY(7px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .next-match-paint {
    position: absolute;
    z-index: 0;
    width: 300px;
    height: 120px;
    pointer-events: none;
  }
  .next-match-paint path[opacity] { opacity: 1; fill: color-mix(in srgb, currentColor 82%, white); }
  .next-match-paint.red {
    top: 26px;
    left: -105px;
    color: color-mix(in srgb, var(--match-blue) 34%, var(--match-paint-base));
    transform: rotate(-34deg);
  }
  .next-match-paint.blue {
    right: -115px;
    bottom: 95px;
    color: color-mix(in srgb, var(--match-blue) 30%, var(--match-paint-base));
    transform: rotate(-34deg);
  }
  .next-match-paint.extra { width: 540px; height: 72px; }
  .next-match-paint.red.extra { top: auto; bottom: 105px; left: -45px; color: color-mix(in srgb, var(--match-blue) 16%, var(--match-paint-base)); transform: rotate(22deg); }
  .next-match-paint.blue.extra { top: 42px; right: -45px; bottom: auto; color: color-mix(in srgb, var(--match-blue) 13%, var(--match-paint-base)); transform: rotate(22deg); }
  .next-match > :where(:not(.next-match-scene, .next-match-graphics)) { position: relative; z-index: 1; }

  /* Photographic backdrop, bottom to top: turf and stadium photo, navy overlays, ball.
     The UI (z-index 1) floats above all of it. */
  .next-match-scene,
  .next-match-graphics {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
  }
  /* Brush strokes fade out before they reach the turf. */
  .next-match-graphics {
    -webkit-mask-image: linear-gradient(180deg, #000 48%, transparent 76%);
    mask-image: linear-gradient(180deg, #000 48%, transparent 76%);
  }
  /* Box matches the photo's aspect so masks and glow track its horizon (~79% down). */
  .scene-photo {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: max(112%, 700px);
    aspect-ratio: 1400 / 941;
    transform: translateX(-50%);
    opacity: var(--scene-photo-opacity);
  }
  .scene-stadium, .scene-turf {
    position: absolute;
    inset: 0;
    background: url("/images/stadium-scene.jpg") center / 100% 100% no-repeat;
  }
  .scene-stadium {
    filter: blur(3px) brightness(0.7) saturate(0.9);
    -webkit-mask-image: linear-gradient(180deg, transparent 12%, rgba(0, 0, 0, 0.55) 45%, #000 72%);
    mask-image: linear-gradient(180deg, transparent 12%, rgba(0, 0, 0, 0.55) 45%, #000 72%);
  }
  .scene-turf {
    filter: brightness(0.85);
    -webkit-mask-image: linear-gradient(180deg, transparent 72%, #000 81%);
    mask-image: linear-gradient(180deg, transparent 72%, #000 81%);
  }
  .scene-horizon {
    position: absolute;
    left: 0;
    right: 0;
    top: 72%;
    height: 14%;
    background: radial-gradient(50% 50% at 50% 50%, var(--scene-horizon), transparent);
  }
  /* Navy grading keeps the centre dark and the text readable. */
  .scene-shade { position: absolute; inset: 0; background: var(--scene-shade); }
  /* Original crosshatch texture, laid over the whole photographic scene. */
  .next-match-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      repeating-linear-gradient(45deg, transparent 0 3px, var(--match-thread) 3px 4px, transparent 4px 7px),
      repeating-linear-gradient(-45deg, transparent 0 3px, var(--match-thread) 3px 4px, transparent 4px 7px);
  }

  /* Ball photo tucked into the bottom-right corner; its cropped side meets the card edge. */
  .scene-ball {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 147px;
    aspect-ratio: 382 / 471;
    opacity: var(--scene-ball-opacity);
  }
  .scene-ball img {
    display: block;
    width: 100%;
    height: 100%;
    filter: brightness(0.8) contrast(1.06) saturate(1.05);
    /* Fades end just before the ball's edge (ball starts ~30% from left, ~19% from top). */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 26%), linear-gradient(180deg, transparent, #000 17%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent, #000 26%), linear-gradient(180deg, transparent, #000 17%);
    mask-composite: intersect;
  }
  /* Contact shadow and blue grade where the ball meets the grass. */
  .scene-ball::before, .scene-ball::after { content: ""; position: absolute; pointer-events: none; }
  .scene-ball::before {
    left: 30%;
    right: -6%;
    bottom: 5%;
    height: 12%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 4, 14, 0.7), transparent);
    mix-blend-mode: multiply;
  }
  .scene-ball::after {
    inset: 0;
    background: linear-gradient(200deg, rgba(20, 60, 130, 0.28), transparent 55%);
    mix-blend-mode: color;
  }

  /* Edge vignette ties the scene together. */
  .next-match::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(125% 95% at 50% 42%, transparent 58%, var(--match-vignette));
  }
  @media (max-width: 900px) { .scene-ball { width: 126px; } }
  @media (max-width: 700px) { .scene-ball { display: none; } }
  .next-match > .next-match-close {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--match-muted);
    font: 24px/1 Arial, sans-serif;
    cursor: pointer;
  }
  .next-match-close:hover { color: var(--match-ink); }
  .next-match-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .next-match-heading { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .next-match-eyebrow {
    margin: 0;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--match-heading);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.28em;
    white-space: nowrap;
  }
  .next-match-eyebrow .accent {
    background: linear-gradient(180deg, var(--match-accent-2), var(--match-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 12px var(--match-glow));
  }
  .next-match-eyebrow::before, .next-match-eyebrow::after {
    content: "";
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--match-eyebrow-line));
    box-shadow: 0 0 10px var(--match-glow);
  }
  .next-match-eyebrow::after { background: linear-gradient(90deg, var(--match-eyebrow-line), transparent); }
  .next-match-subtitle {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--match-muted);
  }

  .next-match-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(210px, auto) minmax(0, 1fr);
    grid-template-areas: "home vs away" "home center away";
    align-items: center;
    column-gap: 20px;
    row-gap: 4px;
  }
  .next-match-body > .next-match-team.home { grid-area: home; }
  .next-match-body > .next-match-team.away { grid-area: away; }
  .next-match-body .next-match-center { grid-area: center; align-self: start; }
  .next-match-stack { display: contents; }
  @media (min-width: 521px) {
    /* The center has its own even spacing, independent of the crests and
       team names. Hidden countdowns keep the usual two-row matchup. */
    .next-match-body:has(.next-match-countdown:not([hidden])) {
      grid-template-areas: "home stack away" "home stack away";
      grid-template-rows: clamp(104px, 18vw, 136px) auto;
      row-gap: 10px;
    }
    .next-match-body:has(.next-match-countdown:not([hidden])) > .next-match-stack {
      grid-area: stack;
      display: flex;
      flex-direction: column;
      align-items: center;
      align-self: start;
      min-width: 0;
      gap: 24px;
    }
    /* Kickoff time sits closer under the VS badge than the countdown above it. */
    .next-match-stack > .next-match-center { align-self: stretch; margin-top: -14px; }
  }
  .next-match-body .next-match-vs { grid-area: vs; justify-self: center; align-self: center; }
  .next-match-center { display: grid; justify-items: center; gap: 6px; min-width: 0; text-align: center; padding-bottom: 6px; }
  .next-match-details { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 36px; padding-top: 16px; margin-top: 6px; border-top: 1px solid color-mix(in srgb, var(--match-blue) 30%, transparent); }
  .next-match-details .nm-venue { flex: 1 1 280px; max-width: 100%; text-align: left; }
  .next-match-details .nm-venue > span { white-space: normal; overflow-wrap: anywhere; }
  .next-match-details .nm-weather { margin-top: 0; margin-left: auto; }
  .nm-date { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: color-mix(in srgb, var(--match-heading) 88%, transparent); }
  .nm-time { font: 700 44px/1 "JetBrains Mono", monospace; letter-spacing: -0.01em; color: var(--accent-strong); }
  :root .nm-time { color: var(--match-heading); }
  .nm-time small { margin-left: 6px; font-size: 17px; }
  .nm-time small.tz, .pv-time small.tz { margin-left: 5px; font-size: 0.23em; font-weight: 600; letter-spacing: 0.04em; color: var(--match-muted); }
  /* AM/PM over the zone, both beside the digits ("5:00 PM/CST"), so the time
     takes less width. */
  .nm-time { display: inline-flex; align-items: center; }
  .nm-suffix { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-left: 7px; line-height: 1; }
  .nm-suffix small, .nm-suffix small.tz { margin-left: 0; }
  .nm-venue { display: inline-flex; align-items: center; gap: 6px; max-width: min(300px, 100%); min-width: 0; font: 17px/1.15 "Barlow Condensed", sans-serif; color: var(--match-ink); text-decoration: none; }
  .nm-venue > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  a.nm-venue:hover > span { text-decoration: underline; }
  /* Map marker before the field name (the same icon as the schedule's venues). */
  .nm-venue .meta-icon { display: inline-flex; flex: none; color: var(--match-accent-2); }
  .nm-venue .meta-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* Kickoff weather (lib/weather.js): one line under the venue. */
  .nm-weather { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; margin-top: 8px; font: 500 16px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.02em; color: color-mix(in srgb, var(--match-ink) 72%, transparent); }
  .nm-wx-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
  .nm-weather strong { font-size: 23px; font-weight: 700; color: var(--match-heading); }
  .nm-weather b { font-weight: 700; letter-spacing: 0.05em; color: var(--match-ink); }
  .nm-wx-sep { width: 1.5px; height: 24px; border-radius: 1px; background: color-mix(in srgb, var(--match-blue) 70%, transparent); }
  .nm-wx-icon { width: 26px; height: 26px; flex: none; overflow: visible; }
  .nm-wx-icon .wx-sun { fill: #ffc940; stroke: #ffc940; stroke-width: 1.5; stroke-linecap: round; }
  .nm-wx-icon .wx-cloud { fill: #eef4fc; stroke: #b9cbe2; stroke-width: 0.6; }
  .nm-wx-icon .wx-line, .nm-wx-icon .wx-rain { fill: none; stroke: var(--match-blue); stroke-width: 1.7; stroke-linecap: round; }
  .nm-wx-icon .wx-snow { fill: #eef4fc; }
  .nm-wx-icon .wx-bolt { fill: #ffc940; }
  .nm-wx-icon .wx-drop { fill: var(--match-blue); }
  .next-match[data-preview-match] { cursor: pointer; }
  .next-match[data-preview-match]:focus-visible { outline: 2px solid var(--match-blue); outline-offset: 3px; }
  /* Hover: a small lift, a brighter edge and glow, crests grow a touch.
     Uses translate/scale (not transform) so it doesn't fight the entrance
     animations, which hold their final transform. */
  .next-match[data-preview-match] { transition: translate 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
  .next-match[data-preview-match] .next-match-team img.crest { transition: scale 0.25s ease; }
  @media (hover: hover) {
    .next-match[data-preview-match]:hover {
      translate: 0 -3px;
      border-color: color-mix(in srgb, var(--match-blue) 85%, transparent);
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--match-blue) 24%, transparent), 0 0 46px -4px var(--match-glow), 0 24px 52px rgba(6, 20, 45, 0.34);
    }
    .next-match[data-preview-match]:hover .next-match-team img.crest { scale: 1.04; }
  }
  @media (prefers-reduced-motion: reduce) {
    .next-match[data-preview-match]:hover { translate: none; }
    .next-match[data-preview-match]:hover .next-match-team img.crest { scale: none; }
  }

  /* Teams share the matchup's row heights: crest first, name/record second. */
  .next-match-body > .next-match-team {
    display: grid;
    grid-template-rows: subgrid;
    justify-items: center;
    align-self: stretch;
    row-gap: 6px;
    min-width: 0;
    text-align: center;
  }
  .next-match-body > .next-match-team > .next-match-crest-wrap { grid-row: 1; align-self: center; }
  .next-match-team-info {
    grid-row: 2;
    align-self: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
  }


  .next-match-team span.name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: clamp(19px, 2.4vw, 23px);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--match-ink);
  }

  .next-match-crest-wrap { position: relative; display: grid; place-items: center; isolation: isolate; }
  .crest-star {
    position: absolute;
    z-index: 2;
    top: -7px;
    right: -7px;
    font-size: 17px;
    line-height: 1;
    filter: drop-shadow(0 2px 3px rgba(22, 32, 46, 0.32));
  }
  .next-match-crest-wrap .crest-glow {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: blur(19px) saturate(2.2);
    opacity: var(--match-logo-glow);
    transform: translateY(12px) scale(0.9);
    pointer-events: none;
  }
  .next-match-team img.crest, .next-match-team .crest-fallback {
    position: relative;
    z-index: 1;
    width: clamp(104px, 18vw, 136px);
    height: clamp(104px, 18vw, 136px);
    font-size: clamp(26px, 5vw, 50px);
    padding: var(--nm-crest-pad);
    border: 0;
    border-radius: 22px;
    background: var(--crest-tile-bg);
    box-shadow: var(--nm-crest-shadow);
    animation: next-match-crest-enter 380ms ease-out both;
  }
  .next-match-team.home img.crest, .next-match-team.home .crest-fallback { animation-delay: 120ms; }
  .next-match-team.away img.crest, .next-match-team.away .crest-fallback { animation-delay: 220ms; }
  .next-match-team .crest-fallback { color: #142d53; }
  .next-match-team img.crest.plate { padding: 12px; background: var(--match-crest); box-shadow: var(--nm-tile-shadow); }

  .next-match-team .name::after {
    content: "";
    display: block;
    width: 52px;
    height: 3px;
    margin: 3px auto 0;
    border-radius: 3px;
    background: var(--match-blue);
    box-shadow: 0 0 8px var(--match-glow);
  }

  .next-match-team .record {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--match-muted);
  }

  .next-match-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    padding: 5px;
    background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--match-blue) 30%, var(--match-vs-bg)), var(--match-vs-bg) 70%);
    border: 2px solid var(--match-blue);
    border-radius: 999px;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--match-blue) 14%, transparent), 0 0 26px var(--match-glow);
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 800;
    color: var(--match-vs-ink);
    font-size: 25px;
    white-space: nowrap;
    position: relative;
  }
  /* Light streaks crossing behind the VS badge. */
  .next-match-vs::before, .next-match-vs::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: 190px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--match-accent-2), transparent);
    box-shadow: 0 0 8px var(--match-glow);
    transform: translate(-50%, -50%) rotate(-24deg);
    opacity: 0.8;
    pointer-events: none;
  }
  .next-match-vs::after { width: 130px; margin-top: 12px; opacity: 0.45; }








  .next-match-countdown[hidden] { display: none; }
  .next-match-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    align-self: center;
    max-width: 100%;
    margin: 0;
    color: var(--match-ink);
    text-align: center;
    font-family: "Barlow Condensed", sans-serif;
  }
  .next-match-body .next-match-countdown { grid-area: countdown; margin: 0; gap: 5px; }
  .next-match-body .countdown-label { font-size: 10px; letter-spacing: 0.2em; }
  .countdown-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--match-muted);
  }
  .countdown-units { display: flex; align-items: stretch; justify-content: center; gap: 7px; max-width: 100%; }
  .countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 1 auto;
    width: 50px;
    min-width: 0;
    padding: 7px 5px 6px;
    border: 1px solid color-mix(in srgb, var(--match-blue) 60%, transparent);
    border-radius: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--match-blue) 10%, var(--match-meta-bg)), var(--match-meta-bg));
    box-shadow: 0 0 18px -6px var(--match-glow), inset 0 1px 0 color-mix(in srgb, var(--match-accent-2) 22%, transparent);
  }
  .countdown-value { display: inline-flex; overflow: hidden; height: 1em; font-size: 25px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--match-heading); }
  .countdown-digit { position: relative; display: block; width: 1ch; height: 1em; }
  .countdown-current, .countdown-outgoing { display: block; height: 100%; }
  .countdown-outgoing { position: absolute; inset: 0; pointer-events: none; }
  .countdown-unit-label { margin-top: 3px; font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--match-muted); }
  .countdown-sep { display: none; }
  .countdown-done { padding: 10px 18px; border: 1px solid color-mix(in srgb, var(--match-blue) 60%, transparent); border-radius: 12px; background: var(--match-meta-bg); font-size: 20px; font-weight: 600; box-shadow: 0 0 18px -6px var(--match-glow); }
  @media (max-width: 400px) { .countdown-units { gap: 8px; } .countdown-unit { width: 46px; padding: 6px 4px; } }

  .next-match-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--match-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-align: center;
    text-transform: uppercase;
  }
  .next-match-footer::before, .next-match-footer::after {
    content: "";
    width: 32px;
    height: 1px;
    background: var(--match-line);
  }

  .dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--win);
    margin-right: 6px;
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  button.refresh-btn {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
  }
  button.refresh-btn:has(.btn-icon) { display: inline-flex; align-items: center; gap: 5px; }
  button.refresh-btn[hidden] { display: none; }
  button.refresh-btn .btn-icon {
    width: 13px;
    height: 13px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  button.refresh-btn:hover { filter: brightness(1.05); }
  button.refresh-btn:disabled { opacity: 0.6; cursor: default; }

  .tip-link {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 20px;
    padding: 5px 12px;
    text-decoration: none;
    display: inline-block;
  }
  .tip-link:hover, .tip-link:focus-visible { filter: brightness(1.05); }

  .toggle-group {
    position: relative; /* holds the sliding pill (slidePill) */
    isolation: isolate;
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
  }

  #age-toggle {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* "Pick an age group" hint after choosing a whole club (see playAgeHint). */
  #age-toggle.age-hint { border-radius: 999px; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 0 14px -4px var(--accent), 0 0 16px -4px var(--accent); transition: box-shadow 0.4s ease; }
  #age-toggle.age-hint .age-link { animation: age-wave 0.55s ease-in-out 2; animation-delay: calc(var(--i, 0) * 70ms); }
  @keyframes age-wave { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }
  .age-hint-tip {
    flex: none; align-self: center; white-space: nowrap;
    font-size: 12px; font-weight: 700; color: var(--accent-strong);
    background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    padding: 4px 10px; border-radius: 999px;
    animation: age-tip-in 0.3s ease-out; transition: opacity 0.4s ease;
  }
  .age-hint-tip.leaving { opacity: 0; }
  @keyframes age-tip-in { from { opacity: 0; transform: translateX(-6px); } }
  @media (prefers-reduced-motion: reduce) {
    #age-toggle.age-hint .age-link, .age-hint-tip { animation: none; }
  }

  .toggle-group button, .toggle-group .age-link {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: var(--muted);
    background: none;
    border: none;
    border-radius: 16px;
    padding: 5px 10px;
    cursor: pointer;
  }
  /* Age groups are real links (search engines follow them to each team page),
     drawn exactly like the buttons beside them. */
  .toggle-group .age-link { line-height: normal; text-decoration: none; text-align: center; }

  .toggle-group button:hover, .toggle-group .age-link:hover { color: var(--ink); }

  /* The selected option is a solid pill: near-white on dark, navy on light. */
  .toggle-group button.active, .toggle-group .age-link.active {
    background: var(--toggle-active-bg);
    color: var(--toggle-active-ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  }
  .toggle-group button.active:hover, .toggle-group .age-link.active:hover { color: var(--toggle-active-ink); }

  /* "Club" at the start of the age row: the whole club (/academy/club/<slug>). */
  .toggle-group .club-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font: 600 11.5px "Libre Franklin", sans-serif; letter-spacing: 0.02em;
    color: var(--muted); text-decoration: none; border-radius: 16px; padding: 5px 10px;
    position: relative; margin-right: 13px; box-shadow: inset 0 0 0 1px var(--line);
  }
  /* A thin divider between Club and the ages. */
  .toggle-group .club-pill::after { content: ""; position: absolute; right: -8px; top: 4px; bottom: 4px; width: 1px; background: var(--line); pointer-events: none; }
  .toggle-group .club-pill svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
  .toggle-group .club-pill:hover { color: var(--ink); }
  .toggle-group .club-pill.active { background: var(--toggle-active-bg); color: var(--toggle-active-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
  /* Club + six ages must fit a phone: tighter pills, and wrap as a last resort. */
  @media (max-width: 480px) {
    .age-row #age-toggle { flex-wrap: wrap; justify-content: center; }
    .age-row #age-toggle { gap: 1px; }
    .title-row .age-row #age-toggle .age-link, .age-row #age-toggle .club-pill { padding: 6px 8px; letter-spacing: 0; }
    .age-row #age-toggle .club-pill { margin-right: 9px; }
    .age-row #age-toggle .club-pill::after { right: -6px; }
    .age-row #age-toggle .club-pill svg { display: none; }
  }

  /* Club Overview: team-only parts hide, the dashboard shows. */
  body.club-mode .team-only { display: none !important; }
  .club-view { display: flex; flex-direction: column; gap: 14px; }
  .club-view[hidden] { display: none; }
  .club-divisions[hidden] { display: none; }
  .club-divisions .schedule-tab { text-decoration: none; }
  .dash-card {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  }
  .dash-kicker { font: 600 11px "Libre Franklin", sans-serif; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }


  .club-dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
  .dash-card { grid-column: span 12; padding: 14px 16px; min-width: 0; color: var(--ink); }
  .dash-card.span-5 { grid-column: span 5; } .dash-card.span-6 { grid-column: span 6; } .dash-card.span-7 { grid-column: span 7; }
  .dash-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; font: 700 15px/1.2 "Barlow Condensed", sans-serif; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); }
  .dash-title small { font: 500 11.5px "Libre Franklin", sans-serif; letter-spacing: 0; text-transform: none; color: var(--muted); }
  .dash-big { margin: 6px 0 2px; font: 700 34px/1.05 "Barlow Condensed", sans-serif; color: var(--ink); }
  .dash-sub { font-size: 13px; color: var(--muted); }
  .dash-empty { padding: 6px 0; font-size: 13.5px; color: var(--muted); }
  .sched-day.is-soon { color: var(--accent-strong); }

  /* Rows shared by the cards: age | content | value; each opens that team. */
  .dash-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 6px; margin: 0 -6px; border-radius: 8px; color: var(--ink); text-decoration: none; }
  a.dash-row:hover, a.dash-row:focus-visible { background: var(--surface-2); }
  .dash-age { font-weight: 800; font-size: 13px; color: var(--accent-strong); }
  .dash-muted { color: var(--muted); font-size: 13px; }

  /* Club staff signup follows the sporting content. */
  .club-contact-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
  .cc-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding-right: 14px; border-right: 1px solid var(--line); color: var(--muted); }
  .cc-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
  .cc-text { flex: 1; min-width: 0; }
  .cc-title { margin: 0 0 3px; font: 700 16px/1.25 "Libre Franklin", sans-serif; color: var(--ink); letter-spacing: 0; text-transform: none; }
  .club-contact-card .dash-sub { margin: 0; }
  .cc-btn {
    flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px;
    font: 700 14px "Libre Franklin", sans-serif; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, #16945a, #1f7a4f); border: 1px solid #16945a; border-radius: 10px;
    box-shadow: 0 6px 16px -8px rgba(22, 148, 90, 0.8);
  }
  .cc-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .cc-btn:hover { filter: brightness(1.08); }
  .cc-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  @media (max-width: 600px) {
    .club-contact-card { flex-wrap: wrap; }
    .cc-icon { display: none; }
    .cc-btn { width: 100%; justify-content: center; }
  }

  /* Club snapshot: a panel of tiles - one notable fact per age group (first
     place, a streak, a big move in the table), new videos, and this week. */
  .form-chips { display: flex; gap: 4px; }
  .form-chip { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; font-size: 11.5px; font-weight: 800; color: #fff; }
  .form-chip.w { background: var(--win); } .form-chip.d { background: var(--draw); } .form-chip.l { background: var(--loss); }

  /* Club Hub: compact fixtures first, readable age rows at every width. */
  .hub-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .hub-heading .dash-title { margin-bottom: 3px; }
  .hub-heading .dash-sub { margin: 0; }
  .hub-action { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--accent-strong); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
  .hub-action[hidden] { display: none; }
  .hub-date { margin: 14px 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
  .hub-fixture { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 12px; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 8px 0; text-align: left; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); font: inherit; cursor: pointer; }
  .hub-fixture:last-child { border-bottom: 0; }
  .hub-fixture:hover, .hub-age-row:hover { background: var(--surface-2); }
  .hub-fixture:focus-visible, .hub-action:focus-visible, .hub-age-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .hub-opponent { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .hub-opponent > span { min-width: 0; }
  .hub-opponent strong { display: block; font-size: 14px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hub-opponent small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
  .hub-crest { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; }
  .hub-opponent .crest, .hub-opponent .crest-fallback { display: block; width: 34px; height: 34px; object-fit: contain; }
  .hub-fixture > .dash-age { padding: 4px 0; border-radius: 6px; text-align: center; font-size: 11px; background: var(--accent-soft); }
  .hub-chevron { width: 12px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .hub-kickoff { text-align: right; font-size: 14px; font-weight: 700; white-space: nowrap; }
  .hub-kickoff small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; }
  /* Team performance: one row per team, its next match in the last column. */
  .hub-age-row { display: grid; grid-template-columns: 40px minmax(110px, 1fr) 64px 48px 122px minmax(190px, 1.5fr) 12px; align-items: center; gap: 12px; padding: 10px 6px; margin: 0 -6px; min-height: 58px; border-radius: 8px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); font-size: 13px; }
  /* Club at a glance: four tiles in a row, 2 x 2 on phones. */
  .club-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; min-height: 92px; }
  /* Each tile has its own color (--tile): the icon, a faint tint and border. */
  .club-tile {
    grid-column: auto; display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tile) 16%, transparent), color-mix(in srgb, var(--tile) 4%, transparent)), color-mix(in srgb, var(--surface) 92%, transparent);
    border-color: color-mix(in srgb, var(--tile) 45%, var(--line));
  }
  .tile-streak { --tile: #2fae6a; } .tile-teams { --tile: #3b8fe0; } .tile-week { --tile: #22a6c9; } .tile-best { --tile: #d9a521; } .tile-video { --tile: #9b6be0; }
  .club-tile-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: var(--tile); background: color-mix(in srgb, var(--tile) 22%, transparent); border: 1px solid color-mix(in srgb, var(--tile) 40%, transparent); }
  .club-tile-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .club-tile-text { display: flex; flex-direction: column; min-width: 0; }
  .club-tile-label { font-size: 13px; font-weight: 600; color: var(--ink); }
  .club-tile-value { font: 700 30px/1.1 "Barlow Condensed", sans-serif; color: var(--ink); }
  .club-tile-sub { color: var(--muted); font-size: 12px; line-height: 1.4; }
  a.club-tile:hover { filter: brightness(1.12); }
  a.club-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  @media (max-width: 600px) {
    .club-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 212px; }
    .club-tile { gap: 10px; padding: 10px 11px; align-items: flex-start; }
    .club-tile-icon { width: 34px; height: 34px; }
    .club-tile-icon svg { width: 19px; height: 19px; }
    .club-tile-label { font-size: 12px; }
    .club-tile-value { font-size: 26px; }
  }
  /* This week at the club: short facts, two per row (one on phones). */
  .club-highlight-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .club-highlight { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
  a.club-highlight:hover { background: var(--surface-2); }
  a.club-highlight:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .club-highlight .club-tile-icon { width: 36px; height: 36px; }
  .club-highlight .club-tile-icon svg { width: 19px; height: 19px; }
  .club-highlight > span:last-child { min-width: 0; }
  .club-highlight strong { display: block; font-size: 14px; line-height: 1.35; }
  .club-highlight small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
  @media (max-width: 600px) { .club-highlight-list { grid-template-columns: minmax(0, 1fr); } }
  /* The age as a small badge, so each row is easy to find at a glance. */
  .hub-age-row > .dash-age { display: grid; place-items: center; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--ink); font-size: 12px; }
  .hub-age-ppm { font-weight: 700; }
  .hub-age-next { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .hub-age-next .crest, .hub-age-next .crest-fallback { width: 26px; height: 26px; flex: none; object-fit: contain; font-size: 9px; }
  .hub-age-next > span { min-width: 0; }
  .hub-age-next strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hub-age-next small { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
  .hub-age-none { color: var(--muted); font-size: 12px; font-style: italic; }
  /* Ages with no games yet and nothing scheduled share one quiet line. */
  .hub-age-idle { padding: 12px 0 2px; border-top: 1px solid var(--line); }
  .hub-age-idle-title { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .hub-age-idle-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
  .hub-age-waiting { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 6px; margin: 0 -6px; border-radius: 8px; color: var(--muted); font-size: 12.5px; text-decoration: none; }
  .hub-age-waiting > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hub-age-waiting:hover, .hub-age-waiting:focus-visible { background: var(--surface-2); color: var(--ink); }
  .hub-age-waiting > .dash-age { flex: none; display: grid; place-items: center; width: 40px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--ink); font-size: 12px; }
  @media (max-width: 600px) { .hub-age-idle-list { grid-template-columns: minmax(0, 1fr); } }
  .hub-age-head { min-height: 0; border-top: 0; padding: 0 6px 8px; color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 700; }
  .hub-age-head:hover { background: transparent; }
  .hub-age-standing small { display: block; color: var(--muted); line-height: 1.5; font-size: 11px; }
  .hub-mobile-label { display: none; }
  .hub-age-record { font-size: 12px; }
  body.club-mode .title-row { padding-bottom: 10px; }
  @media (max-width: 600px) {
    .club-view, .club-dash { gap: 10px; }
    .club-view .dash-card { padding: 12px; }
    .club-view .dash-title { font-size: 15px; }
    body.club-mode .age-row #age-toggle .age-link { padding-inline: 5px; }
    body.club-mode .age-row #age-toggle .club-pill { padding-inline: 7px; margin-right: 5px; }
    .club-view .sched-row { min-height: 48px; }
    .hub-heading { align-items: flex-start; }
    .hub-action { max-width: 115px; }
    .hub-fixture { gap: 7px; min-height: 62px; grid-template-columns: 30px minmax(0, 1fr) auto 10px; }
    .hub-chevron { width: 10px; }
    .hub-opponent { gap: 7px; }
    .hub-opponent strong { font-size: 13px; }
    .hub-crest { width: 30px; height: 30px; flex-basis: 30px; }
    .hub-opponent .crest, .hub-opponent .crest-fallback { width: 30px; height: 30px; }
    .hub-kickoff { font-size: 13px; }
  }
  @media (max-width: 860px) {
    .hub-age-head { display: none; }
    .hub-age-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 6px 10px; }
    .hub-age-row > .dash-age { grid-row: span 3; align-self: start; margin-top: 2px; }
    .hub-age-standing { grid-column: 2; }
    .hub-age-record { grid-column: 2; grid-row: 2; }
    .hub-age-ppm { grid-column: 3; grid-row: 1; text-align: right; }
    .hub-age-row > .form-chips { grid-column: 3; grid-row: 2; }
    .hub-age-row > .hub-age-next { grid-column: 2 / 4; grid-row: 3; padding-top: 6px; border-top: 1px dashed var(--line); }
    .hub-age-row > .hub-chevron { display: none; }
    .hub-age-row.not-started > :is(.hub-age-record, .hub-age-ppm) { display: none; }
    .hub-mobile-label { display: inline; margin-right: 4px; color: var(--muted); font-size: 10px; }
  }

  /* Only the club hub gets the wider canvas; individual team pages keep
     their existing width. Both header and cards use the same inner edges. */
  body.club-mode .page { max-width: 1200px; }
  body.club-mode header.masthead { margin-inline: 0; }
  @media (min-width: 1100px) {
    .club-dash { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); }
    .club-dash > .dash-card { grid-column: 1 / -1; }
    .hub-fixture { gap: 8px; }
    .hub-heading { align-items: flex-start; }
    .hub-heading .dash-sub { font-size: 12px; line-height: 1.5; }
    .hub-action { max-width: 115px; flex: none; }
  }

  /* Upcoming schedule and results: compact rows. */
  .dash-list { display: flex; flex-direction: column; }
  .sched-row { display: grid; grid-template-columns: 46px 34px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 6px; margin: 0 -6px; border-radius: 8px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
  .sched-row:first-child { border-top: 0; }
  .sched-row:hover { background: var(--surface-2); }
  /* The whole row opens the team page; only the Watch link sits above it. */
  .sched-row { position: relative; }
  .sched-link { position: absolute; inset: 0; border-radius: 8px; }
  .sched-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .sched-row > :not(.sched-link) { position: relative; pointer-events: none; }
  .sched-row > .video-link { pointer-events: auto; z-index: 1; justify-self: end; }
  #club-recent .sched-row { grid-template-columns: 46px 34px minmax(0, 1fr) auto auto auto; }
  .sched-day { font-size: 12.5px; font-weight: 700; line-height: 1.15; }
  .sched-day small { display: block; font-weight: 500; color: var(--muted); }
  .sched-opp { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; }
  .sched-opp em { font-style: normal; color: var(--muted); font-size: 12px; }
  .sched-opp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sched-opp .crest, .sched-opp .crest-fallback { width: 22px; height: 22px; flex: none; font-size: 8px; }
  .sched-time { font: 700 13px "JetBrains Mono", monospace; text-align: right; white-space: nowrap; }
  .sched-time small { font: 600 10.5px "Libre Franklin", sans-serif; color: var(--muted); }
  .sched-ha { min-width: 44px; padding: 3px 0; text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; border-radius: 5px; color: var(--muted); border: 1px solid var(--line); }
  .sched-ha.home { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent-strong) 40%, var(--line)); }
  .sched-pending { padding: 3px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; border-radius: 5px; color: var(--draw); background: color-mix(in srgb, var(--draw) 14%, transparent); }

  @media (max-width: 760px) {
    .dash-card.span-5, .dash-card.span-6, .dash-card.span-7 { grid-column: span 12; }
  }
  @media (max-width: 600px) {
    .form-chip { width: 19px; height: 19px; font-size: 10.5px; }
    .form-chips { gap: 3px; }
  }
  @media (max-width: 480px) {
    /* Phones: the opponent's name gets the room (vs/@ still says home or away). */
    .sched-row { grid-template-columns: 42px 30px minmax(0, 1fr) auto; gap: 8px; }
    .sched-row .sched-ha, .sched-opp .crest, .sched-opp .crest-fallback { display: none; }
    .sched-opp { font-size: 13.5px; gap: 5px; }
    #club-recent .sched-row { grid-template-columns: 42px 30px minmax(0, 1fr) auto auto auto; }
    #club-recent .video-link span { display: none; } /* icon-only Watch on phones */
  }

  .title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .title-row #age-toggle .age-link { font-size: 13px; padding: 6px 14px; }

  /* Team header card: club name on the left, the team's own actions (Switch
     team, Share) centred on the right (clear of the fixed theme toggle), age groups in a full-width
     row below. The heading shrinks (and wraps) before the actions drop to
     their own line. */
  .team-heading { flex: 1 1 0; }
  .team-actions { display: flex; flex-wrap: nowrap; gap: 8px; margin-left: auto; align-self: center; flex: none; }
  button.refresh-btn.team-action { font-size: 13px; padding: 7px 14px; }
  /* Switch club as quiet "glass" next to Share, the one accent. The 1px
     border comes out of the padding so both buttons stay the same height. */
  button.refresh-btn.team-action#switch-team-btn {
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 55%, transparent);
    border: 1px solid var(--line);
    padding: 6px 13px;
    backdrop-filter: blur(8px);
    transition: border-color .15s, background-color .15s;
  }
  button.refresh-btn.team-action#switch-team-btn:hover {
    filter: none;
    border-color: color-mix(in srgb, var(--ink) 35%, transparent);
    background: color-mix(in srgb, var(--surface) 75%, transparent);
  }
  a.team-action.rankings-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 6px 13px; border: 1px solid #47769d; border-radius: 20px;
    color: var(--ink); background: color-mix(in srgb, var(--surface) 80%, #286296 20%);
    font: 600 13px "Libre Franklin", sans-serif; text-decoration: none; white-space: nowrap;
    transition: border-color .15s, background-color .15s;
  }
  a.team-action.rankings-action:hover { border-color: #80b8e5; background: color-mix(in srgb, var(--surface) 65%, #286296 35%); }
  .rankings-action .btn-icon { width: 14px; height: 14px; flex: none; fill: none; stroke: #89bde7; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }


  @media (max-width: 640px) {
    .team-heading { flex-basis: 100%; }
    .team-actions { flex-basis: 100%; margin-left: 0; max-height: 60px; transition: max-height .2s ease, opacity .2s ease; }
    .team-actions .team-action { flex: 1 1 0; min-width: 0; min-height: 44px; justify-content: center; padding: 9px 7px; white-space: nowrap; }
    button.refresh-btn.team-action#switch-team-btn { padding: 8px 6px; }
    /* Once the page scrolls, the pinned header keeps only the team and its
       ages; Switch club and Share come back near the top (.compact, set on
       scroll with the same anti-flicker rules as the desktop crest). */
    .sticky-header.compact .team-actions { max-height: 0; opacity: 0; overflow: hidden; margin-top: -10px; pointer-events: none; }
  }
  @media (max-width: 400px) {
    .team-actions { gap: 5px; }
    .team-actions .team-action { font-size: 12px; }
    .team-actions :is(#switch-team-btn, #share-team-btn, #rankings-team-link) .btn-icon { display: none; }
  }

  section {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  h2 {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0;
    color: var(--ink);
  }

  .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
  }

  table {
    border-collapse: collapse;
    width: 100%;
    min-width: 560px;
  }

  thead th {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: right;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    white-space: nowrap;
  }

  thead th:first-child, thead th:nth-child(2) { text-align: left; }

  tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 13.5px;
    white-space: nowrap;
  }

  tbody tr:last-child td { border-bottom: none; }

  td.rank {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    width: 34px;
  }

  td.team {
    text-align: left;
    font-family: "Libre Franklin", sans-serif;
    font-weight: 500;
    font-size: 14.5px;
    color: var(--ink);
  }

  td.team .crest-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  td.team .crest-row img.crest, td.team .crest-row .crest-fallback {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  img.crest {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--surface-2);
    flex: none;
  }
  /* Dark crests (CREST_PLATE) sit on white so they show on the dark theme. */
  img.crest.plate { box-sizing: border-box; padding: 2px; background: #fff; }
  .team-heading img.crest.plate { padding: 8%; }
  /* Header crest: no tile behind it, just a soft glow around its shape.
     Dark crests keep their white plate (above) so they stay visible. */
  .team-heading img.crest:not(.plate) {
    background: none;
    border-radius: 0;
    filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 55%, transparent)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  }

  .crest-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 10px;
    flex: none;
  }

  td.pts {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    color: var(--accent-strong);
  }

  tr.highlight td { background: var(--accent-soft); }
  tr.highlight td.team { font-weight: 700; border-left: 3px solid var(--accent); padding-left: 11px; }

  .schedule-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  /* Previous / Upcoming / All stays reachable while scrolling a long
     schedule: it sticks just under the sticky header (--sticky-top is that
     header's live height, set in the script). */
  .schedule-list > .schedule-tabs {
    position: sticky;
    top: calc(var(--sticky-top, 0px) + 8px);
    z-index: 12;
    box-shadow: var(--shadow);
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
  }
  /* While pinned over the match cards: tinted, outlined and lifted so it
     doesn't blend into the cards scrolling underneath. */
  .schedule-list > .schedule-tabs.is-stuck {
    background: color-mix(in srgb, var(--surface) 82%, var(--accent));
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
  }

  /* Pill groups (Previous/Upcoming/All, League/Flex, club divisions) share one
     shape. position: relative anchors the sliding highlight below; the sticky
     schedule tabs keep position: sticky (a more specific rule above). */
  .schedule-tabs {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-self: center;
    max-width: 100%;
    gap: 4px;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .schedule-tab {
    border: 0;
    border-radius: 999px;
    padding: 10px 22px;
    color: var(--ink);
    background: transparent;
    font: 600 13.5px "Libre Franklin", sans-serif;
    cursor: pointer;
    transition: color 0.2s;
  }

  .schedule-tab.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
  }

  /* Previous / Upcoming / All icons, in the stroke style of the header buttons. */
  .schedule-tab:has(.tab-icon) { display: inline-flex; align-items: center; gap: 6px; }
  .tab-icon { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  /* Phones: tighter pills, and no icons, so "Previous / Upcoming / All" with
     their counts still fit on one line. */
  @media (max-width: 640px) { .schedule-tab { padding: 9px 13px; font-size: 13px; } }
  @media (max-width: 480px) { .schedule-tab { padding: 9px 12px; font-size: 12.5px; } .tab-icon { display: none; } }

  /* Sliding highlight: once slidePill() has measured the active tab, the
     highlight is drawn by ::before and glides to whichever tab is picked. */
  .schedule-tabs.pill-slider::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 0;
    top: 0;
    width: var(--pill-w, 0px);
    height: var(--pill-h, 0px);
    transform: translate(var(--pill-x, 0px), var(--pill-y, 0px));
    border-radius: 999px;
    background: var(--accent-soft);
    transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.3s cubic-bezier(0.3, 0.7, 0.2, 1);
  }
  .schedule-tabs.pill-slider .schedule-tab.active { background: transparent; }
  /* Button groups (age row, club picker's division, theme) slide the same
     way, with their own solid pill. */
  .toggle-group.pill-slider::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 0;
    top: 0;
    width: var(--pill-w, 0px);
    height: var(--pill-h, 0px);
    transform: translate(var(--pill-x, 0px), var(--pill-y, 0px));
    border-radius: 999px;
    background: var(--toggle-active-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.3s cubic-bezier(0.3, 0.7, 0.2, 1);
  }
  .toggle-group.pill-slider > .active,
  .toggle-group.pill-slider > .club-pill.active { background: transparent; box-shadow: none; }
  .schedule-tabs.pill-instant::before,
  .toggle-group.pill-instant::before { transition: none; }
  @media (prefers-reduced-motion: reduce) { .schedule-tabs.pill-slider::before, .toggle-group.pill-slider::before { transition: none; } }

  .schedule-tab:hover:not(.active) { color: var(--accent-strong); }

  .schedule-panel[hidden] { display: none; }

  /* Team page text that sits directly on the night photo stays light in
     both themes. */
  body > .page > section > h2 { color: #e6eef9; }
  body > .page .schedule-list .date-heading,
  body > .page > .share-cta,
  body > .page > .site-footer { color: #aebcd0; }
  body > .page > .share-cta .share-cta-btn { color: #d6e4f7; }

  .schedule-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .past-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .past-results > summary {
    cursor: pointer;
    list-style: none;
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--accent-strong);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
  }

  .past-results > summary::-webkit-details-marker { display: none; }
  .past-results > summary::before { content: "+"; display: inline-block; width: 18px; font-weight: 700; }
  .past-results[open] > summary::before { content: "-"; }

  .past-results .schedule-list { padding-top: 2px; }

  .date-heading {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 10px 0 -2px;
  }

  .date-heading .meta-icon {
    margin-right: 4px;
    font-size: 0.9em;
  }
  .match-footer .meta-icon {
    display: inline-flex;
    margin-right: 4px;
    vertical-align: -3px;
  }
  .match-footer .meta-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  /* "Watch on Taka" notice, shown once per visit before leaving for Taka. */
  .match[data-preview-match] { cursor: pointer; }
  .match[data-preview-match] { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
  .match[data-preview-match]:hover, .match[data-preview-match]:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
    box-shadow: var(--shadow), 0 10px 26px -12px var(--accent);
  }
  .match[data-preview-match]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .match[data-preview-match]:hover, .match[data-preview-match]:focus-visible { transform: none; } }
  /* Match preview (see openMatchPreview). Uses the site's theme tokens; the
     header sits on the stadium photo like the rest of the site, with a
     light or dark shade to match the theme. */
  .match-preview {
    --pv-shade: linear-gradient(180deg, rgba(6, 14, 28, 0.18) 0%, rgba(8, 18, 34, 0.55) 55%, var(--surface) 100%);
    box-sizing: border-box; width: min(940px, calc(100vw - 32px)); max-height: 92dvh; overflow-y: auto; overflow-x: hidden; padding: 0 0 24px;
    border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow);
  }
  .match-preview::backdrop { background: rgba(5, 10, 18, 0.75); }
  /* Zero-height sticky row so the close button stays reachable while scrolling. */
  .preview-heading { position: sticky; top: 0; z-index: 3; height: 0; }
  .preview-heading .modal-close { position: absolute; top: 12px; right: 12px; font-size: 26px; background: color-mix(in srgb, var(--surface) 70%, transparent); }

  .pv-hero { padding: 22px 26px 18px; background: var(--pv-shade), var(--stadium-img) center 5% / cover no-repeat; }
  .pv-title { display: grid; justify-items: center; gap: 2px; margin-bottom: 14px; }
  .pv-title .next-match-eyebrow { font-size: clamp(26px, 4.4vw, 38px); }
  .pv-title .next-match-subtitle { text-transform: uppercase; color: color-mix(in srgb, var(--match-heading) 78%, transparent); }
  .pv-hero .pv-date { color: color-mix(in srgb, var(--match-heading) 78%, transparent); }

  .pv-matchup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, auto) minmax(0, 1fr); grid-template-areas: "home vs away" "home center away"; align-items: center; column-gap: 14px; row-gap: 4px; text-align: center; }
  .pv-matchup > .pv-team:first-child { grid-area: home; } .pv-matchup > .pv-team:last-child { grid-area: away; }
  .pv-matchup > .pv-center { grid-area: center; align-self: start; } .pv-matchup > .next-match-vs { grid-area: vs; justify-self: center; align-self: end; margin: 0 0 22px; }
  .pv-team { display: grid; justify-items: center; gap: 8px; min-width: 0; }
  /* On open: the home team rises in from below, then the away team. */
  .pv-matchup > .pv-team { animation: pv-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .pv-matchup > .pv-team:last-child { animation-delay: 0.18s; }
  @keyframes pv-rise { from { opacity: 0; transform: translateY(18px); } }
  @media (prefers-reduced-motion: reduce) { .pv-matchup > .pv-team { animation: none; } }
  /* Preview crests: the
     logo sits straight on the stadium, except dark crests (CREST_PLATE). */
  .pv-crest { position: relative; display: grid; place-items: center; width: 140px; height: 140px; border-radius: 26px; background: var(--crest-tile-bg); box-shadow: var(--pv-crest-shadow); }
  .pv-crest.plate { background: var(--match-crest); box-shadow: var(--pv-tile-shadow); }
  .pv-crest:not(.plate) img.crest { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45)); }
  .pv-crest img.crest, .pv-crest .crest-fallback { width: 116px; height: 116px; object-fit: contain; font-size: 30px; background: transparent; border-radius: 0; }
  .pv-hero .pv-name, .pv-hero .pv-time, .pv-hero .pv-venue, .pv-hero .pv-date, .pv-title .next-match-subtitle { text-shadow: 0 1px 8px color-mix(in srgb, var(--surface) 70%, transparent); }
  .pv-name { margin-top: 6px; font: 700 clamp(19px, 2.4vw, 25px)/1.1 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.01em; color: var(--match-ink); overflow-wrap: anywhere; }
  .pv-sub { font-size: 14px; font-weight: 600; letter-spacing: 0.2em; color: var(--match-muted); }
  .pv-sub b { font-weight: 600; color: var(--match-ink); }
  .pv-center { display: grid; justify-items: center; gap: 6px; color: var(--match-ink); }
  .pv-line { display: inline-flex; align-items: center; gap: 7px; }
  .pv-date { font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--match-muted); }
  .pv-time { font: 700 46px/1 "JetBrains Mono", monospace; letter-spacing: -0.01em; color: var(--accent-strong); }
  .pv-time small { margin-left: 6px; font-size: 18px; font-weight: 700; }
  .pv-venue { max-width: min(320px, 100%); min-width: 0; font: 17px/1.15 "Barlow Condensed", sans-serif; color: var(--match-ink); }
  .pv-venue a { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pv-venue a { color: inherit; text-decoration: none; } .pv-venue a:hover { text-decoration: underline; }
  .pv-matchup .next-match-vs { width: 58px; height: 58px; font-size: 23px; }



  .pv-content { padding: 0 26px; }
  .pv-comparison { margin-top: 6px; }
  .pv-section-title { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
  .pv-section-title svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .pv-panel { padding: 8px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }

  .pv-stat { display: grid; grid-template-columns: 60px minmax(0, 1fr) 210px minmax(0, 1fr) 60px; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .pv-stat:last-child { border-bottom: 0; }
  .pv-val { font: 600 22px/1 "Barlow Condensed", sans-serif; font-variant-numeric: tabular-nums; text-align: center; color: var(--muted); }
  .pv-val.better { font-weight: 700; color: var(--ink); }
  .pv-label { text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
  .pv-label small { display: block; margin-top: 2px; font-size: 9.5px; letter-spacing: 0.12em; opacity: 0.8; }
  .pv-label .short { display: none; }
  .pv-bar { display: flex; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
  .pv-bar.left { justify-content: flex-end; }
  .pv-bar i { display: block; height: 100%; border-radius: 999px; background: color-mix(in srgb, var(--muted) 55%, transparent); }
  .pv-bar.better i { background: linear-gradient(90deg, var(--match-blue), var(--match-accent-2)); box-shadow: 0 0 8px var(--match-glow); }
  .pv-bar.left.better i { background: linear-gradient(270deg, var(--match-blue), var(--match-accent-2)); }
  /* Bars grow out from the centre when the preview opens, one row after another. */
  .pv-bar i { animation: pv-grow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .pv-stat:nth-child(2) .pv-bar i { animation-delay: 0.06s; }
  .pv-stat:nth-child(3) .pv-bar i { animation-delay: 0.12s; }
  .pv-stat:nth-child(4) .pv-bar i { animation-delay: 0.18s; }
  .pv-stat:nth-child(5) .pv-bar i { animation-delay: 0.24s; }
  .pv-stat:nth-child(6) .pv-bar i { animation-delay: 0.3s; }
  @keyframes pv-grow { from { width: 0; } }
  @media (prefers-reduced-motion: reduce) { .pv-bar i { animation: none; } }

  .pv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
  .pv-card { padding: 14px 18px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); min-width: 0; }
  .pv-card-head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .pv-card-head img.crest, .pv-card-head .crest-fallback { width: 56px; height: 56px; flex: none; object-fit: contain; padding: 5px; border-radius: 12px; background: var(--crest-tile-bg); }
  .pv-card-head img.crest.plate { background: var(--match-crest); }
  .pv-card-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
  .pv-card-name { margin: 2px 0 7px; font: 700 18px/1.1 "Barlow Condensed", sans-serif; text-transform: uppercase; }
  .pv-chips { display: flex; gap: 6px; }
  .pv-chip { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font-size: 12px; font-weight: 800; color: #fff; }
  .pv-chip.W { background: var(--win); } .pv-chip.D { background: var(--draw); } .pv-chip.L { background: var(--loss); }
  .pv-chip.none { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
  .pv-rows { list-style: none; margin: 0; padding: 0; }
  .pv-rows li { display: grid; grid-template-columns: 54px 24px minmax(0, 1fr) auto 24px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
  .pv-rows li:last-child { border-bottom: 0; }
  .pv-rows .d, .pv-rows .at { color: var(--muted); font-size: 13px; }
  .pv-rows .opp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pv-rows .sc { font: 700 14px "JetBrains Mono", monospace; white-space: nowrap; }
  .pv-rows .pv-chip { width: 22px; height: 22px; font-size: 11.5px; }
  .pv-empty { margin: 10px 0; font-size: 14px; color: var(--muted); }

  .pv-detail { list-style: none; margin: 0; padding: 0; }
  .pv-detail li { display: grid; grid-template-columns: 28px 26px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
  .pv-detail li:last-child { border-bottom: 0; }
  .pv-detail img.crest, .pv-detail .crest-fallback { width: 26px; height: 26px; object-fit: contain; padding: 2px; border-radius: 6px; background: var(--crest-tile-bg); }
  .pv-detail img.crest.plate { background: var(--match-crest); }
  .pv-detail small { display: block; font-size: 12px; color: var(--muted); }
  .pv-detail b { font: 700 15px "JetBrains Mono", monospace; white-space: nowrap; }
  .pv-detail .pv-chip { width: 24px; height: 24px; font-size: 12px; }

  @media (max-width: 720px) {
    .match-preview { margin: auto 0 0; width: 100%; max-width: none; max-height: 92dvh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
    .pv-hero { padding: 16px 14px 14px; }
    .pv-content { padding: 0 14px; }
    .pv-title { margin-bottom: 10px; }
    .pv-title .next-match-subtitle { letter-spacing: 0.1em; font-size: 10.5px; text-align: center; padding: 0 36px; }
    .pv-matchup { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "home vs away" "center center center"; column-gap: 8px; row-gap: 12px; }
    .pv-matchup > .next-match-vs { align-self: start; margin: 18px 0 0; width: 46px; height: 46px; font-size: 18px; }
    .pv-matchup .next-match-vs::before { width: 120px; } .pv-matchup .next-match-vs::after { width: 80px; }
    .pv-center { padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--line); justify-self: stretch; }
    .pv-crest { width: 88px; height: 88px; border-radius: 18px; }
    .pv-crest img.crest, .pv-crest .crest-fallback { width: 72px; height: 72px; }
    .pv-name { font-size: 17px; }
    .pv-sub { font-size: 12.5px; letter-spacing: 0.14em; }
    .pv-center { gap: 5px; }
    .pv-time { font-size: 34px; } .pv-time small { font-size: 15px; }
    .pv-venue { max-width: 100%; font-size: 15.5px; }
    .pv-panel { padding: 6px 14px; }
    .pv-stat { grid-template-columns: 42px minmax(0, 1fr) 96px minmax(0, 1fr) 42px; gap: 8px; }
    .pv-val { font-size: 19px; }
    .pv-label { font-size: 9.5px; letter-spacing: 0.1em; } .pv-label small { font-size: 8.5px; }
    .pv-label .long { display: none; } .pv-label .short { display: inline; }
    .pv-cards { grid-template-columns: 1fr; }
    .pv-rows li { font-size: 14px; }
  }
  .video-notice {
    --vn-blue: #1a6fdc;
    width: min(440px, calc(100vw - 32px));
    padding: 22px 24px 22px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--vn-blue) 60%, transparent);
    border-radius: 18px;
    box-shadow: var(--shadow), 0 0 40px -14px color-mix(in srgb, var(--vn-blue) 70%, transparent);
  }
  .video-notice[open] { animation: video-notice-in 0.2s ease-out; }
  @keyframes video-notice-in { from { transform: translateY(8px) scale(0.98); } }
  .video-notice::backdrop { background: rgba(5, 10, 18, 0.66); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .video-notice-close { position: absolute; top: 12px; right: 12px; }
  .video-notice-head { display: flex; align-items: center; gap: 12px; padding-right: 32px; }
  .video-notice-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--video-accent);
    background: var(--video-bg);
    border: 1px solid var(--video-border);
  }
  .video-notice-icon svg { width: 20px; height: 20px; fill: currentColor; }
  .video-notice h2 { margin: 0; font-size: 24px; line-height: 1.1; color: var(--ink); }
  .video-notice-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 16px 0 0;
    padding: 10px 12px;
    font-size: 13.5px;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .video-notice-match[hidden] { display: none; }
  .video-notice-match .crest, .video-notice-match .crest-fallback { width: 28px; height: 28px; border-radius: 6px; font-size: 10px; }
  .video-notice-match .vn-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .video-notice-match .vn-side:first-child { justify-content: flex-end; text-align: right; }
  .video-notice-match .vn-side .crest, .video-notice-match .vn-side .crest-fallback { flex: none; }
  .video-notice-match .vn-team { min-width: 0; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .video-notice-match .vn-vs { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
  .video-notice p { margin: 14px 0 20px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
  .video-notice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .video-notice-actions > * {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
  }
  .video-notice-cancel { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }
  .video-notice-cancel:hover { border-color: var(--accent); }
  .video-notice-continue { color: #fff; background: var(--vn-blue); border: 1px solid var(--vn-blue); box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--vn-blue) 85%, transparent); }
  .video-notice-continue:hover { filter: brightness(1.08); }
  .video-notice-continue svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .video-notice-actions > *:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  @media (max-width: 480px) {
    .video-notice { padding: 20px 18px 18px; }
    .video-notice-actions { grid-template-columns: 1fr; }
    .video-notice-continue { order: -1; }
  }
  @media (prefers-reduced-motion: reduce) { .video-notice[open] { animation: none; } }

  /* "Watch" pill for matches with a Taka video: play icon + label. */
  .video-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: none;
    padding: 4px 11px 4px 7px;
    border-radius: 999px;
    border: 1.5px solid var(--video-border);
    background: var(--video-bg);
    color: var(--video-ink);
    font-family: "Libre Franklin", sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.15s, box-shadow 0.15s;
  }
  .video-link svg { width: 16px; height: 16px; flex: none; fill: var(--video-accent); }
  .video-link svg .video-link-ring { fill: none; stroke: var(--video-accent); stroke-width: 1.6; }
  .video-link:hover { background: color-mix(in srgb, var(--video-accent) 16%, var(--video-bg)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--video-accent) 30%, transparent); }
  .video-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

  .match {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
  }

  .match.live {
    background: color-mix(in srgb, var(--win) 8%, var(--surface));
    border-left: 3px solid var(--win);
  }
  .match.final, .match.result-pending {
    background: var(--surface-2);
    border-left: 3px solid var(--muted);
    box-shadow: none;
  }
  .match.result-pending { border-left-color: var(--draw); }
  .match.highlight { background: var(--team-card-bg); }
  .match.final .score { color: var(--accent-strong); font-size: 20px; }
  .match.final .pill.final { background: var(--line); color: var(--ink); }
  .match.final .pill.final.scored { background: color-mix(in srgb, var(--win) 18%, var(--surface)); color: var(--win); }

  .side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    min-width: 0;
    font-family: "Libre Franklin", sans-serif;
    font-weight: 500;
    font-size: 14px;
  }


  .side.away { justify-content: flex-end; text-align: right; flex-direction: row-reverse; }

  .side img.crest, .side .crest-fallback {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    font-size: 20px;
  }
  .schedule-crest-wrap { position: relative; display: inline-flex; flex: none; }
  .schedule-crest-wrap > .crest { display: block; }

  .side-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .side span.name {
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side span.name {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .record {
    margin-top: 2px;
    font-family: "Libre Franklin", sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
  }

  .side.home .record { text-align: right; }
  .side-details { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .side.home .side-details { justify-content: flex-end; }
  .side.away .side-details { justify-content: flex-start; }
  .side-details .record { margin-top: 0; }
  .venue-role {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .side.home .venue-role { color: var(--home-role); }
  .side.away .venue-role { color: var(--accent-strong); }
  .venue-separator { color: var(--muted); font-size: 11px; }

  .match.highlight .side span.name { font-weight: 700; }

  .score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 108px;
  }

  .score {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    font-size: 17px;
    color: var(--ink);
    letter-spacing: 0.02em;
  }

  .score.tbd { color: var(--ink); font-size: 15px; font-weight: 600; }
  .score .tz { font-size: 0.72em; font-weight: 600; color: var(--muted); opacity: 0.8; white-space: nowrap; }

  .pill {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 10px;
  }

  .pill.final { background: var(--surface-2); color: var(--muted); }
  .pill.upcoming { background: var(--accent-soft); color: var(--accent-strong); }
  .pill.today { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent-strong); }
  .pill.tomorrow { background: color-mix(in srgb, var(--draw) 18%, var(--surface)); color: color-mix(in srgb, var(--draw) 70%, var(--ink)); }
  .pill.live { display: inline-flex; align-items: center; gap: 4px; background: color-mix(in srgb, var(--win) 18%, var(--surface)); color: var(--win); }
  .pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .pill.result-pending { background: color-mix(in srgb, var(--draw) 30%, var(--surface)); color: color-mix(in srgb, var(--draw) 75%, var(--ink)); }

  .match-footer {
    grid-column: 1 / -1;
    font-size: 11.5px;
    color: var(--muted);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin-top: 2px;
    padding-top: 2px;
  }

  .location-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 2px;
  }

  .location-link:hover, .location-link:focus-visible {
    color: var(--accent-strong);
    text-decoration-color: currentColor;
  }

  .share-cta {
    margin: 0;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
  }
  .share-cta-btn {
    font: inherit;
    font-weight: 600;
    color: var(--accent-strong);
    background: none;
    border: none;
    padding: 2px 2px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  }
  .share-cta-btn:hover, .share-cta-btn:focus-visible { text-decoration-color: currentColor; }

  /* Footer: a quiet line, the links, the copyright. */
  .site-footer { display: grid; justify-items: center; gap: 8px; padding: 22px 0 10px; text-align: center; font-size: 12.5px; color: var(--muted); }
  .site-footer p { margin: 0; }
  .site-footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px; font-size: 13.5px; }
  .site-footer-links button, .site-footer-links a { font: inherit; font-weight: 600; color: inherit; background: none; border: none; padding: 6px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; }
  .site-footer-links button:hover, .site-footer-links a:hover,
  .site-footer-links button:focus-visible, .site-footer-links a:focus-visible { text-decoration-color: currentColor; }
  body > .page .site-footer-links { color: #d6e4f7; }
  .site-footer-copy { font-size: 12px; opacity: 0.75; }

  /* Feedback and About popups (footer links). */
  .site-dialog {
    --vn-blue: #1a6fdc;
    width: min(460px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 22px 24px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .site-dialog[open] { animation: video-notice-in 0.2s ease-out; }
  .site-dialog::backdrop { background: rgba(5, 10, 18, 0.66); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .site-dialog .modal-close { position: absolute; top: 12px; right: 12px; }
  .site-dialog h2 { margin: 0 36px 0 0; font-size: 26px; line-height: 1.1; color: var(--ink); }
  .site-dialog h3 { margin: 16px 0 2px; font-size: 14px; color: var(--ink); }
  .site-dialog p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
  .site-dialog h3 + p { margin-top: 0; }
  .site-dialog .video-notice-actions { margin-top: 18px; }
  .fb-form { display: grid; gap: 14px; margin-top: 14px; }
  .fb-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
  .fb-kinds legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
  .fb-kinds label { position: relative; cursor: pointer; }
  .fb-kinds input { position: absolute; opacity: 0; pointer-events: none; }
  .fb-kinds span { display: inline-block; padding: 6px 12px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
  .fb-kinds input:checked + span { color: #fff; background: var(--vn-blue); border-color: var(--vn-blue); }
  .fb-kinds input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
  .fb-field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
  .fb-field small { font-weight: 400; color: var(--muted); }
  .fb-field textarea, .fb-field input {
    font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  }
  .fb-field textarea { min-height: 112px; resize: vertical; }
  .fb-field textarea:focus, .fb-field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
  .fb-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .fb-status { margin: 0 !important; font-size: 13.5px !important; }
  .fb-status.error { color: var(--loss) !important; }
  .fb-form .video-notice-actions { margin-top: 0; }
  .fb-form button:disabled { opacity: 0.6; cursor: wait; }
  /* Add to Home Screen bottom sheet: slides up, respects the iPhone home
     indicator, uses the site's surface/ink tokens in both themes. */
  .pwa-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    width: min(520px, 100%); margin: 0 auto; padding: 20px 18px calc(16px + env(safe-area-inset-bottom));
    color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
    border-radius: 20px 20px 0 0; box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.38);
    animation: pwa-up 0.28s ease-out;
  }
  .pwa-sheet[hidden] { display: none; }
  /* Dims the page behind the instructions, like the other popups. */
  .pwa-backdrop { position: fixed; inset: 0; z-index: 69; background: rgba(5, 10, 18, 0.66); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .pwa-backdrop[hidden] { display: none; }
  .pwa-team { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
  .pwa-team .crest, .pwa-team .crest-fallback { width: 34px; height: 34px; flex: none; font-size: 10px; }
  .pwa-team b { display: block; font-size: 14.5px; }
  .pwa-team small { display: block; font-size: 12.5px; color: var(--muted); }
  @keyframes pwa-up { from { transform: translateY(100%); } }
  @media (prefers-reduced-motion: reduce) { .pwa-sheet { animation: none; } }
  .pwa-close { position: absolute; top: 10px; right: 10px; }
  .pwa-head { display: flex; align-items: flex-start; gap: 14px; padding-right: 30px; }
  .pwa-icon { flex: none; width: 52px; height: 52px; border-radius: 12px; box-shadow: var(--shadow); }
  .pwa-sheet h2 { margin: 0; font-size: 22px; line-height: 1.1; color: var(--ink); }
  .pwa-sheet p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
  .pwa-actions { display: grid; gap: 6px; margin-top: 16px; }
  .pwa-add { min-height: 46px; padding: 0 16px; font: 700 15px "Libre Franklin", sans-serif; color: #fff; cursor: pointer; background: #1a6fdc; border: 0; border-radius: 12px; box-shadow: 0 8px 20px -10px rgba(26, 111, 220, 0.85); }
  .pwa-add:hover { filter: brightness(1.08); }
  .pwa-later { min-height: 40px; font: 600 14px "Libre Franklin", sans-serif; color: var(--muted); cursor: pointer; background: none; border: 0; }
  .pwa-later:hover { color: var(--ink); }
  .pwa-add:focus-visible, .pwa-later:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  .pwa-step-list { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
  .pwa-step-list li { display: grid; grid-template-columns: 22px 40px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
  .pwa-step-num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff; background: #1a6fdc; }
  .pwa-step-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--accent-strong); background: var(--accent-soft); }
  .pwa-step-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .pwa-step-text { display: grid; gap: 2px; min-width: 0; }
  .pwa-step-title { font-size: 15px; font-weight: 600; }
  .pwa-step-title b { font-weight: 800; }
  .pwa-step-text small { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
  #contact-form textarea { min-height: 80px; }
  .cc-privacy { margin: 0 !important; font-size: 12px !important; }
  .club-sheet-head { display: flex; align-items: center; gap: 12px; padding-right: 36px; }
  .club-sheet-head .crest, .club-sheet-head .crest-fallback { width: 44px; height: 44px; }
  .club-sheet-head h2 { margin: 0; }
  .club-sheet-ages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .club-sheet-ages a {
    min-width: 58px; padding: 9px 12px; text-align: center; font-weight: 700; font-size: 14px;
    color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; text-decoration: none;
  }
  .club-sheet-ages a:hover, .club-sheet-ages a:focus-visible { border-color: var(--accent); color: var(--accent-strong); }
  /* Club Overview: a quiet secondary button below the ages - clearly
     clickable, but the age buttons stay the main choice. */
  .club-sheet-overview {
    display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 10px 14px 10px 10px;
    color: var(--ink); text-decoration: none; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--line);
    transition: border-color 0.15s, background-color 0.15s;
  }
  .club-sheet-overview:hover { border-color: var(--accent); background: color-mix(in srgb, var(--surface-2) 88%, var(--accent)); }
  .cso-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 9px; color: var(--accent-strong); background: var(--accent-soft); }
  .cso-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
  .cso-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
  .cso-text strong { font-size: 14.5px; }
  .cso-text small { font-size: 12.5px; color: var(--muted); }
  .cso-arrow { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); transition: transform 0.15s, color 0.15s; }
  .club-sheet-overview:hover .cso-arrow { color: var(--accent-strong); transform: translateX(3px); }
  .club-sheet-overview:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  @media (max-width: 480px) {
    .site-dialog { padding: 20px 18px 18px; }
  }

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

  .state-msg {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
  }

  tbody tr[data-team] { cursor: pointer; }
  tbody tr[data-team]:hover td,
  tbody tr[data-team]:focus-visible td { background: var(--surface-2); }
  tbody tr.highlight[data-team]:hover td,
  tbody tr.highlight[data-team]:focus-visible td { background: var(--accent-soft); filter: brightness(0.97); }
  tbody tr[data-team]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  /* The team name is a real link to its page (search engines follow it); a
     plain click still opens the team's schedule. The row shows the focus. */
  .team-link { color: inherit; text-decoration: none; }
  tbody tr[data-team] .team-name:focus-visible { outline: none; }
  tbody tr[data-team]:has(.team-name:focus-visible) td { background: var(--surface-2); }
  tbody tr.highlight[data-team]:has(.team-name:focus-visible) td { background: var(--accent-soft); filter: brightness(0.97); }
  tbody tr[data-team]:has(.team-name:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 20, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    z-index: 20;
  }

  .modal-overlay[hidden] { display: none; }

  /* ---- Support the tracker (see SUPPORT_CONFIG in the script) ----
     Desktop: a small pill fixed bottom-right that expands into a card.
     Phones: a compact bottom-right pill that opens a bottom sheet. */
  .support-pill, .support-card {
    font-family: "Libre Franklin", sans-serif;
    /* Sky blue, like the mockup. */
    --support-accent: #6fb2ff;
    --support-on-accent: #06121f;
  }
  .support-cup {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--support-accent) 16%, var(--surface));
    font-size: 18px;
    line-height: 1;
  }
  .support-pill {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 21;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px 7px 7px;
    text-align: left;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--support-accent) 55%, transparent);
    border-radius: 999px;
    box-shadow: var(--shadow), 0 0 18px -6px color-mix(in srgb, var(--support-accent) 60%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .support-pill[hidden], .support-card[hidden], .support-backdrop[hidden] { display: none; }
  /* A gentle rise when it appears (no fill-mode, so hover's lift still works). */
  /* Own compositing layer: steadier while iPhone Safari's toolbar resizes the screen. */
  .support-pill { max-width: calc(100vw - 28px); white-space: nowrap; animation: support-pill-in 0.35s ease-out; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
  @keyframes support-pill-in { from { transform: translateY(8px); opacity: 0; } }
  /* Lift on hover with a mouse only: phones keep :hover after a tap, which
     left the pill raised and looking out of place. */
  .support-pill:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--shadow), 0 0 24px -4px color-mix(in srgb, var(--support-accent) 75%, transparent);
  }
  @media (hover: hover) and (pointer: fine) {
    .support-pill:hover {
      transform: translateY(-2px);
      border-color: var(--accent);
      box-shadow: var(--shadow), 0 0 24px -4px color-mix(in srgb, var(--support-accent) 75%, transparent);
    }
  }
  .support-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .support-pill-label { font-size: 13.5px; font-weight: 700; line-height: 1.25; color: var(--support-accent); }
  /* Two gentle nudges (at 2 s and 32 s) to draw the eye, then it rests: one
     soft ring ripples out from the edge and the ball hops. Each cycle is 30 s,
     with the motion in its first ~1.8 s (the percentages below). Only
     transform/opacity move (no repaints), and the pill's own animation and
     hover lift are left alone. */
  .support-pill::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 2px solid var(--support-accent);
    opacity: 0;
    pointer-events: none;
    animation: support-ripple 30s ease-out 2s 2;
  }
  @keyframes support-ripple {
    0% { opacity: 0.9; transform: scale(1); }
    2.9% { opacity: 0.55; transform: scale(1.07, 1.26); }
    5.9%, 100% { opacity: 0; transform: scale(1.12, 1.45); }
  }
  .support-pill .support-cup { animation: support-hop 30s ease-in-out 2s 2; }
  @keyframes support-hop {
    0%, 3.7%, 100% { transform: none; }
    1.1% { transform: translateY(-4px) rotate(-14deg); }
    2.1% { transform: translateY(0) rotate(8deg); }
    2.9% { transform: translateY(-1px) rotate(-3deg); }
  }

  .support-card {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 23;
    width: min(400px, calc(100vw - 32px));
    /* Never taller than the screen, so the close button stays reachable. */
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 20px 20px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--support-accent) 55%, transparent);
    border-radius: 16px;
    box-shadow: var(--shadow), 0 18px 50px -18px rgba(0, 0, 0, 0.6);
    animation: support-in 0.25s ease-out;
  }
  @keyframes support-in { from { transform: translateY(14px); opacity: 0; } }
  .support-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
  .support-card-head h2 { flex: 1; font-family: "Libre Franklin", sans-serif; font-size: 21px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
  .support-card p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
  .support-card p.support-text { margin-bottom: 6px; color: var(--ink); }
  .support-card p.support-subline { margin-bottom: 14px; font-size: 13px; font-weight: 500; color: color-mix(in srgb, var(--ink) 80%, var(--surface)); }
  .support-close {
    flex: none;
    font-size: 22px;
    line-height: 1;
    color: var(--muted);
    background: none;
    border: none;
    border-radius: 8px;
    padding: 4px 9px;
    cursor: pointer;
  }
  .support-close:hover, .support-close:focus-visible { color: var(--ink); background: var(--accent-soft); }
  .support-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .support-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
  .support-amount {
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 2px 9px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
  }
  .support-amount:hover { border-color: var(--accent); }
  /* All four pictures take the same square; the files are already fitted to it. */
  /* The soft halo keeps the dark servers readable on the dark tile. */
  .support-amount img { display: block; width: 64px; height: 64px; object-fit: contain; opacity: 0.86; filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.22)); transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease; }
  .support-amount:hover img { opacity: 1; }
  .support-amount[aria-pressed="true"] img { opacity: 1; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--support-accent) 45%, transparent)); transform: scale(1.06); }
  /* The picked amount is outlined and tinted, so it never looks like the
     solid payment button below it. */
  .support-amount[aria-pressed="true"] {
    color: var(--support-accent);
    background: color-mix(in srgb, var(--support-accent) 14%, var(--surface));
    border-color: var(--support-accent);
    box-shadow: inset 0 0 0 1px var(--support-accent);
  }
  .support-amount:focus-visible, .support-cta:focus-visible, .support-venmo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* One quiet line per amount; reserved height so switching amounts never
     moves the button below. */
  .support-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    font-weight: 700;
    font-size: 15.5px;
    color: var(--support-on-accent);
    background: var(--support-accent);
    border-radius: 12px;
    text-decoration: none;
    text-align: center; /* one line on nearly every phone; wraps rather than clips on the narrowest */
  }
  .support-cta:hover { filter: brightness(1.08); }
  /* Venmo: a plain link, so the payment button above stays the main action. */
  .support-card p.support-cta-sub { margin: 5px 0 0; font-size: 12.5px; line-height: 1.35; text-align: center; color: var(--muted); }
  .support-venmo { display: block; width: fit-content; margin: 6px auto 0; padding: 6px 8px; font-size: 13.5px; font-weight: 700; color: var(--support-accent); text-decoration: underline; text-underline-offset: 2px; border-radius: 6px; }

  /* Seasonal color only: the words stay "Keep the Tracker Alive" all year. */
  html[data-season="halloween"] :is(.support-pill, .support-card) { --support-accent: #ffb15c; --support-on-accent: #211205; }
  html[data-season="halloween"] .support-pill { border-color: #dc954e; box-shadow: var(--shadow), 0 0 24px -7px #f78b30a0; }
  html[data-season="halloween"] .support-cup { transition: transform .18s ease; }
  html[data-season="halloween"] .support-pill:hover .support-cup { transform: rotate(-10deg); animation: none; }

  .support-backdrop { position: fixed; inset: 0; z-index: 22; background: rgba(5, 10, 18, 0.55); }

  /* Let the end of each page scroll clear of the desktop pill. */
  .page { padding-bottom: 96px; }

  @media (max-width: 640px) {
    .support-pill {
      right: calc(14px + env(safe-area-inset-right));
      bottom: calc(14px + env(safe-area-inset-bottom));
      min-height: 44px;
      gap: 7px;
      padding: 7px 14px;
    }
    .support-pill .support-cup { width: 24px; height: 24px; background: none; }
    .support-pill-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .support-card {
      left: 0;
      right: 0;
      bottom: 0;
      width: auto;
      padding: 20px 18px calc(8px + env(safe-area-inset-bottom));
      border-radius: 18px 18px 0 0;
      border-bottom: none;
    }
    .support-card-head h2 { font-size: 20px; }
    .support-amounts { gap: 6px; }
    .support-venmo { margin-top: 2px; padding: 10px 8px; } /* a comfortable tap target */
    .support-amount img { width: 56px; height: 56px; }
  }
  @media (max-width: 360px) { .support-cta { font-size: 14.5px; } }
  /* Short phone screens: smaller pictures keep the button in view. */
  @media (max-width: 640px) and (max-height: 620px) {
    .support-amount img { width: 44px; height: 44px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .support-card { animation: none; }
    .support-pill { transition: none; animation: none; }
    .support-pill::after, .support-pill .support-cup { animation: none; }
    .support-amount img { transition: none; }
    .support-pill:hover, .support-pill:focus-visible { transform: none; }
    html[data-season="halloween"] .support-cup { transition: none; }
    html[data-season="halloween"] .support-pill:hover .support-cup { transform: none; }
  }

  /* "Since your last visit" updates panel on team pages (see renderSinceVisit). */
  .since-card {
    gap: 0;
    padding: 10px 16px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--line));
    border-radius: 18px;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: since-in 0.3s ease-out;
  }
  .since-card[hidden] { display: none; }
  @keyframes since-in { from { transform: translateY(-10px); opacity: 0; } }
  .since-bar { display: flex; align-items: center; gap: 4px; }
  .since-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 44px;
    padding: 4px 8px 4px 4px;
    font: inherit;
    color: var(--ink);
    text-align: left;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
  }
  .since-toggle:hover { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
  .since-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  /* Soft yellow bell: noticeable, not alarming. */
  .since-bell {
    display: grid; place-items: center; flex: none;
    width: 44px; height: 44px; border-radius: 50%;
    color: #f5be1e;
    background: rgba(245, 190, 30, 0.22);
    box-shadow: 0 0 0 1px rgba(245, 190, 30, 0.4), 0 0 18px -4px rgba(245, 190, 30, 0.6);
  }
  .since-bell svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .since-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
  .since-headline { font-size: 17px; font-weight: 400; line-height: 1.25; color: var(--ink); }
  .since-headline strong { font-weight: 800; color: #e0a800; }
  .since-summary { font-size: 13.5px; color: var(--muted); }
  .since-summary:empty { display: none; }
  .since-cheer { font-weight: 800; color: #e0a800; }
  .since-chevron { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
  .since-toggle[aria-expanded="true"] .since-chevron { transform: rotate(180deg); }
  .since-details { margin: 4px 2px 0; }
  .since-details[hidden], .since-feature[hidden], .since-group[hidden] { display: none; }

  .since-when { color: var(--muted); }
  .since-standing-update { display: flex; align-items: center; gap: 16px; padding: 16px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
  .since-standing-update[hidden] { display: none; }
  .since-trend { flex: none; width: 36px; color: var(--win); }
  .since-trend svg { display: block; width: 100%; }
  .since-standing-copy { flex: 1; min-width: 0; }
  .since-standing-copy h3 { margin: 0 0 6px; font-size: 17px; }
  .since-standing-copy .since-standing { margin: 0; line-height: 1.6; }
  .since-standings-action { display: inline-flex; align-items: center; justify-content: center; gap: 16px; flex: none; padding: 10px 16px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
  .since-standings-action:hover { border-color: var(--accent); }
  .since-standings-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .since-caught-up .since-all { color: var(--accent); background: transparent; border-color: transparent; padding-inline: 0; }
  .since-caught-up .since-all:hover { text-decoration: underline; }
  @media (max-width: 600px) {
    .since-card { padding: 12px; }
    .since-when { display: block; font-size: 13px; margin-top: 3px; }
    .since-standing-update { flex-wrap: wrap; gap: 10px; padding: 12px; }
    .since-standing-copy { flex-basis: calc(100% - 46px); }
    .since-standings-action { margin-left: 46px; }
    .since-caught-up .since-all { margin-left: 46px; }
  }

  /* 1. Featured: this team's latest new game. */
  .since-feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 70%), var(--surface-2);
  }
  .since-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .since-side.away { flex-direction: row-reverse; text-align: right; }
  .since-side img.crest, .since-side .crest-fallback {
    width: 46px; height: 46px; flex: none; padding: 4px; border-radius: 12px;
    background: var(--match-crest); object-fit: contain; font-size: 15px;
  }
  .since-side-name { font-size: 15.5px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
  .since-side.me .since-side-name { color: var(--ink); }
  .since-side:not(.me) .since-side-name { color: color-mix(in srgb, var(--ink) 82%, var(--muted)); }
  .since-score { display: grid; justify-items: center; gap: 4px; min-width: 110px; }
  .since-score-num {
    font-family: "Barlow Condensed", sans-serif; font-size: 38px; font-weight: 700;
    line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; color: var(--ink);
  }
  .since-score-num.w { color: var(--win); }
  .since-score-num.l { color: var(--loss); }
  .since-score .pill.final.scored { background: color-mix(in srgb, var(--win) 18%, var(--surface)); color: var(--win); }
  .since-score-date { font-size: 12.5px; color: var(--muted); }
  .since-new-video { font-weight: 600; color: var(--video-accent); }

  /* 2. Standings summary. */
  .since-standing { margin: 10px 4px 0; font-size: 13.5px; color: var(--muted); }
  .since-standing:empty { display: none; }
  .since-standing .sep { margin: 0 6px; opacity: 0.6; }
  .since-standing strong { color: var(--ink); }
  .since-standing .up { color: var(--win); font-weight: 700; }
  .since-standing .down { color: var(--loss); font-weight: 700; }
  /* 4. Footer: caught up, plus a jump to every recent result. */
  .since-caught-up { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 4px 4px; border-top: 1px solid var(--line); }
  .since-caught-up[hidden] { display: none; }
  .since-check { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--win); color: var(--surface); }
  .since-check svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
  .since-caught-up-text { flex: 1 1 220px; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
  .since-caught-up-text strong { font-size: 15.5px; color: var(--win); }
  .since-all {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
    background: color-mix(in srgb, var(--surface) 80%, var(--line)); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  }
  .since-all:hover { border-color: var(--accent); }
  .since-all:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .since-all svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* 3. Compact rows: other new games for this team + around the conference. */
  .since-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .since-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; }
  .since-group-head .since-group-title { margin: 0 4px; }
  .since-group-title { margin: 0 4px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .since-rows { list-style: none; margin: 0; padding: 0; }
  .since-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 62px minmax(0, 1fr) 76px;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 2px 4px;
    font-size: 14px;
  }
  .since-row + .since-row { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
  .since-row-date { font-size: 11.5px; font-weight: 700; line-height: 1.15; text-transform: uppercase; color: var(--muted); }
  .since-row-team { display: flex; align-items: center; gap: 8px; min-width: 0; color: color-mix(in srgb, var(--ink) 80%, var(--muted)); }
  .since-row-team.home { flex-direction: row-reverse; text-align: right; }
  .since-row-team.won { color: var(--win); font-weight: 700; }
  .since-res {
    flex: none; min-width: 20px; padding: 2px 5px; border-radius: 999px; text-align: center;
    font-style: normal; font-size: 10.5px; font-weight: 800; line-height: 1.3;
  }
  .since-res.w { background: color-mix(in srgb, var(--win) 18%, var(--surface)); color: var(--win); }
  .since-res.t { background: color-mix(in srgb, var(--draw) 20%, var(--surface)); color: color-mix(in srgb, var(--draw) 75%, var(--ink)); }
  .since-res.l { background: color-mix(in srgb, var(--loss) 18%, var(--surface)); color: var(--loss); }
  .since-row-team span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .since-row-team img.crest, .since-row-team .crest-fallback { width: 22px; height: 22px; flex: none; object-fit: contain; font-size: 9px; border-radius: 5px; }
  .since-row-score {
    justify-self: center; min-width: 58px; padding: 3px 0; text-align: center;
    font-family: "Barlow Condensed", sans-serif; font-size: 18px; font-weight: 700;
    font-variant-numeric: tabular-nums; color: var(--ink);
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  }
  .since-row-score.w { color: var(--win); border-color: color-mix(in srgb, var(--win) 45%, var(--line)); }
  .since-row-score.l { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 45%, var(--line)); }
  .since-row .video-link { justify-self: end; }
  .since-more { margin: 4px 4px 0; font-size: 13px; color: var(--muted); }

  @media (max-width: 640px) {
    .since-feature { gap: 8px; padding: 12px 10px; }
    .since-side, .since-side.away { flex-direction: column; text-align: center; gap: 6px; }
    .since-side img.crest, .since-side .crest-fallback { width: 44px; height: 44px; }
    .since-side-name { font-size: 13.5px; }
    .since-score { min-width: 0; }
    .since-score-num { font-size: 32px; }
    .since-score .video-link { padding: 7px 12px 7px 9px; }
    .since-row { grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr) auto; gap: 6px; font-size: 13px; }
    .since-row-date { grid-column: 1 / -1; display: flex; gap: 4px; }
    .since-row-date br { display: none; }
    .since-row-score { min-width: 48px; font-size: 16px; }
    .since-row .video-link { padding: 6px; }
    .since-row .video-link span { display: none; }
  }
  @media (prefers-reduced-motion: reduce) { .since-card { animation: none; } .since-chevron { transition: none; } }

  /* Share team popup */
  .share-overlay { align-items: center; z-index: 25; }
  .share-modal {
    --share-blue: #1a6fdc;
    position: relative;
    width: 100%;
    max-width: 580px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 30px 32px 28px;
    animation: share-in 0.22s ease-out;
  }
  @keyframes share-in { from { transform: translateY(10px) scale(0.98); } }
  .share-close { position: absolute; top: 14px; right: 14px; }
  /* One thing stands out in this sheet: the blue Copy link button. The title
     is plain (the team is named in the preview), the preview is a plain
     card, and the share icons are matching neutral circles. */
  .share-title {
    font-size: clamp(22px, 2.8vw, 26px);
    font-weight: 700;
    line-height: 1;
    padding-right: 36px;
    color: var(--ink);
  }
  .share-sub { margin: 8px 0 24px; font-size: 15px; line-height: 1.45; color: var(--muted); }

  .share-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 26px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
  }
  .share-preview-crest .crest, .share-preview-crest .crest-fallback { width: 64px; height: 64px; border-radius: 12px; font-size: 20px; }
  .share-preview-text { display: grid; gap: 3px; min-width: 0; }
  .share-preview-text strong { font-family: "Barlow Condensed", sans-serif; font-size: 21px; line-height: 1.1; }
  .share-preview-desc { font-size: 14px; line-height: 1.35; color: var(--muted); }
  /* Which team exactly: the age (a solid pill like the selected age in the
     header) and the division (outlined, tinted like the header's label). */
  .share-preview-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 3px 0 2px; }
  .share-chip { display: inline-block; padding: 2px 9px; border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent); border-radius: 999px; font: 700 11.5px "Libre Franklin", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
  .share-chip--age { background: var(--toggle-active-bg); border-color: var(--toggle-active-bg); color: var(--toggle-active-ink); }

  .share-targets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: 12px;
    margin-bottom: 26px;
  }
  .share-target {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    background: none;
    border: none;
    border-radius: 12px;
    font: inherit;
    cursor: pointer;
  }
  .share-target[hidden] { display: none; }
  .share-target-name { margin-top: 8px; font-size: 13.5px; font-weight: 600; }
  .share-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }
  .share-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .share-icon svg .fill { fill: currentColor; stroke: none; }
  .share-icon--text svg { fill: currentColor; stroke: none; }
  /* Brand colors only on mouse hover (keyboard focus gets the ring alone, so
     the first icon, focused when the sheet opens, doesn't stand out). */
  .share-icon--text { --brand: #34c759; }
  .share-icon--whatsapp { --brand: #25d366; }
  .share-icon--email { --brand: #1f7ae0; }
  .share-icon--facebook { --brand: #1877f2; }
  .share-target:hover .share-icon, .share-target:focus-visible .share-icon { transform: translateY(-2px); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5); }
  @media (hover: hover) {
    .share-target:hover .share-icon:not(.share-icon--more) { background: var(--brand); border-color: var(--brand); color: #fff; }
  }
  .share-target:focus-visible { outline: none; }
  .share-target:focus-visible .share-icon { outline: 3px solid var(--accent); outline-offset: 3px; }

  .share-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--share-blue);
    border: 1px solid color-mix(in srgb, #fff 18%, var(--share-blue));
    border-radius: 12px;
    box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--share-blue) 80%, transparent);
    cursor: pointer;
  }
  .share-copy svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .share-copy:hover { filter: brightness(1.08); }
  .share-copy:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
  .share-copy.copied { background: var(--win); border-color: var(--win); }
  /* Facebook page: one quiet line (share popup, club pages). */
  .fb-follow { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
  .fb-follow a { color: var(--accent-strong); font-weight: 700; text-underline-offset: 3px; }
  .share-follow { margin-top: 16px; }
  .fb-follow strong { color: var(--ink); }
  .share-thanks {
    position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60;
    display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(92vw, 440px);
    padding: 10px 8px 10px 14px; transform: translateX(-50%);
    background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.7); font-size: 13.5px; line-height: 1.4;
    animation: share-thanks-in .25s ease-out;
  }
  .share-thanks[hidden] { display: none; }
  .share-thanks p { margin: 0; }
  .share-thanks strong { color: var(--ink); }
  .share-thanks a { color: var(--accent-strong); font-weight: 700; text-underline-offset: 3px; }
  .share-thanks button { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
  .share-thanks button:hover, .share-thanks button:focus-visible { background: var(--surface-2); color: var(--ink); }
  @keyframes share-thanks-in { from { opacity: 0; transform: translate(-50%, 8px); } }
  @media (prefers-reduced-motion: reduce) { .share-thanks { animation: none; } }
  .club-follow { margin: 0; }
  .share-toast { margin: 8px 0 0; min-height: 1.2em; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--win); }
  .share-toast:empty { margin: 0; min-height: 0; }


  /* Header: "Share <club>" is the primary action; Switch club stays quiet. */
  button.refresh-btn.team-action.share-primary {
    color: #fff;
    background: #1a6fdc;
    box-shadow: 0 6px 18px -8px rgba(26, 111, 220, 0.9);
  }
  button.refresh-btn.team-action.share-primary:hover { filter: brightness(1.1); }
  .share-primary .btn-label { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  @media (max-width: 760px) {
    .share-modal { padding: 26px 22px 22px; }
    .share-preview { padding: 12px; }
  }
  @media (max-width: 560px) {
    .share-overlay { padding: 10px; align-items: flex-end; }
    .share-modal { border-radius: 18px; }
    .share-targets { grid-template-columns: repeat(3, 1fr); row-gap: 18px; margin-bottom: 22px; }
    .share-primary .btn-label { max-width: 14ch; }
  }
  @media (prefers-reduced-motion: reduce) {
    .share-modal { animation: none; }
    .share-icon { transition: none; }
    .share-target:hover .share-icon, .share-target:focus-visible .share-icon { transform: none; }
  }

  .picker-page {
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow-y: auto;
    background: var(--stadium-backdrop);
  }

  .picker-page[hidden] { display: none; }

  /* Seasonal background (seasonal-theme.js sets html[data-season]; same rules
     as rankings.html). Pinned low so the photo's bottom corners always show:
     a screen narrower than the photo fits its width and --season-sky fills
     above it, a wider one covers. Phones and portrait tablets get the tall
     photo. The shade stays darkest behind the club list. */
  html[data-season] { --season-img: var(--season-wide); --season-size: cover; --season-pos: center 72%; --season-gap: -80px; }
  @media (max-aspect-ratio: 1672/941) { html[data-season] { --season-size: 100% auto; --season-pos: center bottom; --season-gap: calc(100% - 56.3vw); } }
  @media (max-aspect-ratio: 1/1) { html[data-season] { --season-img: var(--season-tall); --season-size: cover; --season-pos: center 75%; --season-gap: -80px; } }
  @media (max-aspect-ratio: 941/1672) { html[data-season] { --season-size: 100% auto; --season-pos: center bottom; --season-gap: calc(100% - 177.7vw); } }
  html[data-season] .picker-page {
    background:
      radial-gradient(ellipse 60% 64% at 50% 45%, rgba(5, 10, 18, 0.72), rgba(5, 10, 18, 0.3) 72%, transparent 100%),
      linear-gradient(var(--season-sky) var(--season-gap), transparent calc(var(--season-gap) + 80px)),
      var(--season-img) var(--season-pos) / var(--season-size) no-repeat,
      var(--season-sky);
  }
  /* Returning visitors land on their saved team at "/", so the team view's
     backdrop changes too (its shade as in .team-bg). */
  html[data-season] .team-bg {
    background:
      radial-gradient(ellipse 42% 75% at 50% 45%, rgba(5, 10, 18, 0.72), rgba(5, 10, 18, 0.28) 65%, rgba(5, 10, 18, 0) 100%),
      linear-gradient(var(--season-sky) var(--season-gap), transparent calc(var(--season-gap) + 80px)),
      var(--season-img) var(--season-pos) / var(--season-size) no-repeat,
      var(--season-sky);
  }

  @media (max-aspect-ratio: 3/2) {
    :root { --stadium-size: cover; }
  }
  @media (max-width: 700px) {
    :root { --stadium-img: url("/images/soccer-stadium-bg-small.jpg"); }
  }

  .modal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
  }

  .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 700;
    font-size: 20px;
    text-transform: uppercase;
    color: var(--accent-strong);
  }

  .modal-title span {
    overflow-wrap: anywhere;
  }

  .modal-title img.crest, .modal-title .crest-fallback { width: 26px; height: 26px; }

  .modal-close {
    flex: none;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 9px;
    border-radius: 6px;
  }
  .modal-close:hover, .modal-close:focus-visible { background: var(--accent-soft); color: var(--accent-strong); }
  .modal-back { flex: none; margin-right: -2px; padding: 2px 9px 4px; font-size: 22px; line-height: 1; color: var(--muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
  .modal-back:hover, .modal-back:focus-visible { background: var(--accent-soft); color: var(--accent-strong); }
  /* ---- Team schedule modal: sticky header and filters, scrolling list ---- */
  #team-modal-overlay { align-items: center; overflow: hidden; padding: 24px 16px; overscroll-behavior: contain; }
  #team-modal-overlay .modal { max-width: 760px; height: min(820px, calc(100dvh - 48px)); background: color-mix(in srgb, var(--surface) 96%, transparent); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
  #team-modal-overlay .modal-header { flex: none; align-items: flex-start; gap: 12px; padding: 20px 20px 16px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--surface-2)), var(--surface-2)); }
  #team-modal-title { flex: 1; min-width: 0; gap: 14px; font-family: "Libre Franklin", sans-serif; text-transform: none; color: var(--ink); }
  #team-modal-title .tm-crest { flex: none; display: inline-flex; }
  #team-modal-title .tm-crest img.crest, #team-modal-title .tm-crest .crest-fallback { width: 68px; height: 68px; border-radius: 10px; object-fit: contain; font-size: 22px; }
  .tm-id { min-width: 0; padding-left: 14px; border-left: 1px solid var(--line); display: grid; gap: 3px; }
  .tm-name { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; overflow-wrap: anywhere; }
  .tm-sub { font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .tm-season { white-space: nowrap; }
  .tm-record { display: flex; align-items: flex-start; gap: 14px; margin-top: 4px; }
  .tm-record span { display: grid; justify-items: center; gap: 1px; position: relative; }
  .tm-record span + span::before { content: "\2013"; position: absolute; left: -11px; top: 0; font-weight: 700; color: var(--muted); }
  .tm-record b { font-size: 17px; font-weight: 800; line-height: 1.2; }
  .tm-record i { font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  .tm-record .w i { color: var(--win); } .tm-record .d i { color: var(--muted); } .tm-record .l i { color: var(--loss); }
  #team-modal-overlay .modal-close { margin: -4px -6px 0 0; font-size: 26px; }
  #team-modal-overlay .modal-back { align-self: center; }

  .tm-filters { flex: none; display: flex; gap: 8px; padding: 12px 20px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: var(--surface); }
  .tm-filters[hidden] { display: none; }
  .tm-filters::-webkit-scrollbar { display: none; }
  .tm-filters button { flex: none; min-height: 34px; padding: 6px 16px; font: 600 13.5px "Libre Franklin", sans-serif; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; transition: color 0.12s, border-color 0.12s, background 0.12s; }
  .tm-filters button:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
  .tm-filters button[aria-pressed="true"] { color: var(--ink); background: var(--accent-soft); border-color: var(--accent); }
  .tm-filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  #team-modal-schedule { flex: 1 1 auto; min-height: 0; gap: 8px; padding: 6px 20px 22px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  #team-modal-schedule::-webkit-scrollbar { width: 8px; }
  #team-modal-schedule::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
  #team-modal-schedule .date-heading { margin: 12px 0 0; font-size: 11px; letter-spacing: 0.08em; }
  #team-modal-schedule .match { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px 12px; padding: 10px 14px 8px; box-shadow: none; transition: border-color 0.12s; }
  #team-modal-schedule .score-block { align-self: center; }
  #team-modal-schedule .match:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  #team-modal-schedule .side { gap: 10px; }
  #team-modal-schedule .side img.crest, #team-modal-schedule .side .crest-fallback { width: 42px; height: 42px; font-size: 14px; }
  #team-modal-schedule .side span.name { font-size: 14.5px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  /* A name that wraps to two lines stays against its crest, in line with its
     Home/Away row (phones center everything instead, below). */
  @media (min-width: 561px) {
    #team-modal-schedule .side.home .side-text { text-align: right; }
    #team-modal-schedule .side.away .side-text { text-align: left; }
  }
  #team-modal-schedule .score-block { min-width: 72px; gap: 3px; }
  #team-modal-schedule .score { font-size: 24px; }
  #team-modal-schedule .score.tbd { font-size: 15px; }
  #team-modal-schedule .match-footer { flex-wrap: wrap; column-gap: 14px; row-gap: 4px; padding-top: 0; margin-top: 0; font-size: 11px; opacity: 0.9; }
  /* Watch replay under FINAL: the same blue-outlined link as everywhere else, just a
     touch smaller, so the matchup stays centered. */
  .score-block .video-link-replay { margin-top: 5px; padding: 5px 11px 5px 8px; font-size: 11.5px; gap: 5px; }
  .score-block .video-link-replay svg { width: 14px; height: 14px; }

  @media (max-width: 560px) {
    #team-modal-overlay { padding: 8px; }
    #team-modal-overlay .modal { height: calc(100dvh - 16px); }
    #team-modal-overlay .modal-header { padding: 14px 14px 12px; }
    #team-modal-title { gap: 10px; }
    #team-modal-title .tm-crest img.crest, #team-modal-title .tm-crest .crest-fallback { width: 52px; height: 52px; }
    .tm-id { padding-left: 10px; }
    .tm-name { font-size: 19px; }
    .tm-filters { padding: 10px 14px; }
    #team-modal-schedule { padding: 4px 12px 18px; }
    #team-modal-schedule .match { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding: 10px 8px 8px; gap: 6px 6px; align-items: start; }
    #team-modal-schedule .score-block { margin-top: 8px; }
    #team-modal-schedule .side, #team-modal-schedule .side.away { flex-direction: column-reverse; justify-content: flex-end; text-align: center; gap: 6px; }
    #team-modal-schedule .side-text { align-items: center; }
    #team-modal-schedule .side-details, #team-modal-schedule .side.home .side-details, #team-modal-schedule .side.away .side-details { justify-content: center; }
    #team-modal-schedule .side img.crest, #team-modal-schedule .side .crest-fallback { width: 36px; height: 36px; }
    #team-modal-schedule .side span.name { font-size: 12.5px; }
    #team-modal-schedule .score-block { min-width: 56px; }
    #team-modal-schedule .score { font-size: 20px; }
    #team-modal-schedule .video-link-replay { min-height: 32px; } /* easier to tap */
  }

  /* Finished and live cards: each half of the card opens that team's
     schedule. JS sets data-hover (home / away) on the half under the pointer. */
  .match[data-team-home] { position: relative; }
  .match[data-team-home][data-hover] { cursor: pointer; }
  .match[data-team-home]::after { content: ""; position: absolute; top: 0; bottom: 0; width: 50%; border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, transparent); opacity: 0; pointer-events: none; transition: opacity 0.12s; }
  .match[data-hover="home"]::after { left: 0; opacity: 1; }
  .match[data-hover="away"]::after { right: 0; opacity: 1; }
  .team-side[data-team-open]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

  .modal-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* ---- Club picker / homepage ---- */
  .picker-content { max-width: 1260px; gap: 18px; }

  /* The hero sits on a photo (images/hero-stadium.jpg), so it keeps its dark
     treatment in both themes. */
  .picker-hero {
    --hero-bg: #0b1320;
    --hero-ink: #f2f6fc;
    --hero-sub: #d3deec;
    --hero-muted: #a9b9cf;
    --hero-accent: #6fb2ff;
    --hero-line: rgba(111, 178, 255, 0.34);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    padding: 34px 36px 24px;
    border: 1px solid var(--hero-line);
    border-radius: 16px;
    background: var(--hero-bg);
    color: var(--hero-ink);
    box-shadow: var(--shadow);
  }
  .picker-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: url("/images/hero-stadium.jpg") right 82% / cover no-repeat;
  }
  .picker-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      linear-gradient(90deg, var(--hero-bg) 0%, rgba(11, 19, 32, 0.95) 36%, rgba(11, 19, 32, 0.6) 60%, rgba(11, 19, 32, 0.2) 100%),
      linear-gradient(180deg, rgba(11, 19, 32, 0.78), rgba(11, 19, 32, 0.35) 45%, transparent 70%),
      linear-gradient(0deg, rgba(11, 19, 32, 0.45), transparent 45%);
  }

  .picker-hero-main { max-width: 700px; }
  .picker-hero-eyebrow { margin: 0 0 10px; color: var(--hero-accent); }

  .picker-hero #picker-title {
    color: var(--hero-ink);
    font-size: clamp(38px, 4.5vw, 64px);
    line-height: 0.95;
    text-wrap: balance;
  }
  .picker-hero #picker-title .accent { color: var(--hero-accent); white-space: nowrap; }

  .picker-hero-sub {
    margin: 12px 0 22px;
    max-width: 34ch;
    font-size: clamp(16px, 1.7vw, 21px);
    line-height: 1.3;
    color: var(--hero-sub);
  }

  .picker-search-done { display: none; }
  @media (max-width: 640px) {
    .picker-page.is-searching .picker-content { padding-top: 8px; gap: 8px; }
    .picker-page.is-searching .picker-hero {
      position: sticky;
      top: 0;
      z-index: 6;
      padding: 10px;
      overflow: visible;
    }
    .picker-page.is-searching .picker-hero-eyebrow,
    .picker-page.is-searching .picker-hero #picker-title,
    .picker-page.is-searching .picker-hero-sub,
    .picker-page.is-searching .picker-browse { display: none; }
    .picker-page.is-searching .picker-search-wrap { display: flex; align-items: center; gap: 8px; }
    .picker-page.is-searching .team-picker-search { min-width: 0; flex: 1; width: 0; font-size: 16px; padding: 12px 10px 12px 42px; }
    .picker-page.is-searching .picker-search-icon { left: 12px; width: 20px; }
    .picker-page.is-searching .picker-search-done {
      display: block;
      flex: none;
      min-height: 44px;
      padding: 8px;
      border: 0;
      border-radius: 8px;
      background: #173452;
      color: #f2f6fc;
      font: inherit;
      cursor: pointer;
    }
    .picker-page.is-searching .picker-directory-head { position: static; }
    .picker-page.is-searching .picker-sticky-search { display: none; }
    .picker-page.is-searching .picker-directory-head h2 { display: none; }
    .picker-search-compact { font-size: 16px; }
  }
  .picker-search-wrap { position: relative; }
  .picker-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--hero-muted);
    stroke-width: 2.2;
    stroke-linecap: round;
    pointer-events: none;
  }
  .team-picker-search {
    width: 100%;
    font-family: "Libre Franklin", sans-serif;
    font-size: 18px;
    color: var(--hero-ink);
    background: rgba(9, 16, 29, 0.86);
    border: 1.5px solid rgba(111, 178, 255, 0.6);
    border-radius: 12px;
    padding: 16px 18px 16px 56px;
    box-shadow: 0 0 22px -6px rgba(111, 178, 255, 0.45);
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  .team-picker-search::placeholder { color: #93a4bb; }
  .team-picker-search:hover { border-color: var(--hero-accent); }
  .team-picker-search:focus-visible {
    outline: none;
    border-color: var(--hero-accent);
    box-shadow: 0 0 0 4px rgba(111, 178, 255, 0.28), 0 0 28px -4px rgba(111, 178, 255, 0.55);
  }

  .picker-browse {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 0 6px;
    padding: 8px 10px;
    font-family: "Libre Franklin", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--hero-ink);
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
  }
  .picker-browse svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }
  .picker-browse:hover { background: rgba(255, 255, 255, 0.07); }
  .picker-browse:focus-visible { outline: 2px solid var(--hero-accent); outline-offset: 2px; }

  /* Quieter than the hero: the same banner, softer surface. */
  .picker-disclaimer {
    padding: 12px 18px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-color: var(--line);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .picker-disclaimer .disclaimer-icon { font-size: 24px; }

  .picker-directory { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 16px; }
  /* The header sticks to the top while the club list scrolls. Once the hero
     search is out of view (.is-stuck, set by an IntersectionObserver) it
     becomes a dark bar with a compact search box. */
  .picker-directory-head {
    position: sticky;
    top: 8px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 0 -12px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
  }
  .picker-directory-head.is-stuck {
    background: rgba(8, 14, 25, 0.9);
    border-color: rgba(111, 178, 255, 0.28);
    box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .picker-sticky-search { position: relative; flex: 1 1 240px; max-width: 480px; }
  .picker-sticky-search .picker-search-icon { left: 14px; width: 18px; height: 18px; stroke: #a9b9cf; }
  .picker-search-compact {
    width: 100%;
    font-family: "Libre Franklin", sans-serif;
    font-size: 15px;
    color: #f2f6fc;
    background: rgba(9, 16, 29, 0.86);
    border: 1.5px solid rgba(111, 178, 255, 0.6);
    border-radius: 10px;
    padding: 9px 12px 9px 40px;
  }
  .picker-search-compact::placeholder { color: #93a4bb; }
  .picker-search-compact:focus-visible {
    outline: none;
    border-color: #6fb2ff;
    box-shadow: 0 0 0 3px rgba(111, 178, 255, 0.28);
  }
  @media (prefers-reduced-motion: reduce) {
    .picker-directory-head { transition: none; }
  }
  .picker-directory-head h2 {
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 700;
    color: var(--accent-strong);
  }
  .picker-directory-tools { display: flex; align-items: center; gap: 14px; }
  .picker-division { flex: none; }
  .picker-division button { font-size: 13px; padding: 7px 16px; }
  /* League | MLS NEXT Flex switch, centered right under the top card (Homegrown
     U15-U19 teams in Flex only). Bolder than the Upcoming/Results tabs: it changes
     the whole page, so it shouldn't read as a quiet filter. */
  /* Lives in the header's age row, after the age groups: a compact version of
     the pill, sized to the age buttons. Phones: its own centered line. */
  .comp-switch-row { display: flex; }
  .comp-switch-row .comp-switch { padding: 3px; gap: 2px; box-shadow: none; }
  .comp-switch-row .schedule-tab { padding: 6px 14px; font-size: 12.5px; }
  @media (max-width: 640px) { .comp-switch-row { flex-basis: 100%; justify-content: center; } }
  .comp-switch-row[hidden] { display: none; }
  #division-switch .schedule-tab { text-decoration: none; }
  /* Same shape as every pill group; only the accent outline marks it out. */
  .comp-switch { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
  @keyframes comp-fade { from { opacity: .35; } to { opacity: 1; } }
  @media (prefers-reduced-motion: no-preference) { .comp-fade { animation: comp-fade .25s ease-out; } }
  .comp-note { margin: 10px 0 0; color: #b9c8da; font-size: 13px; }
  .comp-note[hidden] { display: none; }
  .comp-note strong { color: #e6eef9; }
  .comp-footnote { margin: 10px 0 0; color: #b9c8da; font-size: 12.5px; font-style: italic; text-align: center; }
  .comp-footnote[hidden] { display: none; }
  .sched-flex { flex: none; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-strong); background: var(--accent-soft); }
  .pathway-tag {
    flex: none;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
  }
  /* These sit directly on the night photo, so they stay light in both themes. */
  .picker-page .picker-directory-head h2 { color: #d6e4f7; }
  .picker-page .picker-count { color: #aebcd0; }
  .picker-count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .picker-sort {
    appearance: none;
    font-family: "Libre Franklin", sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a96a8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 36px 9px 14px;
    cursor: pointer;
  }
  .picker-sort:hover { border-color: var(--accent); }
  .picker-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .team-picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 12px;
  }

  /* Club card: the club link stretches over the whole card (::after), and the
     age pills sit above it so each still opens its own age group. */
  .team-picker-row {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 12px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  }
  .team-picker-row:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .team-picker-row:has(.team-picker-club:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-color: var(--accent);
  }

  .team-picker-row .crest, .team-picker-row .crest-fallback { width: 72px; height: 72px; font-size: 24px; border-radius: 12px; flex: none; }

  .team-picker-club {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
  }
  .team-picker-club::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
  .team-picker-club:focus-visible { outline: none; }
  .team-picker-row:hover .team-picker-name { color: var(--accent-strong); }

  .team-picker-name {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.25;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .team-picker-name mark {
    color: inherit;
    background: var(--accent-soft);
    border-radius: 3px;
    padding: 0 1px;
  }

  .team-picker-ages {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    margin-top: auto;
  }
  .team-picker-age {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.02em;
    line-height: 1;
    padding: 5px 0;
    text-align: center;
    text-decoration: none;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
  }
  .team-picker-age:hover { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); }
  .team-picker-age:focus-visible { color: var(--accent-strong); background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 1px; }

  .team-picker-list .state-msg { grid-column: 1 / -1; }
  .picker-empty strong { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
  .picker-suggest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    margin: 16px auto 0;
    padding: 12px 16px;
    max-width: 640px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--ink);
  }
  .picker-suggest[hidden] { display: none; }
  .picker-suggest strong { display: inline; font-size: inherit; margin: 0; }
  .picker-suggest-clubs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
  .picker-suggest-club {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: border-color 0.15s;
  }
  .picker-suggest-club .crest, .picker-suggest-club .crest-fallback { width: 30px; height: 30px; border-radius: 7px; font-size: 11px; }
  .picker-suggest-club:hover { border-color: var(--accent); }
  .picker-suggest-club:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .picker-suggest-more { color: var(--muted); font-size: 13px; }
  .picker-suggest-btn {
    flex: none;
    font: inherit;
    font-weight: 700;
    color: var(--toggle-active-ink);
    background: var(--toggle-active-bg);
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
  }
  .picker-suggest-btn:hover { filter: brightness(1.08); }
  .picker-suggest-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .picker-empty-reset {
    font: inherit;
    font-weight: 600;
    color: var(--accent-strong);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  @media (prefers-reduced-motion: reduce) {
    .team-picker-row { transition: none; }
    .team-picker-row:hover { transform: none; }
  }

  @media (max-width: 960px) {
    .picker-hero { grid-template-columns: 1fr; padding: 28px 26px 22px; }
    .picker-hero-sub { max-width: 44ch; }
    .picker-hero::after {
      background: linear-gradient(90deg, var(--hero-bg) 0%, rgba(11, 19, 32, 0.9) 50%, rgba(11, 19, 32, 0.55) 100%);
    }
  }

  @media (max-width: 640px) {
    .picker-hero { padding: 22px 16px 18px; gap: 18px; }
    .picker-hero::before { background-position: 75% 100%; opacity: 0.55; }
    .picker-hero::after { background: rgba(11, 19, 32, 0.72); }
    .picker-hero-sub { margin: 10px 0 18px; }
    .team-picker-search { font-size: 16px; padding: 14px 14px 14px 50px; }
    .picker-search-icon { left: 16px; width: 22px; height: 22px; }
    .picker-browse { margin: 8px 0 0; }
    .picker-disclaimer { padding: 28px 14px 14px; }
    .team-picker-list { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; }
    .team-picker-age { padding: 7px 0; font-size: 12px; }
    /* Stuck on a phone: two rows - the search box across the top, then the
       Homegrown/Academy switch with Sort beside it. */
    .picker-directory-head.is-stuck { margin: 0 -8px; padding: 8px; gap: 8px; }
    .picker-directory-head.is-stuck h2,
    .picker-directory-head.is-stuck .picker-count { display: none; }
    .picker-directory-head.is-stuck .picker-sticky-search { order: 1; flex-basis: 100%; max-width: none; }
    .picker-directory-head.is-stuck .picker-division { order: 2; }
    .picker-directory-head.is-stuck .picker-directory-tools { order: 3; margin-left: auto; }
    .picker-search-compact { font-size: 16px; }
  }

  .loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 20, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
  }

  .loading-overlay[hidden] { display: none; }

  .loading-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 20px 26px;
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .spinner {
    width: 20px;
    height: 20px;
    flex: none;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  .loading-text {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
  }

  @media (prefers-reduced-motion: reduce) {
    .next-match:not([hidden]),
    .next-match-team img.crest,
    .next-match-team .crest-fallback { animation: none; }
  }

  @media (max-width: 520px) {
    table { width: 470px; min-width: 470px; table-layout: fixed; }
    thead th, tbody td { padding-left: 5px; padding-right: 5px; }
    thead th { font-size: 10px; }
    tbody td { font-size: 12px; }
    thead th:first-child, tbody td.rank { width: 30px; }
    thead th:nth-child(2), tbody td.team { width: 145px; }
    thead th:nth-child(n + 3), tbody td:nth-child(n + 3) { width: 31px; }
    td.team { font-size: 12.5px; overflow-wrap: anywhere; }
    td.team .crest-row { gap: 6px; min-width: 0; padding-right: 5px; }
    td.team .team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    td.team .crest-row img.crest, td.team .crest-row .crest-fallback { width: 26px; height: 26px; }
    .schedule-list, .schedule-panel { gap: 10px; }
    .next-match { padding: 16px 14px 22px; gap: 12px; border-radius: 22px; }
    .next-match-eyebrow { font-size: 28px; }
    .next-match-eyebrow::before, .next-match-eyebrow::after { width: 30px; }
    .next-match-subtitle { font-size: 11px; letter-spacing: 0.32em; }
    .next-match-paint { width: 210px; height: 84px; }
    .next-match-paint.extra { width: 300px; height: 50px; }
    .next-match-paint.red { left: -110px; top: 25px; }
    .next-match-paint.blue { right: -115px; bottom: 105px; }
    .next-match-paint.red.extra { left: -45px; top: auto; bottom: 80px; }
    .next-match-paint.blue.extra { right: -45px; top: 42px; bottom: auto; }
    /* Crests and VS in the first row, names and records in the second, the
       kickoff details across the third. */
    .next-match-body { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "home vs away" "home . away" "center center center"; column-gap: 6px; row-gap: 12px; }
    .next-match-body:has(.next-match-countdown:not([hidden])) { grid-template-areas: "countdown countdown countdown" "home vs away" "home . away" "center center center"; row-gap: 14px; }
    .next-match-body .next-match-center { align-self: auto; }
    .next-match-details { justify-content: center; gap: 14px; padding-top: 14px; }
    .next-match-details .nm-venue { flex-basis: 100%; justify-content: center; text-align: center; }
    .next-match-details .nm-weather { margin-left: 0; }
    .nm-time { font-size: 34px; } .nm-time small { font-size: 15px; }
    .nm-venue { max-width: 100%; font-size: 15.5px; }
    .nm-weather { gap: 6px 11px; font-size: 14px; } .nm-weather strong { font-size: 19px; }
    .nm-wx-item { gap: 5px; } .nm-wx-icon { width: 21px; height: 21px; } .nm-wx-sep { height: 19px; }
    .next-match-body > .next-match-team { row-gap: 8px; }
    .next-match-team-info { gap: 8px; }
    .next-match-team span.name { font-size: 15px; white-space: normal; line-height: 1.05; }
    .next-match-team img.crest, .next-match-team .crest-fallback { width: 100px; height: 100px; border-radius: 16px; }
    .next-match-team img.crest.plate { padding: 10px; }
    .next-match-team .record { font-size: 10px; }
    .next-match-vs { width: 48px; height: 48px; min-width: 48px; min-height: 48px; font-size: 20px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--match-blue) 14%, transparent), 0 0 18px var(--match-glow); }
    .next-match-vs::before { width: 110px; }
    .next-match-vs::after { width: 70px; margin-top: 8px; }
    .next-match-footer { font-size: 8px; letter-spacing: 0.17em; gap: 8px; }
    .next-match-footer::before, .next-match-footer::after { width: 18px; }
    .match { padding: 10px 12px; gap: 6px; }
    .side { gap: 6px; }
    .side img.crest, .side .crest-fallback { width: 32px; height: 32px; border-radius: 6px; font-size: 12px; }
    .side span.name { font-size: 13px; }
    .schedule-crest-wrap .crest-star { top: -5px; right: -5px; font-size: 13px; }
    .record { font-size: 9.5px; margin-top: 0; }
    .record strong { font-size: 10px; }
    .score-block { min-width: 56px; gap: 2px; }
    .score { font-size: 13px; }
    .score.tbd { font-size: 11px; }
    .pill { font-size: 8.5px; padding: 1px 5px; }
    .match-footer { font-size: 10px; }
    .modal-overlay { padding: 16px 10px; }
    .modal-header { padding: 14px 16px; }
    .modal-body { padding: 14px 16px 18px; }
  }
