/* Shared by every sport's pages (docs/<sport>/players-*.html): colors, type, the title bar, buttons and the Filters dropdown.
   The look matches the landing page: a modern, bright atlas. White land on a light blue sea (so the schools' colored
   dots stay easy to see), slate ink and a violet accent; the front page's globe is the deep-blue, green-land version. */

:root {
  --sea: #d9e6fb;
  --land: #ffffff;
  --border: #cbd5e1;
  --panel: #ffffff;
  --line: #e2e8f0;
  --fg: #111827;
  --muted: #64748b;
  --accent: #7c3aed;    /* violet, as on the landing page */
  --accent-soft: rgba(124, 58, 237, .12);
  --focus: #2563eb;
  --shadow: 0 4px 18px rgba(15, 23, 42, .08), 0 1px 3px rgba(15, 23, 42, .08);
  --display: "Plus Jakarta Sans", "Barlow", system-ui, sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --paper-grain: none;
  --page: #f4f6fb;
  --gap: 12px;
}
/* Dark mode: the same atlas at night, in deep navy */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sea: #0b1733; --land: #1e293b; --border: #334155; --panel: #0f172a; --line: #1e293b; --fg: #e5e7eb;
    --muted: #94a3b8; --accent: #a78bfa; --accent-soft: rgba(167, 139, 250, .18); --focus: #60a5fa; --page: #020617;
    --shadow: 0 6px 24px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sea: #0b1733; --land: #1e293b; --border: #334155; --panel: #0f172a; --line: #1e293b; --fg: #e5e7eb;
    --muted: #94a3b8; --accent: #a78bfa; --accent-soft: rgba(167, 139, 250, .18); --focus: #60a5fa; --page: #020617;
    --shadow: 0 6px 24px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { color: var(--fg); font: 15px/1.45 var(--body); }
button, select, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { position: fixed; inset: 0; z-index: 50; background: var(--panel) var(--paper-grain); display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font: 600 19px/1.3 var(--display); padding: 24px; text-align: center; }

