/* BallBoy
   Night session: a dark page, one floodlit blue court, and optic-yellow for
   everything that is free to play. Yellow always means "available". */

:root {
  --bg: #0a0e14;
  --panel: #121924;
  --panel-2: #18212f;
  --rule: #263247;
  --text: #eef2f6;
  --muted: #8f9cb2;
  --ball: #e3ff2a;
  --ink: #0a0e14;
  --court: #1747b0;
  --court-soft: #b9cdf5;
  --clay: #e0703f;
  --grass: #4cc27e;
  --hard: #4c86f0;
  --display: "Familjen Grotesk", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Familjen Grotesk", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--body);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  position: sticky; top: 0; z-index: 5;
  background: rgba(10, 14, 20, 0.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand-wrap { font-size: 1.375rem; letter-spacing: -0.02em; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand svg { color: var(--ball); }
.top nav { display: flex; gap: clamp(12px, 3vw, 24px); overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { text-decoration: none; font-size: 0.9375rem; color: var(--muted); padding: 4px 0; white-space: nowrap; }
.top nav a:hover { color: var(--ball); }
.top nav a[aria-current] { color: var(--text); box-shadow: 0 2px 0 var(--ball); }
[hidden] { display: none !important; }

/* ACE times */
.ace { max-width: 1040px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 40px) clamp(24px, 4vw, 40px); }
.ace__head { margin-bottom: 24px; }
.ace__head h2 { font-size: clamp(2.75rem, 10vw, 5.5rem); font-weight: 700; letter-spacing: -0.045em; color: var(--ball); }
.ace__head p { margin: 10px 0 0; max-width: 54ch; color: var(--muted); }
.ace__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 14px; }
.weeks { display: flex; flex-wrap: wrap; gap: 6px; }
.weeks button {
  font: inherit; font-size: 0.9375rem; line-height: 1.2; color: var(--text); cursor: pointer; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; background: none; border: 1.5px solid var(--rule);
}
.weeks button:hover { border-color: var(--muted); }
.weeks button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--ink); font-weight: 600; }
.ace__count { margin: 0; font-size: 1rem; white-space: nowrap; color: var(--muted); }
.ace__sets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 18px; font-size: 0.9375rem; color: var(--muted); }
.weeks__note { font-size: 0.9375rem; color: var(--muted); padding: 8px 0; }
.ace__key { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 18px 0 0; padding: 0; font-size: 0.8125rem; color: var(--muted); }
.key { display: inline-block; width: 22px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -2px; }
.key--city { background: var(--ball); }
.key--out { box-shadow: inset 0 0 0 2px var(--ball); }
.key--none { box-shadow: inset 0 0 0 1px var(--rule); }
.ace__foot { margin: 14px 0 0; font-size: 0.875rem; color: var(--muted); }
.ace__foot .link-btn { color: var(--text); margin-left: 6px; }
.ace-cell.is-open.is-outer { background-color: transparent; color: var(--ball); box-shadow: inset 0 0 0 2px var(--ball); }

