:root {
  --ink: #0f172a;
  --muted: #475569;
  --bg: #ffffff;
  --surface: #ffffff;
  --alt: #f4f7f5;
  --border: #e2e8f0;
  --accent: #1f6f4a;          /* links, kickers: court green */
  --court: #2f6f4f;
  --court-dark: #24573e;
  --line: rgba(255, 255, 255, 0.45);
  --ball: #d9f04a;
  --ball-ink: #1a2e05;
  --low: #b45309;
  --low-bg: #fef3c7;
  --full: #991b1b;
  --full-bg: #fee2e2;
  --ok: #166534;
  --ok-bg: #dcfce7;
  --placeholder-bg: #fff7d6;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --bg: #0b1220;
    --surface: #111a2e;
    --alt: #0e1728;
    --border: #1f2a40;
    --accent: #86efac;
    --low: #fcd34d;
    --low-bg: #3a2a07;
    --full: #fca5a5;
    --full-bg: #3b1212;
    --ok: #86efac;
    --ok-bg: #0f2e1c;
    --placeholder-bg: #2e2a12;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; padding: 8px 12px; background: var(--bg); }

/* Buttons */
.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}
.button-ball { background: var(--ball); color: var(--ball-ink); }
.button-ball:hover { filter: brightness(0.95); }
.button-disabled {
  background: var(--alt);
  color: var(--muted);
  border: 1px dashed var(--border);
  cursor: default;
}

/* Hero: full-width court behind the heading */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(82vh, 640px);
  display: grid;
  grid-template-rows: auto 1fr;
  color: #fff;
  background: var(--court-dark);
}
.hero-court {
  position: absolute;
  inset: 0;
  background:
    /* service line, centre line, baseline and tramlines */
    linear-gradient(var(--line), var(--line)) 50% 38% / 52% 3px no-repeat,
    linear-gradient(var(--line), var(--line)) 50% 38% / 3px 40% no-repeat,
    linear-gradient(var(--line), var(--line)) 50% 0 / 80% 3px no-repeat,
    linear-gradient(90deg, transparent calc(10% - 1.5px), var(--line) 0 calc(10% + 1.5px), transparent 0,
                           transparent calc(24% - 1.5px), var(--line) 0 calc(24% + 1.5px), transparent 0,
                           transparent calc(76% - 1.5px), var(--line) 0 calc(76% + 1.5px), transparent 0,
                           transparent calc(90% - 1.5px), var(--line) 0 calc(90% + 1.5px), transparent 0) 0 0 / 100% 100% no-repeat,
    linear-gradient(180deg, var(--court) 0%, var(--court-dark) 100%);
  transform: perspective(900px) rotateX(38deg) scale(1.5);
  transform-origin: 50% 0;
}
/* Darken the left and bottom so the heading always reads well over the court (or a photo). */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.15) 60%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0.55) 100%);
}
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 16px;
}
.topbar a { color: inherit; text-decoration: none; }
.brand { font-weight: 800; font-size: 1.1rem; }
.topbar-links { display: flex; gap: 20px; font-weight: 600; }
.topbar-links a:hover { text-decoration: underline; }
.hero-inner {
  position: relative;
  z-index: 1;
  align-self: end;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 16px 56px;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ball);
}
h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.lede { max-width: 40ch; margin: 16px 0 24px; font-size: 1.15rem; color: rgba(255, 255, 255, 0.92); }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--alt); }
.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
h2 { margin: 0; font-size: clamp(1.6rem, 3.5vw, 2.1rem); letter-spacing: -0.01em; line-height: 1.15; }
.section-lede { max-width: 60ch; margin: 10px 0 0; color: var(--muted); }
.note { margin: 18px 0 0; color: var(--muted); }

/* Courses */
#courses-list { margin-top: 28px; }
.courses-empty {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.course {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  border-top: 5px solid var(--court);
  border-radius: var(--radius);
  background: var(--surface);
}
.course-full { border-top-color: var(--border); }
.course-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.course h3 { margin: 0; font-size: 1.3rem; }
.course-dates { margin: 0; font-weight: 600; }
.places {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.places-open { background: var(--ok-bg); color: var(--ok); }
.places-low { background: var(--low-bg); color: var(--low); }
.places-full { background: var(--full-bg); color: var(--full); }
.course-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.course-facts dt { color: var(--muted); font-size: 0.8rem; }
.course-facts dd { margin: 0; font-weight: 600; }
.course .button { align-self: flex-start; margin-top: auto; }

/* How booking works */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--ball);
  color: var(--ball-ink);
  font-weight: 800;
}
.steps h3 { margin: 0 0 6px; font-size: 1.1rem; }
.steps p { margin: 0; color: var(--muted); }

/* Levels */
.levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 28px 0 0;
}
.levels div { padding: 18px 20px; border-left: 4px solid var(--ball); background: var(--alt); border-radius: 0 10px 10px 0; }
.levels dt { font-weight: 700; }
.levels dd { margin: 4px 0 0; color: var(--muted); }

/* Coach */
.coach { display: grid; grid-template-columns: 160px 1fr; gap: 32px; align-items: start; }
.coach-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--court);
  font-size: 3.5rem;
}
.coach-facts { margin: 14px 0 0; padding-left: 20px; }
.placeholder { background: var(--placeholder-bg); border-radius: 6px; padding: 2px 6px; }
ul.placeholder { padding: 10px 10px 10px 30px; }
@media (max-width: 600px) {
  .coach { grid-template-columns: 1fr; }
  .coach-photo { width: 110px; }
}

