/* Friendly, Waze-inspired look: soft surfaces, rounded everything, big touch targets. */
:root {
  --page: #f6f4ef;
  --surface: #ffffff;
  --ink: #1f2328;
  --ink-2: #555a61;
  --muted: #858a90;
  --line: #e7e3da;
  --accent: #2a78d6;
  --play: #0ca30c;
  --okay: #6ea8dc;   /* "Okay" votes: calm blue, between green Great and amber Poor */
  --iffy: #fab219;
  --skip: #d03b3b;
  --play-soft: #e3f5e1;
  --iffy-soft: #fff3d6;
  --skip-soft: #fbe3e1;
  --shadow: 0 2px 10px rgb(40 35 25 / .14);
  --shadow-sm: 0 1px 4px rgb(40 35 25 / .18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #141b23;
    --surface: #1f2833;
    --ink: #eef1f4;
    --ink-2: #b9c3cf;
    --muted: #8793a1;
    --line: #2c3846;
    --accent: #3987e5;
    --play-soft: #1d3a26;
    --iffy-soft: #3b3120;
    --skip-soft: #3d2326;
    --shadow: 0 2px 12px rgb(0 0 0 / .45);
    --shadow-sm: 0 1px 4px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font: 500 15px/1.4 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}
button, input { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- header ---------- */
.top {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface); box-shadow: var(--shadow-sm); position: relative; z-index: 3;
}
.brand { display: flex; align-items: center; gap: 10px; }
.ball {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #f4ff8a, #c9e021 60%, #a9c010);
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .7), var(--shadow-sm);
  position: relative; overflow: hidden;
}
.ball::before, .ball::after {
  content: ""; position: absolute; width: 26px; height: 26px; border: 2px solid #fff; border-radius: 50%;
}
.ball::before { left: -17px; top: 0; }
.ball::after { right: -17px; top: 0; }
h1 { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--page); border-radius: 999px; }
.seg button {
  border: 0; background: transparent; color: var(--ink-2); padding: 7px 14px; border-radius: 999px;
  font-weight: 700; cursor: pointer; transition: background .15s, color .15s;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.toggle { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); font-weight: 700; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s;
}
.toggle .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s;
}
.toggle input:checked + .track { background: var(--play); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- layout ---------- */
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 330px; min-height: 0; }
.layout > * { min-width: 0; }
.mapwrap { position: relative; min-height: 0; }
/* isolation: the map is its own stacking layer, so markers' z-index (used to put
   notable courts on top of each other) can't lift them above the card or legend. */
#map { position: absolute; inset: 0; background: var(--page); isolation: isolate; z-index: 0; }