/* Loading: a ball bounces while BallBoy fetches */
.loader { display: grid; justify-items: center; gap: 10px; padding: 56px 0 72px; color: var(--muted); font-size: 0.9375rem; }
.loader__stage { position: relative; width: 64px; height: 96px; }
.loader__ball {
  position: absolute; left: 16px; bottom: 6px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ball); transform-origin: 50% 100%;
  animation: bounce 0.42s cubic-bezier(0.5, 0, 1, 0.5) infinite alternate;
}
.loader__shadow {
  position: absolute; left: 14px; bottom: 0; width: 36px; height: 8px; border-radius: 50%;
  background: rgba(227, 255, 42, 0.28); filter: blur(2px);
  animation: shadow 0.42s cubic-bezier(0.5, 0, 1, 0.5) infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(-58px) scale(0.96, 1.04); }
  88% { transform: translateY(0) scale(1, 1); }
  to { transform: translateY(0) scale(1.22, 0.74); }
}
@keyframes shadow { from { transform: scale(0.45); opacity: 0.4; } to { transform: scale(1.15); opacity: 1; } }
.ace-table.is-arriving { animation: arrive 0.4s ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
.ace__count strong { font: 700 2rem/1 var(--display); color: var(--text); margin-right: 4px; font-variant-numeric: tabular-nums; }

.ace-table { width: calc(100% + 12px); border-collapse: separate; border-spacing: 6px; margin: 0 -6px; table-layout: fixed; }
.ace-table thead th { text-align: left; padding: 0 2px 4px; font: 600 clamp(1.125rem, 3.5vw, 1.5rem)/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ace-table thead th:first-child { width: clamp(78px, 14vw, 120px); }
.ace-table tbody th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }
.ace-table td { padding: 0; height: 1px; }
.ace-cell {
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  width: 100%; height: 100%; min-height: 58px; padding: 8px 12px;
  border-radius: 10px; font: inherit; text-align: left; overflow: hidden;
}
.ace-cell.is-open { background-color: var(--ball); color: var(--ink); border: 0; cursor: pointer; transition: transform 0.12s ease; }
.ace-cell.is-open:hover { transform: translateY(-2px); }
.ace-cell.is-open:focus-visible { outline-color: #fff; }
.ace-cell > * { flex-shrink: 0; }
.ace-cell__club { font-weight: 700; font-size: 1rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ace-cell__n, .ace-cell__more { font-size: 0.8125rem; line-height: 1.5; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ace-cell.is-out { border: 1px solid var(--rule); color: #5f6c82; font-size: 0.875rem; }
.ace-cell.is-past { color: #46526a; font-size: 0.875rem; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, 0.03) 6px 8px); }

/* BallBoy, the mascot, next to the Ace times heading */
.ace__top { display: grid; gap: 20px; margin-bottom: 32px; }
.ace__top .ace__head { margin-bottom: 0; }
/* The card runs to the right edge of the Ace-times grid below it. */
.boy { position: relative; display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; }
.boy__art { display: block; width: 100%; height: auto; overflow: visible; margin-right: -14px; position: relative; z-index: 1; }
.boy__card { position: relative; background: var(--panel); border: 1px solid var(--rule); border-radius: 18px; padding: 18px 20px; }
/* Speech-bubble tail from his mouth. The art is centred in .boy; his mouth sits
   15.6px above that centre and 95px from the left. The tail's tip stops just off
   his cheek (144px) and its base covers the card's left border (192px). */
.boy::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  left: 144px; top: calc(50% - 21.6px); width: 48px; height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 30'%3E%3Cpath d='M48 1 Q22 3 1.5 6 Q22 15 48 29' fill='%23121924' stroke='%23263247' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.boy__pick { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 18px; align-items: center; }
.boy__when { margin: 0; }
.boy__when .boy__day { display: block; font-size: 0.875rem; color: var(--text); font-weight: 600; }
.boy__when time { display: block; font: 700 clamp(2.5rem, 7vw, 3.5rem)/0.95 var(--display); letter-spacing: -0.05em; color: var(--ball); font-variant-numeric: tabular-nums; }
.boy__what p { margin: 0; }
.boy__club { font: 600 1.0625rem/1.25 var(--display); }
.boy__court { color: var(--muted); font-size: 0.875rem; margin-top: 2px !important; }
.boy__why { color: #b6c1d2; font-size: 0.875rem; margin: 6px 0 0 !important; }
p.boy__day { margin: 0; font-weight: 600; }
.boy__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; }
.boy__actions .btn { padding: 9px 16px; font-size: 0.875rem; }
.boy__actions .link-btn { font-size: 0.875rem; color: var(--text); }
.boy__controls { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 18px; align-items: end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.boy__field { display: grid; gap: 6px; font-size: 0.8125rem; color: var(--muted); }
.boy__field select {
  -webkit-appearance: none; appearance: none; font: inherit; font-size: 0.9375rem; color: var(--text);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238f9cb2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 8px;
  border: 1px solid var(--rule); border-radius: 999px; padding: 7px 34px 7px 14px; cursor: pointer;
}
/* Yellow up to the ball: --p (0-1) is set from JS; 12px is half the 24px thumb. */
.boy__range { --fill-at: calc(12px + (100% - 24px) * var(--p, 0.5)); -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; }
.boy__range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ball) 0 var(--fill-at, 50%), var(--rule) var(--fill-at, 50%)); }
.boy__range::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ball) 0 var(--fill-at, 50%), var(--rule) var(--fill-at, 50%)); }
.boy__range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border: 0; border-radius: 50%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3CclipPath id='c'%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/clipPath%3E%3Ccircle cx='12' cy='12' r='12' fill='%23e3ff2a'/%3E%3Cpath d='M1.5 3 Q9.5 12 1.5 21 M22.5 3 Q14.5 12 22.5 21' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' clip-path='url(%23c)'/%3E%3C/svg%3E") center / 100% 100%; }
.boy__range::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3CclipPath id='c'%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/clipPath%3E%3Ccircle cx='12' cy='12' r='12' fill='%23e3ff2a'/%3E%3Cpath d='M1.5 3 Q9.5 12 1.5 21 M22.5 3 Q14.5 12 22.5 21' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' clip-path='url(%23c)'/%3E%3C/svg%3E") center / 100% 100%; }
.boy__range:focus-visible { outline: none; }
.boy__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff; }
.boy__range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #fff; }

