/* Tonament brand: see docs/BRAND.md.
   Deep Navy #0B1220 · Electric Lime #A3E635 · Slate #475569 · Mist #E5E7EB · Outfit.
   Dark is the default theme; light applies when <html data-theme="light">
   (set before first paint by the snippet in index.html). */

@font-face {
  font-family: 'Outfit';
  src: url('/fonts/Outfit-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* brand constants (same in both themes) */
  --navy: #0B1220;
  /* The paper fixture sheet in the home hero (the same in both themes). */
  --paper: #F3EEE1;
  --paper-rule: #C9D6E8;
  --paper-margin: #E7A3A3;
  --ink: #1E3A8A;
  --ink-red: #B91C1C;
  /* Printed fixtures (the free tools): plain black on white. */
  --print-bg: #FFFFFF;
  --print-ink: #000000;
  --print-line: #999999;
  --print-muted: #444444;
  --lime: #A3E635;
  --slate: #475569;
  --mist: #E5E7EB;
  /* Court mode (the big score): always dark, like the venue display. */
  --court-ink: #FFFFFF;
  --court-line: #1C2740;
  --court-press: #111A2C;
  --court-dim: #94A3B8;
  --court-soft: #CBD5E1;
  --court-btn: #18233A;
  --court-btn-line: #2A3854;

  /* dark theme (default) */
  --bg: #0B1220;
  --surface: #111A2E;
  --surface-2: #18233A;
  --text: #E5E7EB;
  --muted: #94A3B8;
  --border: #24314B;
  --accent: var(--lime);          /* fills: buttons, bars, dots */
  --on-accent: var(--navy);       /* text on an accent fill */
  --accent-text: var(--lime);     /* accent-coloured text on --bg/--surface */
  --accent-soft: rgba(163, 230, 53, 0.13);
  --link: var(--lime);
  --side-a: var(--lime);
  --on-side-a: var(--navy);
  --side-b: var(--slate);
  --on-side-b: #F1F5F9;
  --live: #F87171;
  --live-soft: rgba(248, 113, 113, 0.14);
  --danger: #F87171;
  --header: var(--navy);
  --header-border: #1C2740;
  --scoreboard: #070C17;
  --toast: #E5E7EB;
  --on-toast: var(--navy);
  /* snooker balls: content colours for the scorer's ball buttons (both themes) */
  --ball-red: #DC2626;     --on-ball-red: #FFFFFF;
  --ball-yellow: #FACC15;  --on-ball-yellow: #0B1220;
  --ball-green: #16A34A;   --on-ball-green: #FFFFFF;
  --ball-brown: #92400E;   --on-ball-brown: #FFFFFF;
  --ball-blue: #2563EB;    --on-ball-blue: #FFFFFF;
  --ball-pink: #F472B6;    --on-ball-pink: #0B1220;
  --ball-black: #0F0F0F;   --on-ball-black: #FFFFFF;
  --qr-bg: #FFFFFF;                /* QR codes need a white background to scan, in both themes */
  --radius: 14px;
  --shadow: none;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #EEF0F3;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --text: var(--navy);
  --muted: var(--slate);
  --border: #D5DAE1;
  --accent-text: #3F6212;         /* lime is unreadable as text on white; use deep olive */
  --accent-soft: #ECFCCB;
  --link: var(--navy);
  --live: #B91C1C;
  --live-soft: #FDE5E5;
  --danger: #B91C1C;
  --header-border: var(--navy);
  --scoreboard: var(--navy);
  --toast: var(--navy);
  --on-toast: #FFFFFF;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.05), 0 2px 8px rgba(11, 18, 32, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--link); text-underline-offset: 2px; }
:root[data-theme='light'] a { text-decoration-thickness: 1px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5rem; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.18rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 16px; flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.eyebrow { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }

/* ---------- top bar: navy in both themes, as in the brand mockups */
.topbar { background: var(--header); border-bottom: 1px solid var(--header-border); position: sticky; top: 0; z-index: 10; color: var(--court-ink); }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
@media (max-width: 400px) { .brand img { height: 20px; } }
.topbar .nav-link { color: var(--court-ink); }
.topbar .btn-ghost { color: var(--court-ink); border-color: rgba(255, 255, 255, 0.35); }

.footer { border-top: 1px solid var(--border); margin-top: 24px; }
.footer-inner { max-width: 1040px; margin: 0 auto; padding: 22px 16px 32px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { height: 22px; }
.footer .eyebrow { font-size: 0.68rem; }
.footer .eyebrow b { color: var(--accent-text); font-weight: 600; }

/* theme switch */
.currency-row { margin: 0 0 8px; }
.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; gap: 2px; }
.theme-switch button {
  font: inherit; font-size: 0.78rem; font-weight: 600; border: 0; background: transparent; color: var(--muted);
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.theme-switch button[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); }

/* ---------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 9px 16px; border-radius: 10px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  min-height: 40px;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
:root[data-theme='light'] .btn-primary, :root[data-theme='light'] .btn-primary:hover { border-color: #65A30D; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: currentColor; background: transparent; }
.btn-small { padding: 5px 12px; min-height: 34px; font-size: 0.875rem; }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }
.icon-btn {
  font: inherit; border: 1px solid transparent; background: transparent; color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.label { font-weight: 600; font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.8rem; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; width: 100%;
}
:root[data-theme='light'] input, :root[data-theme='light'] select, :root[data-theme='light'] textarea { background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
:root[data-theme='light'] :is(input, select, textarea, .btn, .icon-btn, a, button):focus-visible { outline-color: var(--navy); }
textarea { resize: vertical; min-height: 96px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.grid-2, .grid-3 { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.formats { display: grid; gap: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions.center { justify-content: center; }

/* ---------- cards & lists */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-list { display: grid; gap: 12px; }
@media (min-width: 640px) { .card-list { grid-template-columns: 1fr 1fr; } }
.t-card { display: block; text-decoration: none; color: inherit; margin: 0; }
.t-card:hover { border-color: var(--accent); }
.t-card h3 { margin-bottom: 4px; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; border: 1px dashed var(--border); border-radius: var(--radius); }
.loading { text-align: center; color: var(--muted); padding: 48px 0; }
.section { margin-bottom: 28px; }
.section > h2 { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.live { background: var(--live-soft); color: var(--live); }
.pill.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; animation: blink 1.4s infinite; }
.pill.done, .pill.completed, .pill.org { background: var(--accent-soft); color: var(--accent-text); }
.pill.league, .pill.knockout { background: rgba(71, 85, 105, 0.35); color: var(--text); }
:root[data-theme='light'] .pill.league, :root[data-theme='light'] .pill.knockout { background: #E2E8F0; color: var(--slate); }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- home hero: navy with lime diagonals in both themes */
.hero {
  position: relative; overflow: hidden; color: var(--mist); border-radius: 20px; margin: 8px 0 28px;
  padding: clamp(28px, 6vw, 56px) clamp(20px, 5vw, 48px);
  background:
    var(--hero-image, none) right center / cover no-repeat,
    linear-gradient(115deg, transparent 0 74%, var(--lime) 74% 77.5%, transparent 77.5% 82%, rgba(163, 230, 53, 0.35) 82% 83%, transparent 83%),
    radial-gradient(circle at 85% 20%, #1B2740 0, var(--navy) 65%);
  border: 1px solid var(--court-line);
}
.hero > * { position: relative; max-width: 34rem; }
.hero .eyebrow { color: var(--court-soft); line-height: 1.9; margin-bottom: 14px; }
.hero .eyebrow b { color: var(--lime); font-weight: 600; }
.hero h1 { font-size: clamp(2rem, 6.5vw, 3.2rem); letter-spacing: -0.02em; margin-bottom: 14px; color: var(--court-ink); }
.hero h1 .accent { color: var(--lime); }
.hero .lead { color: var(--court-soft); }
.hero .btn-ghost { color: var(--court-ink); border-color: rgba(255, 255, 255, 0.4); }
.hero .btn-ghost:hover { border-color: var(--court-ink); }
/* A paper fixture sheet (the blog draws one). */
.paper-sheet {
  position: relative; padding: 20px 14px 18px 34px; border-radius: 8px;
  background: repeating-linear-gradient(transparent 0 27px, var(--paper-rule) 27px 28px) 0 14px / 100% auto, var(--paper);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.paper-sheet::after { content: ''; position: absolute; top: 0; bottom: 0; left: 24px; width: 2px; background: var(--paper-margin); opacity: 0.7; }
.paper-sheet p { margin: 0; font-size: 0.8rem; line-height: 28px; font-style: italic; font-weight: 500; white-space: nowrap; }
.paper-sheet .ink { color: var(--ink); }
.paper-sheet .ink-red { color: var(--ink-red); }
.paper-sheet s { text-decoration-color: var(--ink-red); text-decoration-thickness: 2px; }
.paper-sheet p:first-child { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.paper-sheet .circled { display: inline-block; margin-top: 6px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 50%; transform: rotate(-1.5deg); }
/* The landing page */
.landing-hero.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(20px, 4vw, 48px); align-items: center; }
.landing-hero.hero > * { max-width: none; }
.landing-copy { max-width: 36rem; }
.landing-hero h1 { text-wrap: balance; line-height: 1.08; }
.landing-hero h1 .hl { color: var(--lime); }
.landing-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.landing-hero .muted { color: var(--court-dim); }
.landing-visual { width: 230px; max-height: 440px; overflow: hidden; border: 7px solid #000; border-radius: 34px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); outline: 1px solid #2A3550; }
.landing-visual img { display: block; width: 100%; height: auto; }
@media (max-width: 760px) {
  .landing-hero.hero { grid-template-columns: 1fr; }
  .landing-visual { display: none; }
  .landing-hero .lead { font-size: 1rem; }
}
.landing-h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin: 8px 0 14px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.role-card { margin: 0; display: grid; align-content: start; gap: 4px; }
.role-card h3 { margin: 4px 0 0; font-size: 1.15rem; }
.role-promise { margin: 0 0 6px; color: var(--accent-text); font-weight: 600; }
.role-card ul { margin: 0 0 8px; padding-left: 1.1em; display: grid; gap: 6px; font-size: 0.92rem; color: var(--muted); }
.link-arrow { font-weight: 700; text-decoration: none; margin-top: auto; }
.problem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.problem { margin: 0; }
.problem-before { margin: 0 0 8px; font-weight: 700; color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.problem-after { margin: 0; font-weight: 600; }
.problem-after::before { content: "✓ "; color: var(--accent-text); font-weight: 800; }
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.how-step { margin: 0; display: grid; gap: 4px; align-content: start; }
.how-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.landing-cta { text-align: center; padding: clamp(24px, 5vw, 40px); margin-top: 28px; }
.landing-cta h2 { margin-top: 0; }
/* Signed-in home */
.home-hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.home-hello h1 { margin: 0; }
.quick-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: none; }
.quick-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.quick-chip:hover { border-color: var(--accent); }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 40em; margin-bottom: 22px; }
.features { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.features li { border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; color: var(--mist); background: rgba(255, 255, 255, 0.04); }
@media (max-width: 640px) {
  .hero { background:
    linear-gradient(115deg, transparent 0 86%, var(--lime) 86% 89.5%, transparent 89.5%),
    radial-gradient(circle at 85% 20%, #1B2740 0, var(--navy) 65%); }
}

/* ---------- tournament */
.t-header { margin: 8px 0 12px; }
.t-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-title h1 { margin: 0; }
.conn { font-size: 0.8rem; white-space: nowrap; }
.conn::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--muted); }
.conn.on::before { background: var(--lime); box-shadow: 0 0 0 3px var(--accent-soft); }
.admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 0.9rem;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
/* More tabs past the edge: fade it, so it reads as "scroll for more". */
.tabs.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.tabs.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.tabs.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
@media (max-width: 480px) { .tabs a { padding: 10px 11px; } }
/* Tournament tabs: an icon and a short name; on phones, a bar at the bottom of the screen. */
.t-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.t-tabs .icon { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .t-tabs.bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 0; overflow: visible;
    background: var(--surface); border-top: 1px solid var(--border); border-bottom: 0;
    padding: 0 4px env(safe-area-inset-bottom); box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
    -webkit-mask-image: none; mask-image: none;
  }
  .t-tabs.bar a {
    flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 8px 2px 7px; margin: 0;
    font-size: 0.72rem; border-bottom: 0; border-top: 3px solid transparent;
  }
  .t-tabs.bar a span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .t-tabs.bar .icon { width: 22px; height: 22px; }
  .t-tabs.bar a.active { border-top-color: var(--accent); }
  body:has(.t-tabs.bar) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body:has(.t-tabs.bar) #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
.banner { border-radius: var(--radius); padding: 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.champion {
  background: var(--navy); color: var(--mist); font-size: 1.2rem; font-weight: 600; justify-content: center; text-align: center;
  border: 1px solid var(--court-line); box-shadow: inset 0 -4px 0 var(--lime);
}
.banner.champion strong { color: var(--lime); font-weight: 700; }
.banner.info { background: var(--surface); border: 1px solid var(--border); }
.visibility-banner .actions { margin: 0; }
.visibility .seg button { max-width: none; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; flex-basis: 100%; }
.progress > span { display: block; height: 100%; background: var(--accent); }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.entries li:last-child { border-bottom: 0; }
.entries .seed { width: 28px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.entries .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-actions { display: flex; }
.plan { font-weight: 600; }
details > summary { cursor: pointer; font-weight: 700; }
details[open] > summary { margin-bottom: 12px; }

/* ---------- match cards */
.match-list { display: grid; gap: 10px; }
@media (min-width: 640px) { .match-list { grid-template-columns: 1fr 1fr; } }
.match-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; text-decoration: none; color: inherit;
}
.match-card:hover { border-color: var(--accent); }
.match-card.live { border-color: var(--live); }
.mc-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 0.78rem; margin-bottom: 6px; }
.mc-side { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0; }
.mc-side.won { font-weight: 700; }
.mc-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-games { display: flex; gap: 10px; font-variant-numeric: tabular-nums; }
.mc-games span { min-width: 1.4em; text-align: right; color: var(--muted); }
.mc-games span.gw { color: var(--text); font-weight: 700; }
.mc-games span.cur { color: var(--live); font-weight: 800; }
.serve { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); flex: none; box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.25); }

/* ---------- groups */
.table-wrap { overflow-x: auto; margin: 0 -4px 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.name { white-space: normal; min-width: 120px; }
tr.q td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
tr.q td.name { font-weight: 600; }
.groups-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .groups-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- bracket */
.bracket-scroll { overflow-x: auto; padding-bottom: 8px; }
.bracket { display: flex; gap: 20px; min-width: max-content; }
.round { display: flex; flex-direction: column; width: 220px; }
.round h3 { color: var(--muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; text-align: center; }
.round-matches { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 12px; }
.b-match {
  display: block; position: relative; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
a.b-match:hover { border-color: var(--accent); }
.b-match.live { border-color: var(--live); }
.b-match.bye { opacity: 0.6; }
.b-line { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 0.88rem; }
.b-line + .b-line { border-top: 1px solid var(--border); }
.b-line.won { font-weight: 700; background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.b-line.tbd { color: var(--muted); font-style: italic; }
.b-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-score { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.b-line.won .b-score { color: var(--text); }
.b-live { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 0.6rem; font-weight: 800; color: var(--court-ink); background: #DC2626; padding: 1px 5px; border-radius: 4px; }

/* ---------- match / scoreboard (navy in both themes) */
.back { display: inline-block; margin: 4px 0 10px; text-decoration: none; font-weight: 600; }
.match-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 10px; font-size: 0.9rem; }
.scoreboard { background: var(--scoreboard); color: #F1F5F9; border: 1px solid var(--court-line); border-radius: 18px; padding: 8px 0; margin-bottom: 14px; overflow: hidden; }
.sb-row { display: grid; grid-template-columns: 26px 1fr auto minmax(2.2ch, auto); align-items: center; gap: 10px; padding: 12px 18px 12px 8px; }
.sb-row + .sb-row { border-top: 1px solid var(--court-line); }
.sb-row.has-set { grid-template-columns: 26px 1fr auto auto minmax(2.2ch, auto); }
.sb-row.single { grid-template-columns: 26px 1fr minmax(2.2ch, auto); }
.sb-set { color: #F1F5F9; background: #24314B; }
.sb-row.side-a { box-shadow: inset 5px 0 0 var(--lime); }
.sb-row.side-b { box-shadow: inset 5px 0 0 var(--court-dim); }
.sb-serve { display: flex; justify-content: center; }
.sb-name { font-size: clamp(1.05rem, 4vw, 1.4rem); font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.sb-row.won .sb-name { color: var(--lime); }
.flag { display: inline-block; margin-left: 8px; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 2px 7px; border-radius: 6px; background: var(--lime); color: var(--navy); vertical-align: middle; }
.sb-games { font-size: 1.2rem; font-weight: 700; color: var(--court-soft); background: var(--court-btn); border-radius: 8px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.sb-points { font-size: clamp(2.6rem, 12vw, 4rem); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.sb-foot { font-size: 0.8rem; color: var(--court-dim); padding: 6px 18px 4px; border-top: 1px solid var(--court-line); display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; }

.scorer { display: grid; gap: 12px; margin-bottom: 16px; }
.score-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-btn {
  font: inherit; border: 0; border-radius: 16px; cursor: pointer; padding: 16px 10px;
  min-height: min(34vh, 220px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform 0.06s, filter 0.06s;
}
.score-btn:active:not(:disabled) { transform: scale(0.97); filter: brightness(0.95); }
.score-btn:disabled { opacity: 0.5; }
.score-btn.side-a { background: var(--side-a); color: var(--on-side-a); }
.score-btn.side-b { background: var(--side-b); color: var(--on-side-b); }
.sbtn-plus { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.sbtn-word { font-size: 1.6rem; }
.sbtn-name { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; text-align: center; }
.pick-btns .pick-btn { min-height: 92px; gap: 4px; opacity: 0.7; }
.pick-btns .pick-btn[aria-pressed='true'] { opacity: 1; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.pick-label { font-size: 0.8rem; font-weight: 600; }
.point-pad { display: grid; gap: 12px; }
.ball-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ball { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--border); font: inherit; font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.ball:active { transform: scale(0.94); }
.ball-red { background: var(--ball-red); color: var(--on-ball-red); }
.ball-yellow { background: var(--ball-yellow); color: var(--on-ball-yellow); }
.ball-green { background: var(--ball-green); color: var(--on-ball-green); }
.ball-brown { background: var(--ball-brown); color: var(--on-ball-brown); }
.ball-blue { background: var(--ball-blue); color: var(--on-ball-blue); }
.ball-pink { background: var(--ball-pink); color: var(--on-ball-pink); }
.ball-black { background: var(--ball-black); color: var(--on-ball-black); }
.value-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.value-col { display: grid; gap: 8px; align-content: start; }
.value-team { font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.value-btns { display: grid; gap: 8px; }
.score-btn.value-btn { min-height: 76px; font-size: 1.8rem; font-weight: 700; }
.value-cols.one { grid-template-columns: 1fr; }
.value-cols.one .value-btns { grid-template-columns: repeat(3, 1fr); }
.score-btn.extra-btn { font-size: 1.05rem; background: var(--surface); color: var(--text); border: 2px dashed var(--border); }
.score-btn.extra-btn.on { border-style: solid; }
.score-btn.wicket-btn { font-size: 1.3rem; background: var(--surface); color: var(--text); border: 2px solid var(--border); }
.end-period { width: 100%; justify-content: center; }
.foul-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.foul-row .end-frame { margin-left: auto; }
.pts-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pts-row .pts { padding: 12px 0; font-size: 1.1rem; font-weight: 700; justify-content: center; }
.scorer-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-size: 0.875rem; border: 0; background: var(--surface); color: var(--text); padding: 6px 12px; cursor: pointer; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { width: 110px; padding: 6px 10px; }
.games-table td.won { font-weight: 800; }
.seg.score-mode { display: flex; width: 100%; box-sizing: border-box; margin: 0 0 12px; }
.score-mode button { flex: 1; max-width: none; padding: 8px 14px; }
.result-form { margin: 0; }
.result-table { width: 100%; border-collapse: collapse; }
.result-table th, .result-table td { padding: 4px 6px; text-align: left; }
.result-table thead th { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.result-table tbody th { font-weight: 600; white-space: nowrap; width: 1%; }
/* Long row names ("Tie-break raids (if level)") wrap instead of pushing the boxes off a phone. */
.result-table { table-layout: fixed; }
.result-table tbody th { white-space: normal; width: 34%; line-height: 1.25; }
.result-table input { min-width: 0; }
.result-table input { width: 100%; text-align: center; font-size: 1.15rem; font-weight: 700; }
.result-msg { margin: 8px 0 0; min-height: 1.4em; }
.add-result-card summary { cursor: pointer; }
.add-result { margin-top: 10px; }
.add-result-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-result-sides fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 10px; margin: 0; display: grid; gap: 6px; min-width: 0; }
.add-result-sides legend { font-weight: 600; font-size: 0.85rem; padding: 0 4px; }
.add-result-sides select, .add-result-sides input { width: 100%; min-width: 0; }
.add-result-sides input { text-align: center; font-weight: 700; font-size: 1.1rem; }

/* ---------- toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--toast); color: var(--on-toast); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 0.92rem;
  transition: opacity 0.2s, transform 0.2s; width: max-content; max-width: calc(100% - 32px); z-index: 20; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--ink-red); color: var(--court-ink); }
#toast.has-undo { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding-right: 8px; }
.toast-undo { flex: none; font: inherit; font-weight: 700; border: 0; border-radius: 8px; padding: 6px 12px; min-height: 34px; cursor: pointer; background: var(--accent); color: var(--on-accent); }

/* ---------- accounts & team */
.nav { display: flex; align-items: center; gap: 10px; }
.nav-link { font-weight: 600; text-decoration: none; color: var(--text); font-size: 0.92rem; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; text-decoration: none;
  background: var(--slate); color: var(--court-ink); font-weight: 700; font-size: 0.85rem; user-select: none; flex: none;
}
.avatar.big { width: 56px; height: 56px; font-size: 1.2rem; cursor: default; }
/* The five hubs: a bar at the bottom on phones (the sidebar on desktops). */
.hubbar { display: none; }
@media (max-width: 640px) {
  .hubbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
    background: var(--surface); border-top: 1px solid var(--border); padding: 0 4px env(safe-area-inset-bottom);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
  }
  .hubbar[hidden] { display: none; }
  .hubbar a {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px;
    color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 600; border-top: 3px solid transparent;
  }
  .hubbar .icon { width: 22px; height: 22px; }
  .hubbar a.active { color: var(--text); border-top-color: var(--accent); }
  body.has-hubbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body.has-hubbar #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* Pages with their own bar at the bottom (a tournament, a club) keep theirs. */
  body:has(.t-tabs.bar) .hubbar { display: none; }
}
/* + New: everything you can start */
.sheet.create-sheet { text-align: left; max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 16px 14px; }
.create-sheet h2 { text-align: center; margin: 0 0 4px; }
.create-sheet h3 { margin: 12px 0 6px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.create-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 520px) { .create-grid { grid-template-columns: 1fr 1fr; } }
.create-tile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--surface-2); }
.create-tile > span:last-child { display: grid; min-width: 0; }
.create-tile:hover, .create-tile:focus-visible { border-color: var(--accent); }
.create-tile small { font-size: 0.8rem; line-height: 1.3; }
.create-emoji { font-size: 1.4rem; flex: none; width: 1.6em; text-align: center; }
.create-sheet .btn { margin-top: 12px; }
/* Hub pages */
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
@media (min-width: 720px) { .hub-grid { grid-template-columns: repeat(4, 1fr); } }
.hub-tile { display: grid; gap: 4px; align-content: start; color: var(--text); text-decoration: none; margin: 0; }
.hub-tile:hover { border-color: var(--accent); }
.hub-tile small { line-height: 1.35; }
.hub-emoji { font-size: 1.6rem; }
.hub-stat { margin-top: 6px; font-weight: 700; font-size: 0.85rem; color: var(--accent-text); }
.hub-seg { margin: 12px 0 8px; }
.hub-cta { display: grid; gap: 6px; justify-items: start; }
.you-head { display: flex; align-items: center; gap: 14px; }
.you-head h1 { margin: 0; font-size: 1.4rem; }
.you-head p { margin: 2px 0 0; overflow-wrap: anywhere; }
.you-list { padding: 4px 0; }
.you-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 18px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; flex-wrap: wrap; }
.you-row:first-child { border-top: 0; }
.you-row small { font-weight: 400; }
a.you-row:hover, button.you-row:hover { background: var(--surface-2); }
.auth-card { max-width: 420px; margin: 24px auto; }
.members { list-style: none; margin: 0 0 14px; padding: 0; }
.members li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.members li:last-child { border-bottom: 0; }
.members .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.team-form { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .team-form { grid-template-columns: 1fr auto auto; } }
.link-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.card.danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.sync { text-align: center; font-size: 0.82rem; color: var(--muted); min-height: 1.3em; }
.sync.saving { color: var(--muted); }
.sync.offline { color: var(--danger); font-weight: 700; }
.sync.saved::before { content: "✓ "; color: var(--accent-text); }

/* logo variants that swap with the theme */
:root[data-theme='light'] .on-dark { display: none; }
:root:not([data-theme='light']) .on-light { display: none; }

/* ---------- sports catalogue */
.sport-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sport-chip {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 6px 8px 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; min-height: 36px;
}
button.sport-chip:hover { border-color: var(--muted); }
.sport-chip.live { background: var(--accent); border-color: var(--accent); color: var(--on-accent); cursor: default; }
.sport-chip.voted { border-color: var(--accent); background: var(--accent-soft); }
.chip-tag {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.sport-chip.live .chip-tag { background: var(--navy); color: var(--lime); }
.chip-count { font-size: 0.78rem; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; padding-right: 4px; }

/* ---------- entries: check-in, self-entry, withdrawals */
.check {
  width: 30px; height: 30px; flex: none; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 800;
  border: 2px solid var(--border); background: transparent; color: var(--on-accent);
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.saving { animation: check-saving 1s ease-in-out infinite; cursor: progress; }
@keyframes check-saving { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 7px transparent; } }
.entries li.removing { opacity: 0.4; pointer-events: none; transition: opacity 0.15s; }
.entries li.shake { animation: row-shake 0.4s; }
@keyframes row-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .check.saving { animation: none; box-shadow: 0 0 0 3px var(--accent); } .entries li.shake { animation: none; } }
.entries li.not-here .entry-name, .entries li.out .entry-name { color: var(--muted); }
.entries li.out .entry-name { text-decoration: line-through; }
.entries .contact { display: block; font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.entries .entry-name { display: block; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.entry-tags:empty { display: none; }
.entries .entry-name { overflow-wrap: anywhere; }
.entries .row-actions .icon-btn { width: 30px; }
.pill.withdrawn { background: var(--live-soft); color: var(--live); }
.entries .confirm-btn { display: block; width: max-content; margin-top: 6px; }
.pill.waiting { background: transparent; box-shadow: inset 0 0 0 1px var(--muted); color: var(--muted); }
tr.out td { color: var(--muted); }
.entry-card { border-left: 4px solid var(--accent); }
.check-field { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin-bottom: 10px; }
.check-field input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--lime); }
.check-field small { display: block; color: var(--muted); }
.entry-settings { display: grid; gap: 6px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- static pages: pricing, contact, policies */
.doc { max-width: 820px; }
.doc h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin: 12px 0 10px; }
.doc h2 { margin-top: 28px; }
.doc h3 { margin-top: 18px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 6px; }
.price-grid { display: grid; gap: 16px; margin: 20px 0 8px; }
@media (min-width: 700px) { .price-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .price-grid-4 { grid-template-columns: repeat(4, 1fr); } }
.price-limit { margin: 0 0 4px; }
.price-card { display: flex; flex-direction: column; gap: 6px; }
.price-card ul { flex: 1; }
.price-card.featured { border: 2px solid var(--accent); }
.price { font-size: 2.2rem; font-weight: 700; margin: 0; }
.price small { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.biz { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.biz dt { color: var(--muted); font-weight: 600; }
.biz dd { margin: 0; overflow-wrap: anywhere; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-links .link-btn { color: var(--muted); font-weight: 400; padding: 0; }
.footer-links .link-btn:hover { color: var(--text); text-decoration: underline; }
.footer-legal { max-width: 1040px; margin: 0 auto; padding: 0 16px 28px; font-size: 0.78rem; color: var(--muted); }

/* ---------- Event Pass */
.upgrade-card { border: 2px solid var(--accent); }
.upgrade-card h2 { margin-bottom: 6px; }
.entry-meter { display: grid; gap: 6px; margin: 0 0 10px; }
.entry-meter .progress { height: 5px; }

/* Venue, location and dates */
fieldset.details-set { display: grid; gap: 12px; }
.stack { display: grid; gap: 8px; }
.venue-card { display: flex; gap: 12px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.venue-info { display: grid; gap: 10px; min-width: 0; }
.venue-row { display: flex; gap: 10px; align-items: flex-start; }
.venue-icon { flex: none; width: 20px; text-align: center; }
.t-card-when { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }

/* Find a tournament */
.find-bar { display: grid; gap: 10px; margin-bottom: 16px; }
.find-q { font-size: 1rem; }
.filters > summary { list-style: none; display: inline-flex; }
.filters > summary::-webkit-details-marker { display: none; }
.filter-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; align-items: end; }
.filter { display: grid; gap: 4px; min-width: 0; }
.filter select:disabled { opacity: 0.55; }
.filter-open { margin: 0; align-self: center; }
@media (min-width: 720px) {
  .filters > summary { display: none; }
  .filters[open] > summary { margin: 0; }
  .filter-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Events */
.event-picker { margin: 0 0 8px; }
.event-switch {
  font: inherit; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
}
.event-switch:hover { border-color: var(--accent); }
.event-switch-name { flex: 1; min-width: 0; font-size: 1.02rem; overflow-wrap: anywhere; }
.event-switch-more { flex: none; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.event-line { margin: 6px 2px 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.league, .dot.knockout { background: var(--live); }
.dot.completed { background: var(--text); opacity: 0.45; }
.sheet-action .dot { margin-right: 8px; vertical-align: 2px; }
.sheet-action.current { background: var(--surface-2); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.quick-grid .check-field { margin-bottom: 6px; }
@media (min-width: 640px) { .quick-grid { grid-template-columns: repeat(3, 1fr); } }
.events-list .entry-name { color: var(--text); text-decoration: none; font-weight: 600; }
.events-list .entry-name:hover { text-decoration: underline; }

.t-card-events { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.event-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.event-tag.level-tag { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }

.fee-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.solo-card .entries li { flex-wrap: wrap; }
.pair-with { width: auto; max-width: 11rem; padding: 6px 10px; font-size: 0.875rem; }

/* How it works and FAQ */
.doc.guide { max-width: 1000px; }
.guide .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 36px; }
.step { display: grid; gap: 18px; align-items: start; margin: 0; }
.step-text h3 { margin: 6px 0 6px; font-size: 1.25rem; }
.step-text p { color: var(--muted); margin: 0 0 14px; }
.step-no { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.step-shots { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.shot { flex: 0 0 auto; width: min(260px, 72vw); margin: 0; scroll-snap-align: start; border: 1px solid var(--border); border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: 0 10px 30px rgba(11, 18, 32, 0.25); }
.shot img { display: block; width: 100%; height: auto; }
@media (min-width: 820px) {
  /* Text and screenshots side by side, swapping sides on every other step. */
  .step { grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 36px; }
  .step:nth-child(even) { grid-template-columns: minmax(0, 540px) minmax(0, 1fr); }
  .step:nth-child(even) .step-text { order: 2; }
}
.faq-list { display: grid; gap: 8px; }
.faq { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 0 16px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
.faq[open] summary { color: var(--accent-text); }
.faq p { margin: 0 0 14px; color: var(--muted); }
.guide-cta { margin-top: 32px; }

/* Venue display (/t/<id>/display): a TV or projector, read from across the hall */
.display-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
body.display-mode { background: var(--scoreboard); }
body.display-mode .topbar, body.display-mode .footer { display: none; }
body.display-mode #app { max-width: none; padding: 0; }
body.display-mode.display-idle, body.display-mode.display-idle * { cursor: none; }
.display { height: 100vh; overflow: hidden; display: flex; flex-direction: column; gap: 1.2vw; padding: 1.6vw 2vw; color: var(--text); font-size: clamp(16px, 1.25vw, 30px); }
.display h2 { font-size: 1.15em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6em; }
.dc-head { display: flex; align-items: center; gap: 1.2vw; border-bottom: 2px solid var(--accent); padding-bottom: 0.8vw; }
.dc-brand { height: 2.4em; width: auto; flex: none; padding-right: 1.2vw; margin-right: 0.2vw; border-right: 1px solid var(--border); }
.dc-logo { height: 3.2em; width: auto; max-width: 12em; object-fit: contain; border-radius: 8px; flex: none; }
.dc-title { flex: 1; min-width: 0; }
.dc-title h1 { font-size: 2.2em; margin: 0; line-height: 1.1; }
.dc-title p { margin: 0.2em 0 0; color: var(--muted); }
.dc-clock { text-align: right; display: grid; gap: 0.2em; }
.dc-clock strong { font-size: 2em; font-variant-numeric: tabular-nums; }
.dc-fs { font-size: 1em; }
body.display-mode.display-idle .dc-fs { visibility: hidden; }
.dc-body { flex: 1; min-height: 0; display: grid; gap: 1.6vw; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "courts next" "courts panel"; }
/* Everything fits one screen: lists that run long are cut at the bottom, never scrolled. */
.dc-courts, .dc-next, .dc-panel { min-height: 0; overflow: hidden; }
.dc-courts { grid-area: courts; }
.dc-next { grid-area: next; }
.dc-match { min-width: 0; }
.dc-match strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-panel { grid-area: panel; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1em 1.2em; position: relative; }
.dc-court-grid { display: grid; gap: 1vw; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22em), 1fr)); }
.dc-court { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0.8em 1em; display: grid; gap: 0.35em; }
.dc-court.live { border-color: var(--live); box-shadow: inset 6px 0 0 var(--live); }
.dc-court.free { border-style: dashed; opacity: 0.85; }
.dc-court-head { display: flex; justify-content: space-between; gap: 0.6em; align-items: baseline; }
.dc-court-name { font-weight: 700; font-size: 1.2em; }
.dc-court-name .dc-court-groups { font-weight: 500; font-size: 0.75em; color: var(--muted); }
.dc-court-meta { color: var(--muted); font-size: 0.9em; }
.dc-side { display: grid; grid-template-columns: 1em minmax(0, 1fr) auto auto 2.6em; align-items: center; gap: 0.5em; font-size: 1.25em; }
.dc-side.single { grid-template-columns: 1em minmax(0, 1fr) 2.6em; }
.dc-side.won .dc-name { color: var(--accent-text); }
.dc-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5em; min-width: 0; font-weight: 600; }
.dc-name > span:first-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-name .flag { flex: none; font-size: 0.6em; }
.dc-games { background: var(--surface-2); border-radius: 6px; padding: 0 0.4em; font-variant-numeric: tabular-nums; color: var(--muted); }
.dc-points { font-size: 1.5em; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.dc-free { color: var(--muted); }
.dc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5em; }
.dc-list li { display: flex; justify-content: space-between; gap: 1em; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 0.4em; }
.dc-list small { display: block; color: var(--muted); font-size: 0.8em; }
.dc-list .won { color: var(--accent-text); }
.dc-score, .dc-when { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.dc-queue li:first-child .dc-when { color: var(--accent-text); font-weight: 700; }
.dc-table { width: 100%; border-collapse: collapse; font-size: 1em; }
.dc-table th { font-size: 0.75em; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.dc-table th, .dc-table td { padding: 0.3em 0.4em; border-bottom: 1px solid var(--border); text-align: left; }
.dc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dc-champion { font-size: 2em; font-weight: 700; margin: 0.4em 0; }
.dc-follow .dc-url { font-size: 1.6em; font-weight: 700; color: var(--accent-text); word-break: break-all; }
.dc-dots { position: absolute; right: 1em; top: 1.1em; display: flex; gap: 0.35em; }
.dc-dots span { width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--border); }
.dc-dots span.on { background: var(--accent); }
.dc-wait { flex: 1; display: grid; place-content: center; text-align: center; }
.dc-wait h2 { font-size: 3em; color: var(--text); }
.dc-wait img { height: 9em; width: auto; justify-self: center; margin-bottom: 3em; }
.dc-empty { color: var(--muted); }
.dc-foot { display: flex; align-items: center; justify-content: space-between; gap: 2vw; padding-top: 0.8vw; border-top: 2px solid var(--accent); }
.dc-foot-brand { display: flex; align-items: center; gap: 0.8em; }
.dc-foot-brand img { height: 2.2em; width: auto; }
.dc-foot-brand strong { display: block; font-size: 1.3em; }
.dc-foot-brand .eyebrow { font-size: 0.75em; }
.dc-foot-brand .eyebrow b { color: var(--accent-text); font-weight: 600; }
.dc-sponsors { display: flex; gap: 2vw; justify-content: center; align-items: center; flex-wrap: wrap; flex: 1; }
.dc-sponsors img { height: 2.6em; width: auto; max-width: 10em; object-fit: contain; }
.dc-foot-cta { text-align: right; color: var(--muted); display: grid; }
.dc-foot-cta span { color: var(--accent-text); font-weight: 600; }
.dc-promo { display: grid; gap: 0.5em; align-content: start; }
.dc-promo img { height: 2.6em; width: auto; justify-self: start; }
.dc-promo p { margin: 0; }
.dc-promo .dc-url { font-size: 1.6em; font-weight: 700; }
.dc-promo-small { color: var(--muted); }
/* Every event played out: a podium per event, and a side panel. */
.dc-final-badge { justify-self: end; background: var(--accent); color: var(--on-accent); font-weight: 700; padding: 0.2em 0.7em; border-radius: 999px; }
.dc-done { flex: 1; min-height: 0; display: grid; gap: 1.6vw; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.dc-podium-wrap { min-height: 0; display: flex; flex-direction: column; gap: 1em; }
.dc-podium { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1.25fr 1fr; align-items: end; gap: 1vw; }
.dc-step { display: grid; align-content: start; justify-items: center; gap: 0.35em; text-align: center; padding: 1.2em 0.8em; background: var(--surface); border: 1px solid var(--border); border-radius: 18px 18px 0 0; }
.dc-step.first { height: 100%; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dc-step.second { height: 78%; }
.dc-step.third { height: 62%; }
.dc-medal { font-size: 2.6em; line-height: 1; }
.dc-place { font-size: 0.85em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.dc-step.first .dc-place { color: var(--on-accent); }
.dc-who { font-size: 1.7em; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.dc-step.first .dc-who { font-size: 2.4em; }
.dc-step.third .dc-who + .dc-who { margin-top: 0.2em; }
.dc-final-line { margin: 0; font-size: 1.2em; text-align: center; }
.dc-final-line .dc-score { font-variant-numeric: tabular-nums; color: var(--muted); }
.dc-done-side { grid-area: auto; }
@media (max-aspect-ratio: 1/1) {
  .dc-done { grid-template-columns: 1fr; grid-template-rows: minmax(0, 3fr) minmax(0, 2fr); }
}
@media (max-aspect-ratio: 1/1) {
  .dc-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "courts" "next" "panel"; }
}
/* Someone opening the display on a phone: a smaller logo, the name on its
   own line, and the page scrolls instead of cutting off. */
@media (max-width: 700px) {
  .display { height: auto; min-height: 100vh; overflow: visible; padding: 16px; gap: 14px; }
  .dc-head { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 10px; }
  .dc-brand { height: 1.4em; border-right: 0; padding-right: 0; margin-right: auto; }
  .dc-title { order: 3; flex-basis: 100%; }
  .dc-title h1 { font-size: 1.6em; }
  .dc-clock strong { font-size: 1.3em; }
  .dc-body { display: flex; flex-direction: column; gap: 16px; }
  .dc-courts, .dc-next, .dc-panel { overflow: visible; }
  .dc-done { display: flex; flex-direction: column; gap: 16px; }
  .dc-podium { min-height: 260px; }
  .dc-who { font-size: 1.1em; }
  .dc-step.first .dc-who { font-size: 1.35em; }
}

/* Entry fees paid to the organiser */
.qr-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.qr-preview { width: 96px; height: 96px; object-fit: contain; border-radius: 10px; background: var(--qr-bg); padding: 6px; border: 1px solid var(--border); }
.qr-pay { display: block; width: 200px; max-width: 70%; margin: 12px 0; border-radius: 12px; background: var(--qr-bg); padding: 10px; border: 1px solid var(--border); }
.pay-upi { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); margin: 10px 0; word-break: break-all; }
.pay-card .form { margin-top: 6px; }
.payments-card { border-color: var(--accent); }
.pay-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pay-list li { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.pay-who { display: grid; gap: 2px; }

/* My entries (home) */
.my-entry { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); font-size: 0.9rem; }

/* Courts and order of play */
.court-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.court-card { display: grid; gap: 8px; margin: 0; padding: 12px 14px; }
.court-card.free { border-style: dashed; }
.court-card.dim { opacity: 0.45; }
.court-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.court-head > small { margin-right: auto; }
.court-match { display: grid; gap: 2px; color: var(--text); text-decoration: none; font-weight: 600; }
.court-call { white-space: normal; text-align: left; }
.order-of-play li.waiting .entry-name { color: var(--muted); }
.oop-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Prizes and what's included */
.prizes-card h2 { margin-top: 18px; }
.prizes-card h2:first-child { margin-top: 0; }
.prize-event { font-size: 0.95rem; margin: 12px 0 4px; }
.prize-list, .perk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prize-list li { display: grid; grid-template-columns: 24px auto 1fr; gap: 4px 8px; align-items: baseline; }
.prize-place { font-weight: 600; }
.prize-what { text-align: right; font-weight: 700; }
.perk-list { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.perk-list li::before { content: '✓'; display: inline-block; width: 1.4em; font-weight: 700; color: var(--accent-text); }
.prize-row .prize-place, .prize-row .prize-custom { grid-column: 1 / 3; }
.prize-row .prize-cash { grid-column: 1; }
.prize-row .prize-reward { grid-column: 2; }
.perk-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.perk-tag { background: var(--surface); }

/* Event list builder */
.ev-rows { display: grid; gap: 10px; }
.ev-row {
  display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.ev-row .ev-type { grid-column: 1; grid-row: 1; }
.ev-row .ev-remove { grid-column: 2; grid-row: 1; }
.ev-row .ev-age, .ev-row .ev-level { grid-column: 1 / -1; }
.ev-row .choice { min-height: 34px; padding: 5px 11px; font-size: 0.88rem; }
.ev-row .choice .icon { width: 18px; height: 18px; }
.ev-preview { grid-column: 1 / -1; font-size: 0.85rem; color: var(--muted); }
.ev-row.dup { border-color: var(--danger); }
.ev-row.dup .ev-preview { color: var(--danger); }
.ev-note { color: var(--danger); margin: 0; font-size: 0.85rem; }
.ev-several { border-top: 1px solid var(--border); padding-top: 10px; }
.ev-several > summary { font-weight: 600; }
.ev-several strong { display: block; margin: 8px 0 4px; font-size: 0.9rem; }
.ev-several .quick-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
/* Tournament page: cover, about, photos */
.brand .brand-mark { display: none; }
body.branded .brand .brand-full { display: none; }
body.branded .brand .brand-mark { display: block; }
.t-hero { margin: 0 0 14px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 7; background: var(--surface-2); }
.t-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-card.has-cover { padding-top: 0; overflow: hidden; }
.t-card-cover { display: block; width: calc(100% + 32px); margin: 0 -16px 12px; aspect-ratio: 16 / 7; object-fit: cover; background: var(--surface-2); }
/* A poster on a card: whole, centred, over a soft blur of itself. */
.t-card-cover.poster { position: relative; overflow: hidden; }
.t-card-cover.poster::before { content: ''; position: absolute; inset: -20px; background: var(--cover) center / cover; filter: blur(18px) brightness(.6); }
.t-card-cover.poster img { position: relative; display: block; height: 100%; width: auto; margin: 0 auto; }
/* The tournament page with an Instagram poster: the whole poster beside the title. */
.t-head.has-poster { display: grid; grid-template-columns: minmax(112px, 38%) minmax(0, 1fr); gap: 14px; align-items: start; margin: 8px 0 12px; }
.t-head.has-poster .t-header { margin: 0; }
.t-head.has-poster .t-title { gap: 8px; }
.t-head.has-poster .t-title h1 { font-size: clamp(1.2rem, 5vw, 2rem); line-height: 1.15; overflow-wrap: anywhere; flex-basis: 100%; }
.t-poster { display: block; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 9 / 16; background: var(--surface-2); cursor: zoom-in; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.t-poster img { display: block; width: 100%; height: 100%; object-fit: contain; }
.t-poster:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (min-width: 720px) { .t-head.has-poster { grid-template-columns: 300px minmax(0, 1fr); gap: 24px; } .t-head.has-poster .t-title h1 { font-size: 2.2rem; } }
.about-text p { margin: 0 0 8px; overflow-wrap: anywhere; }
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gallery-item { padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; background: var(--surface-2); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.gallery-item:hover img { transform: scale(1.03); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(7, 12, 23, 0.94); display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; }
.lb-caption { color: var(--mist); margin: 0; text-align: center; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, 0.12); color: var(--court-ink); border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 1.4rem; cursor: pointer; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* Organiser branding (paid) */
.org-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.org-logo { height: 44px; width: auto; max-width: 160px; object-fit: contain; }
.org-name { font-weight: 700; font-size: 1.1rem; }
.sponsors { margin: 28px 0 8px; text-align: center; }
.sponsor-logos { display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: center; align-items: center; }
.sponsor-logos img { height: 44px; width: auto; max-width: 140px; object-fit: contain; }
.powered { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 20px 0 4px; color: var(--muted); text-decoration: none; font-size: 0.8rem; letter-spacing: 0.04em; }
.powered img { height: 14px; width: auto; }

/* Page & branding panel */
.cover-preview { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 10px; }
.cover-preview.poster { width: 160px; aspect-ratio: 9 / 16; object-fit: contain; background: var(--surface-2); }
.photo-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.photo-list li { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.photo-list li img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.photo-list li .hint { grid-column: 2; }
.photo-list li.hidden-photo img { opacity: 0.4; }
.locked { opacity: 0.95; border-style: dashed; }
.brand-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.logo-preview.empty { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatches input[type=color] { width: 44px; height: 36px; padding: 2px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.sponsor-admin { display: grid; gap: 8px; }
.sponsor-admin .sponsor-logos { justify-content: flex-start; }
.sponsor-edit { position: relative; display: inline-flex; }
.sponsor-edit .icon-btn { position: absolute; top: -10px; right: -12px; width: 26px; height: 26px; background: var(--surface); border: 1px solid var(--border); }
label.btn.disabled { opacity: 0.5; pointer-events: none; }
.uploading { margin: 0; }

/* ---------- features page (/features) */
.features-page .hero { margin-bottom: 18px; }
.features-page .hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.hero-note { margin: 14px 0 0; font-size: 0.9rem; }
.sport-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; }
.sport-strip span, .sport-strip a { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 0.9rem; background: var(--surface); color: var(--text); text-decoration: none; }
.sport-strip a:hover { border-color: var(--accent); }
.spotlights { gap: 56px; margin-bottom: 56px; }
.spotlights .step-text h2 { margin: 4px 0 10px; font-size: clamp(1.5rem, 4vw, 2rem); }
.spotlights .eyebrow { color: var(--accent-text); margin: 0; }
.step.step-wide, .step.step-wide:nth-child(even) { grid-template-columns: minmax(0, 1fr); }
.step-wide .step-text { order: 0; max-width: 40em; }
.tv-shot { margin: 0; border: 10px solid var(--scoreboard); border-radius: 16px; overflow: hidden; box-shadow: 0 16px 40px rgba(11, 18, 32, 0.35); }
.tv-shot img { display: block; width: 100%; height: auto; }
.features-title { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 16px; }
.feature-groups { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-bottom: 40px; }
.feature-groups section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.feature-groups h3 { margin: 0 0 10px; font-size: 1.1rem; }
.feature-groups ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.feature-groups li { position: relative; padding-left: 18px; color: var(--muted); }
.feature-groups li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.feature-groups li strong { color: var(--text); font-weight: 600; }
.price-strip h2 { margin-top: 0; }
.price-tiers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 6px 0 14px; }
.price-tiers > div { display: grid; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.price-tiers strong { font-size: 1.4rem; }
.price-tiers > div > span { color: var(--muted); font-size: 0.9rem; }
.hero-end { margin-top: 32px; }
.hero-end h2 { color: inherit; font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 0 0 10px; }

/* ---------- choice buttons (instead of dropdowns): pills, or tiles with an icon */
.icon { display: inline-flex; width: 22px; height: 22px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.scoring-grid { display: grid; gap: 14px; }
.choice {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 0.95rem; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice.disabled { opacity: 0.45; cursor: not-allowed; }
.choice small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.choice:has(input:checked) small { color: inherit; opacity: 0.8; }
.choice-group.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); }
.choice-group.tiles .choice { flex-direction: column; justify-content: center; text-align: center; border-radius: 14px; padding: 14px 10px; min-height: 96px; }
.choice-group.tiles .icon { width: 34px; height: 34px; }
.formats .choice-group.tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.formats .choice-group.tiles .choice { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; text-align: left; gap: 2px 12px; min-height: 0; padding: 12px 14px; }
.formats .choice-group.tiles .icon { grid-row: span 2; width: 30px; height: 30px; }

/* ---------- new tournament, in steps */
.new-flow { max-width: 680px; margin: 8px auto 24px; display: grid; gap: 14px; }
.new-flow h1 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.1rem); }
.new-flow h2 { margin: 0; font-size: 1.25rem; }
.new-flow p { margin: 0; }
.new-flow .actions { display: flex; justify-content: flex-end; }
.new-head { display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.new-progress { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.new-progress .dots { display: inline-flex; gap: 5px; }
.new-progress .dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.new-progress .dots span.on { background: var(--accent); }
.back-link, .link-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; color: var(--link); cursor: pointer; text-align: left; }
.back-link:hover, .link-btn:hover { text-decoration: underline; }

/* ---------- setup checklist (tournament page, before the start) */
.checklist ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.checklist-count { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.checklist-count .progress { flex: 1; max-width: 220px; }
.check-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.check-row .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; }
.check-row.done .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check-row .check-text { display: grid; min-width: 0; }
.check-row .check-text small { color: var(--muted); font-weight: 400; }
.check-row.optional:not(.done) .tick { border-style: dashed; }
.check-row .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- sport landing pages (/badminton, …) and /sports */
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 4px 0 10px; }
.crumbs a { color: var(--muted); }
.sport-page > section { margin-bottom: 40px; }
.sport-page .hero { margin-bottom: 32px; }
.hero .hero-icon { width: 20px; height: 20px; vertical-align: -4px; color: var(--lime); }
.sport-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-bottom: 10px; }
.sport-page .feature-groups p { margin: 0; }
.sport-page .empty-list p { margin: 0 0 10px; }
.choice-group.tiles.sports-hub { margin-bottom: 40px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.sports-hub .choice { text-decoration: none; }
.sports-hub .choice small { margin-top: 4px; }

/* Venue display on Open and above: the organiser leads, Tonament is a small "Powered by" */
.display .dc-org-logo { height: 3.4em; width: auto; max-width: 16em; object-fit: contain; border-radius: 8px; }
.display .dc-org-name { font-size: 1.7em; font-weight: 700; color: var(--text); white-space: nowrap; }
.display.white-label .dc-head { border-bottom-color: var(--border); }
.dc-wait .dc-wait-org { justify-self: center; margin-bottom: 1.5em; }
.dc-wait img.dc-wait-org { height: 9em; max-width: 30em; }
.dc-wait span.dc-wait-org { font-size: 2.6em; }
.dc-foot-white { border-top: 1px solid var(--border); }
.dc-powered { margin: 0; display: inline-flex; align-items: center; gap: 0.5em; color: var(--muted); font-size: 0.8em; white-space: nowrap; }
.dc-powered img { height: 1.05em; width: auto; opacity: 0.75; }

/* ---------- site admin dashboard (/admin) */
.admin { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 12px; }
.admin h3 { margin: 0 0 10px; font-size: 1rem; }
.stat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.stat { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }
.chart-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.chart-grid > .card { margin: 0; }
.chart-card .card-head { align-items: baseline; }
.chart-tip { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.bars { display: block; width: 100%; height: 110px; border-bottom: 1px solid var(--border); }
.bars .bar { fill: var(--accent-text); pointer-events: none; }
.bars .bar-hit { fill: transparent; cursor: default; outline: none; }
.bars .bar-hit:hover, .bars .bar-hit:focus-visible { fill: var(--accent-soft); }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.75rem; margin-top: 4px; }
.chart-table summary { cursor: pointer; color: var(--muted); font-size: 0.8rem; margin-top: 6px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 0.9rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hbar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent-text); }
.admin-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.admin-log li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; font-size: 0.9rem; }
.admin-filters { display: grid; gap: 12px; margin: 0; }
.search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search-row input[type=search] { flex: 1 1 220px; }
.search-row select { flex: 0 1 180px; }
.search-row select.grow { flex: 1 1 200px; min-width: 0; }
.admin-filters .choice { min-height: 32px; padding: 4px 12px; font-size: 0.88rem; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.admin-row { margin: 0; display: grid; gap: 10px; }
.admin-row-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.admin-name { font-weight: 700; font-size: 1.05rem; padding: 0; }
.admin-row .choice { min-height: 32px; padding: 4px 12px; font-size: 0.88rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-actions .check-field { margin: 0 8px 0 0; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.admin-detail h4 { margin: 8px 0 4px; font-size: 0.9rem; }
.admin-detail ul { margin: 0; padding-left: 1.1em; font-size: 0.9rem; }
.reset-link { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0; }
.admin-sum { margin: 0; flex-wrap: wrap; gap: 8px; }
.refund-card { display: grid; gap: 10px; margin: 0; border-color: var(--accent); }
.refund-card h3 { margin: 0; }
.admin-pay td, .admin-pay th { white-space: nowrap; }

/* ---------- academy / venue pages (/@slug) */
.org-hero { position: relative; overflow: hidden; border-radius: 20px; margin: 8px 0 32px; color: var(--mist); border: 1px solid var(--header-border);
  padding: clamp(28px, 6vw, 56px) clamp(20px, 5vw, 48px); min-height: 260px; display: flex; align-items: flex-end;
  background: linear-gradient(115deg, transparent 0 74%, var(--lime) 74% 77%, transparent 77%), radial-gradient(circle at 85% 20%, #1B2740 0, var(--navy) 65%); }
.org-hero.has-cover { background: linear-gradient(180deg, rgba(11, 18, 32, 0.25) 0%, rgba(11, 18, 32, 0.92) 78%), var(--cover) center / cover no-repeat, var(--navy); min-height: 340px; }
.org-hero-inner { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.org-hero h1 { color: var(--court-ink); font-size: clamp(1.9rem, 6vw, 3rem); margin: 4px 0 10px; letter-spacing: -0.01em; }
.org-hero .eyebrow { color: var(--court-soft); margin: 0; }
.org-hero .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.org-hero .btn-ghost { color: var(--court-ink); border-color: rgba(255, 255, 255, 0.4); }
.org-hero-logo { width: 96px; height: 96px; object-fit: contain; border-radius: 18px; background: var(--court-ink); padding: 6px; flex: none; }
.org-sports { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.org-sports a { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 999px; padding: 4px 12px; color: var(--court-ink); text-decoration: none; font-size: 0.9rem; }
.org-sports .icon { width: 18px; height: 18px; color: var(--lime); }
.org-about p { margin: 0 0 10px; max-width: 46em; }
.org-facts { margin-bottom: 40px; }
.org-locations { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-bottom: 40px; }
.org-location h3 { margin: 0 0 8px; }
/* The sport chips sit on the card here, not on the dark header: theme colours. */
.org-location .org-sports a { color: var(--text); border-color: var(--border); }
.org-location .org-sports .icon { color: var(--accent-text); }
.org-location p { margin: 6px 0; }
.org-location .actions { margin-top: 12px; }
.org-gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.org-gallery a { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--surface); }
.org-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.org-lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1200px); }
.org-lightbox::backdrop { background: rgba(7, 12, 23, 0.92); }
.org-lightbox img { display: block; max-width: 100%; max-height: 88vh; border-radius: 12px; }
.org-lightbox button { position: absolute; top: 8px; right: 8px; }

/* the academy editor (/@slug/edit) and create flow */
.slug-input { display: flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding-left: 12px; }
.slug-input input { border: 0; background: transparent; padding-left: 0; min-width: 0; flex: 1; }
.slug-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.slug-status { display: block; margin: -6px 0 12px; min-height: 1.4em; }
.slug-status.ok { color: var(--accent-text); }
.slug-status.bad { color: var(--danger); }
.org-edit-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 16px; }
.org-edit-title { flex: 1 1 14rem; min-width: 0; }
.org-edit-head h1 { margin: 0; overflow-wrap: anywhere; }
.org-edit-head p { margin: 2px 0 0; overflow-wrap: anywhere; }
.org-edit-head .actions { margin: 0; }
.org-edit-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: var(--qr-bg); padding: 4px; flex: none; }
.org-status { border-left: 4px solid var(--border); }
.org-status.live { border-left-color: var(--accent); }
.org-status.grace, .org-status.lapsed { border-left-color: var(--danger); }
.org-status h2 { margin: 0 0 4px; }
.org-status .actions { margin-bottom: 0; }
.org-perk { margin: 10px 0 0; color: var(--accent-text); }
.coach-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 12px; }
.coach-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px 12px 4px; }
.org-photo-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.org-photo-grid li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.org-photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.org-photo-grid .icon-btn { position: absolute; top: 4px; right: 4px; background: var(--surface); }
.org-t-list { list-style: none; padding: 0; margin: 0 0 12px; }
.org-t-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.org-t-list li a { font-weight: 600; flex: 1 1 12em; }
.org-t-list li > .actions, .org-t-list li > .more-btn { margin-left: auto !important; }
.t-byline { font-size: 0.9rem; color: var(--link); }
.settings-card .switch-field strong { font-size: 1.05rem; }
.price-card.org-price { margin: 16px 0; border: 2px solid var(--accent); }
@media (min-width: 800px) { .price-card.org-price { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px 32px; align-items: start; } .price-card.org-price .btn { grid-column: 1 / -1; justify-self: start; } }

/* ---------- player profiles and rankings (/p/<handle>, /rankings) */
.player-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 8px 0 24px; }
.player-hero > div { flex: 1 1 16rem; min-width: 0; }
.player-hero h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
.player-hero p { margin: 4px 0; }
.player-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); border: 3px solid var(--accent); }
.player-avatar.initials, .rank-avatar.initials, .round.initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--on-accent); background: var(--accent); }
.player-avatar.initials { font-size: 2rem; }
.player-titles { font-weight: 600; }
.dupr-line .pill { margin-right: 4px; }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); margin: 0 0 24px; }
.rank-chips { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.rank-chip { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); }
.rank-chip strong { font-size: 1.6rem; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.rank-chip small { color: var(--muted); }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list > li { padding: 12px 0; border-top: 1px solid var(--border); }
.result-list > li:first-child { border-top: 0; }
.result-list p { margin: 4px 0 0; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.result-head a { font-weight: 600; overflow-wrap: anywhere; }
.result-head .more-btn { margin-left: auto; }
.finish { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.finish-w { background: var(--accent); color: var(--on-accent); }
.finish-f, .finish-sf { background: var(--accent-soft); color: var(--accent-text); }
.match-lines { list-style: none; padding: 0; margin: 6px 0 0; font-size: 0.92rem; }
.match-lines li { padding: 2px 0; }
.match-lines .won, .match-lines .lost, .match-lines .drew { display: inline-block; width: 1.4em; font-weight: 700; }
.match-lines .won { color: var(--accent-text); }
.match-lines .lost { color: var(--muted); }
.rank-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 20px; }
.rank-head > .icon { width: 44px; height: 44px; flex: none; color: var(--accent-text); }
.rank-head h1 { margin: 0; font-size: clamp(1.5rem, 5vw, 2.2rem); overflow-wrap: anywhere; }
.rank-head p { margin: 2px 0 0; }
.rank-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.rank-card { margin: 0; }
.rank-card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.rank-card h2 a { color: var(--text); text-decoration: none; }
.rank-list { list-style: none; padding: 0; margin: 0 0 8px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.rank-row:first-child { border-top: 0; }
.rank-no { width: 2.2em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); flex: none; }
.rank-row:nth-child(-n+3) .rank-no { color: var(--accent-text); }
.rank-avatar { width: 36px; height: 36px; aspect-ratio: 1; align-self: center; border-radius: 50%; object-fit: cover; flex: none; font-size: 0.8rem; line-height: 1; }
.rank-name { flex: 1; min-width: 0; display: grid; }
.rank-name a { font-weight: 600; overflow-wrap: anywhere; }
.rank-pts { text-align: right; display: grid; line-height: 1.1; }
.rank-pts strong { font-variant-numeric: tabular-nums; }
.rank-pts small { color: var(--muted); font-size: 0.75rem; }
.rank-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px; }
.rank-filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 8px; scrollbar-width: thin; }
.rank-filters .chip { flex: none; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 0.9rem; background: var(--surface); }
.rank-filters .chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.player-link { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.player-link:hover { text-decoration-color: currentColor; }
.link-form { display: grid; gap: 4px; margin: 8px 0 4px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.logo-preview.round, .org-edit-logo.round { border-radius: 50%; object-fit: cover; padding: 0; }
.org-edit-logo.round.initials { width: 56px; height: 56px; font-size: 1.2rem; }
.logo-preview.round.initials { font-size: 1.4rem; }

/* ---------- sign in with a link */
.check-code { display: flex; align-items: baseline; gap: 12px; margin: 4px 0; }
.check-code strong { font-size: 2rem; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; color: var(--accent-text); }

/* ---------- groups (daily play) */
.page-head { margin: 4px 0 16px; flex-wrap: wrap; gap: 10px; }
.page-head h1 { margin: 0; }
.group-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.group-card > .icon { width: 36px; height: 36px; color: var(--accent-text); flex: none; }
.group-card-main { flex: 1; min-width: 0; display: grid; }
.group-card-main strong { overflow-wrap: anywhere; }
.group-card-rating { display: grid; text-align: right; line-height: 1.1; }
.group-card-rating small { color: var(--muted); font-size: 0.75rem; }
.empty-state h2 { margin-top: 0; }
.group-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 12px; }
.group-head h1 { margin: 0; overflow-wrap: anywhere; }
.group-head p { margin: 2px 0 0; }
.group-head-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex: none; }
.group-head-icon .icon { width: 34px; height: 34px; }
.tab-count { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.75rem; font-weight: 700; text-align: center; }
.rsvp-card h2, .checkin-card h2 { margin: 0; }
.rsvp-card.small h2 { font-size: 1.05rem; }
.rsvp-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 6px; }
.rsvp-buttons .btn { width: 100%; justify-content: center; }
.btn-dark { background: var(--surface-2); border-color: var(--border); }
.rsvp-count { margin: 4px 0; }
.rsvp-names { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.name-chip { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.88rem; }
.name-chip.here { border-color: var(--accent); }
.claim-card { border-color: var(--accent); }
.claim-card h2 { margin: 4px 0 2px; font-size: 1.6rem; }
.claim-standing { display: inline-block; margin: 4px 0 10px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 0.92rem; }
.find-name h2 { margin: 0 0 4px; }
.name-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.name-pick { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 0.95rem; cursor: pointer; }
.name-pick:hover, .name-pick:focus-visible { border-color: var(--accent); }
.name-pick-rank { color: var(--accent-text); font-weight: 700; font-size: 0.85rem; }
.name-chip small { color: var(--muted); }
.eta-field { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 600; }
.eta-field select { width: auto; flex: 0 1 auto; }
.arrivals { margin: 4px 0 0; color: var(--muted); }
.arrivals strong { color: var(--text); font-weight: 600; }
.group-level { margin: 6px 0 0; }
.host-chip { margin: 4px 0 0; font-size: 0.88rem; color: var(--muted); }
.host-chip a, .host-chip strong { font-weight: 600; }
.attendance-table td.here { color: var(--accent-text); font-weight: 700; }
.attendance-table tr.totals td { color: var(--muted); border-top: 1px solid var(--border); }
.checkin-card.on { border-left: 4px solid var(--accent); }
.checkin-card .card-head { align-items: center; gap: 12px; flex-wrap: wrap; }
.court-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-bottom: 16px; }
.court-card { margin: 0; display: grid; gap: 4px; text-decoration: none; color: var(--text); border-left: 4px solid var(--live); }
.court-card.free { border-left-color: var(--border); }
.court-no { font-weight: 700; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.court-no .live-dot { color: var(--live); }
.court-team { display: flex; justify-content: space-between; gap: 8px; }
.court-team strong { font-variant-numeric: tabular-nums; font-size: 1.2rem; }
.upnext-card { border: 2px solid var(--accent); }
.upnext-card h2 { margin: 0; }
.upnext-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 12px 0; font-weight: 700; font-size: 1.1rem; }
.upnext-teams .team:last-child { text-align: right; }
.upnext-teams .vs { color: var(--muted); font-weight: 600; }
.game-line { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.game-line .won { font-weight: 700; }
.game-line small.up { color: var(--accent-text); }
.game-line small.down { color: var(--muted); }
.rank-row.me { background: var(--accent-soft); border-radius: 8px; }
.final-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; margin-top: 10px; }
.final-form label { display: grid; gap: 4px; font-size: 0.9rem; }
.final-form button { grid-column: 1 / -1; }
.final-score { text-align: center; font-size: 1.4rem; }
.setup-card { border: 2px solid var(--accent); }
.setup-card h2 { margin-top: 0; }

/* Level pools: an Open event split by level */
.adv-section + .adv-section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.adv-head { margin: 0 0 8px; font-size: 0.95rem; font-weight: 700; }
.adv-section > .check-field { margin-bottom: 0; }
.placement-set .choice-group, .pools-card .choice-group { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 6px 0 4px; }
.placement-set .choice, .pools-card .choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border-radius: 14px; padding: 10px 14px; text-align: left; }
.placement-set .choice-label, .pools-card .choice-label { font-weight: 700; }
.placement-set .choice small, .pools-card .choice small { display: block; margin: 0; white-space: normal; }
.pool-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; color: var(--muted); }
.pool-counts b { display: inline-block; min-width: 26px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 0.8rem; text-align: center; }
.pool-counts .none { color: var(--danger); font-weight: 600; }
.pool-meet { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-weight: 600; }
.level-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.level-chip { min-width: 30px; min-height: 32px; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.level-chip[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.level-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pool-tag { margin-left: 8px; vertical-align: middle; font-size: 0.75rem; }
.move-select { display: block; margin-top: 4px; width: auto; max-width: 100%; padding: 2px 6px; font-size: 0.8rem; min-height: 0; }

/* On the day: not here yet, arrived, retired, play next */
.banner.warn { background: var(--live-soft); border: 1px solid var(--live); }
.court-head .pill { margin-left: auto; }
.oop-actions, .play-actions, .arrive-form, .retire-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.order-of-play li { flex-wrap: wrap; }
.order-of-play .oop-actions { margin: 0 0 0 auto; justify-content: flex-end; }
.order-of-play .oop-actions.wide { flex-basis: 100%; margin-top: 6px; }
.arrive-form select { width: auto; max-width: 100%; }

/* Team rosters and payments per player */
.roster-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'name cap del' 'email email email'; gap: 4px 6px; align-items: center; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.roster-row [data-k=name] { grid-area: name; }
.roster-row [data-k=email] { grid-area: email; }
.roster-row .roster-cap { grid-area: cap; }
.roster-row .icon-btn { grid-area: del; }
.roster-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.roster-row input[type=text], .roster-row input:not([type]), .roster-row input[type=email] { min-width: 0; width: 100%; }
.roster-cap { display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 0.8rem; color: var(--muted); }
.member-fees ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.member-fees li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }

/* Entry fees per event (Tournament settings) */
.fee-rows { display: grid; gap: 8px; margin: 10px 0; }
.fee-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 8px; align-items: center; }
.fee-row input { width: 100%; }
.fee-row select { width: auto; }
.fee-row label small { display: block; }

/* Free fixture tools (/tools/*) */
.tool-hero { margin-bottom: 14px; }
.tool { padding: 18px; margin-bottom: 32px; }
.tool-form .field { display: grid; gap: 6px; margin: 0 0 12px; }
.tool-form .field > span { font-weight: 600; font-size: 0.9rem; }
.tool-form textarea { width: 100%; font: inherit; }
.tool-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.tool-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.tool-actions { margin: 4px 0 6px; }
.tool-note { margin: 6px 0 0; }
.tool-print-title { display: none; }
.tool-output { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.tool-summary { margin: 0 0 12px; }
.tool-group { margin: 0 0 22px; }
.tool-group h3, .tool-pool { margin: 0 0 8px; }
.tool-pool { margin-top: 22px; font-size: 1.15rem; }
.tool-members { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 10px; list-style: none; counter-reset: m; }
.tool-members li { counter-increment: m; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 0.88rem; background: var(--surface-2); }
.tool-members li::before { content: counter(m) '. '; color: var(--muted); }
.tool-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tool-table th, .tool-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tool-table th:first-child, .tool-table td:first-child { width: 3.5em; color: var(--muted); }
.tool-match { display: inline-block; margin: 0 14px 2px 0; }
.tool-bye { display: inline-block; color: var(--muted); font-style: italic; }
.tool-bracket { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.tool-round { flex: 0 0 190px; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.tool-round h3 { font-size: 0.9rem; margin: 0 0 4px; color: var(--muted); }
.tool-slot { display: grid; gap: 2px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; background: var(--surface-2); font-size: 0.88rem; }
.tool-slot.bye { opacity: 0.75; }
.tool-steps { padding-left: 1.2em; }
.tool-steps li { margin-bottom: 10px; }
.tool-steps p { margin: 2px 0 0; color: var(--muted); }
.tool-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 32px; }
.tool-card { display: grid; gap: 6px; color: var(--text); text-decoration: none; }
.tool-card:hover { border-color: var(--accent); }

/* Blog (/blog) */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.post-tags a { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 0.88rem; color: var(--text); text-decoration: none; background: var(--surface); }
.post-tags a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.post-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0 24px; }
.post-card { display: grid; gap: 6px; color: var(--text); text-decoration: none; align-content: start; }
.post-card:hover { border-color: var(--accent); }
.post-card h2, .post-card h3 { margin: 0; }
.post-card p { margin: 0; }
.post-card.featured { padding: 22px; margin-bottom: 12px; }
.post-card.has-cover { padding-top: 0; overflow: hidden; }
/* Covers: navy brand art, cropped to a band; edge to edge on the card. */
.post-thumb { display: block; width: calc(100% + 32px); max-width: none; height: 140px; margin: 0 -16px 6px; object-fit: cover; object-position: 72% 50%; background: var(--navy); }
.post-card.featured .post-thumb { width: calc(100% + 44px); height: clamp(150px, 24vw, 240px); margin: 0 -22px 8px; }
.post-cover { display: block; width: 100%; max-width: none; height: clamp(150px, 26vw, 260px); object-fit: cover; object-position: 72% 50%; border-radius: var(--radius); margin: 18px 0 6px; background: var(--navy); }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.85rem; }
.post { max-width: 720px; margin: 0 auto 32px; }
.post-head h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em; margin: 10px 0; text-wrap: balance; }
.post-head .lead { font-size: 1.12rem; color: var(--muted); }
.post-toc { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 18px 0; background: var(--surface); font-size: 0.92rem; }
.post-toc ul { margin: 6px 0 0; padding-left: 1.2em; }
.post-body { font-size: 1.05rem; line-height: 1.7; }
/* Laptops: the post uses the page's width. Text in a readable column, the
   contents beside it and in view while you read; a post without contents
   is one wider column. Phones keep the single column above. */
@media (min-width: 1000px) {
  .post { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 250px; column-gap: 48px; align-items: start; }
  .post > * { grid-column: 1; min-width: 0; }
  .post > .post-head { grid-column: 1 / -1; }
  /* The cover beside the title, whole (not cropped to a band). */
  .post-head:has(> .post-cover) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 40%); column-gap: 40px; align-items: center; }
  .post-head > * { grid-column: 1; }
  .post-head > .post-cover { grid-column: 2; grid-row: 1 / span 5; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; object-position: 50% 50%; margin: 0; }
  .post-head { margin-bottom: 22px; }
  .post > .post-toc { grid-column: 2; grid-row: 2 / span 3; position: sticky; top: 84px; margin: 0; max-height: calc(100vh - 110px); overflow: auto; }
  .post-toc ul { list-style: none; padding: 0; display: grid; gap: 6px; }
  .post:not(:has(> .post-toc)) { grid-template-columns: minmax(0, 860px); justify-content: center; }
  .post-body { font-size: 1.08rem; }
  .post-diagram .dg { max-width: 560px; }
}
.post-body h2 { font-size: 1.45rem; margin: 36px 0 10px; line-height: 1.25; scroll-margin-top: 80px; }
.post-body h3 { font-size: 1.15rem; margin: 26px 0 8px; }
.post-body img { max-width: 100%; height: auto; }
.post-body blockquote { margin: 18px 0; padding: 4px 16px; border-left: 4px solid var(--accent); color: var(--muted); }
.post-body .table-wrap { overflow-x: auto; margin: 16px 0; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.post-body th, .post-body td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; white-space: normal; }
.post-body th { background: var(--surface); }
.post-figure { margin: 22px 0; text-align: center; }
.post-figure img { border-radius: 12px; border: 1px solid var(--border); }
.post-figure.phone-shot img { max-width: 320px; }
/* A cut-out product image (transparent PNG/WebP from /brand): no frame, a soft glow behind. */
.post-figure.product-shot { background: radial-gradient(closest-side, var(--accent-soft), transparent); padding: 8px 0; }
.post-figure.product-shot img { border: 0; border-radius: 0; width: auto; max-width: 100%; height: min(320px, 70vw); }
.post-figure figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 6px; }
.paper-inline { margin: 22px auto; max-width: 420px; transform: rotate(-1deg); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.paper-inline p { white-space: normal; }
.post-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.post-compare > div { border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 16px; background: var(--surface); }
.post-compare > div:last-child { border-color: var(--accent); }
@media (max-width: 640px) { .post-compare { grid-template-columns: 1fr; } }
.post-cta { margin: 36px 0 0; padding: 20px; border-color: var(--accent); }
.post-cta h2 { margin: 0 0 6px; }
.rank-mini { padding-left: 1.3em; margin: 0 0 6px; }

/* Printing a tool's fixtures: just the draw, black on white. */
@media print {
  .topbar, .footer, .crumbs, .tool-hero, .tool-form, main > section:not(.tool), main > nav, main > div:not(.tool-cards) { display: none !important; }
  main > .tool-cards { display: none !important; }
  body, .card, .tool { background: var(--print-bg) !important; color: var(--print-ink) !important; box-shadow: none !important; border: 0 !important; }
  .tool { padding: 0; }
  .tool-print-title { display: block; margin: 0 0 8px; color: var(--print-ink); }
  .tool-output { border: 0; margin: 0; padding: 0; }
  .tool-members li, .tool-slot { background: var(--print-bg) !important; border-color: var(--print-line) !important; color: var(--print-ink) !important; }
  .tool-table th, .tool-table td { border-color: var(--print-line) !important; color: var(--print-ink) !important; }
  .tool-bracket { overflow: visible; flex-wrap: wrap; }
  .tool-group { break-inside: avoid; }
  .muted { color: var(--print-muted) !important; }
}

/* Installing the app (Add to Home screen) */
.install-banner { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 14px; }
.install-banner img { border-radius: 10px; flex: none; }
.install-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.install-text small { line-height: 1.3; }
.install-close { flex: none; padding-inline: 10px; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.55); padding: 16px; }
.sheet { width: min(440px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 20px; padding: 22px 20px 18px; text-align: center; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4); }
.sheet h2 { margin: 10px 0 12px; font-size: 1.2rem; }
.sheet-icon { border-radius: 14px; }
.sheet-steps { text-align: left; margin: 0 0 16px; padding-left: 1.3em; display: grid; gap: 10px; }
.share-glyph { display: inline-flex; vertical-align: -4px; color: var(--link); }
.sheet .btn { width: 100%; }
.action-sheet { text-align: left; padding-bottom: 14px; }
.action-sheet h2 { margin: 0 0 10px; font-size: 1.05rem; overflow-wrap: anywhere; }
.sheet-actions { display: grid; margin: 0 -8px 10px; }
.sheet-action { font: inherit; text-align: left; display: grid; gap: 1px; padding: 12px 10px; min-height: 48px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-weight: 600; cursor: pointer; }
.sheet-action:hover, .sheet-action:focus-visible { background: var(--surface-2); }
.sheet-action small { font-weight: 400; font-size: 0.8rem; }
.sheet-action.danger { color: var(--danger); }
.more-btn { flex: none; font-size: 1.25rem; line-height: 1; color: var(--text); }
.next-step { border-left: 4px solid var(--accent); }
.next-step .eyebrow { margin: 0 0 4px; }
.next-step h2 { margin: 0 0 4px; font-size: 1.15rem; overflow-wrap: anywhere; }
.next-step .actions { margin-top: 12px; }
.next-progress { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.next-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; }
.draw-seg, .seg.draw-seg { margin: 0 0 12px; }
.sheet-backdrop.top { align-items: flex-start; }
.search-sheet { text-align: left; padding: 12px 14px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.search-bar { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.search-sheet .search-bar .btn { width: auto; flex: none; }
.search-q { flex: 1; min-width: 0; }
.search-results { margin-top: 10px; }
.search-results > p { margin: 8px 2px; }
.search-hit { padding: 10px 0; border-top: 1px solid var(--border); }
.search-name { display: grid; gap: 1px; text-decoration: none; color: var(--text); }
.search-hit ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.search-hit li a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.search-hit li a small { display: block; }
.t-search { flex: none; }
.fold { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.fold > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; list-style: none; font-weight: 400; }
.fold > summary::-webkit-details-marker { display: none; }
.fold[open] > summary { margin-bottom: 12px; }
.fold[open] .fold-change { visibility: hidden; }
.fold-change { color: var(--link); font-weight: 600; font-size: 0.9rem; flex: none; }
/* Clubs */
.club-head { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 14px; }
.club-head h1 { margin: 0; font-size: 1.5rem; overflow-wrap: anywhere; }
.club-head-text { flex: 1; min-width: 0; }
.club-head p { margin: 4px 0 0; }
.club-head .actions { margin-top: 10px; align-items: center; }
.club-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; flex: none; }
.club-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--on-accent); flex: none; }
.club-icon.big { width: 64px; height: 64px; border-radius: 16px; }
.club-icon.big .icon { width: 34px; height: 34px; }
.club-sports { display: flex; flex-wrap: wrap; gap: 4px; }
.club-card { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); }
.club-card-text { display: grid; gap: 2px; min-width: 0; }
/* The feed */
.feed { list-style: none; margin: 0; padding: 4px 16px; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); font-weight: 700; color: var(--muted); }
.feed-body { flex: 1; min-width: 0; }
.feed-text { margin: 0; overflow-wrap: anywhere; line-height: 1.45; }
.feed-score { font-variant-numeric: tabular-nums; font-weight: 700; }
.feed-meta { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; }
.feed-meta .link-btn.on { color: var(--text); font-weight: 700; }
.feed-meta .more-btn { width: 30px; height: 30px; margin-left: auto; font-size: 1.05rem; }
.feed-comments ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; font-size: 0.92rem; overflow-wrap: anywhere; }
.feed-comments li .link-btn { margin-left: 8px; }
.feed-comment-form { display: flex; gap: 8px; }
.feed-comment-form input { flex: 1; min-width: 0; }
.plays-for { margin: 6px 0 0; }
/* Challenges */
.challenge-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--text); }
.challenge-card-text { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.challenge-head h1 { margin: 4px 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.challenge-head .eyebrow { margin: 0; }
.challenge-message { font-style: italic; margin: 8px 0; }
.feed-cta { margin: 8px 0 0; }
.player-ratings { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
/* Ladders */
.ladder { margin-bottom: 16px; }
.ladder-rungs li.me { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; }
.ladder-open h3 { margin: 14px 0 4px; font-size: 1rem; }
/* Goals */
.goal-card { display: grid; gap: 6px; text-decoration: none; color: var(--text); }
.goal-card .eyebrow, .goal-head .eyebrow { margin: 0; }
.goal-title { font-size: 1.05rem; overflow-wrap: anywhere; }
.goal-versus { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.goal-side { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.goal-side strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.goal-versus.big .goal-side strong { font-size: 2rem; }
.goal-head h1 { margin: 4px 0 10px; font-size: 1.4rem; overflow-wrap: anywhere; }
.goal-big { margin: 0 0 6px; font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.goal-big small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.goal-board .progress { display: block; margin-top: 4px; max-width: 220px; }
.goal-board li.me { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; }
.goal-value { font-variant-numeric: tabular-nums; }
.club-goals { display: grid; gap: 12px; margin-bottom: 16px; }
/* Team ties */
.tie-head .eyebrow { margin: 0 0 8px; }
.tie-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.tie-score span { font-weight: 700; overflow-wrap: anywhere; }
.tie-score span:last-child { text-align: right; }
.tie-score span.won { color: var(--accent-text); }
.tie-score strong { font-size: 2rem; font-variant-numeric: tabular-nums; }
.lineups { display: grid; gap: 12px; margin-bottom: 12px; }
@media (min-width: 720px) { .lineups { grid-template-columns: 1fr 1fr; } }
.lineup-card h3 { margin: 0; }
.lineup-row { display: grid; grid-template-columns: 3.2em 1fr 1fr; gap: 6px; align-items: center; margin-bottom: 6px; }
.lineup-row select:only-of-type { grid-column: 2 / 4; }
.rubbers .won { font-weight: 700; }
.tie-scorer h3 { margin-top: 0; overflow-wrap: anywhere; }
.tie-games { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px 8px; align-items: center; margin-bottom: 8px; }
.tie-games strong { font-size: 0.85rem; overflow-wrap: anywhere; }
/* Notifications */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; text-decoration: none; font-size: 1.15rem; }
.bell:hover { background: rgba(255, 255, 255, 0.08); }
.bell-count { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center; }
.inbox-open { font: inherit; text-align: left; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; display: grid; gap: 2px; flex: 1; min-width: 0; }
.inbox { margin-bottom: 16px; }
.inbox .unread .feed-text { font-weight: 700; }
.inbox .unread .feed-avatar { box-shadow: 0 0 0 3px var(--accent); }
.notify-prefs td, .notify-prefs th { padding: 8px 6px; }
.notify-prefs input { width: 20px; height: 20px; accent-color: var(--lime); }
.offline-card { max-width: 520px; margin: 40px auto; text-align: center; }

/* Group admins: Who's here */
.whos-here summary small { font-weight: 400; }
.whos-here-find { width: 100%; margin: 12px 0 4px; }
.whos-here-part h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 0 4px; }

/* Groups: leaderboard tabs (Players, Doubles pairs, Singles) and Pick players */
.board-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.board-tabs button { font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; border-radius: 999px; padding: 5px 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.board-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pick-card summary small { font-weight: 400; }
.pick-players { margin-top: 12px; }
.pick-players .actions select { width: auto; }

/* "A new version is ready" (shown instead of reloading while something is unsaved) */
.update-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--accent); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); width: max-content; max-width: calc(100% - 32px); font-size: 0.92rem; }

/* Invites (referrals) */
.invite-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 14px; border-color: var(--accent); }
.invite-banner > span:nth-child(2) { flex: 1; min-width: 0; }
.invite-gift { font-size: 1.6rem; line-height: 1; }
.invite-nudge { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--text); text-decoration: none; }
.invite-nudge:hover { border-color: var(--accent); }
.invite-hero h1 { margin: 6px 0 12px; }
.invite-steps { padding-left: 1.2em; display: grid; gap: 8px; margin: 0 0 16px; }
.invite-link { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; overflow-x: auto; }
.invite-link code { font-size: 0.95rem; white-space: nowrap; }
.invite-meter { display: flex; gap: 6px; margin: 4px 0 12px; }
.invite-meter span { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.invite-meter span.on { background: var(--accent); border-color: var(--accent); }
.run-your-own { text-align: center; margin: 22px 0 6px; }
.invite-price { margin: 18px 0; border-color: var(--accent); }
.invite-price h2 { margin-top: 0; }

/* One phone scores a match at a time */
.takeover-card { border-color: var(--accent); text-align: center; margin-bottom: 16px; }
.takeover-card p { margin: 0 0 8px; }

/* Event details (format and scoring, read-only) */
.event-details h2 { margin-top: 0; }
.details-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.details-list dt { color: var(--muted); font-size: 0.9rem; }
.details-list dd { margin: 0; font-weight: 600; }
@media (max-width: 420px) { .details-list { grid-template-columns: 1fr; gap: 0; } .details-list dd { margin-bottom: 8px; } }

/* Setup tab: one section at a time */
.setup-nav { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 4px; scrollbar-width: none; }
.setup-nav::-webkit-scrollbar { display: none; }
.setup-nav a { flex: none; border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 0.88rem; font-weight: 600; color: var(--text); text-decoration: none; background: var(--surface); white-space: nowrap; }
.setup-nav a.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.setup-link { margin: 18px 0 4px; }
.checklist-more { margin-top: 6px; }

/* Club v club */
.club-versus { margin-bottom: 16px; }
.cc-record { display: inline-flex; align-items: baseline; gap: 4px; }
.cc-record strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.cc-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cc-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.cc-list li .pill { margin-left: auto; }
.cc-head h1 a { color: inherit; text-decoration: none; }
.cc-teams { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 640px) { .cc-teams { grid-template-columns: 1fr 1fr; } }
.cc-team h3 { margin: 0 0 8px; }
.cc-roster { margin: 0; padding-left: 20px; }
.cc-roster li { padding: 3px 0; }
.cc-pick { list-style: none; margin: 8px 0; padding: 0; }
.cc-pick .check-field { margin: 0; padding: 8px 0; border-top: 1px solid var(--border); }
.cc-score { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cc-score strong { font-size: 1.3rem; }
.cc-big { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.cc-result { border-color: var(--accent); }

/* Club seasons */
.season-table td:nth-child(2) { white-space: normal; width: 100%; }
.season-round { margin: 14px 0 4px; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.season-fixtures { list-style: none; margin: 0; padding: 0; }
.season-fixture { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); }
.season-fixture a { flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 10px 0; color: inherit; text-decoration: none; }
.season-fixture a span:last-child { text-align: right; }
.season-fixture .won { font-weight: 700; }
.season-score { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 44px; text-align: center; color: var(--muted); }
.section-title { margin: 20px 0 10px; }

/* Runs */
.run-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.run-stats, .run-bests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.run-bests { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.run-stat { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.run-stat strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.run-board li { display: flex; justify-content: space-between; gap: 8px; }
.run-board li.me { background: var(--accent-soft); border-radius: 8px; }

/* Races */
.race-bib { text-align: center; }
.race-bib-no { font-size: 3.5rem; font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; margin: 6px auto; padding: 8px 24px; display: inline-block; border-radius: 12px; background: var(--accent); color: var(--on-accent); }
.race-desk { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.race-desk input { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.race-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.race-results td:nth-child(2) { white-space: normal; width: 100%; }
.race-results tr.me td { background: var(--accent-soft); }
.race-runners { margin-top: 12px; }
.race-runners summary { cursor: pointer; font-weight: 600; padding: 6px 0; }

/* Track meets */
.meet-sheet td:last-child { white-space: nowrap; }
.meet-mark { width: 84px; padding: 6px 8px; font-variant-numeric: tabular-nums; text-align: right; }
.meet-status { width: auto; margin-left: 4px; padding: 6px 4px; }

/* Motorsport */
.kart-no { display: inline-block; min-width: 2.2em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; font-size: 0.85em; }
.kart-sheet th, .kart-sheet td { padding: 6px 3px; }
.kart-sheet td:first-child { white-space: normal; }
.kart-sheet .meet-mark { width: 64px; }
.kart-sheet .meet-status { margin-left: 0; }
.kart-pos { width: 44px; padding: 6px 4px; text-align: right; font-variant-numeric: tabular-nums; }

/* Club honours */
.club-honours { margin-bottom: 16px; }
.honours-list li { flex-wrap: nowrap; align-items: baseline; }
.honours-list li > a { min-width: 0; }
.card.cc-list { padding: 4px 18px; }

/* The avatar's menu */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; z-index: 40; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 6px; display: grid;
}
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-wrap: anywhere; }
.menu-panel > a, .menu-panel > button {
  font: inherit; text-align: left; background: none; border: 0; color: var(--text); text-decoration: none;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.menu-panel > a:hover, .menu-panel > button:hover { background: var(--surface-2); }
.menu-panel hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu-theme { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: 0.85rem; color: var(--muted); }
/* Find events, in the top bar (desktops) */
.top-search { display: none; }
.topbar .top-search input { width: 300px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06); color: var(--court-ink); font: inherit; font-size: 0.92rem; }
.topbar .top-search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.topbar .top-search input:focus { outline: none; border-color: var(--lime); background: rgba(255, 255, 255, 0.1); }

/* ---------- the desktop shell: a sidebar, a wide column, a side column */
.sidebar { display: none; }
@media (min-width: 1024px) {
  body.has-sidebar { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
  body.has-sidebar > .topbar { grid-column: 2; grid-row: 1; }
  body.has-sidebar > main { grid-column: 2; grid-row: 2; }
  body.has-sidebar > .footer { grid-column: 2; grid-row: 3; }
  body.has-sidebar .topbar .brand { display: none; }
  body.has-sidebar .topbar-inner { max-width: 1240px; justify-content: flex-end; }
  body.has-sidebar .top-search { display: block; margin-right: auto; }
  body.has-sidebar .container { max-width: 1240px; padding: 20px 28px; }
  .sidebar {
    display: flex; flex-direction: column; grid-column: 1; grid-row: 1 / span 3; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--header); border-right: 1px solid var(--header-border); padding: 16px 12px; color: var(--court-ink);
  }
  .sidebar[hidden] { display: none; }
  .side-brand { display: block; padding: 6px 10px 18px; }
  .side-brand img { display: block; }
  .sidebar nav { display: grid; gap: 1px; }
  .side-hub, .side-item { display: flex; align-items: center; gap: 10px; text-decoration: none; border-radius: 8px; padding: 7px 10px; color: rgba(255, 255, 255, 0.72); font-size: 0.92rem; }
  .side-hub { color: var(--court-ink); font-weight: 700; margin-top: 10px; }
  .side-hub:first-child { margin-top: 0; }
  .side-hub .icon { width: 20px; height: 20px; color: var(--lime); }
  .side-item { padding-left: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .side-hub:hover, .side-item:hover { background: rgba(255, 255, 255, 0.07); color: var(--court-ink); }
  .side-hub.current, .side-item.current { background: rgba(163, 230, 53, 0.14); color: var(--court-ink); box-shadow: inset 3px 0 0 var(--lime); }
  .side-foot { margin-top: auto; padding-top: 16px; }
  .side-foot .btn { width: 100%; }
  /* More room: card lists in columns. */
  body.has-sidebar .rail-main .card-list, body.has-sidebar .section > .card-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
.with-rail { display: grid; gap: 24px; }
@media (min-width: 1200px) {
  .with-rail { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .rail { position: sticky; top: 80px; }
}
.rail { display: grid; gap: 14px; align-content: start; }
.rail-main { min-width: 0; }
.rail-card { margin: 0; }
.rail-card .card-head h2 { font-size: 1rem; }
.rail .card-list { grid-template-columns: 1fr !important; }
.rail-list { list-style: none; margin: 0; padding: 0; }
.mine-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
@media (min-width: 1200px) { .mine-jump { display: none; } }
.rail-list li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr); column-gap: 6px; padding: 8px 0; border-top: 1px solid var(--border); }
.rail-list li:first-child { border-top: 0; }
.rail-list li > small { grid-column: 2; }
.rail-list li > a { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-list.template-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.rail-list.template-list li > span { min-width: 0; }
.rail-list.template-list li > a { flex: none; width: auto; }
.template-list small { display: block; }
.enter-list { list-style: none; margin: 4px 0 0; padding: 0; }
.enter-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.enter-list li:first-child { border-top: 0; }
.enter-list li small { display: block; }
.enter-list li.current strong { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.enter-list .btn { flex: none; }
.test-bar { border-left-color: var(--accent); }
.test-bar strong { letter-spacing: .08em; }
.rail-list.ranked li { grid-template-columns: 1.6em minmax(0, 1fr) auto; }
.rail-list.ranked li > small { grid-column: auto; }
.start-progress { display: block; }
.start-list { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 2px; }
.start-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; padding: 6px 0; }
.start-list .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 0.75rem; font-weight: 800; }
.start-list li.done .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.start-list li.done span:last-child { color: var(--muted); text-decoration: line-through; }
.start-list a { display: grid; text-decoration: none; color: var(--text); }
.start-list a small { font-weight: 400; }
/* The welcome for someone new */
.welcome-hero.hero { margin-top: 0; }
.welcome-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.intent-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 8px; }
@media (min-width: 640px) { .intent-grid { grid-template-columns: 1fr 1fr; } }
.intent-card { margin: 0; display: grid; gap: 4px; align-content: start; }
.intent-card h3 { font-size: 1.1rem; margin: 2px 0 0; }
.intent-card .actions { margin-top: auto; }
/* The landing's two phones */
.landing-visuals { position: relative; width: 380px; height: 440px; }
.landing-visuals .landing-visual { position: absolute; right: 0; top: 0; }
.landing-visuals .landing-visual.back { right: 150px; top: 40px; transform: rotate(-5deg); opacity: 0.92; }
@media (max-width: 760px) { .landing-visuals { display: none; } }
@media (min-width: 1200px) { .container { max-width: 1180px; } }

/* ---------- admin: the funnel */
.funnel { display: grid; gap: 16px; margin: 20px 0; }
.funnel .section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.funnel .section-head h2 { margin: 0; }
.funnel .num small { font-weight: 400; }
.funnel .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.funnel .plain-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.funnel .plain-list li:has(> .btn) { flex-wrap: nowrap; justify-content: space-between; }
.funnel .plain-list .btn { margin-left: auto; flex: none; }
.pill.failed { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px currentColor; }

/* ---------- a finished tournament: share the results */
.wrap-card { position: relative; border-color: var(--accent); }
.wrap-card h2 { margin: 0 32px 6px 0; }
.wrap-close { position: absolute; top: 10px; right: 10px; font-size: 1.3rem; line-height: 1; }
.wrap-invite { margin: 12px 0 0; }
.event-share { justify-content: flex-end; margin: 0 0 12px; }

/* ---------- one-screen create, copying settings, templates */
.quick-new { display: grid; gap: 14px; }
.quick-new h1 { margin: 0; }
.copy-sheet .copy-list { display: grid; gap: 8px; margin: 12px 0; max-height: 50vh; overflow: auto; }
.template-card .card-head { align-items: flex-start; }
.template-card p { margin: 8px 0; }

/* ---------- AI setup: start from a poster or form; the draft to check */
.ai-start { display: grid; gap: 12px; border-color: var(--accent); }
.ai-start h2 { margin: 0; }
.ai-file { justify-self: start; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.ai-row { display: flex; gap: 8px; }
.ai-row input { flex: 1; min-width: 0; }
.ai-row.stack { flex-direction: column; align-items: flex-start; }
.ai-row.stack textarea { width: 100%; }
.ai-or { margin: 0; }
.progress .indeterminate { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: inherit; animation: indeterminate 1.2s ease-in-out infinite; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.check-this { margin-left: 8px; font-size: 0.75rem; font-weight: 700; color: var(--accent-text); }
.check-this small { font-weight: 400; color: var(--muted); }
.field.unsure input, .field.unsure select, .field.unsure textarea, .ev-draft.unsure { box-shadow: 0 0 0 2px var(--accent-soft); }
.ev-drafts { display: grid; gap: 8px; }
.ev-draft { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 5.5rem auto; gap: 6px; align-items: center; border-radius: 10px; padding: 6px; background: var(--surface-2); }
.ev-draft.bad select, .ev-draft.bad input { border-color: var(--danger); }
.ev-problem { grid-column: 1 / -1; color: var(--danger); }
@media (max-width: 560px) { .ev-draft { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- importing a form's responses */
.import-card h3 { margin: 14px 0 8px; font-size: 1rem; }
.import-cols { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.import-col { display: grid; gap: 4px; }
.import-head { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-totals, .import-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.import-rows { max-height: 360px; overflow: auto; }
.banner.warn ul { margin: 6px 0 0; padding-left: 18px; }
.credits-line { margin: 0; }
.credits-line.low, .muted.low { color: var(--accent-text); font-weight: 600; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* ---------- latecomers: the options under the policy */
.late-sheet .sheet-actions { max-height: 60vh; overflow: auto; }
.late-option { text-align: left; }
.late-option.recommended { box-shadow: inset 3px 0 0 var(--accent); }
.late-option:disabled { opacity: 0.6; }
.assistant textarea { width: 100%; }
.proposals { display: grid; gap: 10px; margin: 8px 0; }
.proposal .check-field { margin: 0; }
.assistant-questions p { margin: 0; }
.assistant-questions p + p { margin-top: 6px; }
.proposal .quote { font-style: italic; }
.proposal.blocked { opacity: 0.65; }
.nudge { padding: 10px 0; border-top: 1px solid var(--border); }
.nudge:first-child { border-top: 0; padding-top: 0; }
.nudge small { display: block; margin-top: 2px; }
.nudge .actions { margin-top: 8px; }
.umpire-notes { margin: 6px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, var(--bg)); }
.umpire-notes li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; }
.late-words p { margin: 0 0 4px; }

/* Quick game: pick a sport, score, save */
.quick-sports { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.quick-sport { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 12px; margin: 0; text-decoration: none; color: var(--text); text-align: center; }
.quick-sport svg { width: 36px; height: 36px; }
.quick-sport:hover { border-color: var(--lime); }
.quick-settings summary { cursor: pointer; }
.quick-settings[open] summary { margin-bottom: 12px; }
.quick-side { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.quick-side legend { font-weight: 600; margin-bottom: 6px; }
.quick-save h2 { margin-top: 0; }

/* /live-scoring: the demo, the steps, TonaClick and the waiting list */
.live-scoring .ls-demo { margin: 24px 0; }
.live-scoring .ls-demo .card-head { flex-wrap: wrap; gap: 10px; }
.live-scoring .ls-demo .score-btn { min-height: 150px; }
.live-scoring .ls-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.live-scoring kbd { font: inherit; font-size: 0.85em; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); }
.ls-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: ls; }
.ls-steps li { counter-increment: ls; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; row-gap: 2px; }
.ls-steps li::before { content: counter(ls); grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.ls-steps span { color: var(--muted); }
.ls-click { display: grid; gap: 20px; align-items: center; }
@media (min-width: 720px) { .ls-click { grid-template-columns: 220px 1fr; } }
.ls-device { justify-self: center; width: 200px; padding: 22px 18px 14px; border-radius: 36px; background: var(--navy); border: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; justify-items: center; }
.ls-key { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--lime); color: var(--navy); }
.ls-key + .ls-key { background: var(--surface-2); color: var(--text); border: 2px solid var(--lime); }
.ls-device small { grid-column: span 2; color: var(--lime); letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; font-size: 0.7rem; }
.ls-points { margin: 0; }
.ls-wait { margin-top: 32px; }
.ls-wait h2 { margin-top: 0; }
.ls-msg { margin: 0; font-weight: 600; }
.ls-msg.ok { color: var(--accent-text); }
.ls-msg.error { color: var(--danger); }

/* Court mode: the score as big as the screen allows (always dark, like the venue display) */
body.court-mode { overflow: hidden; }
.court {
  position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: 1fr auto;
  background: var(--navy); color: var(--court-ink);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.court-sides { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.court-side {
  font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; min-width: 0; min-height: 0;
  display: grid; grid-template-rows: auto 1fr auto; align-items: center; justify-items: center; padding: 14px 8px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.court-side + .court-side { border-left: 2px solid var(--court-line); }
.court-side:disabled { cursor: default; }
.court-side:active:not(:disabled) { background: var(--court-press); }
.court-name { display: flex; align-items: center; gap: 10px; font-size: clamp(1.1rem, 4.5vw, 2.2rem); font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.court-pts { font-size: min(40vw, 62vh); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.court-side.won .court-pts, .court-side.won .court-name { color: var(--lime); }
.court-meta { display: flex; gap: 10px; align-items: center; font-size: clamp(0.9rem, 3vw, 1.3rem); color: var(--court-dim); min-height: 1.6em; }
.court .serve { width: 0.7em; height: 0.7em; }
.court-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--court-line); }
.court-foot { color: var(--court-soft); font-size: 0.95rem; }
.court-foot strong { color: var(--lime); font-weight: 600; }
.court-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.court .btn:not(.btn-primary) { background: var(--court-btn); color: var(--mist); border-color: var(--court-btn-line); }
.quick-tools { flex-wrap: wrap; }
.quick-done h2 { margin-top: 0; }
.quick-done-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.quick-done-list > li { border-top: 1px solid var(--border); padding-top: 10px; }
.quick-done-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.quick-done-acts { display: flex; gap: 6px; }
.quick-save-inline { margin: 10px 0 0; box-shadow: none; background: var(--surface-2); }
.clicker-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--text); }
.clicker-chip.quiet { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.court .clicker-chip { background: var(--court-btn); color: var(--court-soft); }

/* The calling voice: which voice, how fast */
.voice-menu > summary { cursor: pointer; }
.voice-menu .voice-panel { width: min(320px, calc(100vw - 32px)); gap: 6px; }
.voice-menu.up .voice-panel { top: auto; bottom: calc(100% + 8px); }
.voice-list { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.voice-row > button { width: 100%; display: flex; justify-content: space-between; gap: 8px; align-items: center; text-align: left; font: inherit; color: var(--text); background: transparent; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.voice-row > button:hover { background: var(--surface-2); }
.voice-row.on > button { background: var(--accent-soft); font-weight: 600; }
.voice-row.on > button::after { content: '✓'; color: var(--text); }
.voice-rate { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px; }
.voice-panel > .btn { justify-self: start; margin: 0 10px; }
.voice-tip { margin: 4px 10px 6px; }
.court .voice-panel { color: var(--text); }
/* Phones: the voice settings open as a sheet along the bottom of the screen. */
@media (max-width: 640px) {
  .voice-menu .voice-panel, .voice-menu.up .voice-panel { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; z-index: 260; max-height: 75vh; overflow-y: auto; }
}
.voice-row > button small { margin-left: auto; }
.voice-row > button > span { min-width: 0; }
.voice-backdrop { position: fixed; inset: 0; z-index: 39; background: transparent; }
.voice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
@media (max-width: 640px) {
  .voice-backdrop { z-index: 259; background: rgba(0, 0, 0, 0.35); }
}
.voice-head > button { flex: none; white-space: nowrap; }
.voice-head > span { min-width: 0; }
/* Big score: the serving side's whole number is lime, readable from the court (always on dark). */
.court-side.serving .court-pts { color: var(--lime); }
.court-score { display: flex; align-items: center; justify-content: center; gap: min(4.5vw, 7vh); }
/* Pickleball doubles: the server number, big enough to read across the court (about 40% of the score). */
.court-srv { display: grid; justify-items: center; gap: 0.08em; font-size: min(15vw, 24vh); line-height: 1; }
.court-srv small { font-size: 0.2em; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lime); }
.court-srv b { display: grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--lime); color: #0B1220; font-weight: 800; font-variant-numeric: tabular-nums; }
.serve.serve-no { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 0.85em; font-weight: 800; line-height: 1; }

/* The clicker chip and the TonaClick sheet */
button.clicker-chip { font: inherit; font-size: 0.82rem; border: 1px solid transparent; cursor: pointer; }
.clicker-chip.none { background: transparent; border-color: var(--border); color: var(--text); font-weight: 600; }
.court .clicker-chip.none { border-color: var(--court-btn-line); color: var(--court-soft); }
.clicker-backdrop { z-index: 300; overflow-y: auto; }
.clicker-sheet { text-align: left; max-height: calc(100vh - 32px); overflow-y: auto; }
.clicker-sheet h2 { margin-top: 14px; }
.clicker-sheet h3 { margin: 16px 0 4px; font-size: 1rem; }
.clicker-device { width: 150px; padding: 14px 12px 8px; gap: 10px; margin: 0 auto; }
.clicker-device .ls-key { width: 52px; height: 52px; font-size: 1.2rem; }
.clicker-points { margin: 8px 0; padding-left: 1.2em; display: grid; gap: 4px; }
.clicker-presses { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.clicker-presses th, .clicker-presses td { text-align: left; padding: 8px 4px; border-top: 1px solid var(--border); font-size: 0.92rem; vertical-align: top; }
.clicker-presses th { white-space: nowrap; padding-right: 12px; }
.clicker-wait { margin-top: 8px; }
.clicker-msg { margin: 8px 0; font-weight: 600; }
.clicker-msg.ok { color: var(--accent-text); }
.clicker-msg.error { color: var(--danger); }
.clicker-sheet > .btn-ghost { margin-top: 10px; }
.clicker-presses { table-layout: fixed; }
.clicker-presses th { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text); white-space: normal; width: 42%; font-size: 0.92rem; }
.clicker-presses td { overflow-wrap: anywhere; }
.clicker-presses td { white-space: normal; }
.live-scoring .ls-tools { flex-wrap: wrap; }
.ls-presses { margin-top: 14px; padding-top: 4px; }
.ls-presses-note { margin: 0 0 8px; }

/* Customise: 3rd place and scoring by stage */
.stage-scoring { display: grid; gap: 8px; margin-top: 10px; }
.stage-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 1fr 1fr; gap: 8px; align-items: center; }
.stage-row[hidden] { display: none; }
.stage-row .stage-name { font-weight: 600; font-size: 0.92rem; }
.stage-row select, .stage-row input { min-width: 0; }
@media (max-width: 420px) { .stage-row { grid-template-columns: 1fr 1fr; } .stage-row .stage-name { grid-column: span 2; } }
.third-place { margin-top: 14px; max-width: 280px; }
.third-place h3 { font-size: 0.9rem; margin: 0 0 6px; }

/* A format choice explained, with its guide (opens in a new tab) */
.format-help { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.format-help > span { color: var(--text); }
.how-link { font-weight: 600; color: var(--accent-text); white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.how-link:hover { text-decoration-thickness: 2px; }

/* Mixed groups, same-level matches */
.cross-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cross-group { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.cross-group ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; font-size: 0.92rem; }
.cross-group li { display: flex; gap: 8px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.lv-chip { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--text); font-size: 0.72rem; font-weight: 700; flex: none; }
.cross-fx { display: grid; gap: 4px; }
.level-winners ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.level-winners li { display: flex; gap: 10px; align-items: center; font-size: 1.05rem; }
.fx-edit > summary { cursor: pointer; font-size: 0.82rem; color: var(--muted); padding: 2px 0; }
.fx-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin: 6px 0 4px; }
.fx-form select { min-width: 0; }
@media (max-width: 420px) { .fx-form { grid-template-columns: 1fr 1fr; } .fx-form .btn { grid-column: span 2; } }
.fx-add { margin: 0 0 12px; }
.fx-add > summary { font-weight: 600; color: var(--text); }
/* Big score: toasts (Switched ends, Game restarted + Undo) show over the court, at the top clear of its buttons. */
body.court-mode #toast { z-index: 210; top: calc(14px + env(safe-area-inset-top)); bottom: auto; }
.fx-switch { margin: 4px 0 10px; }

/* Format-guide diagrams (server/diagrams.js): inline SVG drawn with the theme's colours. */
.post-diagram { margin: 22px 0; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.post-diagram .dg { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto; overflow: visible; }
.post-diagram figcaption { margin-top: 12px; font-size: 0.92rem; color: var(--muted); line-height: 1.5; text-align: center; }
.dg text { font-family: inherit; font-size: 13px; fill: var(--text); }
.dg .dg-h { font-size: 13.5px; font-weight: 700; fill: var(--accent-text); }
.dg .dg-b { font-weight: 600; }
.dg .dg-s { font-size: 11.5px; fill: var(--muted); }
.dg .dg-m { fill: var(--muted); }
.dg .dg-box { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.2; }
.dg .dg-final { stroke: var(--accent); stroke-width: 2.2; }
.dg .dg-pool { fill: var(--accent-soft); stroke: var(--accent); }
.dg .dg-bye { fill: none; stroke: var(--muted); stroke-dasharray: 5 4; }
.dg .dg-cell { fill: var(--accent-soft); stroke: var(--border); }
.dg .dg-off { fill: var(--bg); stroke: var(--border); }
.dg .dg-line { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dg .dg-strong { stroke: var(--text); stroke-width: 2; }
.dg .dg-win { stroke: var(--accent); stroke-width: 2.5; }
.dg .dg-lose { stroke-dasharray: 5 4; }
.dg .dg-chip-a { fill: var(--accent); }
.dg .dg-chip-b { fill: var(--side-b); }
.dg .dg-chip-c { fill: var(--surface); stroke: var(--muted); }
.dg .dg-ct { font-size: 12.5px; font-weight: 700; }
.dg .dg-ct-a { fill: var(--on-accent); }
.dg .dg-ct-b { fill: var(--on-side-b); }
.dg .dg-ct-c { fill: var(--text); }
.dg .dg-ring { stroke: var(--text); stroke-width: 2.5; }
.dg .dg-me { stroke: var(--text); stroke-width: 2.5; stroke-dasharray: 4 3; }
.dg .dg-bar { fill: var(--side-b); }
.dg .dg-bar-long { fill: var(--accent); }
.dg .dg-podium { fill: var(--surface-2); stroke: var(--border); }
.dg .dg-first { fill: var(--accent); stroke: var(--accent); }
/* A guide opened from tournament setup: the way back, always in reach. */
.back-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }
/* Which format a placement works with (How players are placed). */
.choice-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; vertical-align: middle; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.choice-tag.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
/* Changing the format would turn a placement off. */
.format-warn { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--accent); color: var(--text); font-size: 0.9rem; }

/* ---------- the setup assistant (a chat) */
.chat { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 140px); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; }
.chat-head .back-link { font-size: 1.3rem; text-decoration: none; padding: 4px 8px; }
.chat-title { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.chat-progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.chat-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
.chat-log { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 18px; line-height: 1.45; animation: bubble-in 0.25s ease-out; }
.bubble p { margin: 0; }
.bubble p + p { margin-top: 6px; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; display: flex; gap: 10px; align-items: baseline; }
.bubble.me p { font-weight: 600; }
.bubble-change { background: none; border: 0; padding: 0; font: inherit; font-size: 0.78rem; color: var(--on-accent); opacity: 0.75; text-decoration: underline; cursor: pointer; white-space: nowrap; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bubble { animation: none; } }
.chat-note { margin-top: 8px !important; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 0.9rem; }
.chat-composer { margin: 12px 0 0; padding: 14px 0 4px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 10px; }
.bubble.now { scroll-margin-top: 84px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--accent); }
.chip.on, .chip.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-icon { display: inline-flex; align-items: center; gap: 8px; }
.chip-icon svg { width: 20px; height: 20px; }
.chat-sub { margin: 4px 0 -2px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.chat-text { display: flex; gap: 8px; }
.chat-text input, .chat-text textarea { flex: 1; min-width: 0; min-height: 44px; }
.chat-text.two { flex-wrap: wrap; }
.chat-text.two input { flex: 1 1 45%; }
.chat-text.stack { flex-direction: column; }
.chat-pick { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--muted); }
.chat-pick input { min-height: 44px; }
.chat-actions { display: flex; }
.chat-file { align-self: flex-start; display: inline-flex; gap: 8px; align-items: center; min-height: 48px; }
.chat-options { display: flex; flex-direction: column; gap: 8px; }
.chat-option { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.chat-option:hover { border-color: var(--accent); }
.chat-option.on { border-color: var(--accent); background: var(--accent-soft); }
.chat-option small { color: var(--muted); }
.chat-option .choice-tag { margin-left: 8px; }
.chat-option.plan { cursor: default; padding: 0; overflow: hidden; }
.plan-pick { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px 6px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.chat-option.plan .how-link { padding: 0 14px 10px; font-size: 0.85rem; }
.fits { color: var(--accent-text); font-weight: 600; }
.too-long { color: var(--muted); font-style: italic; }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }
.found { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; }
.found li { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.found-mark { width: 18px; font-weight: 700; color: var(--accent-text); }
.found li.unsure .found-mark, .found li.missing .found-mark { color: var(--muted); }
.found li.missing span:last-child { color: var(--muted); }
.chat-summary { margin-top: 6px; }
.chat-summary h2 { margin-top: 0; }
.sum-row { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border); }
.sum-label { flex: 0 0 110px; color: var(--muted); font-size: 0.9rem; }
.sum-value { flex: 1; font-weight: 600; }
.chat-foot { margin: 16px 0 4px; }

/* New tournament: the assistant or a form. */
.new-choose { max-width: 560px; margin: 0 auto; }
.choose-tile { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--text); padding: 18px; margin-bottom: 12px; border: 1.5px solid var(--border); }
.choose-tile:hover { border-color: var(--accent); }
.choose-tile.primary { border-color: var(--accent); background: var(--accent-soft); }
.choose-tile strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.choose-tile small { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.choose-icon { font-size: 1.8rem; line-height: 1; }

/* "Need a hand?": the way to the assistant. */
.assist-link { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.assist-link span:nth-child(2) { flex: 1; }
.assist-link:hover { outline: 1.5px solid var(--accent); }
.card.checklist .assist-link { margin-bottom: 0; }

/* A "?" next to a setting: a short explanation on tap. */
.tip { display: inline-block; vertical-align: middle; }
/* The explanation spans the field (never off the screen), just under its label. */
.field:has(> .label .tip), .check-field:has(.tip) { position: relative; }
.tip summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.tip summary::-webkit-details-marker { display: none; }
.tip[open] summary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tip-body { position: absolute; z-index: 20; left: 0; right: 0; top: 28px; max-width: 420px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); color: var(--text); font-size: 0.85rem; font-weight: 400; line-height: 1.45; white-space: normal; }
/* Advanced options: folded until needed. */
.advanced-fold { margin: 14px 0; border: 1px solid var(--border); border-radius: 12px; }
.advanced-fold > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 12px 40px 12px 14px; position: relative; }
.advanced-fold > summary::-webkit-details-marker { display: none; }
.advanced-fold > summary::after { content: '+'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--muted); }
.advanced-fold[open] > summary::after { content: '−'; }
.adv-title { font-weight: 700; }
.advanced-body { padding: 0 14px 12px; }
.placement-fold { padding: 4px 12px; }
.placement-fold .advanced-fold { border: 0; margin: 0; }
.placement-fold .advanced-body { padding: 0 2px 8px; }
.placement-fold .advanced-body > .card { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }

/* ---------- the poster editor */
.poster-sizes { margin: 6px 0 12px; }
.poster-preview { position: relative; margin: 0 auto 12px; max-width: 420px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.poster-preview.size-story { max-width: 300px; }
.poster-preview.size-a4, .poster-preview.size-a3 { max-width: 340px; }
.poster-preview img { display: block; width: 100%; height: auto; }
.poster-flag { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface); color: var(--text); font-size: 0.82rem; font-weight: 600; text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.poster-actions { justify-content: center; }
.poster-templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.poster-tpl { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-align: left; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.poster-tpl small { color: var(--muted); }
.poster-tpl.on { border-color: var(--accent); background: var(--accent-soft); }
.poster-colours { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-pair { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--border); cursor: pointer; background: linear-gradient(135deg, var(--sw-bg) 0 60%, var(--sw-ac) 60% 100%); }
.swatch-pair.default { width: auto; padding: 0 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; }
.swatch-pair.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--accent); }
.poster-upgrade { max-width: 560px; }
.poster-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.poster-compare figure { margin: 0; }
.poster-compare img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); display: block; }
.poster-compare figcaption { text-align: center; font-weight: 700; margin-top: 6px; }
.contact-row { margin-bottom: 8px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact-list li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
/* ⇄ Auto: swap ends by themselves (quick and group games; off by default). */
.ends-auto { color: var(--muted); }
.ends-auto.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
/* Set up by an admin for an organiser. */
.behalf-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.handover-card { border-left: 4px solid var(--accent); }
.admin-behalf { margin-bottom: 12px; }

/* Cookie choices (public/consent.js): a card above the bottom bar, never a wall. */
.consent-banner {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; padding: 16px; display: grid; gap: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(11, 18, 32, 0.28);
}
body:has(.hubbar) .consent-banner, body:has(.t-tabs.bar) .consent-banner { bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body:has(.hubbar) .consent-banner { bottom: 16px; } }
.consent-banner p { margin: 0; }
.consent-banner .consent-body { display: grid; gap: 8px; }
.consent-title { font-weight: 700; font-size: 1.05rem; }
.consent-links a { color: var(--link); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-actions .btn { flex: 1 1 auto; min-height: 40px; }
.consent-rows { display: grid; gap: 4px; }
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); cursor: default; }
label.consent-row { cursor: pointer; }
.consent-row > span:first-child { display: grid; gap: 2px; }
.consent-row input[type=checkbox] { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.consent-always { white-space: nowrap; }
.link-btn.consent-link, button[data-consent-open] { font: inherit; }
.cookie-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 8px 0 16px; }
.cookie-table th, .cookie-table td { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); }
.cookie-table th { color: var(--muted); font-weight: 600; }
.cookie-table code { font-size: 0.85em; word-break: break-all; }
.table-scroll { overflow-x: auto; }

/* TonaClick 1 (public/tonaclick.html, the live-scoring page and the posts). */
.tc-hero { display: grid; gap: 20px; align-items: center; margin-bottom: 8px; }
@media (min-width: 900px) { .tc-hero { grid-template-columns: 1fr 1fr; gap: 32px; } }
.tc-photo { margin: 0; }
.tc-play { margin: 0 0 8px; }
.tc-play img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.tc-play figcaption { margin-top: 8px; }
.yt-facade { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #000; }
.yt-facade img { border-radius: 0; transition: transform .3s ease, filter .3s ease; }
.yt-facade:hover img, .yt-facade:focus-visible img { transform: scale(1.02); filter: brightness(.9); }
.yt-play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: var(--accent); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.yt-play::after { content: ''; position: absolute; left: 34px; top: 26px; border: 16px solid transparent; border-left: 24px solid var(--on-accent); border-right: 0; }
.yt-len { position: absolute; right: 12px; bottom: 12px; padding: 3px 9px; border-radius: 8px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .85rem; font-weight: 600; }
.post-video { margin: 0 0 24px; }
.post-video .yt-facade { aspect-ratio: 16 / 9; }
.post-video .yt-facade img { width: 100%; height: 100%; object-fit: cover; }
.post-video figcaption { margin-top: 8px; }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: #000; }
.video-card .video-thumb { position: relative; display: block; margin: 0 -16px 6px; }
.video-card .video-thumb .post-thumb { width: 100%; margin: 0; }
.video-card .video-thumb .yt-play { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
.video-card .video-thumb .yt-play::after { left: 22px; top: 17px; border-width: 11px; border-left-width: 16px; border-right-width: 0; }
.video-page .video-player { margin: 0 0 16px; }
/* Share: the part picked to make (video.js setClip). */
.clip-pick { margin: 4px 0 0; }
.clip-pick p { margin: 6px 0; }
.clip-line { font-weight: 600; font-variant-numeric: tabular-nums; }
.buy { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
/* Signing in to pay, on the match video page (video.js openSignin). */
.v-signin { text-align: left; gap: 12px; }
.v-signin h2 { margin: 0; }
.v-signin p { margin: 0; }
.v-signin .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.v-signin .actions .btn { width: auto; flex: 1; }
.video-links { margin: 0 0 16px; padding-left: 1.2em; display: grid; gap: 6px; }
.tc-photo { display: grid; justify-items: center; padding: 8px 0; background: radial-gradient(closest-side, var(--accent-soft), transparent); }
.tc-photo img { display: block; width: auto; max-width: 100%; height: min(380px, 70vw); }
.tc-photo figcaption { margin-top: 6px; justify-self: start; }
.tc-price { margin: 4px 0 16px; font-size: 1.05rem; }
.tc-price-now { display: inline-block; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 1.35rem; padding: 4px 12px; border-radius: 10px; margin-right: 6px; }
.tc-progress { margin-top: 12px; min-height: 2.6em; }
.tc-bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.tc-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.tc-bar-text { margin: 6px 0 0; color: var(--muted); }
.tc-steps { padding-left: 1.3em; display: grid; gap: 10px; }
.tc-steps li::marker { color: var(--accent-text); font-weight: 800; }
.tc-presses td:first-child { white-space: nowrap; }
.ls-device-photo { justify-self: center; display: block; width: auto; max-width: 100%; height: 260px; }
.clicker-photo { display: block; width: auto; height: 180px; margin: 0 auto 8px; }
.tc-box { border-left: 4px solid var(--accent); }
/* The home page's TonaClick 1 band. */
.tc-band { display: grid; gap: 12px 28px; align-items: center; padding: 20px; margin: 8px 0 28px; }
@media (min-width: 720px) { .tc-band { grid-template-columns: 240px 1fr; padding: 24px 32px; } }
.tc-band .tc-photo img { height: 220px; }
.tc-band h2 { margin: 0 0 6px; }
.tc-band-copy > p { margin: 0 0 10px; }
.tc-band .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.tc-mine { font-weight: 600; color: var(--accent-text); }
a.new-card { color: inherit; text-decoration: none; }
a.new-card:hover { border-color: var(--accent); }
a.new-card p { color: var(--muted); }

/* Home hero slider: slides share one grid cell, so the hero keeps the
   height of the tallest and nothing below it jumps. */
.hero.hero-slider > * { max-width: none; }
.hero-track { display: grid; }
.hero-slide {
  grid-area: 1 / 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(20px, 4vw, 48px); align-items: center;
  opacity: 0; visibility: hidden; transform: translateX(18px);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s;
}
.hero-slide.active { opacity: 1; visibility: visible; transform: none; transition: opacity 0.5s ease, transform 0.5s ease; }
.hero-text { max-width: 36rem; min-width: 0; }
.hero .hero-title { text-wrap: balance; font-size: clamp(2rem, 6.5vw, 3.2rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 14px; color: var(--court-ink); }
.hero .hero-title .accent { color: var(--lime); }
.hero-text .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.hero-visual { flex: none; justify-self: end; }
.hero-visual img { display: block; width: 100%; height: auto; }
.hero-visual.phone { width: 230px; max-height: 420px; overflow: hidden; border: 7px solid #000; border-radius: 34px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); outline: 1px solid var(--court-btn-line); }
.hero-visual.card { width: 300px; overflow: hidden; border-radius: 18px; border: 1px solid var(--court-btn-line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.hero-visual.tv { width: min(440px, 40vw); overflow: hidden; border: 7px solid #000; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); outline: 1px solid var(--court-btn-line); }
.hero-visual.va-hero { width: min(480px, 42vw); overflow: hidden; border-radius: 14px; border: 1px solid var(--court-btn-line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.hero-visual.tc-photo { background: radial-gradient(closest-side, rgba(163, 230, 53, 0.16), transparent); padding: 10px 30px; }
.hero-visual.tc-photo img { width: auto; height: 360px; }
.hero-visual.paper-app { position: relative; width: 390px; height: 380px; }
.paper-app .paper-sheet { position: absolute; left: 0; top: 14px; width: 270px; transform: rotate(-4deg); }
.paper-phone { position: absolute; right: 0; bottom: 0; width: 150px; height: 260px; transform: rotate(3deg); overflow: hidden; border: 6px solid #000; border-radius: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); outline: 1px solid var(--court-btn-line); }
.paper-phone img { display: block; width: 100%; height: auto; }
.hero-visual.sports { display: grid; grid-template-columns: repeat(6, 64px); gap: 6px; }
.hero-visual.sports a { display: grid; justify-items: center; gap: 5px; padding: 8px 2px; border-radius: 12px; background: var(--navy); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--mist); text-decoration: none; font-size: 0.68rem; font-weight: 600; text-align: center; line-height: 1.2; }
.hero-visual.sports a:hover { border-color: var(--lime); }
.hero-visual.sports .icon { width: 24px; height: 24px; color: var(--lime); }
.hero-nav { display: flex; align-items: center; gap: 10px; margin-top: 26px; }
.hero-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-dots button { font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; border-radius: 999px; padding: 5px 12px; border: 1px solid rgba(255, 255, 255, 0.22); background: var(--navy); color: var(--court-soft); transition: background 0.2s, color 0.2s; }
.hero-dots button:hover { border-color: var(--court-ink); color: var(--court-ink); }
.hero-dots button[aria-current="true"] { background: var(--lime); border-color: var(--lime); color: var(--navy); }
.hero-arrow { font: inherit; font-size: 1.4rem; line-height: 1; width: 36px; height: 36px; flex: none; border-radius: 50%; cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.3); background: var(--navy); color: var(--court-ink); }
.hero-arrow:hover { border-color: var(--court-ink); }
.hero-slider :focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.hero-slider { touch-action: pan-y; }
@media (max-width: 860px) {
  .hero-slide { grid-template-columns: 1fr; align-items: start; }
  .hero-visual, .hero-visual.sports { display: none; }
  /* TonaClick is the one picture worth its space on a phone, kept small. */
  .hero-visual.tc-photo { display: block; justify-self: center; order: -1; padding: 0 20px; }
  .hero-visual.tc-photo img { height: 150px; }
  /* Keep the hero within a phone screen: headline, line, buttons. */
  .hero-slider .features { display: none; }
  .hero-slider .lead { font-size: 1rem; margin-bottom: 18px; }
  /* Phones: the dots, without labels. */
  .hero-dots button { width: 10px; height: 10px; padding: 0; border: 0; background: rgba(255, 255, 255, 0.3); }
  .hero-dots button[aria-current="true"] { width: 26px; background: var(--lime); }
  .hero-dot-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero-arrow { display: none; }
  .hero-nav { justify-content: center; margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-slide.active { transition: none; transform: none; }
}

/* What's new (signed-in home, /whats-new). */
.whats-new { margin-bottom: 18px; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.news-item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; padding-right: 30px; }
.news-item.has-img, .whats-new-page .news-item:has(.news-img) { grid-template-columns: 72px minmax(0, 1fr); }
.whats-new .news-item + .news-item { border-top: 1px solid var(--border); padding-top: 12px; }
.news-emoji { font-size: 1.7rem; line-height: 1; text-align: center; padding-top: 2px; }
.news-img { width: 72px; height: auto; display: block; }
.news-text { display: grid; gap: 4px; justify-items: start; }
.news-text p { margin: 0 0 4px; }
.news-close { position: absolute; top: -4px; right: 0; width: 30px; height: 30px; border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; border-radius: 50%; }
.whats-new .news-item + .news-item .news-close { top: 8px; }
.news-close:hover { color: var(--text); background: var(--surface-2); }
.whats-new-page .news-item { margin: 0; padding-right: 16px; }

/* Live scores carry the brand (screenshots and recordings get shared):
   tonament.com, or a white-label tournament's own name with a small mark. */
.sb-status:empty { display: none; }
.sb-brand { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--court-soft); font-weight: 600; white-space: nowrap; }
.sb-live { color: var(--live); font-size: 0.7em; }
.sb-powered { display: inline-flex; opacity: 0.7; }
.brand-mark-img { display: block; height: 13px; width: auto; }
.court { grid-template-rows: auto 1fr auto; }
/* Portrait: the badge has its own slim row above the names. Landscape: it floats between them. */
.court-badge { justify-self: center; margin-top: 8px; display: flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--navy); border: 1px solid var(--court-line); pointer-events: none; }
@media (min-aspect-ratio: 1/1) {
  .court { grid-template-rows: 1fr auto; }
  .court-badge { position: absolute; z-index: 2; left: 50%; top: calc(env(safe-area-inset-top) + 10px); transform: translateX(-50%); margin: 0; }
}
.court-badge img { display: block; height: 18px; width: auto; }
.court-badge .court-badge-org { height: 28px; max-width: 160px; object-fit: contain; }
.court-badge-name { font-weight: 700; font-size: 0.95rem; color: var(--court-ink); white-space: nowrap; }
.court-site { margin-left: auto; font-size: 0.8rem; color: var(--court-dim); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.court-site .brand-mark-img { height: 12px; }
.tc-nudge { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; padding: 8px 14px; border-radius: var(--radius); border: 1px dashed var(--border); color: var(--text); text-decoration: none; font-size: 0.92rem; }
.tc-nudge img { width: auto; height: 44px; flex: none; }
.tc-nudge strong { color: var(--accent-text); }
.tc-nudge:hover { border-color: var(--accent); }
.dc-promo-tc { grid-template-columns: auto 1fr; align-items: center; gap: 0 1.2em; }
.dc-promo-tc .dc-tc-img { height: 7em; width: auto; }
.dc-tc-name { font-size: 1.4em; font-weight: 800; color: var(--court-ink); }
/* Short landscape screens (a phone on its side): the numbers leave room for the names, games and the bar. */
@media (max-height: 520px) {
  .court-pts { font-size: min(34vw, 50vh); }
  .court-srv { font-size: min(12vw, 19vh); }
  .court-bar { padding: 6px 12px; gap: 6px 10px; }
  .court-name { font-size: clamp(1rem, 4.5vh, 1.6rem); }
}
.dc-promo-tc > div { min-width: 0; }
.dc-promo-tc .dc-url { font-size: 1.15em; overflow-wrap: anywhere; }

/* ---------- guided tours: the page dims, one thing is lit up, a card explains it */
.tour { position: fixed; inset: 0; z-index: 65; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(5, 9, 18, 0.72); pointer-events: none; transition: left .32s ease, top .32s ease, width .32s ease, height .32s ease; }
.tour-hole::after { content: ''; position: absolute; inset: -4px; border-radius: 18px; border: 2px solid var(--accent); animation: tour-pulse 1.8s ease-out infinite; }
.tour.centred .tour-hole::after { display: none; }
@keyframes tour-pulse { 0% { opacity: .9; transform: scale(1); } 70% { opacity: 0; transform: scale(1.06); } 100% { opacity: 0; transform: scale(1.06); } }
.tour-card { position: fixed; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); transition: left .32s ease, top .32s ease; font-family: inherit; }
.tour-card::before { content: ''; position: absolute; left: var(--arrow-x, 50%); width: 14px; height: 14px; background: var(--surface); border: 1px solid var(--border); transform: translateX(-50%) rotate(45deg); }
.tour-card[data-side=below]::before { top: -8px; border-right: 0; border-bottom: 0; }
.tour-card[data-side=above]::before { bottom: -8px; border-left: 0; border-top: 0; }
.tour-card[data-side=over]::before, .tour.centred .tour-card::before { display: none; }
.tour-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tour-emoji { font-size: 1.9rem; line-height: 1; }
.tour-count { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.tour-skip { margin-left: auto; background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; padding: 4px 2px; }
.tour-skip:hover, .tour-skip:focus-visible { color: var(--text); text-decoration: underline; }
.tour-card h2 { font-size: 1.2rem; margin: 2px 0 4px; line-height: 1.25; }
.tour-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.45; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: width .2s ease; }
.tour-dots span.done { background: var(--accent-soft); }
.tour-dots span.on { width: 20px; border-radius: 4px; background: var(--accent); }
.tour-btns { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.tour.centred .tour-card { text-align: left; }
.tour.still .tour-hole, .tour.still .tour-card, .tour.still .tour-dots span { transition: none; }
.tour.still .tour-hole::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .tour-hole, .tour-card, .tour-dots span { transition: none; }
  .tour-hole::after { animation: none; }
}
.tour-btn { font-size: 0.9rem; }
.tour-line { margin: -4px 0 12px; }
.tour-line.small { font-size: 0.9rem; }
.tours-sheet .tour-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.tours-sheet .tour-row > span:nth-child(2) { display: grid; min-width: 0; flex: 1; }
.tours-sheet .tour-row small { font-size: 0.82rem; line-height: 1.35; }
.tours-sheet { text-align: left; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.tours-sheet h2 { margin-top: 0; }

/* ---------- a problem with a field: under it, in words, all at once */
.field-error { display: block; color: var(--danger); font-size: 0.84rem; font-weight: 500; line-height: 1.35; margin-top: 2px; }
.field-error::before { content: '⚠ '; }
.field-warn { display: block; color: var(--muted); font-size: 0.84rem; line-height: 1.35; margin-top: 2px; }
.field-warn::before { content: 'ⓘ '; color: var(--accent-text); }
.has-error > input, .has-error > select, .has-error > textarea, .has-error input[aria-invalid], .has-error select[aria-invalid], .has-error textarea[aria-invalid] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.choice-group.has-error, .check-field.has-error { outline: 1px solid var(--danger); outline-offset: 4px; border-radius: 12px; }
.has-warn > input, .has-warn > select, .has-warn > textarea { border-color: var(--accent); }
.result-msg.bad { color: var(--danger); font-weight: 500; }
.result-msg.bad::before { content: '⚠ '; }

/* The setup sections switch to tiles by the room they have, not the window:
   a laptop scaled to 125% or a window that isn't full screen still gets them. */
.setup-body { container: setup / inline-size; }
/* ---------- setup on wide screens: less scrolling
   Short values get short boxes; groups of settings sit side by side as tiles;
   Save stays in reach while a long form is open. On phones: one column, the
   optional groups (courts, entry fees) folded to a line saying what's set. */
details.set-fold { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 14px; min-width: 0; }
details.set-fold > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 700; }
details.set-fold > summary::-webkit-details-marker { display: none; }
details.set-fold > summary::after { content: '▸'; margin-left: auto; color: var(--muted); transition: transform .15s ease; }
details.set-fold[open] > summary::after { transform: rotate(90deg); }
details.set-fold > summary .fold-summary { font-weight: 400; }
details.set-fold[open] > summary .fold-summary { display: none; }
details.set-fold > .fold-body { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 641px) {
  #app .field > input:is([type=number], [type=date], [type=time], [type=datetime-local]) { max-width: 240px; }
  details.set-fold > summary { cursor: default; pointer-events: none; }
  details.set-fold > summary::after { display: none; }
}
@container setup (min-width: 620px) {
  form.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-items: stretch; }
  form.tiles > * { grid-column: 1 / -1; margin: 0; }
  form.tiles > :is(fieldset, .set-fold) { grid-column: auto; }
  form.tiles > .wide, form.tiles > [data-fold=fees] { grid-column: 1 / -1; }
  .setup-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
  .setup-cards > * { margin: 0; }
  .setup-cards > .wide { grid-column: 1 / -1; }
  /* Save in reach: at the foot of the screen while the form runs past it. */
  [data-panel] form > .actions:last-child { position: sticky; bottom: 0; z-index: 4; background: var(--surface); margin: 0 -16px -16px; padding: 12px 16px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
}
/* Unsaved changes: said next to Save; on phones the bar comes up to meet you. */
[data-panel] form[data-dirty] > .actions:last-child::after { content: 'Unsaved changes'; color: var(--muted); font-size: 0.85rem; }
@media (max-width: 640px) {
  [data-panel] form[data-dirty] > .actions:last-child { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 4; background: var(--surface); margin: 0 -16px; padding: 10px 16px; border-top: 1px solid var(--border); box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.18); }
}
@container setup (min-width: 620px) {
  form.tiles > fieldset { align-content: start; }
  /* An event's settings: the format across the top, then fee and groups side by side, scoring below. */
  /* An event's settings, top to bottom as on a phone: event, format and its groups, scoring,
     then entries beside partners (or DUPR), then the one Advanced options fold. */
  form.tiles.event-tiles > :is(.fold, fieldset.formats, fieldset.scoring-set, .wide) { grid-column: 1 / -1; }
  form.event-tiles .group-sizes { max-width: 640px; }
  form.event-tiles > fieldset.scoring-set .scoring-grid, form.event-tiles > fieldset.scoring-set { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  form.event-tiles > fieldset.scoring-set > legend { grid-column: 1 / -1; }
  /* Entries alone on its row: fee and places side by side inside it. */
  form.tiles.event-tiles:not(:has(> .pair-tile)) > .entries-set { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  form.event-tiles:not(:has(> .pair-tile)) > .entries-set > :is(legend, .late-field) { grid-column: 1 / -1; }
  /* Advanced options: final stages and rankings on the left, mixed levels on the right. */
  form.event-tiles .advanced-body:has(> .placement-set) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
  form.event-tiles .advanced-body > .placement-set { grid-column: 2; grid-row: 1 / span 3; border-top: 0; padding-top: 0; margin-top: 0; border-left: 1px solid var(--border); padding-left: 24px; }
  form.event-tiles .advanced-body > .adv-section:not(.placement-set) { grid-column: 1; }
  form.event-tiles .advanced-body > .placement-set + .adv-section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
}
@container setup (min-width: 620px) {
  /* Entry fees: the fee for each event on the left, how players pay on the right. */
  form.tiles > [data-fold=fees] > .fold-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  form.tiles > [data-fold=fees] > .fold-body > * { grid-column: 2; }
  form.tiles > [data-fold=fees] > .fold-body > p.hint:first-child { grid-column: 1 / -1; }
  form.tiles > [data-fold=fees] > .fold-body > .fee-rows { grid-column: 1; grid-row: 2 / span 6; }
}
@media (min-width: 641px) {
@container setup (max-width: 619.98px) {
  [data-panel] form[data-dirty] > .actions:last-child { position: sticky; bottom: 0; z-index: 4; background: var(--surface); margin: 0 -16px -16px; padding: 12px 16px; border-top: 1px solid var(--border); }
}
}

/* ---------- fields: one height, one top edge, one rhythm
   Every text box and select is the same height; boxes side by side share a
   top edge (label, box and hint sit on shared rows); short boxes only where a
   field stands on its own; one spacing scale (16 between sections, 12 inside,
   4 between a label, its box and its hint). */
.form { gap: 16px; }
.field { align-content: start; gap: 4px; }
.grid-2, .grid-3 { align-items: start; gap: 12px; }
.label { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-height: 22px; line-height: 1.3; }
.label .tip { margin: 0; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]):not([type=hidden]), select) {
  box-sizing: border-box; height: 44px; min-height: 44px; padding-top: 0; padding-bottom: 0; line-height: 1.2;
}
.form .check-field, fieldset .check-field, .fold-body .check-field { margin-bottom: 0; }
@media (min-width: 640px) {
  .grid-2:not(:has(> :not(.field))) > .field, .grid-3:not(:has(> :not(.field))) > .field { grid-row: span 3; grid-template-rows: subgrid; row-gap: 4px; }
  #app :is(.grid-2, .grid-3) > .field > input { max-width: none; }
}

/* The free tournament planner (/tournament-planner): the chat between what it does and the questions */
.planner-intro { max-width: 560px; margin: 0 auto 8px; }
.planner-intro h1 { margin-bottom: 6px; }
.planner .chat { min-height: 0; }
.planner-more { max-width: 560px; margin: 32px auto 0; }
.planner-more h2 { font-size: 1.15rem; margin: 22px 0 8px; }
.planner-works, .planner-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.planner-works li, .planner-steps li { line-height: 1.4; }
.planner-works strong, .planner-steps strong { display: block; }
.planner-works span, .planner-steps span { color: var(--muted); }
.planner-links { margin-top: 18px; }
.plan-share { margin-top: 4px; }
@media print {
  main > div.planner { display: block !important; }
  .planner-intro, .planner-more, .chat-head, .chat-progress, .chat-log > .bubble, .chat-composer, .chat-foot, .chat-summary .actions, .chat-summary .link-btn { display: none !important; }
  .chat-summary { border: 0 !important; }
}

/* Self check-in: the organiser's card, the player's page and the venue display */
.self-checkin { display: grid; gap: 10px; padding: 12px; margin: 0 0 10px; border: 1px dashed var(--border); border-radius: 12px; }
.desk-code { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.desk-code strong { font-size: 2rem; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.self-checkin-qr { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.self-checkin-qr img { border-radius: 8px; background: var(--print-bg); }
.checkin-card { max-width: 480px; margin: 0 auto; }
.checkin-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.checkin-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.checkin-done { font-size: 1.15rem; font-weight: 700; }
.code-input { font-size: 2rem; letter-spacing: 0.4em; text-align: center; max-width: 200px; font-variant-numeric: tabular-nums; }
.dc-checkin { display: flex; align-items: center; gap: 24px; margin-top: 28px; text-align: left; }
.dc-checkin img { border-radius: 12px; background: var(--print-bg); }
.dc-checkin p { margin: 0 0 6px; }
.dc-checkin-code { font-size: 4rem; letter-spacing: 0.25em; font-variant-numeric: tabular-nums; }

/* Before an AI action: what it costs */
.spend-sheet h2 { margin-top: 0; }
.spend-sheet p { margin: 0 0 10px; }

/* Pricing: AI credit packs */
.ai-packs { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.ai-packs li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }

/* Plans & billing */
.billing h1 { margin-bottom: 12px; }
.sub-plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 12px 0 20px; }
.sub-plan { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.sub-plan.on { border-color: var(--accent); }
.sub-plan h3 { margin: 0; }
.sub-plan .price { font-size: 1.6rem; font-weight: 700; margin: 0; }
.sub-plan .price small { font-size: 0.9rem; font-weight: 400; color: var(--muted); }
.sub-plan .btn { margin-top: auto; }
.sub-list { margin: 4px 0 8px; padding-left: 18px; display: grid; gap: 4px; }

/* Poster: AI background artwork */
.poster-art { display: grid; gap: 8px; margin: 12px 0 4px; }
.poster-art h3 { margin: 0; }
.poster-art .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.poster-art input { width: 100%; }

/* Share card artwork */
.art-card { display: grid; gap: 8px; }
.art-card h2 { margin: 0; }
.art-card input { width: 100%; }
.art-preview { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.art-preview img { width: 140px; aspect-ratio: 9 / 16; border-radius: var(--radius); border: 1px solid var(--border); object-fit: cover; }

/* Rules and notices; sponsor roles */
.info-set .grid-2 { margin: 0; }
.sponsor-edit { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.sponsor-edit .sponsor-role { width: 120px; font-size: 0.8rem; padding: 4px 6px; min-height: 0; }
.poster-show { margin: 12px 0 4px; }
.poster-show summary { cursor: pointer; font-weight: 700; }

/* "We found your games" */
.found-sheet h2 { margin: 0 0 4px; }
.found-list { display: grid; gap: 6px; margin: 12px 0; max-height: 50vh; overflow: auto; }
.found-sheet { text-align: left; }
.found-item { align-items: flex-start; }
.found-item .found-text { display: grid; gap: 2px; text-align: left; }

/* Cricket scorecard (pro mode) */
.ck-sides { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ck-xi h3 { margin: 0 0 8px; font-size: 1rem; }
.ck-checks { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ck-toss { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.ck-step .field { display: block; margin: 10px 0; }
.ck-step select, .ck-setup select { width: 100%; }
.ck-live { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.ck-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.ck-row.small { margin-top: 4px; color: var(--muted); }
.ck-bat { font-size: 1.05rem; }
.ck-bat.on { color: var(--text); font-weight: 600; }
.ck-over { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ck-ball { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600; }
.ck-ball.b { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ck-ball.w { background: var(--live); color: #fff; border-color: var(--live); }
.ck-extras { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.ck-extras .wicket-btn { border-color: var(--live); }
.ck-how { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ck-card h3 { margin: 16px 0 6px; }
.ck-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 6px 0 10px; }
.ck-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.8rem; border-bottom: 1px solid var(--border); padding: 6px 4px; }
.ck-table td { border-bottom: 1px solid var(--border); padding: 6px 4px; }
.ck-table td:nth-child(n+3), .ck-table th:nth-child(n+3) { text-align: right; }
.ck-card .ck-table:last-child td:nth-child(n+2), .ck-card .ck-table:last-child th:nth-child(n+2) { text-align: right; }
.ck-pom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ck-pom h2, .ck-pom .hint, .ck-pom select, .ck-pom .actions { flex-basis: 100%; }
.ck-pom .actions { margin: 0; }
.ck-pom-line { display: flex; align-items: center; gap: 10px; margin: 0; }
.ck-trophy { width: 36px; height: 36px; border-radius: 18px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ck-highs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin: 0 0 16px; }
.ck-board .ck-table td:nth-child(2), .ck-board .ck-table th:nth-child(2) { text-align: left; }
.ck-who small { white-space: nowrap; }
.card .stat-row { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); margin-bottom: 0; }

/* partner acquisition (/admin/partners, public/app.js paProspects…) */
.pa-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.pa-tabs a { white-space: nowrap; }
.pa { display: grid; gap: 16px; }
.pa > .card, .pa .pa-col > .card { margin: 0; }
.pa h2 { margin: 8px 0 0; }
.pa .plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pa .plain-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pa-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pa-table th, .pa-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.pa-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.pa-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pa-table tr.muted td { color: var(--muted); }
.pa-prospects td { white-space: nowrap; }
.pa-prospects td.name { white-space: normal; min-width: 180px; font-weight: 600; }
.pa-scroll { max-height: 520px; overflow-y: auto; }
.pa-facts { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.pa-facts th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 12px 6px 0; width: 38%; vertical-align: top; }
.pa-facts td { padding: 6px 0; overflow-wrap: anywhere; }
.pa-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-color: var(--accent); }
.pa-form { display: grid; gap: 10px; }
.pa-form h3, .pa-form h4 { margin: 4px 0 0; }
.pa-head h2 { margin: 4px 0 2px; }
.pa-head p { margin: 0; }
.pa-detail { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .pa-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.pa-col { display: grid; gap: 16px; align-content: start; }
.pa-contacts li { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pa-contacts li:last-child { border-bottom: 0; }
.pa-basis select { min-height: 32px; padding: 2px 8px; font-size: 0.85rem; }
.pa-note { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.pa-note textarea { flex: 1; }
.pa-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pa-timeline li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; font-size: 0.9rem; }
@media (max-width: 480px) { .pa-timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.pa-email { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 12px 14px; font-size: 0.92rem; overflow-wrap: anywhere; }
.pa-email p { margin: 0 0 10px; }
.pa-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pa-vars .btn { font-family: inherit; font-variant-numeric: tabular-nums; }
.pa-clip { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; margin: 0; }
.pa-mapping { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin-top: 10px; }
.pa-code { display: block; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 0.82rem; overflow-wrap: anywhere; margin-bottom: 8px; }
.pa-followup summary { cursor: pointer; font-weight: 600; }
.pa-followup form { margin-top: 10px; }
.pa-steps .admin-actions { margin-top: 4px; }
.pa, .pa-col { grid-template-columns: minmax(0, 1fr); }
.pa .admin-actions select { width: auto; max-width: 100%; min-height: 36px; }
.pa-form select[multiple] { min-height: 112px; padding: 4px; }

/* "Check your email": the way on when the email doesn't come. */
.link-fallback { border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 10px; }

/* ---------- Multi-Sport Events
   Phone first: one column. Tablets: forms two or three across (grid-2/3).
   Desktop (with the rail): the standings and live matches, with the sports
   and latest winners alongside; Roles and Settings two across. */
.multi-templates { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.multi-templates .choice { min-height: 84px; }
.multi-new .grid-3 { margin-top: 4px; }
.multi-head h1 { margin: 2px 0 4px; overflow-wrap: anywhere; }
.multi-head .eyebrow { overflow-wrap: anywhere; }
.multi-tabs { margin-top: 4px; }
.multi-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.multi-inline .field { margin: 0; }
.multi-inline > .actions { padding-bottom: 2px; }
@media (max-width: 420px) { .multi-inline { grid-template-columns: 1fr; } }
.multi-role-grid, .multi-settings-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .multi-role-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .multi-settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.multi-role-grid > .card, .multi-settings-grid > .card { margin: 0; }
.rail .multi-sport { padding: 10px 12px; }
.rail .card h2 { font-size: 1.05rem; }
.multi-table { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.multi-row { border: 1px solid var(--border); border-left: 4px solid var(--g); border-radius: 12px; padding: 8px 12px; background: var(--surface); }
.multi-row-head { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 26px 12px 1fr auto auto; gap: 10px; align-items: center; cursor: pointer; }
.multi-row-head:disabled { cursor: default; }
.multi-row-head:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 4px; border-radius: 6px; }
.multi-rank { font-weight: 800; color: var(--muted); text-align: center; }
.multi-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--g); }
.multi-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-medals { font-size: 0.85rem; white-space: nowrap; }
.multi-points { font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.multi-points small { font-weight: 500; color: var(--muted); font-size: 0.75rem; }
.multi-bar { display: block; height: 4px; border-radius: 4px; background: var(--border); margin-top: 8px; overflow: hidden; }
.multi-bar span { display: block; height: 100%; background: var(--g); border-radius: 4px; }
.multi-lines { list-style: none; margin: 10px 0 2px; padding: 0; display: grid; gap: 6px; font-size: 0.9rem; }
.multi-lines li { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 6px; }
.multi-sports { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.multi-sport { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.multi-sport:hover { border-color: var(--accent); }
.multi-sport > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.multi-manage h2 { margin-top: 28px; }
@media (max-width: 520px) { .multi-medals { display: none; } .multi-row-head { grid-template-columns: 22px 10px 1fr auto; } }
/* The venue screen */
.mdisp { min-height: 100vh; display: flex; flex-direction: column; gap: clamp(12px, 2.2vh, 28px); padding: clamp(16px, 3vh, 40px) clamp(16px, 3.5vw, 64px); box-sizing: border-box; }
.mdisp-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.mdisp-head h1 { margin: 0; font-size: clamp(1.4rem, min(3.4vw, 4.6vh), 3.4rem); }
.mdisp-head img { height: clamp(20px, min(2.8vw, 3.8vh), 40px); width: auto; }
.mdisp-panel { flex: 1; }
.mdisp-panel h2 { font-size: clamp(1.2rem, min(2.8vw, 3.8vh), 3rem); margin: 0 0 clamp(8px, 1.6vh, 20px); }
.multi-table.big { gap: clamp(6px, 1.2vh, 14px); }
.multi-table.big .multi-row { padding: clamp(8px, 1.8vh, 24px) clamp(12px, 1.6vw, 28px); }
.multi-table.big .multi-row-head { grid-template-columns: 1.6em 0.8em minmax(0, 1fr) auto auto; font-size: clamp(1.1rem, min(3vw, 4.4vh), 3rem); }
.multi-table.big .multi-dot { width: 0.7em; height: 0.7em; }
.multi-table.big .multi-medals { font-size: 0.6em; display: inline; }
.multi-table.big .multi-points { font-size: 1.15em; }
.multi-table.big .multi-bar { height: 8px; }
.mdisp-live { list-style: none; padding: 0; margin: 0; display: grid; gap: clamp(8px, 1.4vh, 16px); font-size: clamp(1rem, min(2.4vw, 3.2vh), 2.4rem); }
@media (min-width: 1200px) and (min-aspect-ratio: 4/3) { .mdisp-live { grid-template-columns: 1fr 1fr; column-gap: 40px; } }
.mdisp-live li { display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.mdisp-foot { font-size: clamp(0.85rem, 1.2vw, 1.3rem); overflow-wrap: anywhere; }
.multi-people li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.multi-people li:first-child { border-top: 0; }
.multi-captain { border-left: 4px solid var(--g); }
.multi-captain h2 .multi-dot { display: inline-block; vertical-align: middle; }
.multi-cap-sport h4 { margin: 14px 0 4px; }
.multi-cap-sport li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* How-to tables: words wrap on a phone instead of scrolling sideways. */
.guide .table-wrap td { white-space: normal; }
/* Organiser tools (below the event): two across on wide screens. */
@media (min-width: 1100px) {
  .multi-manage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .multi-manage > :is(h2, .banner, p) { grid-column: 1 / -1; }
  .multi-manage > .card { margin: 0; }
}
/* Top bar on small phones: "+ New" stays on one line; the gaps tighten instead. */
.nav .btn, .nav .nav-link { white-space: nowrap; flex: none; }
@media (max-width: 400px) { .nav { gap: 6px; } .topbar-inner { gap: 8px; padding-left: 12px; padding-right: 12px; } }
@media (max-width: 340px) { .brand img { height: 17px; } }
/* Sign in with Google: Google's branding — white button, the colour "G", dark text (both themes). */
.google-signin { display: grid; gap: 10px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #FFFFFF; color: #1F1F1F; border: 1px solid #747775; border-radius: 999px; font-weight: 600; min-height: 44px; text-decoration: none; }
.btn-google:hover { background: #F8F9FA; color: #1F1F1F; }
.g-logo { display: inline-flex; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 2px 0; color: var(--muted); font-size: 0.85rem; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* sign-up feedback (server/feedback.js page, Admin → Overview card, account menu sheet) */
.feedback-page { max-width: 560px; margin: 0 auto; padding: 40px 16px; }
.feedback-form { display: grid; gap: 14px; }
.feedback-form .choice-group { flex-direction: column; align-items: stretch; }
.feedback-form textarea { width: 100%; }
.feedback-card .card { margin: 8px 0 12px; border: 0; padding: 0; background: none; box-shadow: none; }
.feedback-list li { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.feedback-list li:last-child { border-bottom: 0; }
.feedback-comment p { margin: 0; }
.feedback-sheet { display: grid; gap: 12px; }
.feedback-sheet h2 { margin: 0; }

/* the directory: listing banner, sources, city pages, the claim view (server/directory.js) */
.listing-note { display: grid; gap: 8px; border-color: var(--accent); }
.listing-note p { margin: 0; }
.listing-offer { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); }
.listing-sources ul { margin: 0 0 8px; padding-left: 1.1em; }
.dir-card .small { margin: 4px 0 0; }
.claim-card { display: grid; gap: 16px; max-width: 640px; }
.claim-card .form { display: grid; gap: 8px; }
.claim-card h3 { margin: 0; }
.pa-agents summary { cursor: pointer; }
.pa-agents .search-row .field { flex: 1 1 120px; margin: 0; }
.pa-steps-log { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.pa-steps-log code { font-size: 0.78rem; overflow-wrap: anywhere; }
.pa-funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 12px 0 8px; }
.pa-funnel-step { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pa-funnel-step strong { font-size: 1.4rem; line-height: 1.1; }
.pa-funnel-step span { font-size: 0.85rem; }

/* The visual planner (/tournament-planner, /new?mode=plan): sliders, tiles, charts, budget. */
.plan { display: grid; gap: 16px; }
.plan-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .plan-grid { grid-template-columns: 340px minmax(0, 1fr); } .plan-side { position: sticky; top: 76px; } }
.plan-main { display: grid; gap: 16px; min-width: 0; }
.plan-controls { display: grid; gap: 14px; }
.plan-controls h2 { margin: 0; font-size: 1.1rem; }
.plan-more { display: grid; gap: 14px; }
.plan-more > summary { cursor: pointer; font-weight: 600; color: var(--link); }
.plan-more[open] > summary { margin-bottom: 10px; }
.plan-more > * + * { margin-top: 14px; }
.plan-slider { display: grid; gap: 6px; }
.ps-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.ps-value { font-variant-numeric: tabular-nums; color: var(--text); background: var(--accent-soft); border-radius: 999px; padding: 0 10px; }
.plan-slider input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; cursor: pointer; }
.plan-tiles .stat strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.plan-ok { border-color: var(--accent); }
.plan-warn { border-color: var(--ball-yellow); }
.plan-bad { border-color: var(--danger); }
.plan-ok strong { color: var(--text); }
.plan-bad strong { color: var(--danger); }
.plan-badge { margin: 0; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.plan-badge.ok { background: var(--accent-soft); border-color: var(--accent); }
.plan-badge.warn { border-color: var(--ball-yellow); }
.plan-badge.bad { border-color: var(--danger); color: var(--text); }
.plan-badge.bad strong { color: var(--danger); }
.plan-charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.plan-charts figure, .plan-profit { margin: 0; display: grid; gap: 8px; align-content: start; }
.plan-charts figcaption, .plan-profit figcaption { display: grid; gap: 2px; }
.pc-chart { width: 100%; }
.pc-svg { width: 100%; height: 150px; display: block; overflow: visible; }
.pc-bar { fill: var(--border); }
.pc-bar.on { fill: var(--accent); }
.pc-bar.over { fill: var(--danger); opacity: 0.45; }
.pc-bar.on.over { fill: var(--danger); opacity: 1; }
.pc-label { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.pc-label.on { fill: var(--text); font-weight: 700; }
.pc-limit { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pc-limit-label { fill: var(--text); font-size: 10px; font-weight: 600; font-family: var(--font); }
.pc-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.pc-path { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.pc-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.pc-dot.loss { fill: var(--danger); }
.plan-formats { display: grid; gap: 8px; }
.plan-format { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.plan-format span { font-size: 0.85rem; color: var(--muted); }
.plan-format.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-format.over span:nth-child(3) { color: var(--danger); }
.plan-format-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.plan-format-bar > span { display: block; height: 100%; background: var(--accent); }
.plan-format.over .plan-format-bar > span { background: var(--danger); }
.plan-budget > summary { cursor: pointer; }
.plan-budget[open] > summary { margin-bottom: 8px; }
.plan-budget { display: grid; gap: 12px; }
.plan-group h3 { margin: 8px 0 4px; font-size: 0.95rem; }
.plan-line { display: grid; gap: 4px 10px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1fr) auto auto; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); }
.plan-line.off .pl-price, .plan-line.off .pl-qty, .plan-line.off .pl-total { opacity: 0.5; }
.pl-name { display: flex; gap: 8px; align-items: center; min-width: 0; }
.pl-name input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.pl-label { width: 100%; min-width: 0; }
.pl-price, .pl-qty { display: flex; gap: 4px; align-items: center; min-width: 0; }
.pl-price input, .pl-qty input { width: 90px; min-width: 0; }
.pl-qty input { width: 64px; }
.pl-total { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .plan-line { grid-template-columns: minmax(0, 1fr) auto; }
  .pl-name { grid-column: 1 / -1; }
  .pl-total { grid-column: 1 / -1; text-align: left; }
}
.plan-money-results { display: grid; gap: 12px; }
.plan-stack { display: grid; gap: 8px; }
.plan-stack-row { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 8px; align-items: center; }
.plan-stack-bar { display: flex; height: 18px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.plan-stack-bar .seg { display: block; height: 100%; }
.seg.income, .dot.income { background: var(--accent); }
/* Costs: never lime (that's income). */
.seg.c0, .dot.c0 { background: var(--ball-blue); }
.seg.c1, .dot.c1 { background: var(--ball-yellow); }
.seg.c2, .dot.c2 { background: var(--ball-pink); }
.seg.c3, .dot.c3 { background: var(--ball-red); }
.seg.c4, .dot.c4 { background: var(--ball-brown); }
.seg.c5, .dot.c5 { background: var(--side-b); }
.seg.c6, .dot.c6 { background: var(--muted); }
.seg.c7, .dot.c7 { background: var(--ball-black); }
.plan-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.plan-legend li { display: flex; align-items: center; gap: 6px; }
.plan-legend .dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.plan-actions p { flex-basis: 100%; margin: 0; }
@media print {
  .plan-side, .plan-actions, .planner .tabs, .plan-budget > summary { display: none; }
  .plan-grid { grid-template-columns: 1fr; }
}

/* ---------- the video page (/video) */
.video-stage { position: relative; margin-top: 12px; background: var(--navy); border-radius: var(--radius); overflow: hidden; }
.video-stage video { display: block; width: 100%; max-height: 70vh; background: var(--navy); }
.video-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.video-taps { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.video-taps .btn { min-height: 56px; }
.video-count { font-weight: 600; margin: 10px 0 0; }
#v-result video { display: block; width: 100%; max-height: 60vh; margin-top: 12px; background: var(--navy); border-radius: var(--radius); }
.rec-stage video { display: block; width: 100%; max-height: 70vh; background: var(--navy); }
.rec-guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rec-guide polygon, .rec-guide line { fill: none; stroke: var(--lime); stroke-width: 0.6; stroke-dasharray: 2 1.5; vector-effect: non-scaling-stroke; opacity: 0.8; }
.rec-score { position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--navy); color: var(--court-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-score:empty { display: none; }
/* Listing pages: Google's map (Maps Embed). City pages: suggest a place. */
.listing-map iframe { width: 100%; height: 320px; border: 0; border-radius: var(--radius); display: block; }
.suggest-place { display: grid; gap: 8px; }
.suggest-place h2 { margin: 0; }
.suggest-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.suggest-row input, .suggest-owner input[type=tel] { flex: 1 1 200px; min-width: 0; }
.suggest-owner { display: grid; gap: 8px; margin: 0; }
.google-says { display: grid; gap: 6px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius); }
.google-says h4 { margin: 0; }
.google-match { display: grid; gap: 2px; }
.video-overlays { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; display: grid; gap: 6px; }
.video-overlays legend { font-weight: 600; padding: 0 6px; }
.video-overlays label { display: flex; gap: 8px; align-items: center; }
.video-overlays input[type=checkbox] { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--accent); }
.video-overlays label.off { color: var(--muted); }

/* ---------- the video studio (/video): the video stays in view, tools in tabs */
.video-studio { max-width: 1400px; margin: 0 auto; padding: 16px; box-sizing: border-box; }
.studio-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.studio-head h1 { font-size: 1.5rem; margin: 0; }
.studio-head .eyebrow { margin: 0 0 2px; }
.studio { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 16px; align-items: start; }
.studio-view { position: sticky; top: 72px; display: grid; gap: 8px; min-width: 0; }
.studio-view .video-stage { margin-top: 0; }
.studio-empty { display: grid; justify-items: center; align-content: center; gap: 10px; text-align: center; min-height: 320px; padding: 24px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.studio-empty input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.studio-empty-title { font-weight: 700; font-size: 1.15rem; }
.studio-status { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.studio-status-text { font-size: 0.875rem; }
.studio-status-bar { grid-column: 1 / -1; grid-row: 2; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.studio-status-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.studio-status #v-status-stop { grid-row: 1; grid-column: 2; }
.studio-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.studio-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.studio-tabs button { font: inherit; font-size: 0.875rem; font-weight: 600; flex: 1 0 auto; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.studio-tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.studio-tabs button.done::after { content: " ✓"; }
.studio-tabs button:disabled { opacity: 0.45; cursor: not-allowed; }
.studio-pane { display: none; padding: 14px 16px 18px; }
.studio-pane.on { display: block; }
.studio-pane h3 { margin: 14px 0 8px; font-size: 1rem; }
.studio-pane .video-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.studio-points { max-height: 220px; overflow-y: auto; margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.875rem; }
.studio-points li { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; }
.studio-points .link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; text-align: left; flex: 1 1 auto; min-width: 0; }
.studio-points .studio-x { font: inherit; background: none; border: 0; padding: 0 6px; color: var(--muted); cursor: pointer; }
.studio-points .studio-x:hover { color: var(--text); }
.who-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; border: 1px solid var(--border); }
.step-n { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; margin-right: 4px; border-radius: 50%; border: 1px solid currentColor; font-size: 0.75rem; }
/* the stage: zoom (the stage scrolls), the court handles */
.stage-zoom { position: relative; width: calc(var(--zoom, 1) * 100%); }
.video-stage .stage-zoom video { max-height: calc(var(--zoom, 1) * 70vh); }
.video-stage.zoomed { overflow: auto; overscroll-behavior: contain; cursor: grab; }
.video-stage.zoomed-out { display: flex; align-items: center; justify-content: center; overflow: visible; }
.video-stage.zoomed-out .stage-zoom { flex: none; }
.court-handles { position: absolute; inset: 0; pointer-events: none; }
.court-handle { position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; background: transparent; cursor: grab; pointer-events: auto; touch-action: none; }
.court-handle::before { content: ""; position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; border-radius: 50%; background: var(--lime); border: 2px solid var(--navy); box-sizing: border-box; box-shadow: 0 0 0 2px var(--lime); opacity: 0.9; }
.court-handle.held { cursor: grabbing; }
.court-handle.left span { left: auto; right: 34px; }
.court-handle.held::before { opacity: 0.35; }
.court-handle span { position: absolute; left: 34px; top: 12px; padding: 1px 6px; border-radius: 4px; background: var(--navy); color: var(--court-ink); font-size: 0.7rem; font-weight: 600; white-space: nowrap; pointer-events: none; }
.court-handle:focus-visible::before { box-shadow: 0 0 0 4px var(--court-ink); }
.part-bar { position: relative; height: 6px; margin: 4px 0 10px; border-radius: 3px; background: var(--border); }
.part-bar span { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; border-radius: 3px; background: var(--accent); }
.cal-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.cal-tools .seg button { min-width: 38px; }
/* step 2: matches, people */
.match-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.match-chip { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.match-chip button { font: inherit; font-size: 0.85rem; border: 0; background: transparent; color: var(--text); padding: 5px 10px; cursor: pointer; }
.match-chip button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.match-chip.auto { border-style: dashed; }
.match-chip .studio-x { padding: 5px 8px 5px 2px; color: var(--muted); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 12px; }
.side-title { margin: 0 0 6px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.side-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.side-people .person { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.side-people .person canvas, .side-people .person-blank { width: 40px; height: 52px; border-radius: 6px; background: var(--navy); }
.side-people .person-blank { display: block; border: 1px dashed var(--border); background: transparent; box-sizing: border-box; }
.side-people .person-body { display: grid; gap: 4px; min-width: 0; }
.side-people .person-body input, .side-people .person-body select { min-width: 0; width: 100%; box-sizing: border-box; }
.side-people .person-body select { font-size: 0.8rem; padding: 4px 6px; }
.side-people .person-stats { margin: 0; font-size: 0.75rem; color: var(--muted); }
.side-people .person-swap { padding: 4px 8px; }
.alike { border: 1px dashed var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 12px; }
.alike p { margin: 0 0 6px; }
.alike-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.alike-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.alike-list li span { flex: 1 1 160px; }
.pick-boxes { position: absolute; inset: 0; pointer-events: auto; cursor: pointer; }
.pick-boxes[hidden] { display: none; }
.pick-box { position: absolute; padding: 0; border: 2px solid var(--court-ink); border-radius: 6px; background: transparent; pointer-events: none; }
.pick-box span { position: absolute; left: -2px; top: -22px; padding: 1px 6px; border-radius: 4px; background: var(--navy); color: var(--court-ink); font-size: 0.75rem; font-weight: 700; }
.pick-box[aria-pressed="true"] { border-color: var(--lime); box-shadow: 0 0 0 2px var(--lime); }
.anchors { margin: 0 0 12px; }
.anchor-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 8px; }
.anchor-form .actions { grid-column: 1 / -1; margin: 0; }
.anchor-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.anchor-list li { display: flex; gap: 8px; align-items: center; }
#v-analysis { border-top: 1px solid var(--border); margin-top: 14px; }
#v-analysis summary { cursor: pointer; margin: 6px 0; }
.check-line { display: flex; gap: 8px; align-items: center; font-size: 0.875rem; }
.check-line input[type=checkbox] { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--accent); }
.overlay-group { margin: 6px 0 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
  .studio-view { position: sticky; top: 56px; z-index: 5; background: var(--bg); padding-bottom: 6px; }
  .studio-view .video-stage video { max-height: calc(var(--zoom, 1) * 40vh); }
  .sides { grid-template-columns: 1fr; }
  .studio-empty { min-height: 180px; }
  .studio-head h1 { font-size: 1.25rem; }
  .studio-head { margin-bottom: 8px; gap: 4px; }
  .studio-head > p { font-size: 0.8rem; margin: 0; }
}
.tools-video { max-width: 760px; margin: 32px auto; }
.tools-video h2 { margin: 0 0 12px; }

/* ---------- The planner page on every screen size
   One left edge for everything (intro, tabs, the tool, the chat, the notes),
   with text kept to a readable width; tiles two across on the smallest
   phones and all five in a row from tablets up; a lone last chart takes the
   full width; slider tap areas big enough for a thumb on touch screens. */
.planner .planner-intro { max-width: 760px; margin: 0 0 8px; }
.planner .planner-more { max-width: 760px; margin: 32px 0 0; }
.planner .chat { max-width: 640px; margin: 0; }
.planner .plan-tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); }
.planner .plan-tiles .stat { padding: 12px 14px; }
@media (max-width: 400px) { .planner .plan-tiles .stat strong { font-size: 1.3rem; } }
.plan-charts > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (pointer: coarse) { .plan-slider input[type=range] { height: 40px; } }
@media (max-width: 420px) { .planner .tabs a { flex: 1 1 0; text-align: center; white-space: normal; line-height: 1.25; } }
@media (pointer: coarse) { .planner .link-btn { padding: 8px 4px; } }

/* ---------- The tournament page for visitors: a main column and a sidebar (poster, when and where, entry, prizes).
   Phones: the sidebar is one compact card under the title. */
.t-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "side" "main"; gap: 0 28px; }
.t-top { grid-area: top; } .t-side { grid-area: side; } .t-main { grid-area: main; min-width: 0; }
.t-side .side-poster { display: none; }
.glance { display: grid; gap: 12px; padding: 14px 16px; }
.glance-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.glance-row strong { display: block; }
.glance-icon { line-height: 1.4; }
.glance-prizes { list-style: none; margin: 4px 0; padding: 0; font-size: .875rem; display: grid; gap: 2px; }
.glance-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.glance-perks li { font-size: .8125rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.glance-enter { width: 100%; }
@media (max-width: 1023px) { .glance-enter { display: none; } }
.glance-links { display: flex; flex-wrap: wrap; gap: 6px; }
.event-line { margin: 0 0 12px; }
.event-line > summary { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; cursor: pointer; list-style: none; color: var(--muted); font-size: .875rem; padding: 4px 2px; }
.event-line > summary::-webkit-details-marker { display: none; }
.event-line[open] > summary .link-btn { visibility: hidden; }
.entries.grid { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 18px; counter-reset: n; }
.entries.grid li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--border); counter-increment: n; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.entries.grid li::before { content: counter(n); color: var(--muted); font-size: .75rem; min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.entries.grid .entry-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entries.grid li.out .entry-name { text-decoration: line-through; color: var(--muted); }
@media (min-width: 720px) { .entries.grid { columns: 3; } }
@media (min-width: 1024px) {
  .t-layout { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "top side" "main side"; align-items: start; }
  .t-side { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; display: grid; gap: 12px; padding-bottom: 8px; scrollbar-width: thin; }
  .t-side .side-poster { display: block; width: 100%; aspect-ratio: auto; background: transparent; box-shadow: none; }
  .t-side .side-poster img { height: auto; max-height: 40vh; width: auto; max-width: 100%; margin: 0 auto; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
  /* the poster moves from beside the title into the sidebar */
  .t-layout .t-head.has-poster { display: block; }
  .t-layout .t-head.has-poster > .t-poster { display: none; }
  .t-layout .t-head.has-poster .t-title h1 { font-size: 2.2rem; }
}
@media (min-width: 1366px) { .t-main .entries.grid { columns: 4; } }
/* A wide cover above the visitor's page: a banner, not a whole screen. */
@media (min-width: 1024px) { .t-hero:has(+ .t-layout), .t-hero:has(~ .t-layout) { aspect-ratio: auto; height: clamp(180px, 24vw, 320px); } }
@media (min-width: 1440px) { body:has(.t-layout) .container, body:has(.t-layout) main.container { max-width: 1280px; } }

/* ---------- The organiser's tournament page: the same sidebar, with the numbers and quick actions.
   Phones: a compact strip under the title (the checklist stays in the Entries tab). */
.desk-only { display: none; }
.manage-side .admin-bar { margin: 0 0 10px; }
.manage-stats { padding: 12px 14px; display: grid; gap: 8px; }
.manage-numbers { margin: 0; font-weight: 600; }
.manage-events { margin: 0; }
.manage-actions { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.manage-actions .btn { flex: 0 0 auto; }
@media (min-width: 1024px) {
  .desk-only { display: block; }
  .phone-only { display: none; }
  .manage-side .admin-bar { margin: 0; flex-wrap: wrap; gap: 8px; }
  .manage-actions { flex-wrap: wrap; overflow: visible; }
  .manage-side .checklist, .manage-side .budget-card { margin: 0; }
  .manage-side .checklist .check-row { flex-wrap: wrap; }
  .t-side .side-poster.small img { max-height: 38vh; }
  .t-side > * { flex-shrink: 0; min-height: min-content; }
}
/* Entry rows: the name, tags, fee and fee buttons on one line (two on phones), not three. */
.entries li > .name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.entries li > .name > .entry-name { display: inline; }
.entries li > .name > .contact, .entries li > .name > .checkin-when, .entries li > .name > .entry-people, .entries li > .name > .level-chips, .entries li > .name > .member-fees, .entries li > .name > .people-list { flex-basis: 100%; }
.entries li > .name > .entry-tags { margin-top: 0; }
.entries li > .name > .fee-actions { margin-top: 0; margin-left: auto; }
.entries li > .name > .fee-actions .btn { min-height: 30px; padding-block: 4px; }
.lbl-short { display: none; }
@media (max-width: 719px) {
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .entries li > .name:has(.fee-actions) .pill.unpaid { display: none; }
  .entries li > .name:has(.fee-actions) .entry-tags:not(:has(> :not(.unpaid))) { display: none; }
  .fee-actions .fee-waive { display: none; }
  .entries li > .name { gap: 4px 6px; }
}
.add-fold { margin: 0 0 12px; }
.add-fold > summary { list-style: none; display: inline-flex; cursor: pointer; }
.add-fold > summary::-webkit-details-marker { display: none; }
.add-fold[open] > summary { margin-bottom: 10px; }
/* the name gives way (ellipsis) before the fee buttons wrap to a second line */
.entries li > .name:has(> .fee-actions) > .entry-name { flex: 1 1 0; min-width: 4em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the video studio, simplified: cards in step 2, presets in step 3, the timeline */
.studio-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; background: var(--bg); }
.studio-card > h3:first-child { margin-top: 0; }
details.studio-card > summary { display: grid; gap: 2px; cursor: pointer; list-style: none; }
details.studio-card > summary::-webkit-details-marker { display: none; }
details.studio-card > summary .score-card-title { font-weight: 700; }
details.studio-card > summary .score-card-title::after { content: " ▸"; color: var(--muted); }
details.studio-card[open] > summary .score-card-title::after { content: " ▾"; }
details.studio-card[open] > summary { margin-bottom: 10px; }
.studio-card .fold { margin: 10px 0 0; padding: 8px 12px; }
.studio-results { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 0.875rem; }
.studio-results dt { font-weight: 600; }
.studio-results dd { margin: 0; }
.studio-results .fastest-shots { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-results .land-maps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.studio-results .land-maps canvas { border-radius: 8px; }
.practice-box { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.practice-box h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.practice-list { padding-left: 1.2em; margin: 8px 0; display: grid; gap: 10px; }
.practice-list p { margin: 2px 0 0; }
.practice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.practice-head select { width: auto; max-width: 100%; }
.practice-card { display: block; width: 100%; height: auto; margin-top: 8px; border-radius: var(--radius); border: 1px solid var(--border); }
.court-status { margin: 0 0 6px; }
.court-fold { margin-top: 8px; }
.overlay-title { font-weight: 600; margin: 14px 0 6px; }
.presets button { font: inherit; font-size: 0.875rem; padding: 8px 14px; }
.presets button:disabled { opacity: 0.45; cursor: not-allowed; }
.overlay-fold { margin: 10px 0; padding: 8px 12px; }
.overlay-fold .video-overlays { border: 0; padding: 6px 0 0; margin: 0; }
.studio-timeline { display: block; width: 100%; height: 44px; border-radius: var(--radius); background: var(--navy); cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- The signed-in Home: three actions, your tournaments with their next step, everything you can do. */
.home-hello h1 { margin: 0 0 4px; font-size: clamp(1.5rem, 4vw, 2rem); }
.home-actions { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
@media (min-width: 640px) { .home-actions { grid-template-columns: 1.3fr 1fr 1fr; } }
.home-act { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.05rem; min-height: 64px; }
.home-act:hover { border-color: var(--accent); }
.home-act small { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.home-act.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.home-act.primary small { color: var(--on-accent); opacity: .75; }
.home-act .icon { width: 30px; height: 30px; flex: none; }
.home-act .icon svg { width: 100%; height: 100%; }
.home-sub { margin: 10px 0 0; }
.home-sub .link-btn { vertical-align: baseline; }
.home-steps { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; gap: 10px; }
@media (min-width: 640px) { .home-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.home-steps li { padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; }
.home-steps li b { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.home-steps .n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-grid; place-items: center; font-size: .8rem; flex: none; }
.my-t-list { list-style: none; margin: 0; padding: 0; }
.my-t-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.my-t-row:first-child { border-top: 0; padding-top: 0; }
.my-t-name { display: block; font-weight: 700; color: var(--text); text-decoration: none; }
.my-t-name:hover { text-decoration: underline; }
.my-t-row b { color: var(--text); font-weight: 600; }
.my-t-row .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.home-tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.home-tile { display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.home-tile:hover { border-color: var(--accent); }
.home-tile .icon { width: 26px; height: 26px; color: var(--accent-text); }
.home-tile .icon svg { width: 100%; height: 100%; }
.home-tile b { font-size: .95rem; }
.home-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.home-hello { display: block; }
.home-tour-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--border); font-size: .9rem; }
.home-tour-prompt > span:nth-child(2) { flex: 1 1 200px; }

/* ---------- The rules quiz (/quiz) */
.quiz-page { max-width: 760px; }
.quiz-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.quiz-filters .chip { font: inherit; font-size: .9rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.quiz-filters .chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.quiz-progress { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0 0 10px; font-size: .875rem; color: var(--muted); }
.quiz-progress .progress { flex-basis: 100%; }
.quiz-card { display: grid; gap: 16px; padding: 16px; }
@media (min-width: 640px) { .quiz-card { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } }
.quiz-img { width: 100%; height: auto; border-radius: 12px; background: var(--surface-2); max-height: 42vh; object-fit: contain; }
@media (max-width: 639px) { .quiz-img { max-height: 32vh; } }
.quiz-body h2 { margin: 2px 0 14px; font-size: clamp(1.2rem, 4vw, 1.5rem); line-height: 1.25; }
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quiz-option { font-weight: 800; letter-spacing: .02em; min-height: 56px; }
.quiz-option[disabled] { opacity: .55; cursor: default; }
.quiz-option.right, .quiz-option.right[disabled] { opacity: 1; background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.quiz-option.wrong, .quiz-option.wrong[disabled] { opacity: 1; border-color: var(--danger); }
.quiz-why { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.quiz-why p { margin: 0 0 10px; }
.quiz-verdict { font-weight: 800; font-size: 1.1rem; }
.quiz-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.quiz-end { text-align: center; padding: 24px 16px; }
.quiz-score { font-size: clamp(2.6rem, 10vw, 3.6rem); font-weight: 800; margin: 0; line-height: 1.1; }
.quiz-end .actions { justify-content: center; }
/* The quiz's sport picker, and the art panel for rules that have no video yet */
.quiz-pick-title { margin: 8px 0 10px; font-size: 1.15rem; }
.quiz-sports { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .quiz-sports { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.quiz-sport { display: grid; justify-items: start; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.quiz-sport:hover { border-color: var(--accent); }
.quiz-sport svg { width: 30px; height: 30px; color: var(--accent-text); }
.quiz-sport b { font-size: 1rem; }
.quiz-sport.random { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.quiz-dice { font-size: 1.6rem; line-height: 1; }
.quiz-art { position: relative; display: grid; place-items: center; aspect-ratio: 9 / 10; max-height: 32vh; width: 100%; border-radius: 12px; overflow: hidden; background: var(--navy); }
.quiz-art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 58%, var(--lime) 58% 64%, transparent 64%); opacity: .9; }
.quiz-art-icon { position: relative; width: 44%; height: 44%; color: var(--lime); }
.quiz-art-q { position: absolute; right: 12px; bottom: 10px; padding: 2px 12px; border-radius: 999px; background: var(--lime); color: var(--navy); font-weight: 800; font-size: 1rem; }
@media (min-width: 640px) { .quiz-art { max-height: none; } }
.quiz-progress .link-btn { margin-right: auto; }
.replay-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.replay-line label { display: inline-flex; align-items: center; gap: 6px; }
/* The video page before a video is chosen: how it works, in 4 steps. */
.video-howto { margin: 16px 0 0; }
#v-empty[hidden] + .video-howto { display: none; }
.video-howto-title { margin: 0 0 10px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.video-howto-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.video-howto-steps li { display: grid; align-content: start; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 0.875rem; }
.video-howto-steps li > span:last-child { color: var(--muted); }
.howto-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.875rem; }
.howto-court { width: 100%; max-width: 140px; height: auto; }
.howto-court polygon, .howto-court line { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.howto-court circle { fill: var(--accent); }
@media (max-width: 900px) { .video-howto-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .video-howto-steps { grid-template-columns: 1fr; gap: 8px; }
  .video-howto-steps li { grid-template-columns: 28px 1fr; column-gap: 10px; row-gap: 2px; padding: 10px 12px; }
  .video-howto-steps li > .howto-no { grid-row: span 2; }
  .howto-court { display: none; }
}
/* ---------- /video-analysis: the feature page */
.va-shot { margin: 0 0 36px; }
.va-shot svg { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--court-line); }
.va-shot figcaption { margin-top: 8px; }
.va-bg { fill: var(--navy); }
.va-floor { fill: var(--court-btn); }
.va-line { fill: none; stroke: var(--court-dim); stroke-width: 2; opacity: 0.7; }
.va-net line { stroke: var(--court-soft); stroke-width: 2; opacity: 0.8; }
.va-trail { fill: none; stroke: var(--lime); stroke-width: 5; stroke-linecap: round; }
.va-trail-glow { fill: none; stroke: var(--lime); stroke-width: 16; stroke-linecap: round; opacity: 0.18; }
.va-shuttle { fill: var(--court-ink); stroke: var(--lime); stroke-width: 4; }
.va-skel line, .va-skel circle { stroke-width: 4; stroke-linecap: round; fill: none; }
.va-skel-a line, .va-skel-a circle { stroke: var(--lime); }
.va-skel-b line, .va-skel-b circle { stroke: var(--court-soft); stroke-width: 6; }
.va-panel { fill: var(--navy); stroke: var(--court-btn-line); }
.va-tab { fill: var(--lime); }
.va-tab-text { fill: var(--navy); font: 700 12px Outfit, system-ui, sans-serif; letter-spacing: 0.06em; }
.va-big { fill: var(--court-ink); font: 700 44px Outfit, system-ui, sans-serif; }
.va-unit { fill: var(--lime); font: 600 18px Outfit, system-ui, sans-serif; }
.va-small { fill: var(--court-dim); font: 500 12px Outfit, system-ui, sans-serif; letter-spacing: 0.04em; }
.va-serve { fill: var(--lime); }
.va-name { fill: var(--court-ink); font: 600 17px Outfit, system-ui, sans-serif; }
.va-pts { fill: var(--lime); stroke: none; }
.va-pts-b { fill: var(--slate); }
.va-pts-t { fill: var(--navy); font: 700 16px Outfit, system-ui, sans-serif; text-anchor: middle; }
.va-pts-tb { fill: var(--court-ink); }
.va-mini rect { fill: var(--navy); stroke: var(--court-dim); stroke-width: 1.5; opacity: 0.9; }
.va-mini line { stroke: var(--court-dim); stroke-width: 1.5; }
.va-dot-a { fill: var(--lime); }
.va-dot-b { fill: var(--court-soft); }
.va-row { fill: var(--court-ink); font: 600 15px Outfit, system-ui, sans-serif; }
.va-row-v { fill: var(--court-soft); font: 500 14px Outfit, system-ui, sans-serif; text-anchor: end; }
.va-beta { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; }
.va-audience { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-bottom: 32px; }
.va-audience h3 { margin-top: 0; }
.va-price { margin: 28px 0; }
.va-price h2 { margin-top: 0; }

/* Video analysis page: icon badges (lime fill, navy line icon) */
.va-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--on-accent); flex: none; }
.va-icon svg { width: 24px; height: 24px; }
.feature-groups h3:has(.va-icon), .va-audience h3:has(.va-icon) { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.va-audience h3 .va-icon { width: 48px; height: 48px; }
.va-steps li { grid-template-columns: 40px 1fr; column-gap: 14px; position: relative; }
.va-steps li::before { position: absolute; left: -6px; top: -6px; width: 20px; height: 20px; font-size: 0.72rem; background: var(--surface); color: var(--text); border: 1.5px solid var(--accent); z-index: 1; }
.va-steps .va-icon { grid-row: span 2; color: var(--on-accent); width: 40px; height: 40px; border-radius: 50%; }
.va-steps .va-icon svg { width: 22px; height: 22px; }

/* Match videos: the stats an analysed video gave back, and the highlights links. */
.mc-hl { margin-left: auto; margin-right: 6px; color: var(--accent-text); font-size: 0.8rem; }
.match-video { margin: 0 0 16px; }
.match-video .card-head h2 { margin: 0; }
.mv-stats { display: grid; gap: 6px; margin: 8px 0; }
.hl-form { display: grid; gap: 8px; margin-top: 8px; }
.hl-strip h2 { margin: 0 0 8px; }
.hl-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hl-item { display: flex; gap: 10px; align-items: center; min-width: 0; }
.hl-item > div { display: grid; min-width: 0; }
.hl-item strong { overflow-wrap: anywhere; }
.hl-play { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); text-decoration: none; font-size: 1rem; }
.analyse-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border); }
.analyse-list li:first-child { border-top: 0; }
.analyse-list .actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.film-tip { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.video-bests h2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.save-stats { display: grid; gap: 6px; justify-items: start; margin: 8px 0 16px; }

/* The live plan card (Plan: will it fit?) on a tournament. */
.plan-card p { margin: 6px 0; }
.plan-card .plan-badge { margin: 8px 0; }
.plan-fixes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.plan-length { margin: 4px 0 8px; }

/* "Tournament today" in a group session, and the group's and club's tournaments, groups and honours. */
.ge-start { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ge-card .card-head h2, .ge-form .card-head h2 { margin: 0; }
.ge-card.done h2 { margin: 4px 0 8px; }
.ge-players { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); cursor: pointer; font-size: 0.9rem; }
.check-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.check-chip input { margin: 0; }
.ge-fixtures h3, .ge-round h3 { margin: 12px 0 6px; font-size: 0.95rem; }
.ge-fixtures li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 6px 0; border-top: 1px solid var(--border); }
.ge-fixtures li:first-child { border-top: 0; }
.ge-fixtures li.live { font-weight: 600; }
.ge-fixtures .vs { color: var(--muted); }
.ge-table { margin-top: 10px; }
.ge-bracket { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ge-match { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; }
.ge-match .won { font-weight: 700; }
.group-honours li, .group-tournaments li, .club-tournaments li { padding: 4px 0; }
.club-group { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }
.club-group:first-child { border-top: 0; }
.new-home { flex-wrap: wrap; }
