/* uControlTennis — "Hardcourt Blue" dark theme with "Optic Yellow" accents;
   padel mode (html[data-sport="padel"]) swaps the accent to red and CONTROL to burgundy.
   Mobile first. Logical properties throughout so Hebrew RTL mirrors for free. */

:root {
  --bg: #0A1A30;
  --bg-2: #0D2140;
  --surface: #12304F;
  --surface-2: #173A60;
  --surface-3: #1D4673;
  --line: #1F4A78;
  --court-line: rgba(234, 242, 255, .10);
  --text: #EAF2FF;
  --muted: #9FB6D6;
  --faint: #6F8BB0;
  --optic: #D7FF1F;
  --optic-2: #C2EB00;
  --optic-rgb: 215, 255, 31;  /* the same yellow, for rgba() tints */
  --optic-hi: #efff7a;
  --optic-lo: #a9c700;
  --optic-ink: #0A1A30;
  --brand-blue: #2D8FD8;    /* logo blue, lifted a step for contrast on the dark court */
  --tennis-orange: #F9A51A; /* logo orange (CONTROL, flames) */
  --padel-burgundy: #C0304F; /* burgundy lifted two steps: #800020 all but vanishes on the navy */
  --brand-orange: var(--tennis-orange);
  --ok: #3DDC97;
  --warn: #FFB547;
  --danger: #FF6B6B;
  --rain: #5AB8FF;
  --radius: 16px;
  --radius-sm: 10px;
  --tap: 52px;
  --tabbar-h: 64px;
  --font: "Heebo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* The photos themselves (--photo*, --hero-photo*) are set per page on <html>
     by the layout from app/lib/photos.php: each sport has its own set, and a
     page never shows the same one twice. The -sm cut is for phones. */
  --photo-pos: center;
  --hero-photo-pos: center;
  --glass: rgba(16, 42, 72, .72);
  --glass-2: rgba(13, 33, 64, .84);
  --glass-line: rgba(120, 170, 230, .18);
  --shadow: 0 10px 30px rgba(3, 10, 22, .35);
}

/* Padel: red where tennis is optic yellow, burgundy where it is orange. */
[data-sport="padel"] {
  --optic: #FF3B3B;
  --optic-2: #E02626;
  --optic-rgb: 255, 59, 59;
  --optic-hi: #ff8a7a;
  --optic-lo: #b81c1c;
  --brand-orange: var(--padel-burgundy);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: transparent;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  -webkit-tap-highlight-color: transparent;
}
/* The sport's photo, fixed behind everything (a fixed layer rather than
   background-attachment: fixed, which iOS ignores). Bright at the top, sinking
   into the navy further down so long pages stay readable. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 26, 48, .40) 0%, rgba(10, 26, 48, .72) 34%, rgba(10, 26, 48, .93) 62%, var(--bg) 100%),
    var(--photo-sm) var(--photo-pos) / cover no-repeat,
    var(--bg);
}
@media (min-width: 720px) {
  body::before {
    background:
      linear-gradient(180deg, rgba(10, 26, 48, .35) 0%, rgba(10, 26, 48, .70) 40%, rgba(10, 26, 48, .93) 75%, var(--bg) 100%),
      var(--photo) var(--photo-pos) / cover no-repeat,
      var(--bg);
  }
}
body.signed-out, body.bare { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
a { color: var(--optic); text-decoration: none; }
img, svg { max-width: 100%; }
#pvInvite [hidden] { display: none !important; }   /* .btn-row and .field set display, which beats [hidden] */
.ic { flex: none; vertical-align: middle; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.num, bdi.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.stack > * + * { margin-block-start: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap-row { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { height: 16px; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: rgba(8, 20, 38, .62);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--glass-line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1.05rem; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--optic); color: var(--optic-ink); }
/* Logo: blue "U" + "TENNIS", orange "CONTROL" (from the brand artwork). */
.logo { display: block; height: auto; }
.logo-sm { height: 38px; width: auto; }
.logo-lg { width: min(320px, 80%); margin: 0 auto 10px; }
.wordmark { display: inline-flex; flex-direction: column; line-height: .9; font-weight: 800; letter-spacing: -.02em; direction: ltr; }
.wordmark b { font-weight: 800; }
.wm-u, .wm-t { color: var(--brand-blue); }
.wm-c { color: var(--brand-orange); }
.wm-tennis .wm-c { color: var(--tennis-orange); }
.wm-padel .wm-c { color: var(--padel-burgundy); }
/* Tennis / padel selector: both logos, the current one lit, the other one a quiet tap target. */
.sport-switch { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sport-opt { display: flex; align-items: center; padding: 3px 6px; border-radius: 10px; border: 1px solid transparent; transition: opacity .15s, background .15s; }
.sport-opt:not(.on) { opacity: .42; }
.sport-opt:not(.on) .wordmark-sm { font-size: .82rem; }
.sport-opt:not(.on) .wordmark-sm .wm-t { font-size: 1rem; }
.sport-opt:not(.on):hover { opacity: .75; }
.sport-opt.on { background: rgba(var(--optic-rgb), .08); border-color: rgba(var(--optic-rgb), .28); }
.wordmark-sm { font-size: 1.05rem; }
.wordmark-sm .wm-t { font-size: 1.28rem; }
.wordmark-lg { font-size: 2.3rem; }
.wordmark-lg .wm-t { font-size: 2.95rem; }
.topbar-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-inline-start: 4px; color: var(--text); font-weight: 700; font-size: .92rem; }
.topbar-back { display: grid; place-items: center; width: 40px; height: 40px; margin-inline-start: -8px; color: var(--text); }
[dir="rtl"] .topbar-back .ic, [dir="rtl"] .chev .ic { transform: scaleX(-1); }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.topbar-link { display: grid; place-items: center; width: 40px; height: 40px; color: var(--muted); }
.lang-toggle {
  min-width: 44px; height: 36px; padding: 0 10px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .85rem;
}

.banner {
  display: flex; align-items: center; gap: 10px; margin: 12px 16px 0; padding: 12px 14px;
  border-radius: var(--radius-sm); background: #1b3f66; color: var(--text); font-size: .92rem;
  border: 1px solid #2d6aa6;
}
.banner .ic { color: var(--rain); }
/* The waiver banner is a duty, not an offer: warn colours, and it stays up
   until every player on the account has signed the version in force. */
.banner-warn { background: rgba(255, 181, 71, .12); border-color: rgba(255, 181, 71, .4); color: #ffd9a0; }
.banner-warn .ic { color: var(--warn); }
/* Open onboarding tasks: red, so a provider mid-setup notices it before anything else. */
.banner-danger { background: rgba(255, 107, 107, .14); border-color: rgba(255, 107, 107, .4); color: #ffbdbd; }
.banner-danger .ic { color: var(--danger); }

/* ── "Use the app" bar (Android browsers only) ───────── */
.appbar {
  display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); font-size: .9rem;
  animation: appbar-in .28s ease-out both;
}
.appbar-mark { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--optic); color: var(--optic-ink); }
.appbar-cta {
  flex: none; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .88rem;
  background: var(--optic); color: var(--optic-ink);
}
.appbar-x { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: none; color: var(--muted); }
@keyframes appbar-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .appbar { animation: none; } }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }

