:root {
  --green-900: #0b3d24;
  --green-700: #15693d;
  --green-500: #2a9d5a;
  --ball: #d8ed3a;
  --ball-dark: #c0d520;
  --cream: #faf7ee;
  --club-navy: #001e52;
  --club-blue: #003da5;
  --club-yellow: #ffcb05;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: #d8dde2;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body > main { flex: 1 0 auto; }
body > .site-footer { flex-shrink: 0; }
body > header {
  background: linear-gradient(90deg, var(--club-navy), var(--club-blue));
  color: white;
  padding: 0.4rem 1.5rem 0.4rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 3px solid var(--club-yellow);
}
body > header .brand {
  display: inline-flex; align-items: center;
  text-decoration: none;
}
body > header .brand img {
  height: 64px; width: auto; display: block;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
body > header a { color: white; text-decoration: none; }

.header-nav {
  display: flex; align-items: center; gap: 0.25rem;
  margin-left: 1.75rem;
}
.header-nav a {
  padding: 0.45rem 0.85rem; border-radius: 5px;
  font-size: 0.85rem; font-weight: 600;
  color: rgba(255,255,255,0.85);
  transition: background 0.12s ease, color 0.12s ease;
}
.header-nav a:hover {
  background: rgba(255,255,255,0.1); color: white;
}
.header-nav a.active {
  background: var(--club-yellow); color: var(--club-navy);
}

.admin-status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-left: auto;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  color: white;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
}
.admin-status-dot {
  flex: 0 0 auto;
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--club-yellow);
  box-shadow: 0 0 6px rgba(255,203,5,0.7);
}
.admin-status-text {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
}
.admin-status-label {
  font-size: 0.78rem; font-weight: 500;
  opacity: 0.7;
}
.admin-status-user {
  font-size: 0.85rem; font-weight: 700;
  color: var(--club-yellow);
}
.admin-status-caret {
  font-size: 0.7rem; opacity: 0.7; margin-left: 0.15rem;
  transition: transform 0.15s ease;
}