/* ---------- legend ---------- */
.legend {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  padding: 8px 12px; font-size: 12.5px; max-width: calc(100% - 24px);
}
.legend .title { font-weight: 800; color: var(--ink); }
.legend .bar { height: 8px; border-radius: 4px; margin: 6px 0 3px; width: 180px; max-width: 100%; }
.legend .ends { display: flex; justify-content: space-between; color: var(--ink-2); }
.legend .keys { display: flex; gap: 10px; margin-top: 4px; color: var(--ink-2); flex-wrap: wrap; }
.legend .keys i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* Legend swatches for the weather shading (rain / wind / striped both). */
.legend .sw { display: inline-block; width: 16px; height: 11px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ---------- court markers ---------- */
.court-marker { cursor: pointer; display: flex; flex-direction: column; align-items: center; }
/* Each court: a small tennis court coloured by playability, with its number on a
   white label underneath. Shown at every zoom level. */
.pin {
  display: block; padding: 2px; background: var(--surface); border-radius: 6px; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: transform .12s;
}
.pin svg.court { width: 32px; height: 19px; display: block; }
.pin.school svg.court { width: 26px; height: 16px; }
.lbl {
  display: inline-block; margin-top: 2px; padding: 2px 6px; border-radius: 999px; box-shadow: var(--shadow-sm);
  font-weight: 800; font-size: 12px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: var(--surface); color: var(--ink);
}
.court-marker:hover .pin, .court-marker.selected .pin { transform: scale(1.12); }
.court-marker.selected .pin { border-color: var(--accent); }
.ic { width: 15px; height: 15px; vertical-align: -2px; flex: none; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.ball-dot { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f4ff8a, #c9e021 60%, #a9c010); display: inline-block; }
.facts span { display: inline-flex; align-items: center; gap: 5px; }
.court-marker .nm {
  display: none; margin-top: 3px; padding: 1px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 700;
  background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--ink-2); white-space: nowrap;
}
.show-names .court-marker .nm { display: block; }

/* ---------- court card ---------- */
.card {
  position: absolute; left: 12px; bottom: 12px; z-index: 4; width: 340px; max-width: calc(100% - 24px);
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px 16px;
}
.card .x {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: var(--page); color: var(--ink-2); font-size: 18px; cursor: pointer;
}
.card .head { display: flex; gap: 10px; align-items: center; padding-right: 34px; }
.card .head svg.court { width: 46px; height: 28px; flex: none; }
.card h3 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2; }
.verdict {
  display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; padding: 10px 12px; border-radius: 14px;
}
.verdict.play { background: var(--play-soft); }
.verdict.iffy { background: var(--iffy-soft); }
.verdict.skip { background: var(--skip-soft); }
.verdict .face { font-size: 28px; line-height: 1; }
.verdict strong { font-size: 16px; font-weight: 800; display: block; }
.verdict .score { margin-left: auto; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.verdict .score small { font-size: 12px; color: var(--muted); font-weight: 700; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
/* Court condition from courts.csv, shown above the weather. */
.status { margin: 10px 0 4px; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; color: var(--ink); }
.status.poor { background: var(--iffy-soft); }
.status.closed { background: var(--skip-soft); }
/* Google Maps / Street View buttons. */
.links { display: flex; gap: 8px; margin: 10px 0 2px; }
.links a {
  flex: 1; text-align: center; padding: 7px 10px; border-radius: 999px; background: var(--page);
  color: var(--ink); font-weight: 700; font-size: 13px; text-decoration: none;
}
.links a:hover { background: color-mix(in srgb, var(--accent) 12%, var(--page)); }

/* Court condition votes + comments, at the bottom of the court card. */
.community { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.community .ctitle { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
/* Bar chart: label | bar (share of votes) | count. The whole row is the tap target. */
.vbar {
  display: grid; grid-template-columns: 112px 1fr 26px; align-items: center; gap: 8px; width: 100%;
  border: 2px solid transparent; background: none; color: var(--ink); padding: 3px 6px; border-radius: 10px;
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.vbar:hover { background: var(--page); }
.vbar.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.vbar .vl { font-weight: 700; white-space: nowrap; }
.vbar .vt { height: 10px; border-radius: 5px; background: var(--page); overflow: hidden; }
.vbar .vt i { display: block; height: 100%; border-radius: 5px; min-width: 0; }
.vbar .vn { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.vhint { margin: 2px 6px 0; }
/* Comments, Instagram-style. */
.comments { margin-top: 12px; }
.comments ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 190px; overflow-y: auto; }
.comments li, .comments .add { display: flex; gap: 8px; align-items: flex-start; }
.comments .av {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 13px;
}
.comments .cbody { font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.comments .cbody a { color: var(--muted); }
.comments .empty { margin: 2px 0 6px; }
.comments .add { margin-top: 10px; align-items: center; }
.comments .add input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px;
}
.comments .add button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 800; cursor: pointer; }
.comments .add button:disabled { opacity: .5; }
.community .google {
  width: 100%; border: 0; border-radius: 999px; padding: 9px 12px; margin-top: 10px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 800; font-size: 13.5px;
}
.community .msg { margin-top: 4px; color: var(--ink-2); min-height: 1em; }
.community .acct { margin-top: 6px; }
.community .acct a { color: var(--muted); }
/* The card can now be tall on phones; let it scroll instead of covering the whole map. */
.card { max-height: calc(100% - 24px); overflow-y: auto; }
.facts span { background: var(--page); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 4px; }
.strip div { text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.strip i { display: block; height: 18px; border-radius: 5px; margin-bottom: 3px; }
.strip i.play { background: var(--play); } .strip i.iffy { background: var(--iffy); } .strip i.skip { background: var(--skip); }
.strip .dn { display: block; height: 14px; margin-bottom: 2px; }
.strip .dn svg { width: 13px; height: 13px; display: inline-block; }
.strip .dn.sun { color: #f2a900; }
.strip .dn.moon { color: #7c8da3; }
.best { margin-top: 10px; font-weight: 800; color: var(--ink); }

/* ---------- list ---------- */
.panel { background: var(--surface); overflow-y: auto; padding: 14px 14px 20px; box-shadow: var(--shadow-sm); z-index: 1; }
.panel h2 { font-size: 15px; margin: 2px 4px 10px; font-weight: 800; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li {
  display: grid; grid-template-columns: 50px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 14px; background: var(--page); cursor: pointer; transition: transform .1s;
}
.list li:hover { transform: translateY(-1px); }
.list li:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.list li svg.court { width: 46px; height: 28px; display: block; }
.list .name { font-weight: 800; line-height: 1.2; }
.list .sub { color: var(--ink-2); font-size: 12.5px; }
.list .num { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- time bar ---------- */
/* Big time label + buttons, then a slider whose bar is shaded day/night with hour ticks. */
.timebar {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 18px;
  padding: 10px 16px 8px; max-width: 100vw;
  background: var(--surface); box-shadow: 0 -1px 4px rgb(0 0 0 / .08); position: relative; z-index: 3;
  --day: #ffe3a1; --night: #cbd5e3; --thumb: 24px;
}
@media (prefers-color-scheme: dark) { .timebar { --day: #6e5c2c; --night: #2c3847; } }
.timehead { display: flex; align-items: center; gap: 8px; }
.when { min-width: 170px; text-align: center; }
.when .big { font-size: 19px; font-weight: 800; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums; }
.when .big .live { color: var(--accent); }
.round, .nowbtn {
  border: 0; background: var(--page); color: var(--ink); height: 38px; min-width: 38px;
  border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 18px;
}
.nowbtn { padding: 0 16px; font-size: 14px; background: var(--accent); color: #fff; }
.nowbtn[aria-pressed="true"] { opacity: .55; }

.slider { position: relative; height: 46px; }
.slider .track {
  position: absolute; top: 9px; height: 10px; border-radius: 5px;
  left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2);
}
.slider input {
  position: absolute; inset: 0 0 auto 0; width: 100%; height: 28px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.slider input::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.slider input::-moz-range-track { height: 28px; background: transparent; }
.slider input::-webkit-slider-thumb {
  -webkit-appearance: none; width: var(--thumb); height: var(--thumb); margin-top: 2px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff; box-shadow: var(--shadow);
}
.slider input::-moz-range-thumb {
  width: var(--thumb); height: var(--thumb); border-radius: 50%; box-sizing: border-box;
  background: var(--accent); border: 3px solid #fff; box-shadow: var(--shadow);
}
.slider input:focus-visible::-webkit-slider-thumb { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.ticks { position: absolute; left: 0; right: 0; top: 26px; height: 18px; }
.ticks span {
  position: absolute; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.ticks span.day { color: var(--ink-2); font-weight: 800; }
.ticks span::before {
  content: ""; position: absolute; left: 50%; top: -7px; width: 1px; height: 5px; background: var(--muted);
}

/* MapLibre controls, softened */
.maplibregl-ctrl-group { border-radius: 14px !important; box-shadow: var(--shadow) !important; overflow: hidden; }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* ---------- accounts: header button, sign-in dialog, profile ---------- */
.acct-btn {
  display: inline-flex; align-items: center; gap: 7px; border: 0; cursor: pointer; font-weight: 800;
  background: var(--accent); color: #fff; border-radius: 999px; padding: 7px 16px; min-height: 36px;
}
.acct-btn:has(.av) { background: var(--page); color: var(--ink); padding: 4px 12px 4px 4px; }
.av {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 13px;
}
.av.lg { width: 52px; height: 52px; font-size: 22px; }
dialog.acct {
  width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0;
  border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
dialog.acct::backdrop { background: rgb(15 20 25 / .45); }
#acctBody { padding: 22px 22px 18px; }
.acct .x {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: var(--page); color: var(--ink-2); font-size: 18px; cursor: pointer;
}
.acct h2 { margin: 0 36px 2px 0; font-size: 21px; font-weight: 800; }
.acct h3 { margin: 18px 0 6px; font-size: 14px; font-weight: 800; }
.acct .sub { margin: 0 0 14px; }
.acct .note { background: var(--iffy-soft); border-radius: 12px; padding: 9px 12px; margin-bottom: 12px; font-size: 13.5px; }
.acct form { display: flex; flex-direction: column; gap: 10px; }
.acct label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.acct input:not([type="checkbox"]) {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 16px; /* 16px stops iOS zooming in */
  background: var(--surface); color: var(--ink); font-weight: 600;
}
.acct input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.acct a { color: var(--accent); font-weight: 700; }
.acct .forgot { align-self: flex-end; margin-top: -4px; }
.acct button.primary, .acct form.row button {
  border: 0; border-radius: 999px; padding: 11px 16px; background: var(--accent); color: #fff;
  font-weight: 800; cursor: pointer;
}
.acct button:disabled { opacity: .55; cursor: default; }
.acct .msg { min-height: 1.2em; margin-top: 10px; color: var(--ink-2); font-weight: 700; }
.acct .switch { margin-top: 6px; text-align: center; }
.acct .fine { margin-top: 10px; text-align: center; }
.acct .fine a { color: var(--muted); }
/* "Continue with Google": Google's standard button (white, gray outline, the four-colour G). */
.gbtn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px;
  border-radius: 999px; border: 1px solid #747775; background: #fff; color: #1f1f1f; cursor: pointer;
  font: 600 15px/1 Roboto, Nunito, system-ui, sans-serif;
}
.gbtn:hover { background: #f8f9fa; }
.gbtn .g { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) {
  .gbtn { background: #131314; border-color: #8e918f; color: #e3e3e3; }
  .gbtn:hover { background: #1f1f20; }
}
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.phead { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.acct form.row { flex-direction: row; align-items: flex-end; }
.acct form.row label { flex: 1; }
.acct .favs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.acct .favs button {
  width: 100%; display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; text-align: left;
  border: 0; border-radius: 12px; padding: 8px 10px; background: var(--page); color: var(--ink); cursor: pointer; font: inherit;
}
.acct .favs svg.court { width: 40px; height: 24px; display: block; }
.acct .favs b, .acct .favs .muted { display: block; }
.acct .favs .num { font-weight: 800; font-variant-numeric: tabular-nums; }
.acct .stats { margin: 0; }
.acct label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 600; color: var(--ink); cursor: pointer; }
.acct label.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.pfoot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pfoot button { border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 800; cursor: pointer; }
.pfoot .ghost { background: var(--page); color: var(--ink); }
.pfoot .danger { background: none; color: var(--skip); }

/* ---------- favorites ---------- */
.card .fav {
  position: absolute; top: 8px; right: 46px; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: var(--page); color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer;
}
.card .fav.on { color: #e3a500; }
.card .head { padding-right: 80px; }
#favWrap { margin-bottom: 18px; }
.pin { position: relative; }
.fstar {
  position: absolute; top: -8px; left: -7px; font-size: 12px; line-height: 1; color: #e3a500;
  text-shadow: 0 0 2px var(--surface), 0 0 2px var(--surface);
}

/* ---------- court checks: live reports + "likely busy" guesses ---------- */
.ldot {
  position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--surface); box-shadow: var(--shadow-sm);
}
.ldot.full { background: var(--skip); }
.ldot.few { background: var(--iffy); }
.ldot.open { background: var(--play); }
.crowd { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.crowd .ctitle { margin-bottom: 6px; }
.crowd-now, .crowd-guess { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 12px; margin-bottom: 8px; }
.crowd-now.full { background: var(--skip-soft); }
.crowd-now.few { background: var(--iffy-soft); }
.crowd-now.open { background: var(--play-soft); }
.crowd-guess { background: var(--page); }
.crowd-guess.busy b { color: var(--skip); }
.crowd-guess.maybe b { color: #b07a00; }
@media (prefers-color-scheme: dark) { .crowd-guess.maybe b { color: var(--iffy); } }
.crowd a, .toast a { color: var(--accent); font-weight: 700; }
.report { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 12px; padding: 8px 10px; }
.rbtns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 2px; }
.rbtns button {
  border: 0; border-radius: 10px; padding: 9px 4px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm), inset 0 -3px 0 var(--c, var(--line));
}
.rbtns .full { --c: var(--skip); }
.rbtns .few { --c: var(--iffy); }
.rbtns .open { --c: var(--play); }
.crowdtag { font-weight: 800; border-radius: 6px; padding: 0 5px; color: var(--ink); }
.crowdtag.full { background: var(--skip-soft); }
.crowdtag.few { background: var(--iffy-soft); }
.crowdtag.open { background: var(--play-soft); }

/* "At a court?" button, under the zoom buttons. */
.locate {
  position: absolute; top: 84px; right: 10px; z-index: 2; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink); font-weight: 800; font-size: 13px;
  border-radius: 999px; padding: 8px 12px; box-shadow: var(--shadow);
}

/* Small pop-up message along the top of the map. */
.toast {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5;
  width: max-content; max-width: min(440px, calc(100% - 24px));
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 10px 8px 10px 14px; font-size: 13.5px;
}
.toast[hidden] { display: none; }
.toast .tbody { flex: 1; min-width: 0; }
.toast .rbtns { min-width: 260px; }
.toast .tx { flex: none; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 6px; }

@media (max-width: 760px) {
  html, body { height: auto; }
  .layout { flex: none; grid-template-columns: minmax(0, 1fr); grid-template-rows: 62vh auto; }
  .timebar { position: sticky; bottom: 0; z-index: 10; grid-template-columns: minmax(0, 1fr); }
  .timehead { justify-content: space-between; }
  .when { flex: 1; min-width: 0; }
  .card { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; }
  .legend { top: 8px; left: 8px; }
  /* Phones: smaller court icon; the label number stays a readable 11.5px. */
  .pin { padding: 1.5px; }
  .pin svg.court { width: 24px; height: 14px; }
  .pin.school svg.court { width: 20px; height: 12px; }
  .lbl { font-size: 11.5px; padding: 1.5px 5px; margin-top: 1px; }
  /* Phones: account button is just your initial; check-in button sits under the zoom buttons. */
  .acct-btn .who { display: none; }
  .acct-btn:has(.av) { padding: 4px; }
  .locate { top: 78px; right: 8px; }
  .toast { top: 8px; }
}