/* ── Bottom tab bar ─────────────────────────────────── */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(8, 20, 38, .82);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid var(--glass-line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--faint); font-size: .72rem; font-weight: 500; }
.tabbar a.on { color: var(--optic); }
.tabbar a.on .ic { filter: drop-shadow(0 0 6px rgba(var(--optic-rgb), .35)); }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--glass) 0%, var(--glass-2) 100%);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-link { display: block; color: inherit; }
.card-link:active { transform: scale(.99); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; color: #c3d4ec; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.divider { height: 1px; background: var(--court-line); margin: 14px 0; }

/* Photo hero: the sport's photograph under a navy wash, text on the dark end. */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 28px 20px 24px;
  background:
    linear-gradient(180deg, rgba(10, 26, 48, .05) 0%, rgba(10, 26, 48, .45) 50%, rgba(10, 26, 48, .92) 100%),
    var(--hero-photo-sm) var(--hero-photo-pos) / cover no-repeat,
    var(--surface);
  border: 1px solid var(--glass-line);
  box-shadow: 0 18px 50px rgba(3, 10, 22, .5);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
}
.hero > * { position: relative; }
.hero h1 { font-size: 2rem; }
.hero .muted { color: #d2def0; }
.hero .ball { position: absolute; inset-inline-end: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--optic-hi), var(--optic) 45%, var(--optic-lo) 100%); opacity: .9; box-shadow: 0 10px 40px rgba(var(--optic-rgb), .25); }
.hero-kicker { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px; background: linear-gradient(rgba(var(--optic-rgb), .16), rgba(var(--optic-rgb), .16)), rgba(8, 20, 38, .72); border: 1px solid rgba(var(--optic-rgb), .5); color: var(--optic); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-shadow: none; }

/* Signed-out landing: a full-bleed, website-style hero. */
.wrap:has(> .landing) { max-width: 1080px; }
.landing-hero {
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: min(78vh, 640px); margin: -16px -16px 0; padding: 32px 20px 28px;
  border-radius: 0 0 28px 28px; border-top: 0;
}
.landing-hero h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); font-weight: 800; letter-spacing: -.02em; max-width: 16ch; margin-bottom: .35em; }
.landing-hero .lead { font-size: clamp(1.02rem, 2.4vw, 1.25rem); max-width: 46ch; color: #dbe6f5; }
.landing-hero .logo-lg, .landing-hero .wordmark-lg { margin: 0 0 18px; }
.landing-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; max-width: 420px; }
.features { display: grid; grid-template-columns: 1fr; gap: 12px; }
.features .card { margin: 0; }
.feature-ic { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 12px; border-radius: 14px; background: rgba(var(--optic-rgb), .14); border: 1px solid rgba(var(--optic-rgb), .35); color: var(--optic); }
.feature-n { float: inline-end; color: var(--faint); font-weight: 800; font-size: .9rem; }
.photo-credit { font-size: .68rem; color: var(--faint); text-align: center; margin: 28px 0 0; opacity: .8; }
.features .card { padding: 0; overflow: hidden; }
.feature-photo { height: 150px; background: var(--surface) center / cover no-repeat; border-bottom: 1px solid var(--glass-line); }
.feature-body { position: relative; padding: 0 16px 16px; }
.feature-body .feature-ic { margin-top: -23px; background: var(--bg-2); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.features .card { position: relative; }
.features .feature-n { float: none; position: absolute; top: 10px; inset-inline-end: 10px; z-index: 1; padding: 2px 9px; border-radius: 999px; background: rgba(8, 20, 38, .75); color: #fff; font-size: .78rem; }
.photo-credit a { color: var(--muted); }
@media (min-width: 560px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 720px) {
  .hero { background:
    linear-gradient(180deg, rgba(10, 26, 48, .05) 0%, rgba(10, 26, 48, .45) 50%, rgba(10, 26, 48, .92) 100%),
    var(--hero-photo) var(--hero-photo-pos) / cover no-repeat, var(--surface); }
  .landing-hero { margin: 8px 0 0; padding: 48px 44px 40px; border-radius: 28px; border-top: 1px solid var(--glass-line); }
  .landing-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 26, 48, .55), transparent 60%); pointer-events: none; }
  [dir="rtl"] .landing-hero::after { background: linear-gradient(270deg, rgba(10, 26, 48, .55), transparent 60%); }
  .landing-hero > * { z-index: 1; }
  .landing-cta { flex-direction: row; align-items: center; }
  .landing-cta .btn { width: auto; padding: 0 28px; }
}
@media (min-width: 960px) { .features { grid-template-columns: repeat(4, 1fr); } }