.boy__eyes { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.boy__ball { transform-box: fill-box; transform-origin: center; }
.boy__ball.is-serving { animation: boy-toss 0.75s cubic-bezier(0.3, 0, 0.3, 1); }
@keyframes boy-toss { 45% { transform: translateY(-36px) rotate(180deg); } 100% { transform: none; } }
.boy__head { transform-box: fill-box; transform-origin: 50% 90%; }
.boy__head.is-serving { animation: boy-nod 0.6s ease-in-out 0.15s; }
@keyframes boy-nod { 40% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } }
.boy__pick.is-in { animation: settle 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@media (max-width: 560px) {
  .boy { grid-template-columns: 1fr; }
  .boy__art { width: 132px; margin: 0 0 -4px 6px; }
  .boy__card { padding: 16px; }
  /* Card sits under him: the tail rises from the card's top edge to just under
     his talking arm, right of his shirt (tip ~100,100), clear of his shoe. */
  .boy::after { left: 96px; top: 98px; width: 30px; height: 56px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 56'%3E%3Cpath d='M4 56 Q7 24 4 1.5 Q15 28 29 56' fill='%23121924' stroke='%23263247' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  .boy__pick { grid-template-columns: 1fr; }
  .boy__controls { grid-template-columns: 1fr; }
}

/* Real vs sample */
.src { display: inline-block; vertical-align: middle; font: 600 0.6875rem/1 var(--body); letter-spacing: 0.02em; padding: 4px 7px; border-radius: 999px; border: 1px dashed currentColor; opacity: 0.75; }
.src--real { border: 0; background: var(--ball); color: var(--ink); opacity: 1; }
.ace-cell { position: relative; }
.ace-cell__src { display: inline-block; vertical-align: 1px; line-height: 1.3; margin-left: 4px; font-weight: 600; font-size: 0.6875rem; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--ball); }
.ace-cell.is-outer .ace-cell__src { background: var(--ball); color: var(--ink); }
.ace-cell.is-open { padding-inline: calc(9% + 14px); }
/* Free times carry the seam of a tennis ball. */
.ace-cell.is-open { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M-3,-12 Q21,50 -3,112 M103,-12 Q79,50 103,112' fill='none' stroke='white' stroke-opacity='.9' stroke-width='4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); background-size: 100% 100%; background-repeat: no-repeat; }
.ace-cell.is-open.is-outer { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M-3,-12 Q21,50 -3,112 M103,-12 Q79,50 103,112' fill='none' stroke='%23e3ff2a' stroke-opacity='.7' stroke-width='4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); }
.ace__legend { margin: 10px 0 0; font-size: 0.8125rem; color: var(--muted); max-width: 80ch; }