/* Dropdown wrapper */
.admin-menu {
  position: relative;
  margin-left: auto;
}
.admin-menu > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.admin-menu > summary::-webkit-details-marker { display: none; }
.admin-menu[open] > summary .admin-status-caret { transform: rotate(180deg); }
.admin-menu[open] > summary { background: rgba(255,255,255,0.15); }
.admin-menu-panel {
  position: absolute; right: 0; top: 100%;
  margin-top: 0.5rem;
  background: white; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
  min-width: 14rem;
  padding: 0.35rem 0;
  z-index: 200;
  animation: menu-pop 0.12s ease-out;
}
@keyframes menu-pop {
  from { transform: translateY(-4px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.admin-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 0.55rem 1rem;
  color: var(--ink); text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
}
.admin-menu-item:hover { background: var(--cream); color: var(--green-700); }
.admin-menu-sep {
  border: 0; border-top: 1px solid var(--line); margin: 0.3rem 0;
}
.admin-menu-form { margin: 0; padding: 0; }
.admin-menu-logout { color: #b03030; }
.admin-menu-logout:hover { background: #fce8e8; color: #b03030; }

.admin-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: 999px; padding: 0.52rem 1.1rem;
  letter-spacing: 0.01em; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.admin-link span { font-size: 1.2rem; line-height: 1; }
.admin-link:hover {
  background: var(--green-500); color: white; border-color: var(--ball);
  box-shadow: 0 4px 14px rgba(216,237,58,0.25);
  transform: translateY(-1px);
}
.admin-link:focus-visible {
  outline: 2px solid var(--ball); outline-offset: 3px;
}
.admin-link:active { transform: translateY(0); }
@media (max-width: 640px) {
  body > header { padding: 0.3rem 1rem 0.3rem 1.5rem; }
  body > header .brand img { height: 48px; }
  .header-nav { margin-left: 0.75rem; gap: 0.1rem; }
  .header-nav a { padding: 0.3rem 0.55rem; font-size: 0.78rem; }
  .admin-status { padding: 0.25rem 0.65rem; gap: 0.4rem; }
  .admin-status-label { display: none; }
  .admin-link { padding: 0.46rem 0.9rem; font-size: 0.84rem; }
  .admin-link span { font-size: 1.12rem; }
}

.login-form .field { padding: 0.6rem 0; }
.login-error {
  background: #fce8e8; color: #8a2424;
  border: 1px solid #f0bdbd; border-radius: 6px;
  padding: 0.6rem 0.85rem; margin: 1rem 1.5rem 0;
  font-size: 0.9rem;
}

/* Standalone fallback login page — looks like a centred modal panel
   on a dimmed backdrop, so wrong-creds / direct hits to /admin/login
   match the dialog experience. */
.login-page {
  min-height: calc(100vh - 80px);  /* roughly viewport minus header */
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(42,157,90,0.10), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(11,61,36,0.08), transparent 60%);
}
.login-card {
  width: 100%; max-width: 26rem;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 64px rgba(11,61,36,0.18);
  overflow: hidden;
}
.admin-link {
  font-size: 0.8rem; opacity: 0.85;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 3px; padding: 0.15rem 0.55rem;
}
.admin-link:hover { background: rgba(255,255,255,0.1); }
main { padding: 1rem 0; }
h2 { margin-top: 0.5rem; }
table { border-collapse: collapse; width: 100%; background: white; }
th, td { padding: 0.4rem 0.6rem; border: 1px solid #e0e3e8; text-align: left; vertical-align: top; }
th { background: #eef2f4; }
input, select, button { font-size: 0.95rem; padding: 0.3rem 0.5rem; }
button { cursor: pointer; }
button.primary {
  background: #1f6f4a; color: white; border: none; padding: 0.5rem 1rem; border-radius: 4px;
}
button.danger {
  background: #b03030; color: white; border: 1px solid #8a2424; padding: 0.4rem 0.9rem; border-radius: 4px;
}
button.danger:hover { background: #8a2424; }
.inline-delete { display: inline; margin-left: 0.5rem; }
.inline-delete button {
  background: none; border: 1px solid #c0c5cc; color: #b03030;
  padding: 0.05rem 0.45rem; border-radius: 3px; font-size: 0.75rem;
}
.inline-delete button:hover { background: #fce8e8; border-color: #b03030; }
.danger-zone {
  margin-top: 2rem; padding-top: 1rem;
  border-top: 1px dashed #d0c0c0;
}
button.link { background: none; border: none; color: #b00; }
form.row-form { display: flex; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }
form.row-form input, form.row-form select { flex: 1 1 6em; }
form.inline { display: inline; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; }
.event-nav { display: flex; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid #d0d4d9; margin-bottom: 1rem; flex-wrap: wrap; }
.event-nav a { color: #1f6f4a; text-decoration: none; }
.event-nav a.active { font-weight: bold; }
.hint { color: #555; font-size: 0.9rem; }
.warn { background: #fff4cc; border-left: 4px solid #c08800; padding: 0.6rem 1rem; margin-bottom: 1rem; }
.unplaced-warn { background: #fdeaea; border-left-color: #c0001f; }
.missing-pairs-warning { margin: 0.75rem 0 0; }
.missing-pairs-warning ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.unplaced-name { color: #c0001f; font-weight: 700; }
.bracket { display: flex; gap: 1.5rem; overflow-x: auto; padding-bottom: 1rem; }
.bracket .round { min-width: 220px; }
.bracket .match {
  background: white; border: 1px solid #d0d4d9; border-radius: 4px;
  padding: 0.4rem 0.6rem; margin-bottom: 0.6rem;
}
.bracket .match.scheduled { border-left: 4px solid #1f6f4a; }
.bracket .entrant { padding: 0.15rem 0; }
.bracket .entrant.winner { font-weight: bold; }
.bracket .meta { color: #666; font-size: 0.8rem; margin-top: 0.3rem; }
table.schedule td { min-width: 9em; }
label { display: block; margin: 0.4rem 0; }
label input, label select { display: block; margin-top: 0.2rem; width: 100%; max-width: 28em; }
.tournament-list { list-style: none; padding: 0; }
.tournament-list li { padding: 0.4rem 0; border-bottom: 1px solid #eee; }
.reg-link {
  display: inline-block; margin-left: 0.5rem;
  background: #1f6f4a; color: white; padding: 0.1rem 0.5rem;
  border-radius: 3px; text-decoration: none; font-size: 0.8rem;
}

/* ── Hero / countdown banner ─────────────────────────────────────────── */
.hero {
  position: relative;
  background:
    radial-gradient(circle at 100% 0%, rgba(216,237,58,0.18), transparent 55%),
    linear-gradient(160deg, rgba(11,61,36,0.72), rgba(21,105,61,0.62)),
    url("/images/FinalTrophyHero.jpg") center / cover no-repeat;
  color: white;
  padding: 3.5rem 2rem 3rem;
  border-radius: 12px;
  margin: 1rem 0 2rem;
  text-align: center;
  box-shadow: 0 12px 30px rgba(11,61,36,0.18);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: none;
}
.hero-cta {
  display: inline-block;
  background: var(--ball); color: var(--green-900);
  padding: 0.85rem 2.1rem; border-radius: 999px;
  font-weight: 800; text-decoration: none;
  letter-spacing: 0.03em; text-transform: uppercase; font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(216,237,58,0.45);
  animation: cta-pulse 2.4s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(216,237,58,0.45); }
  50%      { box-shadow: 0 6px 24px rgba(216,237,58,0.85), 0 0 0 6px rgba(216,237,58,0.12); }
}
.hero-cta:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px rgba(216,237,58,0.7), 0 0 0 8px rgba(216,237,58,0.18);
  background: var(--ball-dark);
  animation-play-state: paused;
}
.hero-cta-closed { animation: none; }
.hero-fireworks {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: inherit;
  clip-path: inset(0 round 12px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
}
.hero-content {
  position: relative;
  z-index: 2;
}
.hero-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.22em;
  opacity: 0.75; font-weight: 600;
}
.hero-name {
  margin: 0.35rem 0 0.4rem;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.05;
}
.hero-dates {
  opacity: 0.85; margin-bottom: 1.5rem; font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.hero-empty .hero-name { font-size: 2rem; }
.countdown {
  display: flex; justify-content: center; gap: 0.6rem;
  margin: 0.5rem 0 1.5rem;
  font-variant-numeric: tabular-nums;
}
.countdown .cd-time {
  display: inline-flex; gap: 0.55rem;
}
.cd-unit {
  display: inline-flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.65rem 0.9rem;
  border-radius: 8px; min-width: 4rem;
}
.cd-unit b {
  font-size: 2.1rem; line-height: 1; font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ball);
}
.cd-unit::after {
  content: attr(data-label);
  font-size: 0.65rem; opacity: 0.75;
  text-transform: uppercase; letter-spacing: 0.15em;
  margin-top: 0.25rem;
}
.countdown.started .cd-time { font-size: 1.5rem; font-weight: bold; color: var(--ball); }

/* ── Coming-up cards ─────────────────────────────────────────────── */
.more-events { margin-bottom: 2.5rem; text-align: center; }
.section-heading {
  display: flex; align-items: center; gap: 1rem;
  margin: 0.5rem 0 1.75rem;
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--green-900);
}
.section-heading::before,
.section-heading::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.section-heading > span {
  display: inline-flex; align-items: center; gap: 0.5rem;
  white-space: nowrap;
}
.event-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, 19rem);
  grid-auto-rows: 1fr;
  justify-content: center;
  gap: 1rem;
}
.event-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.25rem 1.3rem; display: flex; flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  height: 100%;
  overflow: hidden;
}
.event-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green-700) 0%, var(--green-500) 60%, var(--ball) 100%);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.25s ease;
}
.event-card .card-cta { margin-top: auto; }
.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(11,61,36,0.14);
  border-color: var(--green-500);
}
.event-card:hover::before { transform: scaleX(1); }
.event-card h4 {
  margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--green-900);
  font-weight: 800; letter-spacing: -0.01em;
}
.event-card-dates {
  color: var(--muted); font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  margin-top: 0.55rem;
}
.event-badges {
  margin-top: 0.1rem; display: flex; flex-wrap: wrap; gap: 0.3rem;
  justify-content: center;
}
.event-badge {
  background: var(--cream); color: var(--green-700);
  border: 1px solid var(--green-500);
  padding: 0.12rem 0.5rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.event-stat {
  margin-top: 0.7rem; color: var(--muted); font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.event-stat strong { color: var(--ink); font-weight: 700; }
.countdown-small {
  margin-top: 0.85rem;
}
.countdown-small .cd-time { gap: 0.3rem; }
.countdown-small .cd-unit {
  background: var(--green-900); color: white; border: none;
  padding: 0.4rem 0.55rem; min-width: 2.8rem; border-radius: 6px;
}
.countdown-small .cd-unit b {
  color: var(--ball); font-size: 1.1rem;
}
.countdown-small .cd-unit::after {
  font-size: 0.55rem; opacity: 0.85;
}
.card-cta {
  align-self: stretch; margin-top: 1rem; text-align: center;
  background: var(--green-700); color: white; text-decoration: none;
  padding: 0.6rem 1rem; border-radius: 6px; font-size: 0.85rem;
  font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  transition: background 0.15s ease;
}
.card-cta:hover { background: var(--green-900); }

.event-card-link { text-decoration: none; color: inherit; display: block; }
.event-card-link .card-cta { display: block; }
.event-card .dot { color: var(--line); margin: 0 0.15rem; }

/* Placeholder card shown in "Coming up" when there are no upcoming
   tournaments after the next one. Same dimensions as a real card so the
   grid layout doesn't shift, but visually muted (dashed border, no hover). */
.event-card-placeholder {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1.3rem;
}
.event-card-placeholder::before { display: none; }
.event-card-placeholder:hover {
  transform: none; box-shadow: none; border-color: var(--line);
}
.event-card-placeholder h4 {
  color: var(--muted); font-weight: 700; margin: 0 0 0.3rem;
}
.event-card-placeholder .placeholder-msg {
  margin: 0; font-size: 0.85rem;
  max-width: 16rem;
}
.admin-shortcut {
  margin-top: 3rem; text-align: center;
  font-size: 0.85rem; color: var(--muted);
}
.admin-shortcut a {
  color: var(--green-700); text-decoration: none; border-bottom: 1px dotted;
}
.public-page { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
main:has(> .home-page) {
  background:
    linear-gradient(rgba(250,247,238,0.83), rgba(250,247,238,0.87)),
    url("/images/WestHeatonCourtsHeader.jpg") center / cover no-repeat;
}
.hero-empty {
  background:
    radial-gradient(circle at 100% 0%, rgba(216,237,58,0.28), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(42,157,90,0.45), transparent 50%),
    linear-gradient(160deg, var(--green-700) 0%, var(--green-500) 100%);
}
.hero-empty .hero-name {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin-bottom: 0.4rem;
}
.hero-empty .hero-dates {
  max-width: 32rem; margin-left: auto; margin-right: auto;
  font-size: 0.95rem;
}

@media (max-width: 480px) {
  .hero {
    padding: 2.5rem 1.25rem 2.25rem;
  }
}
.date-range { display: flex; gap: 1rem; }
.date-range label { flex: 1; }

.capacity {
  background: white; border: 1px solid #d0d4d9; border-radius: 6px;
  padding: 0.75rem 1rem; margin: 1rem 0;
}
.capacity.warn { background: #fff4cc; border-color: #c08800; }
.capacity h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.capacity-table { margin-top: 0.4rem; }
.capacity-table th, .capacity-table td { padding: 0.25rem 0.6rem; }
.issue { color: #8a5a00; margin: 0.3rem 0 0; }

/* ── Inline date toggles (player unavailability) ─────────────────────── */
.date-toggles {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.4rem; border: 1px dashed #c0c5cc; border-radius: 4px;
  flex: 1 1 100%;
}
.dt-label { font-size: 0.85rem; color: #555; margin-right: 0.3rem; }
.date-toggle {
  background: #f6f7f9; border: 1px solid #c0c5cc; border-radius: 4px;
  padding: 0.2rem 0.5rem; font-size: 0.8rem; cursor: pointer;
}
.date-toggle:hover { background: #e5edea; }
.date-toggle.selected {
  background: #c08800; color: white; border-color: #c08800; font-weight: bold;
}

/* ── Public registration page ───────────────────────────────────────── */
.hero-events {
  margin-top: 1rem;
  display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center;
}
.event-badge.inverted {
  background: rgba(255,255,255,0.12);
  color: white;
  border-color: rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
}
.register-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0; overflow: hidden;
  box-shadow: 0 2px 8px rgba(11,61,36,0.06);
  max-width: 42rem; margin: 0 auto;
}
.form-section {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--line);
}
.form-section:last-of-type { border-bottom: none; }
.form-section h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem; font-weight: 700;
  color: var(--green-900); letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 0.55rem;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.65em; height: 1.65em; border-radius: 999px;
  background: linear-gradient(160deg, var(--green-700) 0%, var(--green-900) 100%);
  color: white; font-size: 0.78em; font-weight: 800;
  box-shadow: 0 2px 6px rgba(11,61,36,0.25);
  flex-shrink: 0;
}
.step-opt {
  margin-left: auto;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
  padding: 0.18rem 0.55rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* One layout primitive for every form row: a label/heading stacked above
   its control with a fixed gap. Used on plain inputs, on the gender pill
   group, and on the team select — same metrics, so columns always align. */
.field {
  display: flex; flex-direction: column;
  gap: 0.3rem;
  margin: 0.5rem 0;
}
.field-label {
  font-size: 0.9rem; font-weight: 500; line-height: 1.3;
  color: var(--ink);
}
.required-marker, .required-note > span { color: #b42318; font-weight: 800; }
.required-note {
  max-width: 42rem; margin: 0.85rem auto -0.35rem; padding: 0 0.15rem;
  color: var(--muted); font-size: 0.78rem; text-align: right;
}
.events-schedule-warning {
  margin: 0.45rem 0 0.8rem; color: #b42318;
  font-size: 0.84rem; line-height: 1.45;
}
/* Polished control styling — applies to any input/select/textarea inside a
   .field wrapper, in any form (register, admin dialogs, modals). Exceptions
   for compact contexts are scoped by .form-inline / .field-inline / .avail-row
   with their own higher-specificity rules. */
.field > input,
.field > select,
.field > textarea {
  width: 100%; max-width: none;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--paper);
  font: inherit; font-size: 0.9rem; font-weight: 500;
  color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field > select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 0.7rem;
  cursor: pointer;
}
.field > input::placeholder { color: #aaa; }
.field > select:hover { border-color: var(--green-500); }
.field > input:focus,
.field > select:focus,
.field > textarea:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(42,157,90,0.15);
}

.register-form .two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  align-items: start;
}
@media (max-width: 520px) {
  .register-form .two-col { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* Gender pill toggle — radios styled as a pair of buttons */
.pill-row {
  display: flex; gap: 0.5rem;
}
.pill {
  position: relative; flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 1rem;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer; user-select: none;
  font-weight: 600; font-size: 0.9rem;
  color: var(--ink);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease,
              box-shadow 0.14s ease, transform 0.08s ease;
}
.pill input {
  position: absolute; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; margin: 0;
}
.pill:hover { background: #eaf3ed; border-color: var(--green-500); }
.pill:has(input:checked) {
  background: linear-gradient(160deg, var(--green-700) 0%, var(--green-900) 100%);
  border-color: var(--green-900); color: white;
  box-shadow: 0 3px 10px rgba(11,61,36,0.18);
}
.pill:has(input:focus-visible) {
  outline: 2px solid var(--green-700); outline-offset: 2px;
}
.pill:active { transform: scale(0.97); }

/* Event-pick checkboxes (cream-tinted panel) */
.event-checks {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1.5rem;
  background: var(--cream); padding: 0.85rem 1rem; border-radius: 8px;
  border: 1px solid var(--line);
}
.event-checks label { margin: 0; }
.register-form .check { display: flex; align-items: center; gap: 0.5rem; }
.register-form .check input { width: auto; margin: 0; }
.register-form .check > span { flex: 1 1 auto; }
.event-fee { margin-left: auto; color: var(--green-700); white-space: nowrap; }
.entry-deal-banner {
  display: flex; align-items: center; justify-content: center; gap: 0.8rem;
  margin: 0.7rem 0 0.85rem; padding: 0.8rem 1rem;
  color: #4f3800;
  background: linear-gradient(135deg, #fff7c7, #ffe78a);
  border: 1px solid #e5bd37; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(151, 104, 0, 0.12);
  text-align: center;
}
.entry-deal-banner span:not(.deal-star) { font-size: 0.9rem; }
.deal-star { color: #c88700; font-size: 1.5rem; line-height: 1; }
@media (max-width: 500px) {
  .entry-deal-banner { gap: 0.45rem; padding-inline: 0.65rem; }
  .deal-star { font-size: 1.15rem; }
  .entry-deal-banner span:not(.deal-star) { font-size: 0.82rem; }
}
.registration-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.65rem; padding: 0.75rem 1rem;
  background: #e8f1ec; color: var(--green-900);
  border: 1px solid var(--green-500); border-radius: 8px;
  font-weight: 700;
}
.registration-total strong { font-size: 1.15rem; }
.registration-confirmation {
  display: grid; gap: 1rem;
  padding: 1.1rem 1.2rem;
}
.confirmation-heading {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  text-align: left;
}
.confirmation-heading > div { display: grid; gap: 0.1rem; }
.confirmation-heading strong { font-size: 1.35rem; }
.confirmation-heading span:not(.confirmation-tick) { font-size: 0.9rem; }
.confirmation-tick {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: rgba(255,255,255,0.22); font-size: 1.35rem; font-weight: 900;
}
.confirmation-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem;
  padding: 0.8rem; border-radius: 8px;
  background: rgba(255,255,255,0.14);
}
.confirmation-summary > div {
  display: grid; align-content: start; justify-items: center; gap: 0.35rem;
  text-align: center;
}
.confirmation-label {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; opacity: 0.82;
}
.confirmation-events {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.confirmation-dates {
  display: grid !important; grid-template-columns: minmax(0, 1fr) !important;
  justify-items: center; gap: 0.3rem;
  width: 100%; margin: 0; padding: 0; list-style: none;
}
.confirmation-dates > li {
  display: block; width: 100%; margin: 0; padding: 0;
  font-weight: 800; text-align: center;
}
.confirmation-events .event-badge { background: white; color: var(--green-900); }
.confirmation-actions { text-align: center; }
@media (max-width: 520px) {
  .confirmation-summary { grid-template-columns: 1fr; }
}
.same-day-warning {
  margin: 0.75rem 0 1rem;
}
.same-day-warning ul {
  margin: 0.4rem 0 0;
}
.schedule-exception-choice {
  padding-top: 0;
}
.schedule-exception-choice .check {
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.75rem;
  background: #fff8e6; border: 1px solid #e9c86d; border-radius: 8px;
  cursor: pointer;
}
.schedule-exception-choice input {
  flex: 0 0 auto; width: 1rem; height: 1rem; margin-top: 0.15rem;
}
.schedule-exception-choice span {
  display: grid; gap: 0.2rem;
}
.schedule-exception-choice small {
  color: var(--muted); font-weight: 400;
}
.player-event-checks { grid-template-columns: 1fr; gap: 0.45rem; }
.player-event-checks .check {
  display: flex; align-items: center; gap: 0.65rem;
  min-height: 2rem; cursor: pointer;
}
.player-event-checks .check[hidden] { display: none; }
.player-event-checks .check input {
  flex: 0 0 auto; width: 1rem; height: 1rem; margin: 0;
  accent-color: var(--green-700);
}
.event-price-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.55rem; margin-top: 1rem;
}
.event-price {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem 0.75rem; background: var(--cream);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.85rem; font-weight: 600;
}
.money-input {
  display: inline-flex; align-items: center; width: 6.2rem;
  background: white; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden;
}
.money-input > span { padding-left: 0.55rem; color: var(--muted); }
.money-input input {
  min-width: 0; width: 100%; padding: 0.4rem 0.45rem 0.4rem 0.2rem;
  border: 0; background: transparent; font: inherit;
}
.money-input:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(42,157,90,0.12); }
.money-input input:focus { outline: none; }
.register-form .actions {
  margin-top: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--cream);
}
.register-cta {
  display: flex; align-items: center; justify-content: center; gap: 0.65rem;
  width: 100%;
  background: linear-gradient(160deg, var(--green-700) 0%, var(--green-900) 100%);
  color: white; border: none;
  padding: 0.95rem 1.5rem; border-radius: 999px;
  font-weight: 700; font-size: 1rem; letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer;
  box-shadow: 0 4px 14px rgba(11,61,36,0.2);
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.register-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(11,61,36,0.28), 0 0 0 4px rgba(42,157,90,0.12);
}
.register-cta .cta-arrow {
  display: inline-block;
  transition: transform 0.18s ease;
  font-size: 1.05em;
}
.register-cta:hover .cta-arrow { transform: translateX(4px); }
.register-cta:disabled,
.register-cta.submitting { transform: none; box-shadow: none; }
.cta-note {
  margin: 0.65rem 0 0; text-align: center;
  font-size: 0.78rem; color: var(--muted);
  letter-spacing: 0.02em;
}
.cta-note::before { content: '💳  '; }
.success {
  background: linear-gradient(160deg, #fff8d8 0%, var(--ball) 100%);
  border: 1px solid var(--ball-dark);
  color: var(--green-900);
  padding: 1.1rem 1.4rem; border-radius: 12px;
  margin-bottom: 1.5rem;
  max-width: 42rem; margin-left: auto; margin-right: auto;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(216,237,58,0.35);
  position: relative;
  text-align: center;
}
.success strong {
  display: block; font-size: 1.25rem;
  margin-bottom: 0.35rem; font-weight: 800;
  letter-spacing: -0.005em;
}
.success::before {
  content: '🎾'; display: block;
  font-size: 1.6rem; margin-bottom: 0.2rem;
}
.success a {
  color: var(--green-900); font-weight: 700;
  text-decoration: underline; text-decoration-color: rgba(11,61,36,0.3);
  text-underline-offset: 3px;
}
.success a:hover { text-decoration-color: var(--green-900); }
.registration-error {
  display: flex; align-items: flex-start; gap: 0.85rem;
  max-width: 42rem; margin: 1.25rem auto;
  padding: 1rem 1.15rem;
  background: #fff5f5; color: #6e2a2a;
  border: 1px solid #e0aaaa; border-left: 4px solid #b03030;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(110,42,42,0.08);
}
.registration-error-icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 1.7rem; width: 1.7rem; height: 1.7rem;
  border-radius: 50%; background: #b03030; color: white;
  font-weight: 800;
}
.registration-error strong { display: block; margin-bottom: 0.15rem; }
.registration-error p { margin: 0.1rem 0; }
.registration-error-help { font-size: 0.82rem; opacity: 0.82; }
.payment-card {
  max-width: 42rem; margin: 1.25rem auto 2rem;
  background: var(--paper); border: 1px solid var(--line);
  border-top: 5px solid var(--ball); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(11,61,36,0.12); overflow: hidden;
}
.payment-card-head {
  padding: 1.35rem 1.5rem 1.1rem; text-align: center;
  background: linear-gradient(160deg, rgba(216,237,58,0.16), rgba(42,157,90,0.08));
}
.payment-card-kicker {
  color: var(--green-700); font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.payment-card-head h3 { margin: 0.2rem 0; color: var(--green-900); font-size: 1.5rem; }
.payment-card-head p { margin: 0.25rem 0 0; }
.payment-breakdown { padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.payment-breakdown > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.3rem 0; font-size: 0.9rem;
}
.payment-breakdown .payment-total {
  margin-top: 0.45rem; padding-top: 0.7rem;
  border-top: 1px solid var(--line); color: var(--green-900); font-size: 1.05rem;
}
.bank-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem;
  margin: 0; padding: 1.15rem 1.5rem;
}
.bank-details > div { min-width: 0; }
.bank-details dt {
  color: var(--muted); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.bank-details dd {
  margin: 0.15rem 0 0; color: var(--green-900); font-weight: 750;
  overflow-wrap: anywhere;
}
.payment-note { margin: 0; padding: 0 1.5rem 1rem; color: var(--muted); font-size: 0.82rem; }
.payment-actions {
  display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 1rem 1.5rem; background: var(--cream); border-top: 1px solid var(--line);
}
@media (max-width: 520px) {
  .payment-card-head, .payment-breakdown, .bank-details { padding-left: 1rem; padding-right: 1rem; }
  .bank-details { grid-template-columns: 1fr; }
  .payment-note { padding-left: 1rem; padding-right: 1rem; }
  .payment-actions { align-items: stretch; }
  .payment-actions .btn { text-align: center; }
}
.back-link {
  max-width: 42rem; margin: 1.25rem auto;
  font-size: 0.9rem;
}
.back-link a { color: var(--green-700); text-decoration: none; }
.back-link a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────────────
   ADMIN — page chrome (page header, panels, tables, buttons, status)
   ───────────────────────────────────────────────────────────────────── */

.admin-page {
  /* Use the full viewport — admin pages have lots of data. */
  padding: 0 1.75rem;
}
@media (max-width: 640px) {
  .admin-page { padding: 0 0.75rem; }
}

.page-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.page-header-text h2 {
  margin: 0; font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.01em; color: var(--green-900);
}
.page-header-text .crumb {
  display: inline-block; margin-top: 0.25rem;
  font-size: 0.8rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.page-header-text .crumb a { color: var(--muted); text-decoration: none; }
.page-header-text .crumb a:hover { color: var(--green-700); }
.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 1.5rem; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.panel-header {
  padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
}
.panel-header > .btn { flex: 0 0 auto; }
.panel-header h3 {
  margin: 0; font-size: 0.85rem; color: var(--green-700);
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700;
}
.panel-body { padding: 1.25rem; }
.panel-body.flush { padding: 0; }
.panel-hint {
  margin: 0;
  padding: 0.55rem 1.25rem;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem; color: var(--muted);
}

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid transparent; border-radius: 6px;
  padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
  white-space: nowrap; font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--green-700); color: white; border-color: var(--green-700);
}
.btn-primary:hover { background: var(--green-900); border-color: var(--green-900); }
.btn-secondary {
  background: white; color: var(--green-700); border-color: var(--green-500);
}
.btn-secondary:hover { background: var(--cream); border-color: var(--green-700); }
.btn-ghost {
  background: transparent; color: var(--muted); border-color: var(--line);
}
.btn-ghost:hover { background: var(--cream); color: var(--ink); }
.btn-danger {
  background: white; color: #b03030; border-color: #e6cccc;
}
.btn-danger:hover { background: #fdebeb; border-color: #b03030; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn-xs {
  padding: 0.15rem 0.5rem; font-size: 0.72rem;
  border-radius: 4px; font-weight: 600;
}
.btn-row {
  background: none; border: none;
  cursor: pointer; padding: 0.25rem 0.4rem; font-size: 1rem;
  border-radius: 4px; line-height: 1;
  color: #b03030;
}
.btn-row:hover { background: #fce8e8; }
/* Row action buttons (edit pencil + delete bin) sit side-by-side at the
   start of the row. The form wrapping the delete button uses display:contents
   so the button itself acts as the flex item — no stray form-box artifacts. */
.row-actions { display: flex; align-items: center; gap: 0.25rem; }
.row-actions > form { display: contents; }
.btn-edit { color: var(--green-700); }
.btn-edit:hover { background: #eaf3ed; }
.btn-delete:hover { background: #fce8e8; }

.status {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.status::before {
  content: ''; width: 0.45rem; height: 0.45rem; border-radius: 50%;
}
.status-upcoming { background: #e5f1ea; color: var(--green-700); }
.status-upcoming::before { background: var(--green-700); }
.status-live { background: #fff7cc; color: #8a5a00; }
.status-live::before { background: #d4a300; box-shadow: 0 0 6px #d4a300; animation: pulse 1.6s ease-in-out infinite; }
.status-finished { background: #ececec; color: var(--muted); }
.status-finished::before { background: var(--muted); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.4); }
}

.admin-table {
  width: 100%; border-collapse: collapse; background: var(--paper);
}
.admin-table th, .admin-table td {
  padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top;
  font-size: 0.9rem;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--cream); }
.admin-table th {
  background: #f7f9f8;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table td.shrink { width: 1%; white-space: nowrap; }
.admin-table .empty {
  text-align: center; color: var(--muted); padding: 1.5rem; font-style: italic;
}

/* Horizontal-scroll wrapper for wide admin tables — keeps columns at a
   readable width when the panel gets narrow rather than line-wrapping. */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll > .admin-table { min-width: 44rem; }
.table-scroll.tight > .admin-table { min-width: 30rem; }

/* Re-style our common form bits for admin context */
.form-inline {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end;
  padding: 0.85rem 1.25rem; background: var(--cream); border-top: 1px solid var(--line);
}
.form-inline input, .form-inline select {
  padding: 0.45rem 0.6rem; border: 1px solid var(--line);
  border-radius: 5px; font-size: 0.85rem; font-family: inherit;
  background: white;
}
.form-inline input:focus, .form-inline select:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 2px rgba(42,157,90,0.12);
}
.form-inline > label {
  display: flex; flex-direction: column; font-size: 0.7rem;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; gap: 0.25rem;
}
.form-inline > label input, .form-inline > label select {
  font-size: 0.85rem; font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--ink); margin: 0;
}

/* ── Modal dialog ───────────────────────────────────────────────── */
dialog.modal {
  border: none;
  padding: 0;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  max-width: 38rem;
  width: calc(100vw - 2rem);
  max-height: calc(100vh - 4rem);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  animation: modal-pop 0.18s ease-out;
}
dialog.modal-narrow {
  max-width: 26rem;
}
dialog.modal[open] {
  display: flex; flex-direction: column;
}
dialog.modal::backdrop {
  background: rgba(11,61,36,0.55);
  backdrop-filter: blur(4px);
  animation: modal-fade 0.18s ease-out;
}
@keyframes modal-pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0)   scale(1);    opacity: 1; }
}
@keyframes modal-fade {
  from { opacity: 0; } to { opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: white;
}
.modal-header h3 {
  margin: 0; font-size: 1.05rem; color: var(--green-900);
  font-weight: 800; letter-spacing: -0.01em;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1;
  color: var(--muted);
  padding: 0.1rem 0.55rem; border-radius: 4px;
  transition: background 0.12s ease, color 0.12s ease;
}
.modal-close:hover { background: var(--cream); color: var(--ink); }
dialog.modal .admin-form { overflow-y: auto; }
.confirm-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.95rem; color: var(--ink);
  line-height: 1.5;
}
.confirm-body .confirm-message { margin: 0; }

/* Inline error banner inserted into dialog forms on AJAX validation failure. */
.dialog-error {
  margin: 1rem 1.5rem 0;
  padding: 0.7rem 0.9rem;
  background: #fce8e8; color: #8a2424;
  border: 1px solid #f0bdbd; border-radius: 6px;
  font-size: 0.9rem; font-weight: 500;
  display: flex; align-items: flex-start; gap: 0.45rem;
}
.dialog-error::before { content: '⚠'; }

/* Tournament cards on admin home */
.t-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 24rem));
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.t-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.1rem 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 0.85rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.t-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(11,61,36,0.1); }
.t-card.status-finished { opacity: 0.85; }
.t-card.status-live { border-left: 4px solid #d4a300; }
.t-card-head { display: flex; flex-direction: column; gap: 0.3rem; }
.t-card-head h3 {
  margin: 0; font-size: 1.2rem; font-weight: 800;
  letter-spacing: -0.01em;
}
.t-card-head h3 a { color: var(--green-900); text-decoration: none; }
.t-card-head h3 a:hover { color: var(--green-700); }
.t-card-dates {
  color: var(--muted); font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.t-card-body {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
  padding: 0.6rem 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
}
.t-card-stat { text-align: center; }
.stat-value {
  font-size: 1.5rem; font-weight: 800; color: var(--green-900);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.stat-label {
  font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.15rem;
}
.t-card-events { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.t-card-actions {
  display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 0.85rem;
}
.t-card-delete { display: inline; margin-left: auto; }

.empty-state {
  grid-column: 1 / -1;
  background: var(--paper); border: 1px dashed var(--line); border-radius: 10px;
  padding: 2.5rem 1.5rem; text-align: center;
}
.empty-state h3 { margin: 0 0 0.4rem; color: var(--green-900); font-weight: 700; }
.empty-state p { margin: 0; color: var(--muted); }

/* Admin form (panel-based) */
.admin-form { display: flex; flex-direction: column; }
.admin-form .field { margin: 0; }
.admin-form .field-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}

/* Vertical rhythm between fields inside a form-section */
.admin-form .form-section > * + * { margin-top: 0.9rem; }

.new-tournament-panel .panel-header {
  flex-direction: column; align-items: flex-start; gap: 0.25rem;
}
.panel-header-hint {
  font-size: 0.85rem; color: var(--muted); font-weight: 500;
  text-transform: none; letter-spacing: 0;
}

.form-section {
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.form-section:last-of-type { border-bottom: none; }
.form-section-title {
  margin: 0 0 0.9rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--green-700); font-weight: 700;
}
.form-section-hint {
  margin: -0.4rem 0 0.9rem; color: var(--muted); font-size: 0.85rem;
}

.form-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--cream);
  border-top: 1px solid var(--line);
}
.btn-lg { padding: 0.7rem 1.5rem; font-size: 0.95rem; }

/* Event toggles — chip-style buttons that act like checkboxes */
.event-toggles {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.event-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: white; border: 2px solid var(--line);
  padding: 0.55rem 1rem; border-radius: 999px;
  cursor: pointer; user-select: none;
  font-size: 0.85rem; font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.event-toggle:hover { border-color: var(--green-500); color: var(--green-700); }
.event-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.event-toggle::before {
  content: ''; display: inline-block;
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 2px solid var(--line); background: white;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.event-toggle:has(input:checked) {
  background: var(--green-700); color: white; border-color: var(--green-700);
}
.event-toggle:has(input:checked)::before {
  background: var(--ball);
  border-color: var(--ball);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M2 7 L6 11 L12 3' stroke='%230b3d24' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: center;
}

/* Tournament detail page */
.t-summary {
  margin-top: 0.5rem; color: var(--muted);
  font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
}
.t-summary .dot { opacity: 0.5; }
.t-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.t-summary-events { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }

.page-header-text h2 .status { vertical-align: middle; margin-left: 0.65rem; font-size: 0.65rem; }

.tab-nav {
  display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.35rem; margin-bottom: 1.5rem;
}
.tab-nav-sticky {
  position: sticky; top: 0.5rem; z-index: 20;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(11,61,36,0.08);
}
.tab-nav a {
  flex: 0 1 auto;
  padding: 0.6rem 0.85rem; border-radius: 5px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.85rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.tab-nav a:hover { background: var(--cream); color: var(--green-700); }
.tab-nav a.active { background: var(--green-700); color: white; }
.tab-nav .count {
  display: inline-block; margin-left: 0.4rem;
  background: rgba(0,0,0,0.06); color: inherit;
  padding: 0 0.45rem; border-radius: 999px; font-size: 0.75em;
}
.tab-nav a.active .count { background: rgba(255,255,255,0.2); }
.tab-spacer { flex: 1; }
.tab-jump {
  font-weight: 500 !important;
  font-size: 0.78rem !important;
  color: var(--muted) !important;
  border-left: 1px solid var(--line);
  border-radius: 0 !important;
  padding: 0.5rem 0.85rem !important;
}
.tab-jump:hover { color: var(--green-700) !important; background: transparent !important; }
.tab-nav .tab-jump + .tab-jump { border-left: 1px solid var(--line); }
section[id] { scroll-margin-top: 4.5rem; }

.capacity-panel .capacity-headline {
  font-size: 0.85rem; color: var(--muted); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.capacity-headline .ok { color: var(--green-700); font-weight: 700; }
.capacity-headline .short { color: #b03030; font-weight: 700; }
.capacity-panel.warn { border-left: 4px solid #c08800; }
.issues-block {
  padding: 0.85rem 1.25rem; background: #fff8e1;
  border-top: 1px solid var(--line);
}
.issue { margin: 0.2rem 0; color: #8a5a00; font-size: 0.88rem; }

.two-panel {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem;
}
@media (max-width: 900px) {
  .two-panel { grid-template-columns: 1fr; }
}

.gender-pill {
  display: inline-block; padding: 0.05rem 0.5rem;
  border-radius: 999px; font-weight: 700; font-size: 0.7rem;
}
.gender-pill.g-M { background: #d6e8f5; color: #15466e; }
.gender-pill.g-F { background: #f5d8e7; color: #7a2154; }

/* Player row: gender pill + name + optional seed badge inline */
.players-table .player-id {
  display: flex; align-items: center; gap: 0.45rem;
  flex-wrap: wrap;
}
.players-table .player-id strong { font-weight: 700; }
.players-panel-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.players-panel-actions .btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 8.75rem; min-height: 36px; box-sizing: border-box;
  padding: 0.4rem 0.3rem; font-size: 0.75rem; white-space: nowrap;
}
.player-tools {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: var(--cream);
}
.pair-tools {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: var(--cream);
}
.pair-search { flex-basis: 13rem; width: 13rem; }
.player-search {
  display: flex; align-items: center; gap: 0.35rem; flex: 0 1 16rem;
  width: 16rem; max-width: 100%; min-height: 36px;
  padding: 0.25rem 0.55rem; border: 1px solid var(--line);
  border-radius: 7px; background: var(--paper); color: var(--muted);
}
.player-search:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 2px rgba(42,157,90,0.12); }
.player-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 0.85rem; }
.player-search input::placeholder { font-size: 0.8rem; }
.player-event-filter select {
  min-height: 36px; padding: 0.35rem 1.8rem 0.35rem 0.6rem;
  border: 1px solid var(--line); border-radius: 7px;
  background-color: var(--paper); color: var(--ink); font-size: 0.8rem;
}
.player-event-filter select:focus {
  border-color: var(--green-500); outline: 0;
  box-shadow: 0 0 0 2px rgba(42,157,90,0.12);
}
.player-search-count { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
@media (max-width: 520px) {
  .players-panel-header { flex-wrap: wrap; padding: 0.8rem 0.85rem; }
  .players-panel-header h3 { flex: 1 0 100%; }
  .players-panel-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .players-panel-actions .btn {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-width: 0; min-height: 40px; box-sizing: border-box;
    padding: 0.45rem 0.3rem; font: inherit; font-size: 0.75rem;
    text-align: center; white-space: nowrap;
  }
  .player-tools { padding: 0.75rem 0.85rem; gap: 0.4rem; }
  .pair-tools { padding: 0.75rem 0.85rem; gap: 0.4rem; }
  .pair-search { flex: 1 1 100%; width: 100%; max-width: none; margin: 0; }
  .player-search {
    flex: 0 1 15rem; width: 82%; max-width: 15rem; min-height: 36px;
    margin: 0 auto; padding: 0.25rem 0.55rem; border-radius: 8px;
  }
  .player-search input { font-size: 16px; }
  .player-search input::placeholder { font-size: 0.8rem; }
  .player-event-filter { flex: 1 1 auto; }
  .player-event-filter select { width: 100%; min-height: 40px; font-size: 16px; }
  .player-search-count { width: 100%; text-align: right; padding-right: 0.15rem; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.payment-status-form { display: inline-flex; margin: 0; }
.payment-stamp {
  appearance: none; padding: 0.2rem 0.48rem; border: 1px dashed #9aa39e;
  border-radius: 4px; background: #fff; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 0.66rem; font-weight: 750; letter-spacing: 0.04em;
  line-height: 1.1; text-transform: uppercase; transform: rotate(-1deg);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.payment-stamp:hover { border-color: var(--green-700); color: var(--green-700); transform: rotate(0deg) scale(1.03); }
.payment-stamp.is-paid {
  border: 2px solid var(--green-700); background: rgba(42,157,90,0.09);
  color: var(--green-700); font-weight: 850;
}
.payment-stamp.is-paid:hover { background: rgba(42,157,90,0.16); }
.seed-badge {
  background: var(--ball); color: var(--green-900);
  font-size: 0.65rem; font-weight: 800;
  padding: 0.1rem 0.4rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* Pair row: two-player layout with team line under each name */
.pairs-table .pair-line {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.pair-player {
  display: flex; flex-direction: column; line-height: 1.25;
}
.pair-player strong { font-weight: 700; }
.pair-team {
  color: var(--muted); font-size: 0.72rem;
  text-transform: none; letter-spacing: 0;
}
.pair-amp { color: var(--muted); font-weight: 700; }

.hcp-badge {
  display: inline-block; min-width: 3.2rem; text-align: center;
  padding: 0.15rem 0.55rem; border-radius: 5px;
  background: var(--cream); border: 1px solid var(--line);
  font-size: 0.78rem; font-weight: 700; color: var(--green-900);
  font-variant-numeric: tabular-nums;
}

.panel-header h3 .count {
  display: inline-block; margin-left: 0.35rem;
  background: var(--cream); color: var(--green-700);
  padding: 0.05rem 0.55rem; border-radius: 999px;
  font-size: 0.85em; font-weight: 800;
}

.action-panel .panel-body, .danger-panel .panel-body { padding: 1.25rem 1.5rem; }
.danger-panel { border-color: #e6cccc; }
.danger-panel .action-title { color: #8a2424; }
.action-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.25rem; flex-wrap: wrap;
}
.action-title { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 700; color: var(--green-900); }
.action-row .hint { margin: 0; max-width: 30rem; }

.muted-suffix {
  color: var(--muted); font-weight: 500; margin-left: 0.4rem;
  font-size: 0.7em; text-transform: lowercase; letter-spacing: 0.05em;
}

/* Bracket view — cascading layout: each round column stretches to the same
   height and distributes its matches evenly with space-around. As each later
   round has half as many matches, they naturally sit centred between the pair
   of earlier-round matches that feed them, producing the classic bracket shape. */
.bracket {
  position: relative;
  display: flex; gap: 3rem;
  align-items: stretch;
  overflow-x: auto; padding: 0.5rem 0.25rem 2rem;
  min-height: 36rem;
}
.bracket .round {
  display: flex; flex-direction: column;
  min-width: 14rem; flex: 0 0 14rem;
}
.round-head {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--green-700); font-weight: 700;
  padding-bottom: 0.45rem; margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.round-count {
  display: block; color: var(--muted); font-weight: 500;
  font-size: 0.65rem; text-transform: none; letter-spacing: 0;
  margin-top: 0.15rem;
}
.round-matches {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  justify-content: space-around;
  gap: 2rem;
}
.pair {
  display: flex; flex-direction: column;
  gap: 0.6rem;
}
.match-wrap {
  position: relative;
  flex: 0 0 auto;
}

/* ── Bracket connector lines (drawn by static/bracket-connectors.js) ──
   The JS injects an absolutely-positioned <svg> as the first child of
   .bracket and draws polylines from each match's right midpoint to its
   next-round successor's left midpoint, bending through the gap. */
.bracket-connectors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bracket .round { position: relative; z-index: 1; }
.bracket .match {
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  margin-bottom: 0;
  overflow: hidden;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
  font-size: 0.82rem;
}
.bracket .match:hover { box-shadow: 0 4px 12px rgba(11,61,36,0.08); }
.bracket .match { position: relative; }
.bracket .match.is-scheduled { border-left: 3px solid var(--green-500); }
.bracket .match.is-done { background: #f6faf6; }
.bracket .entrant {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.32rem 0.55rem;
  font-size: 0.85rem;
}
.bracket .entrant + .entrant { border-top: 1px solid var(--line); }
.bracket .entrant.winner {
  background: rgba(216,237,58,0.18);
  font-weight: 700;
}
.bracket .entrant .seed {
  color: var(--green-700); font-size: 0.7em; margin-right: 0.15rem;
  background: var(--cream); padding: 0 0.25rem; border-radius: 3px;
}
.bracket .entrant .hcp {
  color: var(--muted); margin-left: 0.4rem;
  background: var(--cream); padding: 0 0.3rem; border-radius: 3px;
}
.bracket .entrant .bye { color: var(--muted); font-size: 0.82em; }
.bracket .entrant .tbd { color: var(--muted); font-size: 0.82em; }
.bracket .entrant .tick {
  color: var(--green-700); font-weight: 800;
}
.bracket .meta {
  padding: 0.3rem 0.55rem; border-top: 1px solid var(--line);
  background: #fafafa;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.3rem; flex-wrap: wrap; min-height: 1.6rem;
}
.bracket .meta-when {
  font-size: 0.68rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bracket .match-actions { display: flex; gap: 0.25rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.bracket .match-actions .inline { display: inline-flex; gap: 0.25rem; }

/* Schedule view */
.schedule-day { margin-bottom: 1rem; }
.schedule-day .panel-header h3 {
  font-size: 0.95rem; color: var(--green-900); text-transform: none;
  letter-spacing: 0; font-weight: 800; font-variant-numeric: tabular-nums;
}
.schedule-table .slot-cell {
  text-align: center; font-weight: 700; color: var(--green-700);
  background: var(--cream);
  font-variant-numeric: tabular-nums;
}
.match-pill {
  display: inline-block;
  background: white; border: 1px solid var(--line);
  border-left: 3px solid var(--green-500);
  padding: 0.35rem 0.6rem; border-radius: 4px;
  font-size: 0.82rem; line-height: 1.3;
  cursor: grab;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.match-pill:hover { box-shadow: 0 2px 6px rgba(11,61,36,0.1); }
.match-pill.dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.schedule-cell {
  transition: background 0.1s ease, outline 0.1s ease;
}
.schedule-cell.drag-over {
  background: rgba(216,237,58,0.25) !important;
  outline: 2px dashed var(--green-500);
  outline-offset: -3px;
}
.empty-slot { color: var(--line); font-weight: 700; }

.schedule-drop-error {
  position: sticky; top: 0.5rem; z-index: 30;
  margin: 0 0 1rem;
  padding: 0.7rem 0.95rem;
  background: #fce8e8; color: #8a2424;
  border: 1px solid #f0bdbd; border-radius: 6px;
  font-size: 0.9rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.schedule-drop-error .close-error {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; line-height: 1; color: #8a2424;
}

/* ── Click-from-calendar date picker (.ucal) ─────────────────────── */
.ucal {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem 0.95rem;
  margin: 0.6rem auto 0;
  box-shadow: 0 1px 2px rgba(11, 61, 36, 0.04), 0 4px 12px rgba(11, 61, 36, 0.05);
  position: relative;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}
.ucal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green-700) 0%, var(--green-500) 60%, var(--ball) 100%);
}
.ucal-grid-wrap {
  display: flex; gap: 1.75rem; flex-wrap: wrap;
  justify-content: center;
}
.ucal-month {
  min-width: 17rem;
  max-width: 22rem;
  flex: 0 1 19rem;
}
.ucal-title {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.5rem;
  padding: 0.15rem 0.1rem 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.ucal-title-name {
  font-size: 1.05rem; font-weight: 700; color: var(--green-900);
  letter-spacing: 0.01em;
}
.ucal-title-year { color: var(--muted); font-weight: 500; }
.ucal-title-count {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--green-700);
  background: #e8f1ec; padding: 0.18rem 0.55rem; border-radius: 999px;
}
.ucal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.ucal-dow {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted); text-align: center;
  padding: 0.25rem 0 0.45rem;
}
.ucal-dow.weekend { color: var(--green-700); }
.ucal-blank { visibility: hidden; }

.ucal-day {
  text-align: center;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--ink);
  position: relative;
  transition: background-color 120ms ease, color 120ms ease,
              border-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}
/* non-tournament days — recede */
.ucal-day.disabled {
  color: #c8ccd2;
  font-weight: 400;
}
/* tournament days (clickable) */
button.ucal-day {
  cursor: pointer;
  background: #eaf3ed;
  border-color: #d2e4d9;
  color: var(--green-900);
  font-weight: 600;
}
button.ucal-day.weekend {
  background: #dfeee5;
  border-color: #c1dccd;
}
button.ucal-day:hover {
  background: var(--green-500);
  border-color: var(--green-700);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(21, 105, 61, 0.25);
}
button.ucal-day:focus-visible {
  outline: 2px solid var(--green-700);
  outline-offset: 2px;
}
/* "Today" ring (works for both tournament & non-tournament days) */
.ucal-day.today {
  box-shadow: inset 0 0 0 2px var(--ball-dark);
}
button.ucal-day.today { background: #f3fadf; }
button.ucal-day.today:hover { background: var(--green-500); }
/* Selected = MARKED UNAVAILABLE — red to signal "blocked" */
button.ucal-day.selected {
  background: #b03030;
  border-color: #8a2424;
  color: white;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
button.ucal-day.selected:hover {
  background: #8a2424;
  border-color: #6e1c1c;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(138, 36, 36, 0.3);
}
button.ucal-day.selected.today { box-shadow: inset 0 0 0 2px var(--ball); }
/* Cap reached — clickable but greyed-out look on the rest */
button.ucal-day:disabled {
  background: #f4f5f7;
  border-color: transparent;
  color: #b8bcc2;
  cursor: not-allowed;
  font-weight: 500;
}
button.ucal-day:disabled:hover {
  transform: none; box-shadow: none;
  background: #f4f5f7; color: #b8bcc2;
}

.ucal-chips {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  font-size: 0.85rem;
}
.ucal-counter {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-700);
  background: #e8f1ec;
  padding: 0.25rem 0.65rem; border-radius: 999px;
  margin-right: 0.35rem;
}
.ucal-counter.full {
  color: #8a2424; background: #fce8e8;
}
.chip-unavail {
  background: #fce8e8;
  border-color: #f1c4c4;
  color: #8a2424;
  font-weight: 600;
}
.chip-unavail button { color: #b03030; }
.chip-unavail button:hover { color: #6e1c1c; }
.ucal-chips .hint {
  color: var(--muted); font-style: normal;
}

@media (max-width: 480px) {
  .ucal { padding: 0.85rem 0.7rem 0.8rem; width: auto; }
  .ucal-grid-wrap { gap: 1rem; }
  .ucal-month { min-width: 0; max-width: none; flex-basis: 100%; }
  .ucal-day { font-size: 0.85rem; }
  .ucal-title-count { font-size: 0.65rem; padding: 0.15rem 0.45rem; }
}
.chip {
  background: #eef2f4; border: 1px solid #d0d4d9; border-radius: 999px;
  padding: 0.15rem 0.5rem; display: inline-flex; align-items: center; gap: 0.25rem;
}
.chip button {
  background: none; border: none; color: #777; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0;
}
.chip button:hover { color: #b00; }
.tag {
  display: inline-block;
  background: #eef2f4; border: 1px solid #d0d4d9; border-radius: 3px;
  padding: 0.05rem 0.4rem; font-size: 0.75rem;
  margin-right: 0.2rem; margin-bottom: 0.15rem;
}

/* ── Weekly availability widget ─────────────────────────────────── */
.avail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.6rem;
  align-items: start;
}
.avail-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.65rem 0.55rem;
  background: var(--paper);
}
.avail-day-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.4rem;
}
.avail-day-head strong { font-size: 0.95rem; }
.avail-day-hint {
  font-size: 0.7rem; color: var(--muted);
  margin: 0 0 0.4rem;
}
.avail-rows {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.avail-row-header { display: none; }
.avail-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  grid-template-areas:
    "start end remove"
    "picker picker picker";
  gap: 0.3rem 0.35rem;
  align-items: center;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--line);
}
.avail-row:last-child { border-bottom: none; padding-bottom: 0; }
.avail-row > input[name$="_time"]:not([name$="_end_time"]) { grid-area: start; }
.avail-row > input[name$="_end_time"] { grid-area: end; }
.avail-row > [data-remove-slot] { grid-area: remove; }
.avail-row > .court-picker { grid-area: picker; }
.avail-row input[type="time"],
.avail-row input[type="number"] {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.9rem;
}
.court-picker {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
}
.court-toggle {
  display: inline-flex; align-items: center;
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  min-width: 1.8rem; justify-content: center;
  font-size: 0.78rem;
  cursor: pointer;
  background: #fafafa;
  user-select: none;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.court-toggle input {
  position: absolute; inset: 0;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.court-toggle.on {
  background: #2f6f3e; border-color: #2f6f3e; color: white;
}
.field-inline {
  display: flex; align-items: center; gap: 0.6rem;
  align-self: flex-start;
  margin-bottom: 0.6rem;
}
.admin-form .field.field-inline {
  flex-direction: row;
  align-items: center;
  align-self: flex-start;
}
.admin-form .field.field-inline > .field-label { flex: 0 0 auto; }
.admin-form .field.field-inline > input[type=number] {
  flex: 0 0 5rem; width: 5rem;
}
.field-inline .field-label { white-space: nowrap; }
.field-inline input[type="number"] {
  width: 5rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* ── FAQ / how-to page ──────────────────────────────────────────── */
.faq-page .page-subtitle {
  color: var(--muted); margin: 0.25rem 0 0;
}
.faq-page .panel { max-width: 50rem; }
.faq-steps {
  margin: 0; padding-left: 1.2rem; line-height: 1.55;
}
.faq-steps li { margin-bottom: 0.45rem; }
.faq-steps ul { margin: 0.35rem 0 0.25rem; padding-left: 1.1rem; }
.faq-list dt {
  font-weight: 700; margin-top: 1rem; color: var(--green-900);
}
.faq-list dt:first-child { margin-top: 0; }
.faq-list dd {
  margin: 0.25rem 0 0; line-height: 1.55; color: var(--ink);
}
.faq-page code {
  background: #eef2f4; border: 1px solid #d0d4d9; border-radius: 3px;
  padding: 0.02rem 0.32rem; font-size: 0.85rem;
}

/* ── Registration closed states ─────────────────────────────────── */
.hero-cta-closed {
  background: #b0b0b0; cursor: not-allowed; opacity: 0.85;
}
.hero-sub { margin-top: 0.5rem; color: rgba(255,255,255,0.85); }
.card-cta-closed {
  background: #d3d3d3; color: #555;
}
.closed-banner {
  background: #fff5f5; border: 1px solid #e0aaaa; border-radius: 8px;
  padding: 1.1rem 1.25rem; margin: 1rem 0; color: #6e2a2a;
}
.closed-banner h3 { margin: 0 0 0.4rem; }
.closed-banner p { margin: 0.25rem 0; }
.event-badge[title] { cursor: help; }

/* ── Site footer ────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  padding: 1.35rem 1.5rem 1.5rem;
  border-top: 4px solid var(--club-yellow);
  text-align: center;
  color: rgba(255,255,255,0.72);
  background: linear-gradient(90deg, var(--club-navy), var(--club-blue));
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.site-footer-brand {
  font-weight: 800; color: white; font-size: 1rem;
  letter-spacing: 0.01em;
}
.site-footer-details {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem 0.65rem;
  flex-wrap: wrap; font-size: 0.78rem;
}
.site-footer-details span + span::before { content: '-'; margin-right: 0.65rem; }
.site-footer-details strong { color: rgba(255,255,255,0.9); }

@media (max-width: 520px) {
  .site-footer { padding: 1.2rem 1rem 1.35rem; }
  .site-footer-brand { font-size: 0.92rem; }
  .site-footer-details { flex-direction: column; gap: 0.15rem; }
  .site-footer-details span + span::before { content: none; }
}

/* ── Form validation feedback (events-required) ──────────────────── */
.events-invalid {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 3px rgba(192,57,43,0.15);
}
.events-error {
  color: #c0392b; font-size: 0.85rem; margin: 0.25rem 0 0.5rem;
}

/* ── Email-schedule dialog ──────────────────────────────────────── */
dialog.email-dialog { max-width: 48rem; }
dialog.modal-wide   { max-width: 48rem; }
.email-form .form-section { padding: 1rem 1.5rem; }
.email-form .form-section:first-of-type { padding-top: 1.25rem; }
.email-form .form-section-title {
  margin: 0 0 0.6rem;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--green-700);
}
.email-form .form-section-hint { margin: 0; color: var(--muted); font-size: 0.85rem; }
.email-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit; font-size: 0.9rem;
  resize: vertical;
  min-height: 3rem;
  background: white;
}
.email-preview-section { background: var(--cream); }
.email-preview {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  max-height: 14rem;
  overflow: auto;
  color: var(--ink);
  margin: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
}

/* ── Schedule page enhancements ─────────────────────────────────── */
.schedule-filter {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin: 0.5rem 0 1rem;
  align-items: center;
  justify-content: center;
}
.filter-chip {
  background: white;
  border: 1px solid var(--line);
  color: var(--green-700);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.filter-chip:hover { background: var(--cream); }
.filter-chip.is-on {
  background: var(--green-700); color: white; border-color: var(--green-700);
}
.schedule-cell.is-filtered-out .match-pill,
.schedule-cell.is-filtered-out .match-note {
  opacity: 0.18; pointer-events: none;
}
.schedule-day.is-today {
  border-left: 4px solid var(--ball);
  box-shadow: 0 0 0 1px rgba(216,237,58,0.4), 0 6px 18px rgba(11,61,36,0.08);
}
.today-badge {
  display: inline-block;
  background: var(--ball); color: var(--green-900);
  font-size: 0.7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.15rem 0.55rem; border-radius: 999px;
  margin-left: 0.5rem; vertical-align: middle;
}
.schedule-cell .match-pill {
  cursor: pointer;
}
.match-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.3;
}

/* ── Printable schedule (also applied @media print on the regular page) ── */
.print-page { padding: 1rem 1.5rem; max-width: 60rem; margin: 0 auto; }
.print-page h1 { margin: 0 0 0.25rem; font-size: 1.6rem; }
.print-page .print-subtitle { margin: 0 0 1rem; color: #555; }
.print-page .print-day { page-break-inside: avoid; margin-bottom: 1.75rem; }
.print-page .print-day h2 {
  font-size: 1.15rem; margin: 0.5rem 0 0.5rem;
  padding-bottom: 0.3rem; border-bottom: 2px solid #222;
}
.print-page .print-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.print-page .print-table th, .print-page .print-table td {
  padding: 0.4rem 0.5rem; border: 1px solid #ccc; text-align: left;
  vertical-align: top;
}
.print-page .print-table th {
  background: #f0f0f0; font-weight: 700;
}
.print-page .print-actions {
  margin-bottom: 1rem; display: flex; gap: 0.5rem;
}
@media print {
  .print-actions, .site-footer, header, nav { display: none !important; }
  .print-page { padding: 0; max-width: none; }
  .print-day { page-break-after: always; }
  .print-day:last-child { page-break-after: auto; }
  body { background: white; }
}
.admin-form textarea {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit; font-size: 0.9rem;
  resize: vertical;
  min-height: 4rem;
}
.avail-pill {
  display: inline-block;
  background: #f0f5ee; border: 1px solid #cfdbc9; color: #2c4423;
  border-radius: 999px;
  padding: 0.1rem 0.6rem; font-size: 0.8rem;
  margin: 0.1rem 0.25rem 0.1rem 0;
  font-variant-numeric: tabular-nums;
}
.schedule-cell-unavailable {
  background: repeating-linear-gradient(45deg,
    #f4f4f4, #f4f4f4 6px, #ececec 6px, #ececec 12px);
  border: 1px solid var(--line);
}
/* Make the create-tournament dialog wider to fit the 7 weekday cards */
dialog#create-tournament-dialog,
dialog#edit-availability-dialog {
  max-width: 56rem;
  /*
   * Safari can lose the composited dialog layer when controls are added or
   * toggled inside a scrolling <dialog> whose backdrop is blurred/animated.
   * It presents as a white page until focus moves away. These two large,
   * dynamic availability dialogs use the same dimming without GPU blur or
   * transform animation, avoiding that repaint bug.
   */
  animation: none;
}
dialog#create-tournament-dialog::backdrop,
dialog#edit-availability-dialog::backdrop {
  background: rgba(11,61,36,0.62);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  animation: none;
}

/* ── Submit-celebration overlay (fireworks.js → tennisCelebrate) ─── */
.celebrate-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 61, 36, 0.0);
  transition: background 240ms ease;
  pointer-events: none;
}
.celebrate-overlay.in { background: rgba(11, 61, 36, 0.35); }
.celebrate-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}
.celebrate-banner {
  position: relative;
  background: linear-gradient(160deg, var(--green-700) 0%, var(--green-900) 100%);
  color: white;
  padding: 1.75rem 2.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(216, 237, 58, 0.35),
    0 18px 50px rgba(0, 0, 0, 0.35),
    0 0 80px rgba(216, 237, 58, 0.25);
  transform: scale(0.6) translateY(20px);
  opacity: 0;
  transition: transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 220ms ease;
}
.celebrate-overlay.in .celebrate-banner {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.celebrate-emoji {
  font-size: 3.5rem; line-height: 1;
  animation: celebrate-bob 0.9s ease-in-out infinite;
}
.celebrate-text {
  font-size: 1.8rem; font-weight: 800; letter-spacing: 0.01em;
  margin-top: 0.5rem;
  background: linear-gradient(90deg, var(--ball) 0%, #ffffff 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.celebrate-sub {
  margin-top: 0.4rem;
  font-size: 0.85rem; color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.04em; text-transform: uppercase;
}
@keyframes celebrate-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-10px) rotate(8deg); }
}

button.register-cta.submitting {
  opacity: 0.7; cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
  .celebrate-overlay, .celebrate-banner, .celebrate-emoji { transition: none; animation: none; }
}

/* ── Public draws / schedule page ─────────────────────────────────── */
.public-tabs {
  display: flex; gap: 0.4rem;
  justify-content: center;
  margin: 0.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}
.public-tab {
  padding: 0.7rem 1.2rem;
  color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.public-tab:hover { color: var(--green-700); }
.public-tab.active {
  color: var(--green-900);
  border-bottom-color: var(--green-700);
}
.public-empty {
  text-align: center; padding: 2.5rem 1.5rem;
  color: var(--muted);
}
.public-empty h3 { color: var(--green-900); margin: 0 0 0.5rem; }
.public-bracket-section + .public-bracket-section { margin-top: 1rem; }
.bracket-public .match-actions { display: none; }
.public-schedule-day .panel-hint { display: none; }
.match-pill-static {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: default;
  display: inline-block;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* ── Public schedule: structured match card ───────────────────────── */
.match-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  width: 100%;
  padding: 0.7rem 0.7rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(11,61,36,0.05);
}
.match-card-event {
  align-self: flex-start;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--green-500);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.match-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.match-card-loc {
  display: none; /* desktop: court is the column header. shown on mobile. */
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green-700);
  white-space: nowrap;
}
.match-card-players {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: center;
}
.match-card-player {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.match-card-vs {
  align-self: center;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  position: relative;
  padding: 0 0.6rem;
}
.match-card-vs::before,
.match-card-vs::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.85rem;
  height: 1px;
  background: var(--line);
}
.match-card-vs::before { right: 100%; }
.match-card-vs::after  { left: 100%; }
.match-card-meta {
  display: flex;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--muted);
}
.match-card-handicap {
  /* plain text — no pill/border around the handicap */
  color: var(--muted);
}

/* Per-event colour-coding of the event pill. */
.match-card-event[data-event="MS"]  { background: #2a9d5a; }
.match-card-event[data-event="LS"]  { background: #c2476f; }
.match-card-event[data-event="MD"]  { background: #2f80c2; }
.match-card-event[data-event="LD"]  { background: #b8862b; }
.match-card-event[data-event="MXD"] { background: #8157c2; }

/* ── Admin: publish toggles ───────────────────────────────────────── */
.publish-intro { max-width: 46rem; margin: 0 0 1rem; }
.modal-body { padding: 1.1rem 1.5rem; overflow-y: auto; }
.modal-body > :first-child { margin-top: 0; }
.modal-body > :last-child { margin-bottom: 0; }
.schedule-all-list {
  list-style: none; margin: 0.8rem 0 0; padding: 0;
  max-height: 18rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.schedule-all-list li {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.6rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper); font-size: 0.9rem;
}
.schedule-all-list .vs { color: var(--muted); font-size: 0.8rem; }
.publish-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem; align-items: start; justify-items: start;
}
.publish-card {
  display: flex; flex-direction: column; gap: 0.7rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); padding: 0.85rem 1rem;
  max-width: 42rem;
}
.publish-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; flex-wrap: wrap;
}
.publish-card-body { display: flex; flex-direction: column; gap: 0.6rem; }
.publish-label {
  font-weight: 700; color: var(--green-900);
}
.publish-status {
  font-size: 0.75rem; font-weight: 700;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.publish-status.is-on  { background: #e8f1ec; color: var(--green-700); border: 1px solid var(--green-500); }
.publish-status.is-off { background: #f4f5f7; color: var(--muted);     border: 1px solid var(--line); }

/* ── Home page: "View draws" chip under event cards & hero ─────────── */
.event-card-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.card-public-link {
  font-size: 0.8rem; font-weight: 600;
  color: var(--green-700);
  text-decoration: none;
  background: #e8f1ec;
  border: 1px solid var(--green-500);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  transition: background 0.12s ease, color 0.12s ease;
}
.card-public-link:hover { background: var(--green-700); color: white; }
.hero-public-link { margin-top: 0.85rem; }
.hero-public-link a {
  color: var(--ball);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(216,237,58,0.4);
  padding-bottom: 2px;
}
.hero-public-link a:hover { border-bottom-color: var(--ball); }

/* Schedule publish picker: per-date checkboxes that look like pills. */
.publish-schedule-hint { margin: 0; color: var(--muted); }
.publish-date-list {
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.4rem;
  max-height: 11rem; overflow-y: auto;
  padding: 0.1rem;
}
.publish-date {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; font-weight: 500;
  padding: 0.2rem 0.55rem 0.2rem 0.4rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.publish-date input {
  width: 0.85rem; height: 0.85rem; margin: 0; cursor: pointer;
  accent-color: var(--green-700);
}
.publish-date:hover { border-color: var(--green-500); }
.publish-date:has(input:checked) {
  background: #e8f1ec;
  border-color: var(--green-500);
  color: var(--green-900);
}
.publish-schedule-actions { display: flex; gap: 0.4rem; align-items: center; }

/* Public draws/schedule tab: break out of .public-page's 1100px max-width
   so big brackets and wide court schedules can stretch toward the viewport
   edges. Inner padding keeps content off the screen edges; .bracket and
   .schedule-table still scroll horizontally if they exceed available width. */
.public-tab-wide {
  /* Centered, but allowed to grow wider than the 1100px page column (up to
     1300px) so brackets stay roomy on big screens while remaining centred.
     left:50% + translateX(-50%) centres on the viewport regardless of the
     narrower parent; the width cap keeps a sensible gutter on every size. */
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw - 3rem, 1300px);
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
/* Tabs and back link sit inside .public-tab-wide so they align to its left
   edge instead of being centered in the narrower .public-page container. */
.public-tab-wide .back-link { max-width: none; margin: 1.25rem 0; }

/* Filter chips on the draws tab: hide whole bracket sections instead of
   dimming them — there's only one section per event so dim doesn't make
   sense the way it does for mixed match pills on the schedule grid. */
.public-bracket-section.is-filtered-out { display: none; }

/* Match score pill next to the winner's name inside the bracket entrant row. */
.entrant-score {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.1rem 0.5rem;
  background: #e8f1ec;
  border: 1px solid var(--green-500);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--green-900);
  white-space: nowrap;
}
.entrant { display: flex; align-items: center; gap: 0.3rem; }
.entrant .entrant-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bracket-public .entrant:has(.entrant-score) { flex-wrap: wrap; }
.bracket-public .entrant:has(.entrant-score) .entrant-name { order: 1; }
.bracket-public .entrant:has(.entrant-score) .tick { order: 2; }
.bracket-public .entrant-score {
  order: 3;
  flex: 0 0 100%;
  margin: 0.15rem 0 0;
  justify-content: center;
}

/* Result-dialog: "Alice beats Bob" headline above the score input. */
.result-summary {
  margin: 0 0 1rem; padding: 0.85rem 1rem;
  background: var(--cream); border: 1px solid var(--line); border-radius: 8px;
  text-align: center; font-size: 1.05rem;
  color: var(--green-900);
}
.result-summary strong { color: var(--green-700); font-weight: 800; }

/* ── Public schedule on phones: reflow the court grid into a per-time
   agenda. Each time slot becomes a heading; only the courts that actually
   have a match show, each card carrying its court number (the column
   header is gone). Empty and unavailable cells are dropped. ───────────── */
@media (max-width: 640px) {
  .public-tab-wide { padding-left: 0; padding-right: 0; }

  .public-schedule-table thead { display: none; }
  .public-schedule-table,
  .public-schedule-table tbody,
  .public-schedule-table tr,
  .public-schedule-table td {
    display: block;
    width: 100%;
  }

  .public-schedule-table tr {
    border: none;
    border-top: 2px solid var(--line);
    padding: 0.35rem 0 0.7rem;
  }
  .public-schedule-table tbody tr:first-child { border-top: none; }
  /* Drop time rows that have nothing scheduled. */
  .public-schedule-table tr:not(:has(.match-card)) { display: none; }

  /* Time label becomes the group heading. */
  .public-schedule-table td.slot-cell {
    background: transparent;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 800;
    color: var(--green-900);
    padding: 0.35rem 0.1rem 0.45rem;
  }
  .public-schedule-table td.slot-cell::before {
    content: "🕒 ";
    font-weight: 400;
  }

  /* One match per row, full width; hide blanks & unavailable courts. */
  .public-schedule-table td.schedule-cell {
    border: none;
    padding: 0 0 0.5rem;
  }
  .public-schedule-table td.schedule-cell:last-child { padding-bottom: 0; }
  .public-schedule-table td.schedule-cell.is-empty,
  .public-schedule-table td.schedule-cell-unavailable { display: none; }

  /* Surface the court number inside the card now the header is gone. */
  .match-card-loc { display: inline-flex; }
  .match-card { padding: 0.8rem; gap: 0.6rem; }
  .match-card-player { font-size: 0.98rem; }
}

/* ── Drag-to-pan the bracket (see static/bracket-pan.js) ──────────────
   Touch pans natively; mouse/pen users grab and drag. The grab cursor
   advertises that the wide tree can be dragged sideways. */
.bracket {
  cursor: grab;
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
  overscroll-behavior-x: contain;    /* don't trigger browser back-swipe */
}
.bracket.is-panning {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto;
}

/* ── Public & admin schedule: collapsible day panels ─────────────────
   Each day is a <details> with a tappable/clickable header — date +
   weekday + match count + caret. The same on every screen size; all days
   start closed and clicking any header toggles that day open or closed.
   toggles that day open or closed.

   The summary is kept as a plain block with the flex layout on an inner
   .day-summary-row: a flex/grid <summary> can break the native open/close
   toggle in some browsers (notably iOS Safari). */
.schedule-day > summary.day-summary {
  display: block;
  list-style: none;
  cursor: pointer;
}
.schedule-day > summary.day-summary::-webkit-details-marker { display: none; }
.schedule-day > summary.day-summary::marker { content: ""; }
.day-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.admin-schedule-day > .day-summary .day-summary-row { width: 100%; }
.day-summary-meta { display: inline-flex; align-items: center; gap: 0.6rem; }
.day-match-count {
  font-size: 0.78rem; font-weight: 600;
  color: var(--muted); white-space: nowrap;
}
.day-summary-caret {
  display: inline-block;
  color: var(--muted); font-size: 0.8rem;
  transition: transform 0.15s ease;
}
.schedule-day[open] > summary .day-summary-caret { transform: rotate(180deg); }

@media (max-width: 640px) {
  .day-summary-row { gap: 0.5rem; }
}

/* Centre the public bracket within its panel. `safe center` keeps a wide
   bracket that overflows scrollable from the left edge (no clipped first
   round) while centring draws that do fit. */
.bracket-public { justify-content: safe center; }

/* "Bump to next free slot" — a quick action at the top of the schedule edit
   dialog, set off from the form fields below it. */
.reschedule-form {
  margin: 1rem 1.5rem 0;
  padding: 0.75rem 0.9rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
}
.reschedule-form .hint { margin: 0; }

/* Expand/collapse-all control above the public schedule day list. */
.schedule-toolbar {
  display: flex;
  justify-content: center;
  margin: 0 0 1rem;
}