/* Signed-in home: a shorter photo banner with the greeting. */
.home-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 20%, rgba(10, 26, 48, .55) 100%); }
.home-hero > * { z-index: 1; }
.home-hero { min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 14px; }
.home-hero h1 { font-size: 1.9rem; margin-bottom: .2em; }
.home-hero p { margin: 0; }

/* ── Buttons (thumb friendly) ────────────────────────── */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  text-align: center; user-select: none; touch-action: manipulation;
  transition: transform .06s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 60px; font-size: 1.1rem; border-radius: 16px; }
.btn-xl { min-height: 72px; font-size: 1.25rem; border-radius: 18px; }
.btn-optic { background: var(--optic); border-color: var(--optic); color: var(--optic-ink); box-shadow: 0 6px 24px rgba(var(--optic-rgb), .18); }
.btn-optic:active { background: var(--optic-2); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: #7a2d3a; color: var(--danger); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #062a1c; }
.btn-rain { background: #17436f; border-color: #2c73b5; color: #cfe8ff; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: 12px; }
.btn-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
/* Grid items refuse to shrink below their content by default; a <select> with a
   long option would then push the page wider than the phone. */
.btn-row > *, .row > * { min-width: 0; }
select, input, textarea { max-width: 100%; }
.btn-row.three { grid-auto-flow: row; grid-template-columns: 1fr 1fr 1fr; }
.btn-stack > .btn + .btn { margin-top: 10px; }
.btn .spin { width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Chips & badges ─────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: .8rem; font-weight: 600; }
.chip-level { background: rgba(var(--optic-rgb), .12); color: var(--optic); border: 1px solid rgba(var(--optic-rgb), .3); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .01em; }
.badge-rain { background: rgba(90, 184, 255, .16); color: var(--rain); }
.badge-heat { background: rgba(255, 140, 60, .16); color: #FF9A55; }
.badge-cold { background: rgba(170, 220, 255, .16); color: #bfe6ff; }
.badge-pass { background: rgba(var(--optic-rgb), .14); color: var(--optic); }
.badge-sub { background: rgba(190, 150, 255, .16); color: #CDB2FF; }
.badge-wd { background: rgba(255, 107, 107, .14); color: var(--danger); }
.badge-auto { background: rgba(255, 181, 71, .14); color: var(--warn); }
.badge-ok { background: rgba(61, 220, 151, .14); color: var(--ok); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-padel { background: rgba(192, 48, 79, .18); color: #ff9fb2; }

/* ── Lists ───────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
/* Hundreds of directory courts: scroll inside the card, not the whole page. */
.pv-pick-list { max-height: 55vh; overflow-y: auto; overscroll-behavior: contain; }
.pv-pick-list [hidden] { display: none !important; }   /* .list-item sets display, which beats [hidden] */
.list > li + li { border-top: 1px solid var(--court-line); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 2px; color: inherit; min-height: var(--tap); }
.list-item .chev { color: var(--faint); margin-inline-start: auto; }

/* Match card */
.mcard { display: block; color: inherit; padding: 14px 16px; }
.mcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .82rem; margin-bottom: 8px; }
.mcard-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.mcard-vs .side { font-weight: 700; font-size: 1rem; min-width: 0; overflow-wrap: anywhere; }
.mcard-vs .side:last-child { text-align: end; }
.mcard-vs .vs { color: var(--faint); font-size: .8rem; font-weight: 700; }
.mcard-vs .me { color: var(--optic); }
.mcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.next-action { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; color: var(--optic); }
.next-action.neutral { color: var(--muted); }
.scoreline { font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; }

/* ── Forms ───────────────────────────────────────────── */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .88rem; font-weight: 600; }
input[type=text], input[type=url], input[type=date], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; min-height: var(--tap); padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 1rem;
}
textarea { padding: 12px 14px; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--optic); outline-offset: 1px; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 5px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: grid; place-items: center; min-height: 46px; border-radius: 10px; font-weight: 700; color: var(--muted); cursor: pointer; text-align: center; padding: 0 6px; }
.seg input:checked + label { background: var(--optic); color: var(--optic-ink); }
.seg input:focus-visible + label { outline: 2px solid var(--optic); }

.choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; }
.choice + .choice { margin-top: 10px; }
.choice input { margin-top: 3px; width: 22px; height: 22px; accent-color: var(--optic); flex: none; }
.choice:has(input:checked) { border-color: var(--optic); background: rgba(var(--optic-rgb), .06); }
.choice .t { font-weight: 700; }
.choice .d { color: var(--muted); font-size: .88rem; }

/* ── Score pad (+/- for sweaty hands) ────────────────── */
.pad-names { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; text-align: center; font-weight: 700; }
.pad-names .me { color: var(--optic); }
.set-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--bg-2); }
.set-card + .set-card { margin-top: 12px; }
.set-card.done { border-color: rgba(61, 220, 151, .5); }
.set-card.bad { border-color: rgba(255, 107, 107, .5); }
.set-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; font-weight: 700; margin-bottom: 8px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 4px; direction: ltr; }
.stepper button {
  height: 72px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; cursor: pointer; touch-action: manipulation;
}
.stepper button.plus { background: var(--optic); border-color: var(--optic); color: var(--optic-ink); }
.stepper button:active { transform: scale(.94); }
.stepper output { text-align: center; font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  /* Keep "you | opponent" side by side, matching the column headers; just tighten the steppers. */
  .set-card { padding: 10px; }
  .set-grid { gap: 8px; }
  .stepper { grid-template-columns: 50px 1fr 50px; gap: 2px; }
  .stepper button { height: 68px; border-radius: 14px; }
  .stepper output { font-size: 2rem; }
}
.points-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.points-preview > div { text-align: center; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.points-preview b { display: block; font-size: 1.8rem; color: var(--optic); font-variant-numeric: tabular-nums; }

/* ── Timer ───────────────────────────────────────────── */
.timer { text-align: center; padding: 18px; border-radius: var(--radius); background: #0f2a4a; border: 1px solid var(--line); }
.timer .t { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; }
.timer.ready .t { color: var(--optic); }

/* ── Slot picker ─────────────────────────────────────── */
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.day {
  flex: none; scroll-snap-align: start; width: 68px; padding: 10px 0; border-radius: 14px; text-align: center;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; font: inherit;
}
.day .dw { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.day .dn { display: block; font-size: 1.2rem; font-weight: 800; }
.day.on { background: var(--surface-3); border-color: var(--optic); }
.day.picked::after { content: ""; display: block; width: 6px; height: 6px; margin: 4px auto 0; border-radius: 50%; background: var(--optic); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.time { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; direction: ltr; }
.time.on { background: var(--optic); color: var(--optic-ink); border-color: var(--optic); }
.picked-list { display: grid; gap: 8px; margin-top: 14px; }
.picked-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: rgba(var(--optic-rgb), .08); border: 1px solid rgba(var(--optic-rgb), .3); font-weight: 700; }
.picked-item button { background: none; border: 0; color: var(--muted); padding: 6px; cursor: pointer; }

.slot-offer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.slot-offer + .slot-offer { margin-top: 8px; }
.slot-offer .when { font-weight: 800; }

/* ── Standings table ─────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; color: var(--faint); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 8px 6px; }
.table td { padding: 12px 6px; border-top: 1px solid var(--court-line); }
.table td.n, .table th.n { text-align: center; font-variant-numeric: tabular-nums; }
.table tr.me td { background: rgba(var(--optic-rgb), .06); }
.table tr.me td:first-child { box-shadow: inset 3px 0 0 var(--optic); }
[dir="rtl"] .table tr.me td:first-child { box-shadow: inset -3px 0 0 var(--optic); }
.pos { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); font-weight: 800; font-size: .8rem; }
.pos.first { background: var(--optic); color: var(--optic-ink); }

/* ── Bracket ─────────────────────────────────────────── */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; }
.bm { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.bm .bs { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: .9rem; }
.bm .bs + .bs { border-top: 1px solid var(--court-line); }
.bm .bs.win { font-weight: 800; color: var(--optic); }

/* ── Map ─────────────────────────────────────────────── */
.map { height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0d2140; }
.leaflet-container { font-family: var(--font); }

/* ── Misc ────────────────────────────────────────────── */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ic { color: var(--optic); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.notice { padding: 12px 14px; border-radius: 12px; background: rgba(255, 181, 71, .1); border: 1px solid rgba(255, 181, 71, .35); color: #ffd9a0; font-size: .92rem; }
.notice.info { background: rgba(90, 184, 255, .08); border-color: rgba(90, 184, 255, .35); color: #cfe8ff; }
.notice.ok { background: rgba(61, 220, 151, .08); border-color: rgba(61, 220, 151, .35); color: #b9f5da; }
.notice.bad { background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .35); color: #ffc9c9; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); }
.steps span.on { background: var(--optic); }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 16px; width: max-content; margin: 0 auto; }
.pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--optic); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
.desktop-only { display: none; }
@media (min-width: 720px) { .desktop-only { display: block; } .mobile-only { display: none; } }

#toast {
  position: fixed; inset-inline: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 50;
  max-width: 560px; margin: 0 auto; padding: 14px 16px; border-radius: 14px;
  background: #0b1c33; border: 1px solid var(--line); color: var(--text); font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s;
}
#toast.show { opacity: 1; transform: none; }
#toast.bad { border-color: #7a2d3a; color: #ffc9c9; }
#toast.ok { border-color: #1f7a55; }

dialog.sheet {
  width: 100%; max-width: 560px; margin: auto auto 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line); border-radius: 22px 22px 0 0; background: var(--surface); color: var(--text);
}
dialog.sheet::backdrop { background: rgba(3, 10, 22, .6); }
@media (min-width: 720px) { dialog.sheet { margin: auto; border-radius: 22px; } }

.admin-nav { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.admin-nav a { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .88rem; }
.admin-nav a.on { background: var(--optic); color: var(--optic-ink); border-color: var(--optic); }

/* ── Birth-date picker ───────────────────────────────── */
:root { --dp-item: 44px; }

.field > .field-label { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.info-btn { display: inline-flex; padding: 0; border: 0; background: none; color: var(--faint); cursor: pointer; }
.info-btn .ic { width: 15px; height: 15px; }
/* `label.field` carries the bottom margin; this one is a div, and the helper
   line under it is pulled up by -6px, so give it the same breathing room. */
.birth-picker .field { margin-bottom: 14px; }

.dp-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px;
  padding: 10px 14px; border-radius: 14px; text-align: start; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); font: inherit;
  transition: border-color .15s, transform .1s;
}
.dp-trigger:active { transform: scale(.985); }
.dp-trigger b { display: block; font-size: 1.06rem; font-weight: 700; }
.dp-trigger .ic:last-child { color: var(--faint); }
.dp-trigger.is-empty b { color: var(--faint); font-weight: 600; }
.dp-trigger:not(.is-empty) { border-color: rgba(var(--optic-rgb), .34); }
.dp-trigger:not(.is-empty) > .ic:first-child { color: var(--optic); }
.dp-trigger-age { display: block; }
[dir=rtl] .dp-trigger .ic:last-child { transform: scaleX(-1); }

dialog.sheet.dp { padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
dialog.sheet.dp[open] { animation: dp-up .3s cubic-bezier(.22, .9, .2, 1); }
dialog.sheet.dp[open]::backdrop { animation: dp-fade .3s ease; }
@keyframes dp-up { from { transform: translateY(14%); opacity: .4; } }
@keyframes dp-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  dialog.sheet.dp[open], dialog.sheet.dp[open]::backdrop { animation: none; }
}

.dp-grab { display: grid; place-items: center; height: 26px; margin: -4px 0 2px; touch-action: none; cursor: grab; }
.dp-grab i { width: 44px; height: 4px; border-radius: 4px; background: var(--surface-3); }

.dp-head { text-align: center; padding: 2px 0 12px; outline: none; }
.dp-head-date { font-size: 1.42rem; font-weight: 800; letter-spacing: -.02em; }
.dp-head-meta { display: flex; justify-content: center; gap: 8px; margin-top: 8px; min-height: 26px; }

.dp-seg { margin-bottom: 14px; }
.dp-seg button {
  min-height: 42px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--muted); font: inherit; font-weight: 700; transition: background .15s, color .15s;
}
.dp-seg button.on { background: var(--optic); color: var(--optic-ink); }
.dp-seg button:focus-visible { outline: 2px solid var(--optic); outline-offset: 2px; }

.dp-view { min-height: calc(var(--dp-item) * 5); }

/* Wheels: three scroll-snap cylinders under one highlight band. */
.dp-wheels { position: relative; display: flex; gap: 6px; perspective: 900px; }
.dp-band {
  position: absolute; inset-inline: 0; top: calc(var(--dp-item) * 2); height: var(--dp-item);
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); pointer-events: none;
}
.dp-wheel {
  position: relative; z-index: 1; flex: 1 1 0; min-width: 0;
  height: calc(var(--dp-item) * 5); overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; touch-action: pan-y;
  transform-style: preserve-3d;
}
.dp-wheel::-webkit-scrollbar { display: none; }
.dp-wheel:focus-visible { outline: 2px solid var(--optic); outline-offset: 2px; border-radius: 12px; }
.dp-wheel-m { flex: 1.35 1 0; }
.dp-wheel ul { margin: 0; padding: calc(var(--dp-item) * 2) 0; list-style: none; }
.dp-wheel li {
  display: grid; place-items: center; height: var(--dp-item); scroll-snap-align: center;
  font-size: 1.12rem; font-weight: 600; color: var(--muted); white-space: nowrap;
  backface-visibility: hidden; will-change: transform, opacity;
}
.dp-wheel li.on { color: var(--text); font-weight: 800; font-size: 1.24rem; }
.dp-wheel li > span { font-variant-numeric: tabular-nums; }
.dp-fade { position: absolute; inset-inline: 0; height: calc(var(--dp-item) * 1.6); pointer-events: none; z-index: 2; }
.dp-fade-t { top: 0; background: linear-gradient(var(--surface) 12%, transparent); }
.dp-fade-b { bottom: 0; background: linear-gradient(transparent, var(--surface) 88%); }

/* Calendar: a swipeable three-month track, plus year and month panes. */
.dp-cal { position: relative; }
.dp-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.dp-nav {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 12px; background: var(--bg-2); color: var(--text); cursor: pointer;
}
.dp-nav:disabled { opacity: .3; pointer-events: none; }
.dp-nav:active { background: var(--surface-3); }
.dp-prev .ic { transform: scaleX(-1); }
[dir=rtl] .dp-prev .ic { transform: none; }
[dir=rtl] .dp-next .ic { transform: scaleX(-1); }
.dp-title {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 auto;
  min-height: 44px; border: 0; border-radius: 12px; background: none; cursor: pointer;
  color: var(--text); font: inherit; font-size: 1.05rem; font-weight: 700;
}
.dp-title .ic { transform: rotate(90deg); transition: transform .2s; color: var(--muted); }
.dp-title.open .ic { transform: rotate(-90deg); }

.dp-dows { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--faint); font-size: .76rem; font-weight: 700; padding-bottom: 4px; }
/* The track is laid out LTR whatever the page direction, so a drag can be
   reasoned about in physical pixels; each month grid is flipped back to RTL.
   Three columns of exactly 100% keep the panel width out of a percentage
   cycle, and the fixed six rows stop the sheet jumping between month lengths. */