/* Plain pages (privacy) */
.topbar-plain {
  max-width: none;
  /* Full-width border, contents lined up with the 1040px page column. */
  padding-left: max(16px, calc((100% - 1040px) / 2 + 16px));
  padding-right: max(16px, calc((100% - 1040px) / 2 + 16px));
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.prose { max-width: 720px; padding-top: 32px; padding-bottom: 48px; }
.prose h1 { max-width: none; font-size: 2.2rem; margin: 8px 0 12px; }
.prose h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.draft { display: inline-block; padding: 6px 10px; border-radius: 6px; background: var(--placeholder-bg); font-weight: 600; font-size: 0.9rem; }
.updated { color: var(--muted); margin-top: 28px; }

/* Footer */
.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 28px; }
.footer p { margin: 0; }

/* Buttons used on the booking pages */
.button-primary { background: var(--court); color: #fff; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.button-primary:hover { background: var(--court-dark); }
.button-primary:disabled { opacity: 0.6; cursor: progress; }
.button-secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid currentColor;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.button-large { padding: 14px 26px; font-size: 1.1rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* Panels (status messages) */
.panel { margin: 20px 0; padding: 18px 20px; border-radius: var(--radius); background: var(--alt); border-left: 6px solid var(--court); }
.panel h1 { margin: 0 0 6px; font-size: 1.8rem; }
.panel p { margin: 0; }
.panel-ok { background: var(--ok-bg); border-left-color: var(--ok); }
.panel-warn { background: var(--low-bg); border-left-color: var(--low); }

/* Booking form */
.book { max-width: 760px; padding-top: 28px; padding-bottom: 48px; }
.book > h1 { max-width: none; font-size: 2.2rem; margin: 0 0 8px; }
.form-section { margin: 28px 0 0; padding: 0; border: 0; }
.form-section legend { padding: 0; }
.form-section h2 { font-size: 1.35rem; margin: 0 0 10px; }
.hint { margin: 0 0 10px; color: var(--muted); font-size: 0.95rem; }
.optional { color: var(--muted); font-weight: 400; }
.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; }
.field input, .field select {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  border: 2px solid var(--muted);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
.input-medium { max-width: 240px !important; }
.input-short { max-width: 90px !important; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.field-error { margin: 0 0 6px; color: var(--full); font-weight: 700; }
.has-error { padding-left: 14px; border-left: 5px solid var(--full); }
.has-error input, .has-error select { border-color: var(--full); }
.choice-list { display: grid; gap: 10px; }
.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--court); background: var(--ok-bg); }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--court); flex: none; }
.choice strong { display: block; }
.choice-meta { display: block; color: var(--muted); font-size: 0.95rem; }
.choice-full { opacity: 0.55; cursor: not-allowed; }
.child {
  position: relative;
  margin: 0 0 16px;
  padding: 18px 18px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--alt);
}
.child-title { font-weight: 800; font-size: 1.05rem; padding: 0 6px; }
.remove-child { position: absolute; top: 14px; right: 16px; }
.total-line { font-size: 1.2rem; margin: 0 0 8px; }
.total .placeholder { display: block; width: fit-content; margin: 0 0 16px; }
.error-summary {
  margin: 20px 0;
  padding: 18px 20px;
  border: 4px solid var(--full);
  border-radius: 10px;
}
.error-summary h2 { margin: 0 0 8px; font-size: 1.25rem; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--full); font-weight: 700; }

/* Confirmation */
.summary { margin: 20px 0; border-top: 1px solid var(--border); }
.summary > div { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.summary dt { font-weight: 700; }
.summary dd { margin: 0; }
@media (max-width: 520px) { .summary > div { grid-template-columns: 1fr; gap: 2px; } }
.reference { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15em; letter-spacing: 0.05em; }
.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list li { margin: 0 0 4px; }

/* Coach area */
.coach-main { padding-top: 24px; padding-bottom: 48px; }
.coach-main h1 { max-width: none; font-size: 2rem; margin: 0 0 4px; }
.coach-main h2 { font-size: 1.35rem; margin: 32px 0 8px; }
.muted { color: var(--muted); }
.coach-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.coach-head p { margin: 4px 0 0; }
.coach-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.coach-actions .button { padding: 9px 16px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
table.data .num { text-align: right; white-space: nowrap; }
table.data .actions { white-space: nowrap; }
table.data .actions form { display: block; margin-top: 4px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--alt); color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--low-bg); color: var(--low); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 16px; }
.stats div { padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; }
.stats dt { color: var(--muted); font-size: 0.85rem; }
.stats dd { margin: 2px 0 0; font-size: 1.4rem; font-weight: 800; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.group-card { padding: 14px 16px; border: 1px solid var(--border); border-left: 5px solid var(--ball); border-radius: 10px; }
.group-card h3 { margin: 0 0 6px; font-size: 1rem; }
.group-card li { font-size: 0.95rem; }
details.ended { margin-top: 16px; }
details.ended summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.course-form { max-width: 620px; }
.course-form fieldset { border: 0; padding: 0; }
.radio { display: flex; gap: 10px; align-items: center; margin: 6px 0; font-weight: 400 !important; }
.radio input { width: 20px; height: 20px; accent-color: var(--court); }
.coach-area .topbar-links { align-items: center; font-weight: 400; }

/* Register: printable */
.register th.tick, .register td.tick { width: 52px; text-align: center; border-left: 1px solid var(--border); }
.register-group { break-inside: avoid; }
.register-group h2 { font-size: 1.1rem; }
@media print {
  .no-print, .topbar { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .coach-main { padding: 0; max-width: none; }
  table.data th, table.data td { border-bottom: 1px solid #999; padding: 6px 8px; color: #000; }
  .register td.tick, .register th.tick { border-left: 1px solid #999; }
  .muted { color: #444; }
}
table.data .reference { white-space: nowrap; }
@media (max-width: 600px) {
  .coach-area .topbar-links .muted { display: none; }
  .coach-area .brand { white-space: nowrap; }
}
