/* Футбольные школы Москвы. Tokens first, then the shell every page shares, then each page top to bottom.
   World: a weekend planner. Pale grass-grey ground, white containers lifted by a soft shadow, Onest in five sizes,
   green only on actions and active states, sun yellow only on dates. */
:root {
  --ground: #f3f6f4; --ground: light-dark(#f3f6f4, #0f1612);
  --surface: #ffffff; --surface: light-dark(#ffffff, #18221c);
  --ink: #141b17; --ink: light-dark(#141b17, #f2f6f3);
  --text: #1c2520; --text: light-dark(#1c2520, #e6ece8);
  --muted: #66706b; --muted: light-dark(#66706b, #9aa69f);
  --line: #e4e9e6; --line: light-dark(#e4e9e6, #263129);
  --line-strong: #c6d1cb; --line-strong: light-dark(#c6d1cb, #3a473f);
  --grass: #1a7f46; --grass: light-dark(#1a7f46, #3fbf74);        /* 5.0:1 with white text; the dark grass carries ink text */
  --on-grass: #fff; --on-grass: light-dark(#fff, #0f1612);         /* text on a grass fill */
  --on-ink: #fff; --on-ink: light-dark(#fff, #0f1612);             /* text on an ink fill (pressed chips and tiles) */
  --crest-bg: #f3f6f4; --crest-bg: light-dark(#f3f6f4, #e9efeb);   /* crests are drawn for light paper: they keep a light disc at night */
  --crest-ink: #15703c;
  --grass-deep: #15703c; --grass-deep: light-dark(#15703c, #5fd48f);
  --grass-tint: #e3f3e9; --grass-tint: light-dark(#e3f3e9, #173826);
  --grass-soft: #9fe0b8; --grass-soft: light-dark(#9fe0b8, #15703c);   /* weekend labels on the ink tile */
  --sun: #ffcf3f;
  --sun-ink: #3b2a00;
  --sun-tint: #fff4cf; --sun-tint: light-dark(#fff4cf, #3a2f0e);
  --sky-tint: #e6f0ff; --sky-tint: light-dark(#e6f0ff, #16283f);
  --sky-ink: #1d58a8; --sky-ink: light-dark(#1d58a8, #8fbaff);
  --grey-tag: #eef1ef; --grey-tag: light-dark(#eef1ef, #263129);
  --stale: #b5bdb8; --stale: light-dark(#b5bdb8, #5c6862);
  --warn-ink: #8a5a00; --warn-ink: light-dark(#8a5a00, #f0c36b);
  --paid-ink: #7a4b00; --paid-ink: light-dark(#7a4b00, #f1cf7a);
  --badge-ink: #3a463f; --badge-ink: light-dark(#3a463f, #c9d3cc);
  --map-bg: #e9eeeb; --map-bg: light-dark(#e9eeeb, #10171a);
  --sh-1: rgba(20, 27, 23, .05); --sh-1: light-dark(rgba(20, 27, 23, .05), rgba(0, 0, 0, .35));
  --sh-2: rgba(20, 27, 23, .06); --sh-2: light-dark(rgba(20, 27, 23, .06), rgba(0, 0, 0, .4));
  --sh-3: rgba(20, 27, 23, .08); --sh-3: light-dark(rgba(20, 27, 23, .08), rgba(0, 0, 0, .45));
  --sh-4: rgba(20, 27, 23, .14); --sh-4: light-dark(rgba(20, 27, 23, .14), rgba(0, 0, 0, .55));
  --shadow-soft: 0 1px 2px var(--sh-1), 0 6px 18px var(--sh-2);
  --shadow-float: 0 2px 6px var(--sh-3), 0 14px 36px var(--sh-4);
  --r-frame: 20px; --r-card: 16px; --r-tile: 12px; --r-pill: 999px;
  --fs-1: 13px; --fs-2: 15px; --fs-3: 17px; --fs-4: 20px; --fs-5: 26px;   /* the whole scale */
  --ctl: 40px;
  --display: "Unbounded", "Onest", system-ui, sans-serif;  /* titles, the wordmark, date numerals, positions */
  --build: "local-202610261550";  /* scripts/stamp_build.py writes the deploy id here, in the HTML and in js/common.js */
  --ball: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23fff' stroke='%231a7f46' stroke-width='2'/%3E%3Cpath d='M12 7l4.8 3.5-1.8 5.6H9L7.2 10.5z' fill='%231a7f46'/%3E%3Cpath d='M12 7V1.6M16.8 10.5l5.2-1.7M15 16.1l3.2 4.4M9 16.1l-3.2 4.4M7.2 10.5L2 8.8' stroke='%231a7f46' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E");
  --flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a7f46' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 22V3'/%3E%3Cpath d='M7 4h10l-3 4 3 4H7z' fill='%23fff'/%3E%3C/svg%3E");
  --town: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a7f46' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='rgba(255,255,255,.7)' stroke-dasharray='4.2 3.6'/%3E%3C/svg%3E");
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23141b17' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  --chev-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10l4-4 4 4'/%3E%3C/svg%3E");
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;  /* the tokens above resolve to the device's scheme unless the sun/moon button pins one */
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
/* The three drawn icons and the map tiles cannot use light-dark(): they are set once per scheme. */
:root[data-theme="dark"], :root.scheme-dark {
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23f2f6f3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  --chev-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230f1612' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10l4-4 4 4'/%3E%3C/svg%3E");
  --flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235fd48f' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 22V3'/%3E%3Cpath d='M7 4h10l-3 4 3 4H7z' fill='%2318221c'/%3E%3C/svg%3E");
  --town: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235fd48f' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='rgba(24,34,28,.7)' stroke-dasharray='4.2 3.6'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .leaflet-tile-pane, :root.scheme-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) saturate(.45) brightness(.82) contrast(.9); }  /* the night map */
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; min-height: 100vh; background: var(--ground); color: var(--text); font-size: var(--fs-2); line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.page-map { height: 100vh; }  /* the map page is an app screen: the list scrolls inside; the other pages scroll as documents */
::selection { background: var(--sun); color: var(--sun-ink); }
input, textarea { caret-color: var(--grass); }
:focus-visible { outline: 2px solid var(--grass); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a { color: inherit; }
button, select, input { font: inherit; }
.hidden { display: none !important; }
.bar, .controls, .foot { flex-shrink: 0; }

/* ---------------------------------------------------------------- top bar */
.bar { position: sticky; top: 0; z-index: 1100; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 64px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brandline { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-size: var(--fs-1); font-weight: 500; letter-spacing: -.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.ball-ico { width: 22px; height: 22px; background: var(--ball) center / contain no-repeat; }
.nav { display: inline-flex; gap: 2px; padding: 3px; background: var(--ground); border-radius: var(--r-pill); justify-self: center; }
.nav a { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px; border-radius: var(--r-pill); color: var(--muted); font-size: var(--fs-2); font-weight: 500; text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px var(--sh-4); }
.nav svg { display: none; }  /* the icons belong to the phone tab bar */
.tools { justify-self: end; display: flex; align-items: center; gap: 8px; }
.theme { flex: none; width: var(--ctl); height: var(--ctl); border: 0; border-radius: 50%; background: var(--ground); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.theme:hover { background: var(--grass-tint); color: var(--grass-deep); }
.tg { flex: none; display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 16px 0 13px; border-radius: var(--r-pill); background: var(--grass-tint); color: var(--grass-deep); font-size: var(--fs-2); font-weight: 600; text-decoration: none; }  /* the channel is the site's call to action */
.tg:hover { background: var(--grass); color: var(--on-grass); }
.tg svg { width: 20px; height: 20px; }
.theme svg { width: 20px; height: 20px; display: none; }
.theme[data-mode="auto"] .i-auto, .theme[data-mode="light"] .i-light, .theme[data-mode="dark"] .i-dark { display: block; }

/* ---------------------------------------------------------------- filters and the day strip */
.controls { display: grid; gap: 10px; padding: 12px 20px 0; }
.controls > * { min-width: 0; }  /* grid items default to their content width; the scrolling rows must not widen the page */
.page-trials .controls, .page-teams .controls { width: 100%; max-width: 1120px; margin: 0 auto; }  /* the list pages centre their content; the filters line up with it */
.toolbar { position: relative; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }  /* every filter stays on screen; a laptop wraps to a second row */
.chip { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: var(--fs-2); font-weight: 500; white-space: nowrap; cursor: pointer; flex: none; }
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"], .chip[aria-expanded="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip.check { cursor: pointer; }
.chip.check input { accent-color: var(--grass); margin: 0; width: 16px; height: 16px; }
.chip.select, .chip.menu { appearance: none; padding-right: 34px; background: var(--surface) var(--chev) right 12px center / 14px no-repeat; }
.chip.menu[aria-expanded="true"] { background-color: var(--ink); color: var(--on-ink); background-image: var(--chev-up); }
.popover { position: absolute; left: 0; top: calc(100% + 8px); z-index: 1050; width: min(780px, 100%); max-height: calc(100vh - 150px); overflow: auto; padding: 16px 18px 18px; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-float); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: var(--fs-3); font-weight: 600; }
.pop-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--ground); color: var(--ink); font-size: var(--fs-4); line-height: 1; cursor: pointer; }
.pop-close:hover { background: var(--grass-tint); }
#groupChips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.group[aria-pressed="true"] { background: var(--grass-tint); color: var(--grass-deep); border-color: transparent; }  /* eleven leagues on at once must not become an ink wall */
.leagues { display: flex; flex-wrap: wrap; gap: 12px 28px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-1); }
.leagues .group { min-width: 220px; }
.leagues .group-title { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; margin-bottom: 4px; }
.leagues .group-title button { border: 0; background: none; color: var(--grass-deep); cursor: pointer; font-size: var(--fs-1); font-weight: 500; padding: 0; }
.leagues label { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.leagues input { accent-color: var(--grass); }
/* the day strip: the one move this site owns */
.days { display: flex; gap: 6px; align-items: stretch; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding: 8px 4px 6px 2px; }
.dayt { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 58px; height: 56px; padding: 0 10px; border: 0; border-radius: var(--r-tile); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); cursor: pointer; transition: background-color .16s ease-out, color .16s ease-out, box-shadow .16s ease-out; }
.dayt:hover { box-shadow: var(--shadow-float); }
.dayt .wd { font-size: var(--fs-1); font-weight: 500; color: var(--muted); line-height: 1.2; }
.dayt .dn { font-family: var(--display); font-size: var(--fs-3); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dayt.all .dn, .dayt.later .dn { font-family: inherit; font-size: var(--fs-2); font-weight: 600; }
/* the page's one load moment: the strip rises tile by tile */
@keyframes tile-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dayt { animation: tile-in .4s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 28ms); }
.dayt.we .wd { color: var(--grass-deep); font-weight: 600; }
.dayt .n { position: absolute; top: -8px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--sun); color: var(--sun-ink); font-size: var(--fs-1); font-weight: 700; line-height: 20px; text-align: center; }
.dayt[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.dayt[aria-pressed="true"] .wd { color: color-mix(in srgb, var(--on-ink) 78%, transparent); }
.dayt[aria-pressed="true"].we .wd { color: var(--grass-soft); }
.dayt.empty { color: var(--muted); background: transparent; box-shadow: none; cursor: default; }
.dayt.empty .dn { font-weight: 500; }
.dayt.empty.we .wd { color: var(--muted); font-weight: 500; }

/* ---------------------------------------------------------------- map page */
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 580px; gap: 14px; min-height: 0; padding: 12px 20px 14px; }
.layout > * { min-width: 0; }
.map-wrap { position: relative; min-height: 320px; border-radius: var(--r-frame); overflow: hidden; background: var(--map-bg); box-shadow: var(--shadow-soft); }
#map { position: absolute; inset: 0; }
.leaflet-container { font-family: inherit; }
.leaflet-tile-pane { filter: saturate(.5) brightness(1.05) contrast(.94); }  /* the standard tiles, lightened so the sun chips and crests lead */
.leaflet-bar { border: 0 !important; border-radius: var(--r-tile) !important; overflow: hidden; box-shadow: var(--shadow-float) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--ink) !important; border-bottom-color: var(--line) !important; }
.leaflet-control-attribution { padding: 2px 6px; font-size: 11px; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--grass-deep) !important; }
.fab { position: absolute; right: 12px; top: 12px; z-index: 500; display: flex; gap: 8px; }
.fab button { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: var(--fs-1); font-weight: 600; box-shadow: var(--shadow-float); cursor: pointer; }
.fab button:hover { background: var(--ground); }
.fab button.active { background: var(--ink); color: var(--on-ink); }
.legend { position: absolute; left: 12px; bottom: 24px; z-index: 500; display: grid; gap: 6px; padding: 10px 12px; background: var(--surface); border-radius: var(--r-tile); box-shadow: var(--shadow-float); font-size: var(--fs-1); color: var(--text); }
.legend span { display: flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 16px; height: 16px; background: var(--ball) center / contain no-repeat; }
.dot.flag { background-image: var(--flag); }
.dot.town { background-image: var(--town); }