.dp-swipe { overflow: hidden; touch-action: pan-y; direction: ltr; }
.dp-track { display: grid; grid-template-columns: repeat(3, 100%); width: 100%; transform: translateX(-100%); transition: transform .28s cubic-bezier(.22, .8, .2, 1); }
.dp-panel { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, 44px); gap: 2px; }
[dir=rtl] .dp-panel { direction: rtl; }
.dp-panel i { display: block; }
.dp-day {
  display: grid; place-items: center; width: 100%; height: 100%;
  border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer;
  font: inherit; font-size: .98rem; font-variant-numeric: tabular-nums;
  transition: background .12s, transform .1s;
}
.dp-day:active { transform: scale(.9); background: var(--surface-3); }
.dp-day:disabled { color: var(--faint); opacity: .35; pointer-events: none; }
.dp-day.on { background: var(--optic); color: var(--optic-ink); font-weight: 800; box-shadow: 0 4px 16px rgba(var(--optic-rgb), .25); }

.dp-pane {
  position: absolute; inset-inline: 0; top: 50px; bottom: 0; z-index: 3;
  display: grid; gap: 6px; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 2px; background: var(--surface); animation: dp-pane-in .18s ease;
}
@keyframes dp-pane-in { from { opacity: 0; transform: translateY(-6px); } }
.dp-pane-y { grid-template-columns: repeat(4, 1fr); }
.dp-pane-m { grid-template-columns: repeat(3, 1fr); align-content: start; }
.dp-cell {
  min-height: 46px; border: 1px solid transparent; border-radius: 12px;
  background: var(--bg-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-cell:active { transform: scale(.96); }
.dp-cell:disabled { opacity: .3; pointer-events: none; }
.dp-cell.on { background: var(--optic); color: var(--optic-ink); font-weight: 800; }

.dp-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 14px; }
.dp-actions .btn { min-height: 54px; }

/* Liability waiver — a long document: readable on its own page, and boxed with
   its own scroll when it sits inside a form the player is about to submit. */
.waiver-doc h3 { font-size: .95rem; margin: 16px 0 6px; }
.waiver-doc h3:first-of-type { margin-top: 6px; }
.waiver-doc p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; white-space: pre-line; }
.waiver-doc p:last-child { margin-top: 4px; color: var(--text); font-weight: 600; }
.waiver-box { max-height: 44vh; overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }

/* ── Court bookings and the provider portal ──────────── */
input[type=time], input[type=tel], input[type=email] { width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; }
input[type=time]::-webkit-calendar-picker-indicator { filter: invert(1); }
.range-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.range-chips .chip { padding: 6px 12px; border: 1px solid var(--line); background: transparent; }
.range-chips .chip-on { background: var(--optic); color: var(--optic-ink); border-color: var(--optic); }
.slot-day { padding-top: 4px; padding-bottom: 4px; }
.slot + .slot { border-top: 1px solid var(--court-line); }
.slot > summary { list-style: none; cursor: pointer; min-height: var(--tap); padding: 10px 2px; }
.slot > summary::-webkit-details-marker { display: none; }
.slot[open] > summary { color: var(--optic); }
.slot-unit { padding: 10px 12px; margin: 0 0 8px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-row b { font-size: 1.15rem; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--optic); color: var(--optic); }
.qr-lg svg { width: min(72vw, 280px); height: auto; }

/* A from–to time slider (schedules): two range inputs stacked on one track; only
   their thumbs take the pointer, so either can be dragged. The track runs
   00 → 24 left to right even in Hebrew (its container is dir=ltr). */
.hours-day { display: grid; grid-template-columns: 3.6em 1fr 6.6em; align-items: center; gap: 10px; }
.hours-label { text-align: center; font-weight: 700; font-size: .9rem; direction: ltr; }
.hrange { --thumb: 26px; position: relative; height: 34px; }
.hrange-track { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 6px; background: var(--surface-3); }
.hrange-fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--optic); }
.hrange input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: none;
  -webkit-appearance: none; appearance: none; pointer-events: none; }