/* Second serve: same voice as ACE times, on the dark page */
.serve { max-width: 1040px; margin: 0 auto; padding: clamp(16px, 4vw, 40px) clamp(16px, 4vw, 40px) clamp(24px, 4vw, 40px); }
.serve .ace__head h2 { font-size: clamp(2.25rem, 8vw, 4.25rem); }
.serve .pick--top { padding-top: 4px; }
.serve .pick__time span, .serve .pick__count { color: var(--muted); }
.serve .pick__time .pick__day { color: var(--text); }
.serve .pick__why { color: #b6c1d2; }
.serve .btn--ghost { border-color: var(--rule); color: var(--text); }
.serve .btn--ghost:hover { border-color: var(--muted); }
.serve .empty p { color: var(--muted); }

/* Second serve layout: time, then the big button, on the left */
.pick__left { display: grid; justify-items: start; gap: 18px; }
.btn.btn--serve { font-size: 1.25rem; padding: 18px 36px; }
.btn.btn--serve:active { transform: scale(0.97); }
.pick__left .pick__count { margin: -8px 0 0; }

/* Serve another: the pick lifts away and the next settles in, piece by piece */
.pick--top.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.13s ease-in, transform 0.13s ease-in; }
.pick--top.is-in .pick__time, .pick--top.is-in .pick__body { animation: settle 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.pick--top.is-in .pick__body { animation-delay: 0.07s; }
@keyframes settle { from { opacity: 0; transform: translateY(12px); } }
.serve-dot { display: inline-block; width: 0.6em; height: 0.6em; margin-right: 0.6em; border-radius: 50%; background: var(--ink); vertical-align: 0.05em; }
.is-tossed .serve-dot { animation: toss 0.5s cubic-bezier(0.3, 0, 0.3, 1); }
@keyframes toss { 40% { transform: translateY(-0.75em); } 80% { transform: translateY(0) scale(1.15, 0.85); } }

/* Planner: the floodlit court */
.runoff { padding: clamp(16px, 4vw, 40px) clamp(10px, 4vw, 40px) clamp(24px, 5vw, 56px); }
.court {
  max-width: 1040px; margin: 0 auto;
  background: var(--court); color: #fff;
  border: 3px solid #fff;
  padding: clamp(20px, 4vw, 40px);
}
.court__title { font-size: clamp(1.625rem, 4.5vw, 2.5rem); }
.court__lede { margin: 8px 0 0; color: var(--court-soft); }

.prefs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 32px; margin-top: 28px; }
.prefs fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.prefs legend { padding: 0; margin-bottom: 8px; font-size: 0.875rem; color: var(--court-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: block; padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  font-size: 0.9375rem; line-height: 1.2; white-space: nowrap;
}
.chips label:hover span { border-color: #fff; }
.chips input:checked + span { background: var(--ball); border-color: var(--ball); color: var(--ink); font-weight: 600; }
.chips input:focus-visible + span { outline: 3px solid #fff; outline-offset: 2px; }

.near { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
select {
  font: inherit; color: #fff; background: rgba(10, 14, 20, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.5); border-radius: 999px; padding: 6px 14px;
}
.link-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.field-msg { margin: 8px 0 0; font-size: 0.875rem; color: var(--court-soft); }
.check { display: flex; align-items: center; gap: 10px; align-self: end; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ball); margin: 0; flex: none; }

/* The net divides what you ask for from what BallBoy brings back. */
.prefs__wide { grid-column: 1 / -1; }
.net { position: relative; height: 3px; background: #fff; margin: 32px calc(-1 * clamp(20px, 4vw, 40px)); }
.net::before, .net::after { content: ""; position: absolute; top: -7px; width: 3px; height: 17px; background: #fff; }
.net::before { left: 0; }
.net::after { right: 0; }

/* Picks */
.picks__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 20px; }
.picks__head h2 { font-size: clamp(1.625rem, 4.5vw, 2.5rem); }
.picks__head p { margin: 0; color: var(--court-soft); font-size: 0.9375rem; }

.pick--top { display: grid; grid-template-columns: auto 1fr; gap: 8px clamp(20px, 4vw, 48px); align-items: start; }
.pick__time { margin: 0; font-family: var(--display); line-height: 0.9; }
.pick__time time { display: block; font-size: clamp(3.5rem, 13vw, 7rem); font-weight: 700; color: var(--ball); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.pick__time span { display: block; margin-top: 10px; font-size: 1.125rem; color: var(--court-soft); }
.pick__time .pick__day { margin: 0 0 10px; color: #fff; font-weight: 600; }
.pick__count { margin: 12px 0 0; font-size: 0.875rem; color: var(--court-soft); }
.results { margin-top: 0; }
.found { margin: 0 0 4px; color: var(--court-soft); font-size: 0.9375rem; }
.results .also { margin-top: 10px; }
.pick__body h3 { font-size: clamp(1.375rem, 3.5vw, 2rem); }
.pick__court { margin: 6px 0 0; }
.pick__why { list-style: none; padding: 0; margin: 14px 0 0; color: #dbe6fb; font-size: 0.9375rem; }
.pick__why li { padding-left: 18px; position: relative; }
.pick__why li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--ball); }
.pick__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.btn {
  display: inline-block; font: 600 0.9375rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  padding: 11px 18px; border-radius: 999px; border: 1.5px solid var(--ball);
  background: var(--ball); color: var(--ink);
}
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.btn:hover { filter: brightness(1.08); }
.btn--ghost:hover { border-color: #fff; }

.also { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, 0.3); }
.also li { border-bottom: 1px solid rgba(255, 255, 255, 0.3); }
.also button {
  display: grid; grid-template-columns: 5.5em 1fr auto; gap: 12px; align-items: baseline;
  width: 100%; padding: 12px 0; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
}
.also button:hover .also__club { text-decoration: underline; text-underline-offset: 3px; }
.also__time { font: 600 1.25rem/1 var(--display); color: var(--ball); font-variant-numeric: tabular-nums; }
.also__meta { color: var(--court-soft); font-size: 0.875rem; white-space: nowrap; }

.empty h3 { font-size: 1.5rem; }
.empty p { margin: 8px 0 0; max-width: 56ch; color: #dbe6fb; }

.sample { margin: 28px 0 0; font-size: 0.875rem; color: var(--court-soft); max-width: 70ch; }
.sample strong { color: #fff; font-weight: 600; }

/* Clubs */
.clubs { max-width: 1120px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px) clamp(32px, 6vw, 64px); }
.clubs h2 { font-size: clamp(1.625rem, 4.5vw, 2.5rem); }
.clubs__lede { margin: 8px 0 28px; color: var(--muted); max-width: 64ch; }
.split { display: grid; gap: 32px; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } .map { position: sticky; top: 76px; } }

.map { margin: 0; }
.map svg { display: block; width: 100%; height: auto; border-radius: 14px; background: var(--panel); }
.map figcaption { margin-top: 10px; font-size: 0.8125rem; color: var(--muted); }
.map .water { fill: #0d2342; }
.map .harbour { fill: none; stroke: #0d2342; stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.map .place { font: 12px var(--body); fill: #56637a; }
.map .sea { font: italic 13px var(--body); fill: #3f6190; }
.map .pin { cursor: pointer; }
.map .pin circle { fill: var(--panel); stroke: var(--muted); stroke-width: 1.5; }
.map .pin.has-free circle { fill: var(--ball); stroke: var(--ball); }
.map .pin text { font: 600 12px var(--body); fill: var(--text); paint-order: stroke; stroke: var(--panel); stroke-width: 4; stroke-linejoin: round; }
.map .pin:hover circle, .map .pin:focus-visible circle { stroke: #fff; stroke-width: 3; }
.map .pin:focus-visible { outline: none; }
.map .pin.is-outer circle { stroke-dasharray: 3 3; }
.map .pin.is-outer.has-free circle { fill: transparent; stroke: var(--ball); stroke-dasharray: none; stroke-width: 2.5; }
.map .origin { fill: none; stroke: #fff; stroke-width: 2.5; }

.club-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.club-list li { border-bottom: 1px solid var(--rule); }
.club {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px;
  width: 100%; padding: 16px 8px; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
}
.club:hover { background: var(--panel); }
.club__name { font: 600 1.1875rem/1.2 var(--display); letter-spacing: -0.01em; }
.club__where { color: var(--muted); font-size: 0.875rem; text-align: right; white-space: nowrap; }
.club__courts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.875rem; color: var(--muted); }
.club__status { font-size: 0.875rem; text-align: right; color: #66738a; }
.club__status.is-free { color: var(--ball); font-weight: 600; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: baseline; background: var(--muted); }
.dot--clay { background: var(--clay); }
.dot--hard { background: var(--hard); }
.dot--grass { background: var(--grass); }
.dot--allweather { background: #2fc4c9; }
.dot--indoor { background: transparent; border: 2px solid var(--text); }

.tag { display: inline-block; font-size: 0.8125rem; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--text); border: 1px solid var(--rule); }
.tag--guest { background: var(--ball); border-color: var(--ball); color: var(--ink); font-weight: 600; }

.second__title { font-size: 1.5rem; margin-top: 40px; }
.second__lede { margin: 6px 0 14px; color: var(--muted); font-size: 0.9375rem; }

/* Waiting lists */
.waiting { max-width: 1120px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px); }
.waiting h2 { font-size: clamp(1.625rem, 4.5vw, 2.5rem); }
.waiting__lede { margin: 8px 0 28px; color: var(--muted); max-width: 70ch; }
.waiting__lede span { color: var(--text); }
/* Waiting lists: an overview table; each row opens to the details. */
.waiting__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.wait__head, .wait__row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 3fr) minmax(0, 2.4fr) 20px; gap: 6px 20px; align-items: center; }
.wait__head { padding: 0 0 10px; font-size: 0.8125rem; color: var(--muted); }
.wait__head::after { content: ""; }
.wait { border-bottom: 1px solid var(--rule); }
.wait__row { padding: 16px 0; cursor: pointer; list-style: none; }
.wait__row::-webkit-details-marker { display: none; }
.wait__row::after { content: ""; width: 9px; height: 9px; justify-self: end; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform 0.2s; }
.wait[open] .wait__row::after { transform: rotate(-135deg) translateY(-3px); }
.wait__row:hover strong, .wait__row:focus-visible strong { color: var(--ball); }
.wait__row:focus-visible { outline: 2px solid var(--ball); outline-offset: 4px; border-radius: 6px; }
.wait__club { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.wait__club strong { font: 600 1.0625rem/1.25 var(--display); }
.wait__club .tag { font-size: 0.75rem; padding: 2px 8px; }
.wait__cell { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.wait__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wait__sub { display: inline-block; min-width: 6.5em; font-size: 0.8125rem; color: var(--muted); }
.wait__unknown { color: var(--muted); font-style: italic; }
.wait__body { padding: 0 0 20px; max-width: 72ch; }
.wait__body p { margin: 6px 0 0; }
.wait__how { color: #b6c1d2; font-size: 0.9375rem; }
.wait__src { color: var(--muted); font-size: 0.8125rem; }
.wait__src a { color: var(--text); margin: 0 6px; }
@media (max-width: 760px) {
  .wait__head { display: none; }
  .wait__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 20px; }
  .wait__club { grid-column: 1 / 3; }
  .wait__row::after { grid-column: 3; grid-row: 1; }
  .wait__price { grid-column: 1 / 3; }
  .wait__label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-size: 0.75rem; color: var(--muted); }
}
.waiting__missing { margin: 18px 0 0; color: var(--muted); font-size: 0.875rem; max-width: 72ch; }
@media (max-width: 760px) { .wait { grid-template-columns: 1fr; } .wait__club { grid-row: auto; } .wait dl { grid-template-columns: 1fr 1fr; } }

/* Pages: Waiting lists and Alerts share the Ace heading */
.page { max-width: 1040px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 40px) clamp(24px, 4vw, 40px); }
.page .ace__head p span { color: var(--text); }

/* Alerts (design preview) */
.alerts { background: var(--panel); border-radius: 18px; padding: clamp(18px, 4vw, 32px); }
.alerts__preview { margin: 0 0 22px; color: var(--muted); font-size: 0.9375rem; }
.alerts__preview .src { margin-right: 8px; }
.alerts__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px 40px; }
.alerts fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.alerts legend { padding: 0; margin-bottom: 6px; font: 600 1.1875rem/1.2 var(--display); }
.switch { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.switch input { appearance: none; flex: none; width: 44px; height: 26px; margin: 2px 0 0; border-radius: 999px; background: var(--rule); position: relative; cursor: pointer; transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform 0.15s; }
.switch input:checked { background: var(--ball); }
.switch input:checked::after { transform: translateX(18px); background: var(--ink); }
.switch span { color: var(--muted); font-size: 0.9375rem; }
.switch strong { display: block; color: var(--text); font-weight: 600; font-size: 1rem; }
.alerts__email { display: grid; gap: 6px; padding: 12px 0 14px 58px; border-bottom: 1px solid var(--rule); font-size: 0.875rem; color: var(--muted); }
.alerts__email input { font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; max-width: 320px; }
.alerts__buy { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 28px; }
.alerts__price { margin: 0; color: var(--muted); }
.alerts__price strong { font: 700 clamp(2.5rem, 8vw, 3.5rem)/1 var(--display); letter-spacing: -0.04em; color: var(--ball); margin-right: 8px; }
.alerts__msg { margin: 0; flex-basis: 100%; color: var(--text); min-height: 1.5em; }

/* When to check */
.when { max-width: 1120px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px) clamp(40px, 7vw, 80px); }
.when h2 { font-size: clamp(1.625rem, 4.5vw, 2.5rem); }
.when__lede { margin: 8px 0 28px; color: var(--muted); max-width: 64ch; }
.when__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.when__list li { background: var(--panel); border-radius: 14px; padding: 22px; border-top: 3px solid var(--ball); }
.when__list h3 { font-size: 1.1875rem; letter-spacing: -0.01em; }
.when__list p { margin: 10px 0 0; color: #b6c1d2; font-size: 0.9375rem; }
.when__clubs { margin: 20px 0 0; color: var(--muted); font-size: 0.875rem; max-width: 72ch; }

/* Club detail */
dialog {
  width: min(900px, calc(100% - 24px)); max-height: calc(100% - 24px);
  padding: 0; border: 1px solid var(--rule); border-radius: 18px; background: var(--panel); color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(3px); }
.detail { padding: clamp(20px, 4vw, 36px); }
.detail__head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.detail__head h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
.detail__sub { margin: 4px 0 0; color: var(--muted); }
.close { font: inherit; background: none; border: 1.5px solid var(--rule); border-radius: 999px; padding: 6px 14px; cursor: pointer; color: var(--text); flex: none; }
.close:hover { border-color: var(--text); }
.detail__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.detail__note { margin: 14px 0 0; max-width: 68ch; }
.detail h3 { font-size: 1.125rem; margin-top: 28px; letter-spacing: -0.01em; }
.detail__day { margin: 4px 0 12px; color: var(--muted); font-size: 0.875rem; }
.grid-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); padding: 4px; }
.grid { border-collapse: separate; border-spacing: 2px; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.grid th { font-weight: 400; color: var(--muted); padding: 2px 4px; white-space: nowrap; }
.grid thead th { text-align: left; }
.grid tbody th { text-align: left; position: sticky; left: 0; background: var(--bg); color: var(--text); padding-right: 10px; }
.grid td { width: 30px; min-width: 30px; height: 22px; border-radius: 3px; }
.s-free { background: var(--ball); }
.grid td button { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 3px; background: none; cursor: pointer; }
.grid td button:hover, .grid td button:focus-visible, .grid td.is-chosen button { outline: 2px solid #fff; outline-offset: -1px; }
.detail__chosen { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 16px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 10px; }
.detail__chosen p { margin: 0; }
.detail__time { font: 700 1.5rem/1.1 var(--display); color: var(--ball); font-variant-numeric: tabular-nums; }
.s-booked { background: #2c394f; }
.s-past { background: #141b27; }
.s-unreleased { background: #141b27; box-shadow: inset 0 0 0 1px var(--rule); }
.s-closed { background: repeating-linear-gradient(135deg, #121924 0 4px, #1b2534 4px 6px); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--muted); }
.legend i { display: inline-block; width: 16px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.detail__actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.detail__actions small { color: var(--muted); }

/* Footer: quiet and dark. The logo is the header mark, faded into the background. */
.foot { border-top: 1px solid var(--rule); margin-top: clamp(32px, 6vw, 64px); padding: clamp(28px, 5vw, 48px) clamp(16px, 4vw, 40px) 32px; color: var(--muted); font-size: 0.875rem; }
.foot__inner, .foot__base { max-width: 1040px; margin: 0 auto; }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; }
.foot__logo { display: inline-flex; align-items: center; gap: 8px; color: #2c3748; text-decoration: none; font: 700 1.375rem/1 var(--display); letter-spacing: -0.02em; transition: color 0.2s; }
.foot__logo:hover { color: #3d4a5e; }
.foot__brand p { margin: 10px 0 0; max-width: 32ch; }
.foot__nav { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 40px; align-content: start; }
.foot__nav a { color: var(--muted); text-decoration: none; }
.foot__nav a:hover, .foot__nav a:focus-visible { color: var(--ball); }
.foot__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; margin-top: 28px; padding-top: 20px; border-top: 1px solid #1a2230; font-size: 0.8125rem; color: #6b778a; }
.foot__base p { margin: 0; }
.foot__src { max-width: 70ch; }
.foot__src a { color: inherit; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 560px) {
  .pick--top { grid-template-columns: 1fr; }
  .also button { grid-template-columns: 4.5em 1fr; }
  .also__meta { grid-column: 2; }
  .ace-table { width: calc(100% + 8px); border-spacing: 4px; margin: 0 -4px; }
  .ace-cell { padding: 6px 8px; min-height: 52px; }
  .ace-cell__club { font-size: 0.875rem; }
  .ace-cell__n { font-size: 0.75rem; }
  .ace-cell__more, .ace-cell__km { display: none; }
  .ace-cell.is-open { padding-inline: calc(9% + 5px); }
  .ace-cell.is-out, .ace-cell.is-past { font-size: 0.75rem; }
  .weeks button { padding: 7px 11px; font-size: 0.875rem; }
}
@media (prefers-reduced-motion: reduce) { .boy__eyes, .boy__ball.is-serving, .boy__head.is-serving, .boy__pick.is-in { animation: none; } }
@media (prefers-reduced-motion: reduce) { .pick--top.is-in .pick__time, .pick--top.is-in .pick__body, .is-tossed .serve-dot { animation: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .ace-cell.is-open { transition: none; } .ace-table.is-arriving { animation: none; } }