/* the date block: one geometry everywhere a date appears. The chip sits on pins, cards and the legend; the tile on rows. */
.dchip { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 8px; background: var(--sun); color: var(--sun-ink); font-size: var(--fs-1); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1; }
.dchip, .dot { font-style: normal; }  /* the legend marks them up as <i> */
.dchip.none { background: var(--grey-tag); color: var(--badge-ink); font-weight: 600; }
.dchip.plain { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.dtile { width: 64px; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--r-tile); background: var(--sun); color: var(--sun-ink); line-height: 1; flex: none; }
.dtile b { font-family: var(--display); font-size: var(--fs-5); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dtile span { font-size: var(--fs-1); font-weight: 600; margin-top: 3px; }
.dtile.none { background: var(--grey-tag); color: var(--badge-ink); font-size: var(--fs-1); font-weight: 600; text-align: center; padding: 0 4px; }

/* map pins (divIcons) */
.pin { position: relative; transform: translate(-50%, -100%); white-space: nowrap; }
.pin .lbl { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 8px; background: var(--surface); color: var(--ink); font-size: var(--fs-1); font-weight: 700; box-shadow: var(--shadow-float); font-variant-numeric: tabular-nums; }
.pin .lbl::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.pin.date .lbl { background: var(--sun); color: var(--sun-ink); }
.pin.stale .lbl { color: var(--muted); }
.pin.active .lbl { box-shadow: 0 0 0 3px var(--grass), var(--shadow-float); }
.pin.active { animation: pop .35s ease-out; }
.pindot { width: 18px; height: 18px; background: var(--ball) center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); transform: translate(-50%, -50%); }
.pindot.match { background-image: var(--flag); }
.pindot.city { background-image: var(--town); }
.pindot.active { width: 26px; height: 26px; animation: pop-dot .35s ease-out; }
.pindot.stale { filter: grayscale(1) opacity(.7); }
.cluster { display: inline-flex; align-items: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-weight: 700; font-size: var(--fs-1); box-shadow: var(--shadow-float); transform: translate(-50%, -50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cluster .soon { background: var(--sun); color: var(--sun-ink); border-radius: 6px; padding: 2px 6px; }
.cluster.active { box-shadow: 0 0 0 3px var(--grass), var(--shadow-float); }  /* the cluster that holds the open club */
.leaflet-marker-icon:has(> .cluster.active) { opacity: 1 !important; }  /* markercluster fades a spiderfied cluster; the ringed one stays legible over its legs */
@keyframes pop { 0% { transform: translate(-50%, -100%) scale(.85); } 60% { transform: translate(-50%, -100%) scale(1.08); } 100% { transform: translate(-50%, -100%) scale(1); } }
@keyframes pop-dot { 0% { transform: translate(-50%, -50%) scale(.85); } 60% { transform: translate(-50%, -50%) scale(1.15); } 100% { transform: translate(-50%, -50%) scale(1); } }

/* the list column */
.panel { position: relative; display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 2px 2px 12px; }
.panel-head h1, .page-head h1 { margin: 0; font-family: var(--display); font-size: var(--fs-4); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.count { font-size: var(--fs-1); color: var(--muted); margin-top: 3px; }
.count b { color: var(--ink); font-weight: 600; }
.grid { overflow: auto; flex: 1; padding: 4px 2px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.grid .empty, .page .empty { grid-column: 1 / -1; color: var(--muted); padding: 24px 4px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 0; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-soft); cursor: pointer; text-align: left; transition: transform .15s ease-out, box-shadow .15s ease-out; }
.card:hover { box-shadow: var(--shadow-float); transform: translateY(-1px); }
.card.active { box-shadow: 0 0 0 2px var(--grass), var(--shadow-soft); }
.card .crest { display: flex; align-items: center; gap: 12px; }
.crest-img, .ph { width: 48px; height: 48px; border-radius: 50%; object-fit: contain; background: var(--crest-bg); flex: none; }
.ph { display: grid; place-items: center; font-weight: 600; color: var(--crest-ink); font-size: var(--fs-3); }
.crest-img.sm, .ph.sm { width: 30px; height: 30px; font-size: var(--fs-1); }
.crest-img.big, .ph.big { width: 64px; height: 64px; border-radius: 16px; font-size: var(--fs-5); }
.card h2 { margin: 0; font-size: var(--fs-3); font-weight: 600; line-height: 1.2; }  /* a school under the page's h1 */
.card .league { font-size: var(--fs-1); color: var(--muted); margin-top: 2px; }
.card .addr { font-size: var(--fs-1); color: var(--muted); }
.card .addr .warn { color: var(--warn-ink); }
.card .next { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: var(--fs-2); font-weight: 500; margin-top: 2px; }
.card .cfoot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 4px; font-size: var(--fs-1); }
.card .cfoot a { color: var(--grass-deep); font-weight: 600; text-decoration: none; }
.card .cfoot a:hover { text-decoration: underline; }
.card .km { font-weight: 600; }
.badge { display: inline-block; font-size: var(--fs-1); font-weight: 500; padding: 2px 8px; border-radius: var(--r-pill); background: var(--grey-tag); color: var(--badge-ink); white-space: nowrap; }
.badge.free { background: var(--grass-tint); color: var(--grass-deep); }
.badge.paid { background: var(--sun-tint); color: var(--paid-ink); }
.badge.stale { background: var(--grey-tag); color: var(--muted); }
.badge.role { background: var(--sky-tint); color: var(--sky-ink); margin-right: 6px; vertical-align: 1px; }
.welcome { display: flex; gap: 14px; align-items: center; margin: 0 2px 12px; padding: 12px 16px; background: var(--grass-tint); color: var(--grass-deep); border-radius: var(--r-card); font-size: var(--fs-2); }
.welcome p { margin: 0; flex: 1; }
.welcome b { font-weight: 600; }
.welcome button { flex: none; height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--grass); color: var(--on-grass); font-weight: 600; cursor: pointer; }
.welcome button:hover { background: var(--grass-deep); }

/* the club panel */
.detail { position: absolute; inset: 0; z-index: 20; overflow: auto; background: var(--surface); border-radius: var(--r-frame); box-shadow: var(--shadow-float); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.detail .hd { display: flex; gap: 14px; padding: 20px 56px 14px 20px; align-items: center; }
.detail .hd h2 { margin: 0; font-size: var(--fs-4); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.detail .hd .sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; color: var(--muted); font-size: var(--fs-1); }
.detail .close { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--ground); color: var(--ink); font-size: var(--fs-4); line-height: 1; cursor: pointer; }
.detail .close:hover { background: var(--grass-tint); }
.detail .sec { padding: 14px 20px; border-top: 1px solid var(--line); }
.detail .sec h3 { margin: 0 0 8px; font-size: var(--fs-1); font-weight: 600; color: var(--muted); }
.detail .more-link { display: inline-block; margin-top: 8px; color: var(--grass-deep); font-weight: 600; text-decoration: none; }
.trial-block { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.trial-block p { margin: 0; font-size: var(--fs-2); }
.btn { display: inline-flex; align-items: center; height: 38px; margin-top: 12px; padding: 0 16px; border-radius: var(--r-pill); background: var(--grass); color: var(--on-grass); text-decoration: none; font-weight: 600; font-size: var(--fs-2); }
.btn:hover { background: var(--grass-deep); }
.detail ul.more { margin: 10px 0 0; padding-left: 18px; font-size: var(--fs-1); }
.detail ul.more li { margin: 4px 0; }
.detail ul.more a, .detail td a, .detail .kv a, .detail .note.hint a { color: var(--grass-deep); font-weight: 600; text-decoration: none; }
.detail table { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.detail td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.detail td:last-child { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.detail .kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: var(--fs-2); }
.detail .kv span { color: var(--muted); }
.detail .note { font-size: var(--fs-1); color: var(--muted); }
.detail .note .ok { color: var(--grass-deep); font-weight: 600; }
.detail .note.hint { margin: 10px 0 0; }

/* ---------------------------------------------------------------- list pages: trials and standings */
.page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 6px 20px 48px; }
.page-head { margin: 12px 0 18px; }
.page-head h1 { font-size: var(--fs-5); }
.page-head .lead { margin: 4px 0 0; color: var(--muted); max-width: 64ch; }
.day-h { margin: 28px 0 10px; font-size: var(--fs-4); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.day-h span { font-weight: 700; }
.day:first-child .day-h { margin-top: 6px; }
.trials-list { display: grid; gap: 10px; }
.trow { display: grid; grid-template-columns: 64px minmax(200px, 1.1fr) minmax(240px, 1.6fr) 150px; gap: 18px; align-items: start; padding: 16px 18px; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-soft); }
.trow .when small { display: block; margin-top: 6px; font-size: var(--fs-1); color: var(--muted); text-align: center; line-height: 1.3; }
.trow .who { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.trow .who .crest-img, .trow .who .ph { width: 44px; height: 44px; }
.trow .club { font-size: var(--fs-3); font-weight: 600; color: var(--ink); text-decoration: none; }
.trow .club:hover { color: var(--grass-deep); text-decoration: underline; }
.trow .addr { font-size: var(--fs-1); color: var(--muted); margin-top: 3px; }
.trow .what .title { font-size: var(--fs-2); font-weight: 600; }
.trow .what .note { font-size: var(--fs-1); color: var(--muted); margin-top: 2px; }
.trow .snippet { color: var(--muted); font-size: var(--fs-1); margin-top: 6px; line-height: 1.4; }
.trow .src { text-align: right; }
.trow .src a { color: var(--grass-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.trow .src a:hover { color: var(--grass); }
.trow .conf { font-size: var(--fs-1); color: var(--muted); margin-top: 8px; line-height: 1.4; }
.trow .conf .ok { color: var(--grass-deep); font-weight: 600; }
.undated-block { margin-top: 32px; }
.undated-block summary { cursor: pointer; padding: 6px 0; margin-bottom: 10px; font-size: var(--fs-4); font-weight: 700; letter-spacing: -.01em; }
.undated-block summary::marker { color: var(--grass); font-size: .75em; }
/* standings */
.standings { margin: 0 0 16px; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-soft); overflow: hidden; }
.standings h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0; padding: 14px 18px 10px; font-size: var(--fs-3); font-weight: 600; }
.standings h2 .lg b { font-weight: 700; }
.standings h2 .meta { font-size: var(--fs-1); font-weight: 400; color: var(--muted); }
.standings h2 .meta .groups { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--grey-tag); color: var(--badge-ink); font-weight: 500; }
.standings table { width: 100%; max-width: 100%; border-collapse: collapse; table-layout: auto; font-size: var(--fs-2); }
.standings th, .standings td { text-align: left; padding: 9px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.standings th { font-size: var(--fs-1); color: var(--muted); font-weight: 500; }
.standings th.num, .standings td.num { text-align: right; font-variant-numeric: tabular-nums; }
.standings th.pos, .standings td.pos { width: 56px; }
.standings td.pos { font-family: var(--display); font-size: var(--fs-2); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--grass-deep); }
.standings td.pos .top { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; background: var(--grass-tint); }
.standings .teamcell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.standings .club { font-weight: 600; color: var(--ink); text-decoration: none; }
.standings .club:hover { color: var(--grass-deep); text-decoration: underline; }
.standings td.team .note { font-size: var(--fs-1); color: var(--muted); }
.standings td.pts { font-weight: 700; }
.standings td.link a { color: var(--grass-deep); font-weight: 600; text-decoration: none; font-size: var(--fs-1); }

/* ---------------------------------------------------------------- footer */
.foot { display: flex; flex-wrap: wrap; gap: 2px 20px; padding: 10px 20px 14px; font-size: var(--fs-1); color: var(--muted); }
.foot p { margin: 0; }
.foot a { color: var(--grass-deep); font-weight: 500; }
.foot .warn { color: var(--warn-ink); }
.noscript { padding: 16px; }

/* a short laptop screen cannot pin the map page: it scrolls as a document with a fixed map row */
@media (max-height: 760px) and (min-width: 901px) {
  body.page-map { height: auto; }
  .layout { height: 620px; }
}

/* ---------------------------------------------------------------- static pages: clubs/, leagues/, years/, towns/, about */
.page-static .page { max-width: 880px; }
.breadcrumbs { margin: 10px 0 0; font-size: var(--fs-1); color: var(--muted); }
.breadcrumbs a { color: var(--grass-deep); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.static-head { display: flex; gap: 16px; align-items: center; margin: 14px 0 6px; }
.static-head h1 { margin: 0; font-family: var(--display); font-size: var(--fs-5); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.static-head .sub { margin-top: 4px; font-size: var(--fs-1); color: var(--muted); }
.page-static .lead { margin: 6px 0 0; color: var(--muted); max-width: 64ch; }
.page-static .page-head .chips-row { margin-top: 12px; }
.page-static .sec { margin: 18px 0; padding: 16px 18px; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-soft); }
.page-static .sec h2 { margin: 0 0 10px; font-size: var(--fs-3); font-weight: 600; }
.page-static .sec p { margin: 8px 0 0; }
.page-static .sec p:first-child { margin-top: 0; }
.page-static .sec ul, .page-static .sec ol { margin: 8px 0 0; padding-left: 22px; }
.page-static .sec li { margin: 4px 0; }
.page-static .sec p a, .page-static .sec li a { color: var(--grass-deep); font-weight: 600; text-decoration: none; }
.page-static .sec p a:hover, .page-static .sec li a:hover { text-decoration: underline; }
.page-static .sec .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.page-static .sec .kv span { color: var(--muted); }
.page-static .sec .kv b { font-weight: 500; }
.page-static .sec .kv a, .page-static .sec .more-link, .trial .src a { color: var(--grass-deep); font-weight: 600; text-decoration: none; }
.page-static .sec .kv a:hover, .page-static .sec .more-link:hover, .trial .src a:hover { text-decoration: underline; }
.page-static .sec .more-link { display: inline-block; margin-top: 10px; }
.page-static .sec .note, .trial .who, .linklist .note { font-size: var(--fs-1); color: var(--muted); }
.trial { padding: 12px 0; border-top: 1px solid var(--line); }
.trial:first-of-type { padding-top: 0; border-top: 0; }
.trial .when { font-weight: 700; color: var(--ink); }
.trial .what { font-weight: 600; margin-top: 2px; }
.trial .who { margin-top: 2px; }
.trial .who a { color: var(--ink); font-weight: 600; text-decoration: none; }
.trial .who a:hover { color: var(--grass-deep); text-decoration: underline; }
.trial blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--sun); color: var(--text); }
.trial .src { margin-top: 6px; }
.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.linklist li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--line); }
.linklist li:first-child { padding-top: 0; border-top: 0; }
.linklist a { color: var(--ink); font-weight: 600; text-decoration: none; }
.linklist a:hover { color: var(--grass-deep); text-decoration: underline; }
.linklist .dchip { align-self: center; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-row a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); text-decoration: none; font-weight: 500; font-size: var(--fs-1); }
.chips-row a:hover { box-shadow: inset 0 0 0 1px var(--grass); color: var(--grass-deep); }
.page-static .sec .chips-row a { background: var(--ground); }
table.teams { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
table.teams th, table.teams td { text-align: left; padding: 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.teams th { font-size: var(--fs-1); color: var(--muted); font-weight: 500; border-top: 0; }
table.teams th.num, table.teams td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 12px; }
table.teams td a { color: var(--ink); text-decoration: none; }
table.teams td a:hover { color: var(--grass-deep); text-decoration: underline; }
.page-static .day-h { margin: 0 0 10px; }
.foot .links a { margin-right: 14px; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 1180px) { .layout { grid-template-columns: minmax(0, 1fr) 460px; } .grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  body { padding-bottom: 66px; }  /* room for the tab bar */
  body.page-map { height: auto; }
  .bar { position: static; grid-template-columns: 1fr auto; height: 56px; gap: 10px; padding: 0 16px; }  /* brand left, channel and theme right; the nav is the tab bar */
  .tg { width: var(--ctl); padding: 0; justify-content: center; }  /* icon only on a phone's bar */
  .tg span { display: none; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); border-radius: 0; box-shadow: 0 -6px 20px rgba(20, 27, 23, .08); }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; height: 50px; padding: 0; border-radius: var(--r-tile); font-size: var(--fs-1); }
  .nav svg { display: block; width: 22px; height: 22px; }
  .nav a[aria-current="page"] { background: transparent; box-shadow: none; color: var(--grass-deep); }
  .controls { padding: 10px 16px 0; gap: 6px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; -webkit-overflow-scrolling: touch; padding: 2px 0 8px; }  /* a phone scrolls the row; the thin scrollbar says it continues */
  #year { order: -3; } #noChains { order: -2; } #role { order: -1; }  /* year and the chains chip fit the first screen; the role select peeks past the edge */
  .chips::-webkit-scrollbar, .days::-webkit-scrollbar { height: 4px; }
  .chips::-webkit-scrollbar-thumb, .days::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }
  .days { padding: 8px 0 8px; }
  .dayt.empty { min-width: 44px; padding: 0 6px; }  /* a quiet day takes less of the phone's row */
  .dayt.all { position: sticky; left: 0; z-index: 2; margin-right: 4px; }  /* the reset stays in view while the strip scrolls; the next tile's corner clears it at rest */
  .dayt.all::after { content: ""; position: absolute; left: 100%; top: -8px; bottom: -8px; width: 6px; background: var(--ground); }
  .popover { position: fixed; inset: auto 0 0 0; width: auto; max-height: 72vh; overflow: auto; border-radius: 20px 20px 0 0; z-index: 1250; }
  .layout { grid-template-columns: 1fr; height: auto; padding: 10px 16px 12px; }
  .map-wrap { height: 46vh; min-height: 300px; }
  .fab { top: 10px; right: 10px; }
  .legend { display: none; }
  .panel { min-height: 50vh; }
  .panel-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .panel-head .chip.select { width: 100%; }
  .grid { grid-template-columns: 1fr; overflow: visible; padding: 2px 0 12px; }
  .welcome { flex-direction: column; align-items: stretch; margin: 0 0 12px; }
  .detail { position: fixed; inset: auto 0 0 0; height: 78vh; border-radius: 20px 20px 0 0; z-index: 1300; }
  .page { padding: 4px 16px 32px; }
  .page-head { margin: 8px 0 14px; }
  .page-head h1 { font-size: var(--fs-4); }
  .trow { grid-template-columns: 64px 1fr; gap: 12px 14px; padding: 14px; }
  .trow .what, .trow .src { grid-column: 2; }
  .trow .src { text-align: left; }
  .standings th.num:first-of-type, .standings td.num:first-of-type { display: none; }
  .standings th:last-child, .standings td.link { display: none; }
  .standings th, .standings td { padding: 8px 12px; }
  .standings th.pos, .standings td.pos { width: 48px; }
  .day-h, .undated-block summary { font-size: var(--fs-3); }
  .foot { padding: 10px 16px 14px; }
  .static-head h1 { font-size: var(--fs-4); }
  .page-static .sec { padding: 14px; }
  .page-static .sec .kv { grid-template-columns: 1fr; gap: 2px; }
  .page-static .sec .kv span { margin-top: 6px; }
}
@media (pointer: coarse) {  /* fingers: 40px+ controls, 44px zoom buttons */
  .fab button { min-height: 40px; }
  .leaflet-touch .leaflet-bar a, .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