.hrange input[type=range]::-webkit-slider-runnable-track { height: 34px; background: transparent; }
.hrange input[type=range]::-moz-range-track { background: transparent; }
.hrange input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: var(--thumb); height: var(--thumb);
  margin-top: 4px; border-radius: 50%; background: var(--optic); border: 3px solid var(--optic-ink); cursor: grab; }
.hrange input[type=range]::-moz-range-thumb { pointer-events: auto; width: 20px; height: 20px; border-radius: 50%;
  background: var(--optic); border: 3px solid var(--optic-ink); cursor: grab; }
.hrange input[type=range]:disabled::-webkit-slider-thumb { cursor: default; }
.hours-scale .hrange { height: 16px; }

/* Schedules: rows of days, hours and a price. On a row's slider, time taken by a
   row above (priority) is hatched red and cannot be entered; time before the
   row's start is closed, hatched grey. Each row's colour matches its bars in the
   week overview. */
.sched-row { padding: 10px 0 10px; border-top: 1px solid var(--court-line); border-inline-start: 3px solid var(--sc, transparent); padding-inline-start: 10px; }
.sched-row:first-child { border-top: 0; }
.sched-row [data-row-remove][hidden] { display: none !important; }
.seg-price { gap: 8px; margin-top: 4px; }
.seg-price input { min-width: 0; }
.hrange-lock, .hrange-off { position: absolute; top: -4px; bottom: -4px; border-radius: 4px; }
.hrange-lock, .hrange-key-lock { background: repeating-linear-gradient(45deg, rgba(255, 107, 107, .55) 0 4px, transparent 4px 8px); }
.hrange-off, .hrange-key-off { background: repeating-linear-gradient(45deg, rgba(159, 182, 214, .35) 0 4px, transparent 4px 8px); }
.hrange-key { display: inline-block; width: 22px; height: 12px; border-radius: 3px; vertical-align: middle; margin-inline: 6px 4px; }
.sched-legend { gap: 2px; flex-wrap: wrap; color: var(--muted); }
.sched-week { display: grid; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--court-line); }
.sched-week-day { display: grid; grid-template-columns: 2.2em 1fr; align-items: center; gap: 8px; }
.sched-week-bar { position: relative; height: 16px; border-radius: 4px;
  background: repeating-linear-gradient(45deg, rgba(159, 182, 214, .18) 0 4px, transparent 4px 8px); }