/* ---------- title bar ---------- */
/* Cards: clean white panels with a soft shadow */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
}
.bar {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0; pointer-events: none;
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--gap);
  padding: max(var(--gap), env(safe-area-inset-top)) max(var(--gap), env(safe-area-inset-right)) 0 max(var(--gap), env(safe-area-inset-left));
}
.bar > * { pointer-events: auto; }
.brand { padding: 11px 18px 12px; flex: 0 1 auto; max-width: 520px; min-width: 300px; }
h1 { font: 800 clamp(22px, 2.4vw, 31px)/1 var(--display); letter-spacing: .01em; margin: 0; text-transform: uppercase; text-wrap: balance; }
h1 span { color: var(--accent); text-transform: none; letter-spacing: 0; }
h2 { font: 700 18px/1.15 var(--display); text-transform: uppercase; letter-spacing: .04em; margin: 0; text-wrap: balance; }
.sub { color: var(--muted); margin: 4px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.tools { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; flex: 1 1 560px; min-width: 0; margin-left: auto; }   /* stays on the right; every button keeps its name, so the row wraps when it must */
.tools .btn { height: 36px; padding: 0 11px; gap: 5px; font-size: 13px; }
.tools .btn svg { width: 15px; height: 15px; }
.tools .sportpick { width: auto; height: 36px; padding: 0 30px 0 12px; border-radius: 18px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); max-width: 210px; }
/* the strip of maps; it wraps onto its own row and scrolls sideways when it doesn't fit */
.maptabs { order: 9; display: flex; align-items: center; gap: 1px; max-width: 100%; margin-left: auto; padding: 3px 4px; overflow-x: auto; scrollbar-width: none; background: var(--panel); border: 1px solid var(--border); border-radius: 21px; box-shadow: var(--shadow); }
.maptabs::-webkit-scrollbar { display: none; }
.maptabs .grp { flex: none; padding: 0 3px 0 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.maptabs a { flex: none; padding: 6px 10px; border-radius: 16px; font-size: 13px; font-weight: 600; color: inherit; text-decoration: none; white-space: nowrap; }
.maptabs a:hover { background: var(--accent-soft); }
.maptabs a[aria-current] { background: var(--fg); color: var(--panel); }
/* active filters */
.fchips { display: flex; flex-wrap: wrap; gap: 5px; }
.brand .fchips { margin-top: 7px; }
.fchip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 3px 10px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft); color: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; max-width: 100%; }
.fchip span { color: var(--accent); font-size: 14px; line-height: 1; }
.fchip:hover { background: var(--panel); }
/* when nothing matches */
.nomatch { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0 2px; }
.nomatch p { margin: 0; font-size: 14.5px; }
/* tabs inside a page */
.tabset { min-width: 0; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs button { flex: none; padding: 7px 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--fg); }
.tabs .ct { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tabpanel { display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.btn {
  height: 42px; border: 1px solid var(--border); background: var(--panel); border-radius: 21px; padding: 0 16px; cursor: pointer;
  font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
.btn:hover { border-color: var(--fg); }
.btn[aria-expanded="true"] { background: var(--fg); color: var(--panel); border-color: var(--fg); }
.btn svg { width: 17px; height: 17px; flex: none; }
.badge { background: var(--accent); color: var(--panel); border-radius: 999px; font-size: 12px; line-height: 1; padding: 3px 7px; font-variant-numeric: tabular-nums; }
.toast { position: absolute; right: 0; top: calc(100% + 6px); background: var(--fg); color: var(--panel); padding: 6px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; z-index: 40; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 1.5px var(--sw2, transparent); }

/* ---------- panels and the Filters dropdown ---------- */
.panel { position: fixed; z-index: 9; top: calc(var(--bar-h, 76px) + var(--gap)); bottom: var(--gap); width: 350px; display: flex; flex-direction: column; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 20px; }
.panel-body { overflow: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.x { width: 32px; height: 32px; border: 0; background: none; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; color: var(--muted); }
.x:hover { background: var(--accent-soft); color: var(--fg); }
.fwrap { position: relative; }
.panel.pop {
  position: absolute; top: calc(100% + 12px); right: 0; bottom: auto; width: 350px; z-index: 30; overflow: visible;
  max-height: calc(100dvh - var(--pop-top, 70px) - var(--gap));
  transform-origin: var(--caret-x, 90%) 0; animation: pop .14s ease-out;
}
.panel.pop::before {   /* pointer: a rotated square sharing the panel's border */
  content: ""; position: absolute; top: -7px; left: calc(var(--caret-x, 300px) - 7px); width: 12px; height: 12px;
  background: var(--panel); border-left: 1px solid var(--border); border-top: 1px solid var(--border); transform: rotate(45deg); border-radius: 2px 0 0 0;
}
.panel.pop .panel-head { border-radius: 10px 10px 0 0; }
.panel.pop .panel-body { border-radius: 0 0 10px 10px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.group { display: flex; flex-direction: column; gap: 6px; }
.label { font: 600 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.field { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); }
/* dropdowns: our own arrow, a set distance from the edge (the browser's sits right against it, whatever the padding) */
select.field { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer; text-overflow: ellipsis;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--panel); align-self: flex-start; }
.seg button { border: 0; background: none; padding: 7px 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--panel); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--panel); }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.note { color: var(--muted); font-size: 13px; }

/* phones: title on its own row; the dropdown spans the toolbar row */
/* tablets: title and buttons on one row, the maps on the next */
@media (min-width: 761px) and (max-width: 1100px) {
  .tools { display: contents; }
  .brand { flex: 1 1 0; }
  .tools .sportpick { order: 8; }
  .maptabs { flex: 1 1 calc(100% - 200px); min-width: 0; margin-left: 0; }
}
@media (max-width: 760px) {
  :root { --gap: 8px; }
  .brand { padding: 9px 13px; flex: 1 1 100%; max-width: none; }
  .sub { font-size: 12px; }
  .tools { flex: 1 1 100%; }
  .tools .btn { height: 32px; padding: 0 9px; font-size: 12.5px; }
  .tools .sportpick { order: 8; max-width: 132px; }   /* the sport and the maps share a row */
  .maptabs { flex: 1 1 0; min-width: 0; margin-left: 0; }
  .fwrap { position: static; }
  .panel.pop { left: 0; right: 0; width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.tmap { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--sea); min-height: 0; }
.tmap canvas.hot { cursor: pointer; }
.ttip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; font-size: 13px; line-height: 1.35; box-shadow: var(--shadow); white-space: nowrap; font-variant-numeric: tabular-nums; z-index: 2; }
.sel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sel-head h2 { font-size: 24px; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.tl li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 14px; border-radius: 4px; }
.tl li.hl { background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
button.nmb:hover { border-bottom-color: var(--fg); }

/* ---------- the pages that scroll (all but the dot map): title bar, route maps, side lists ---------- */
body:not(.fullmap) { background: var(--page); }
body:not(.fullmap) .bar { position: static; padding-bottom: 6px; }
body:not(.fullmap) .tools { justify-content: flex-end; }
@media (min-width: 1101px) {
  body:not(.fullmap) .brand { padding: 8px 14px 9px; max-width: 440px; }
  body:not(.fullmap) .brand h1 { font-size: 26px; }
  body:not(.fullmap) .brand .sub { margin-top: 2px; }
}
@media (min-width: 1701px) {
  body:not(.fullmap) .brand { max-width: none; }
  body:not(.fullmap) .brand h1 { white-space: nowrap; }
}
.page { padding: 0 max(var(--gap), env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(var(--gap), env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 10px; }
.head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; min-height: 22px; }
.key { display: inline-flex; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.key svg { vertical-align: middle; margin-right: 5px; }
.tmap canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: default; touch-action: manipulation; }
.ttip .note { font-size: 12px; }
.tside { border: 1px solid var(--line); border-radius: 8px; overflow: auto; overscroll-behavior: contain; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.sel-head .note { margin-top: 3px; }
body:not(.fullmap) .big { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
body:not(.fullmap) .big div { display: flex; flex-direction: column; }
body:not(.fullmap) .big b { font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
body:not(.fullmap) .big b.in { color: var(--in); }
body:not(.fullmap) .big b.out { color: var(--out); }
body:not(.fullmap) .big small { color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 2px; }
body:not(.fullmap) .group h2 { font-size: 18px; }
.tl .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl .nm button { all: unset; cursor: pointer; border-bottom: 1px dotted var(--muted); }
.tl .nm button:hover { border-bottom-color: var(--fg); }
.tl .nm button:focus-visible { outline: 2px solid var(--focus); }
.tl .arrow { color: var(--muted); margin: 0 4px; }
.tl .v { font-variant-numeric: tabular-nums; color: var(--muted); }
.tl .v b { color: var(--fg); font-weight: 600; }
.tl .b { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.tl .b span { display: block; height: 100%; background: var(--bar-c, var(--accent)); }
.tl.in .b span { --bar-c: var(--in); }
.tl.out .b span { --bar-c: var(--out); }
:root { --in: var(--accent); --out: #0284c7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --out: #38bdf8; } }
:root[data-theme="dark"] { --out: #38bdf8; }
.ctl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.ctl > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; max-width: 100%; }
.ctl .row { display: flex; align-items: center; gap: 6px; }
.fine { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }
@media (max-width: 1000px) {   /* "body" so these beat each page's own .tgrid */
  body .tgrid { grid-template-columns: minmax(0, 1fr); height: auto; }
  body .tmap { aspect-ratio: 1.55; }
  body .tside { overflow: visible; }
}
/* the loading bar: it moves until the page is ready */
.loading::after { content: ""; width: 180px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent) 0 0 / 40% 100% no-repeat var(--line); animation: loadbar 1.3s ease-in-out infinite; }
.loading.failed::after { display: none; }
@keyframes loadbar { from { background-position: -60% 0; } to { background-position: 160% 0; } }