.sched-week-bar span { position: absolute; top: 0; bottom: 0; background: var(--sc); color: var(--optic-ink); border-radius: 3px;
  font-size: .65rem; font-weight: 800; display: grid; place-items: center; overflow: hidden; }
.hrange input[type=range]:disabled::-webkit-slider-thumb { background: var(--surface); border-color: var(--optic); }
.hrange input[type=range]:disabled::-moz-range-thumb { background: var(--surface); border-color: var(--optic); }

/* The yearly calendar. Six schedule colours, cycled. */
.sc-1 { --sc: var(--rain); } .sc-2 { --sc: var(--tennis-orange); } .sc-3 { --sc: var(--ok); }
.sc-4 { --sc: var(--danger); } .sc-5 { --sc: #B78CFF; } .sc-6 { --sc: var(--warn); }
.sc-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--sc, transparent); border: 2px solid var(--sc, var(--line)); }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cal-month { padding: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 6px; }
.cal-dow { text-align: center; font-size: .7rem; color: var(--faint); }
.cal-day { aspect-ratio: 1; min-height: 32px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text);
  font: inherit; font-size: .82rem; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0; }
.cal-day[class*=sc-] { background: var(--sc); border-color: var(--sc); color: var(--optic-ink); font-weight: 700; }
.cal-day:disabled { opacity: .35; cursor: default; }
.cal-today { box-shadow: inset 0 0 0 2px var(--optic); }
/* A Jewish holiday: a small mark in the corner; hollow once overridden by hand. */
.cal-day, .cal-hol-key { position: relative; }
.cal-hol::after, .cal-hol-key::after { content: ""; position: absolute; top: 3px; inset-inline-end: 3px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--warn); border: 1px solid var(--optic-ink); }
.cal-hol.cal-over::after { background: transparent; border: 1.5px solid var(--warn); }
.cal-hol-key { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 8px;
  font-size: .75rem; vertical-align: middle; margin-inline-end: 4px; }
.cal-anchor { outline: 3px solid var(--optic); outline-offset: 1px; }
.cal-save { position: sticky; bottom: calc(var(--tabbar-h) + 8px); z-index: 5; }
.hours-scale .hrange span { position: absolute; left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--at)); transform: translateX(-50%);
  font-size: .72rem; color: var(--faint); }
#pvInvite [hidden] { display: none !important; }   /* .btn-row and .field set display, which beats [hidden] */
.cal-row { padding: 10px 0; border-top: 1px solid var(--court-line); }
.cal-row select { margin-top: 6px; }
.contract-fields [hidden], #pvInvite [data-show-when][hidden] { display: none !important; }
.seg-col { flex-direction: column; align-items: stretch; }
.seg-col label { border-radius: 12px; }

/* Booking page: courts we have no relationship with, collapsed under one button. */
.more-courts { margin-top: 16px; }
.more-courts > summary { list-style: none; cursor: pointer; min-height: var(--tap); }
.more-courts > summary::-webkit-details-marker { display: none; }
.more-courts > summary .chev .ic { transform: rotate(90deg); }
.more-courts[open] > summary .chev .ic { transform: rotate(-90deg); }
.more-courts[open] > summary { margin-bottom: 8px; }
.home-provider { border-color: var(--optic); gap: 12px; }
/* Signing in with Google / Microsoft to connect a calendar. */
.cal-vendor { justify-content: flex-start; gap: 12px; background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 700; }
.cal-vendor-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; font-size: 1rem; flex: none; }
.cal-vendor-google { color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.cal-vendor-microsoft { color: #fff; background: #0078d4; border-radius: 6px; }
/* Provider overview: the management screens as tiles. */
.pv-manage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pv-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; margin: 0 !important; }
.pv-tile .ic { color: var(--optic); }
/* A section that opens: reads as "tap to open", not as an action button that does nothing. */
.expander > summary { list-style: none; cursor: pointer; min-height: var(--tap); gap: 10px; }
.expander > summary::-webkit-details-marker { display: none; }
.expander-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px dashed var(--optic); color: var(--optic); flex: none; }
.expander > summary .chev .ic { transform: rotate(90deg); transition: transform .15s; }
.expander[open] > summary .chev .ic { transform: rotate(-90deg); }
.expander[open] > summary .expander-ic { border-style: solid; }
.more-courts .list-item > .ic { color: var(--muted); }

/* ── Wide screens: a website, not a phone ───────────── */
/* The bottom tab bar moves up into the header as a centred nav, and the
   content column widens a little. */
@media (min-width: 1000px) {
  .topbar { min-height: 64px; padding-block: 8px; }
  .tabbar {
    top: 0; bottom: auto; inset-inline: 0; margin-inline: auto; width: max-content; z-index: 25;
    height: 64px; padding: 0; display: flex; gap: 4px; align-items: center;
    background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tabbar a { flex-direction: row; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; font-size: .95rem; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
  .tabbar a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
  .tabbar a.on { color: var(--optic-ink); background: var(--optic); }
  .tabbar a.on .ic { filter: none; }
  body { padding-bottom: 40px; }
  .wrap { max-width: 760px; padding-top: 24px; }
}

/* ── Phones and the app: keep the players' faces in view ─ */
/* On a phone the content fills the width, so a centred background photo puts
   the player's face behind the cards. Instead the photo is sized from the
   viewport height and shifted, using the face point from app/lib/photos.php,
   so the face lands in a clear band at the top of the screen; the content
   starts below that band. Pages that open with their own .hero banner do the
   same inside the banner (face in its top part, text under it) and drop the
   background photo, which would only be hidden behind the banner. */
@media (max-width: 719px) {
  body::before {
    background:
      linear-gradient(180deg, rgba(10, 26, 48, .10) 0%, rgba(10, 26, 48, .25) 22%, rgba(10, 26, 48, .88) 36%, rgba(10, 26, 48, .94) 70%, var(--bg) 100%),
      var(--photo-sm) no-repeat,
      var(--bg);
    /* 60vh tall is enough: below the band the wash is nearly opaque. */
    background-size: 100% 100%, auto 60vh, auto;
    background-position: 0 0,
      clamp(calc(100vw - var(--photo-r) * 60vh), calc(50vw - var(--photo-fx) * var(--photo-r) * 60vh), 0px)
      clamp(-20vh, calc(13vh - var(--photo-fy) * 60vh), 0px),
      0 0;
  }
  .wrap { padding-top: calc(16px + 26vh); }
  .wrap:has(> .hero:first-child), .wrap:has(> .landing) { padding-top: 16px; }
  body:has(.wrap > .hero:first-child, .wrap > .landing)::before {
    background: linear-gradient(180deg, #0f2a4c 0%, var(--bg) 60%);
  }

  .hero {
    --hh: 46vh;
    padding-top: 24vh;
    background:
      linear-gradient(180deg, rgba(10, 26, 48, 0) 0, rgba(10, 26, 48, .15) 16vh, rgba(10, 26, 48, .85) 30vh, rgba(10, 26, 48, .95) 100%),
      var(--hero-photo-sm) no-repeat,
      var(--surface);
    background-size: 100% 100%, auto var(--hh), auto;
    background-position: 0 0,
      clamp(calc(100vw - 32px - var(--hero-photo-r) * var(--hh)), calc(50vw - 16px - var(--hero-photo-fx) * var(--hero-photo-r) * var(--hh)), 0px)
      clamp(calc(-.25 * var(--hh)), calc(11vh - var(--hero-photo-fy) * var(--hh)), 0px),
      0 0;
  }
  .landing-hero {
    --hh: 58vh;
    padding-top: 30vh;
    min-height: 0;
    background-position: 0 0,
      clamp(calc(100vw - var(--hero-photo-r) * var(--hh)), calc(50vw - var(--hero-photo-fx) * var(--hero-photo-r) * var(--hh)), 0px)
      clamp(calc(-.25 * var(--hh)), calc(14vh - var(--hero-photo-fy) * var(--hh)), 0px),
      0 0;
  }
  .home-hero { min-height: 0; padding-top: 20vh; }
}
