/* Padel La Baule: night-court theme. Phones show one day; wide screens up to 7 days side by side. */
:root {
  --bg: #eef2f8;
  --bg-2: #e3e9f4;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --line: #dbe2ee;
  --text: #0e1626;
  --muted: #5d6a82;
  --court: #2357e8;
  --court-ink: #ffffff;
  --ball: #c6ef2e;
  --ball-ink: #1b2700;
  --ball-line: #9cc40f;
  --plan: #d98a00;
  --plan-soft: #fff1d6;
  --danger: #d23c3c;
  --warn: #c77d00;
  --ok: #17a05d;
  --sim: #e08a00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 22, 38, .06), 0 8px 24px rgba(14, 22, 38, .08);
  --sheet-shadow: 0 -12px 40px rgba(14, 22, 38, .18);
  --hatch: rgba(14, 22, 38, .06);
  --top: 63px;   /* sticky top bar height */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070c18;
    --bg-2: #0b1428;
    --surface: #0f1729;
    --surface-2: #141e34;
    --line: #1f2b45;
    --text: #e9eefb;
    --muted: #8b98b8;
    --court: #4c7dff;
    --court-ink: #ffffff;
    --ball: #d4f53c;
    --ball-ink: #1b2700;
    --ball-line: #d4f53c;
    --plan: #ffb547;
    --plan-soft: #33260c;
    --danger: #ff6b6b;
    --warn: #ffb547;
    --ok: #3ddc84;
    --sim: #ffa726;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
    --sheet-shadow: 0 -12px 40px rgba(0, 0, 0, .55);
    --hatch: rgba(255, 255, 255, .04);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
a { color: var(--court); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.fine { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 0 0 2px; }

/* -- buttons ------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; transition: transform .08s, background .15s, border-color .15s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--ball); color: var(--ball-ink); border-color: var(--ball); }
.btn.plan { background: var(--plan); color: #1f1300; border-color: var(--plan); }
.btn.danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, var(--line)); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 20px; line-height: 1;
}
.icon-btn:disabled { opacity: .35; }
.icon-btn.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* -- simulation bar ------------------------------------------------------------------ */
.sim-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap;
  background: var(--sim); color: #1d1300; font-size: 12.5px;
  padding: max(6px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
}
.sim-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sim-day { font-weight: 700; }
.sim-btn { border: 0; border-radius: 99px; padding: 5px 11px; background: rgba(0, 0, 0, .16); color: inherit; font-weight: 700; font-size: 12px; }

/* -- login --------------------------------------------------------------------------- */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in oklab, var(--court) 45%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, color-mix(in oklab, var(--ball) 22%, transparent), transparent 60%),
    var(--bg-2);
}
.court-lines { position: absolute; inset: 8% 6%; border: 2px solid color-mix(in oklab, var(--text) 10%, transparent); border-radius: 6px; pointer-events: none; }
.court-lines::before, .court-lines::after { content: ""; position: absolute; background: color-mix(in oklab, var(--text) 10%, transparent); }
.court-lines::before { left: 50%; top: 0; bottom: 0; width: 2px; }
.court-lines::after { left: 20%; right: 20%; top: 50%; height: 2px; }
.login-card {
  position: relative; width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow); padding: 26px 22px 22px;
}
.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=email], input[type=password], input[type=text], input[type=search] {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  padding: 0 14px; font-size: 16px; /* 16px: iOS does not zoom on focus */
}
input:focus { outline: 2px solid var(--court); outline-offset: 1px; }
.form-err { color: var(--danger); font-size: 14px; min-height: 1em; margin: 10px 0 0; }
.form-note { background: var(--plan-soft); border: 1px solid var(--plan); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }

/* -- brand / top bar ----------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 10px; line-height: 1.1; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.brand.big b { font-size: 24px; }
.brand.big span { font-size: 13px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.sync { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sync .next { font-variant-numeric: tabular-nums; }
.club-link {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 11px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.club-link svg { color: var(--muted); }
@media (hover: hover) { .club-link:hover { border-color: var(--court); } }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 25%, transparent); }
.sync.err .dot { background: var(--danger); }
.sync.err { color: var(--danger); }
.sync.wait .dot { background: var(--warn); }
.me { position: relative; }
.avatar, .menu-avatar {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--court); color: var(--court-ink);
  font-weight: 800; font-size: 15px; letter-spacing: .02em; display: grid; place-items: center; flex: none;
}
.menu {
  position: absolute; right: 0; top: 50px; width: min(300px, calc(100vw - 24px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 10px; z-index: 30;
}
.menu-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 10px; border-bottom: 1px solid var(--line); }
.menu-who { min-width: 0; }
.menu-who b { display: block; }
.menu-who span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.name-form { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.name-form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.name-form div { display: flex; gap: 6px; }
.name-form input { min-height: 40px; }
.menu-item { width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 10px; font-weight: 600; margin-top: 6px; }

/* -- layout -------------------------------------------------------------------------- */
.wrap {
  max-width: 2000px; margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* -- bottom tabs ----------------------------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 8px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 54px; border: 0; border-radius: 14px; background: none; color: var(--muted); font-size: 12px; font-weight: 700;
}
.tab[aria-selected="true"] { color: var(--court); background: color-mix(in oklab, var(--court) 12%, transparent); }
.tab-count {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--ball); color: var(--ball-ink); font-size: 11px; display: grid; place-items: center;
}
.tab-count:empty { display: none; }
@media (min-width: 900px) {
  .tabbar { left: 50%; right: auto; bottom: calc(16px + env(safe-area-inset-bottom)); width: 460px; transform: translateX(-50%);
    border: 1px solid var(--line); border-radius: 20px; padding: 6px; box-shadow: var(--shadow); }
  .tab { flex-direction: row; gap: 8px; font-size: 14px; min-height: 48px; }
  .tab-count { position: static; }
}

/* -- my reservations (tab 1): booked = solid outline, pre-booked = dashed --------------- */
.list-view { max-width: 760px; margin: 0 auto; }
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0 4px; }
.list-head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.list-head p { margin: 4px 0 0; font-size: 13px; }
.day-head { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 8px; }
.resa-day { display: grid; gap: 8px; }
.resa {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: var(--surface); cursor: pointer; min-width: 0;
}
.resa.booked { border: 2px solid var(--court); }
.resa.planned { border: 2px dashed var(--plan); background: color-mix(in oklab, var(--plan) 6%, var(--surface)); }
.resa.failed { border: 1.5px dashed var(--line); opacity: .7; cursor: default; }
.resa .when b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.resa .when span { font-size: 12.5px; color: var(--muted); }
.resa .what { min-width: 0; }
.resa .what b { display: block; overflow-wrap: anywhere; }
.resa .what span { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.resa .cancel { color: var(--danger); background: transparent; border-color: color-mix(in oklab, var(--danger) 45%, var(--line)); }
.resa .final { font-size: 12px; color: var(--muted); white-space: nowrap; }
.empty-state { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 40px 16px; margin-top: 16px;
  border: 1.5px dashed var(--line); border-radius: 18px; color: var(--muted); }
.btn.danger-fill { background: var(--danger); color: #fff; border-color: var(--danger); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0 12px; }
.hero h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }
.hero p { margin: 4px 0 0; font-size: 13.5px; max-width: 760px; }
.hero p b { color: var(--text); }
.quota {
  display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; padding: 2px 10px 2px 8px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap;
}
.quota.full { border-color: var(--plan); }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 14px; height: 8px; border-radius: 3px; background: var(--line); }
.pips i.on { background: var(--court); }
.quota.full .pips i.on { background: var(--plan); }
.legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg.free { background: color-mix(in oklab, var(--court) 55%, var(--surface)); }
.lg.mine { background: var(--ball); }
.lg.plan { border: 1.5px dashed var(--plan); }
.lg.planned { background: var(--plan-soft); border: 1.5px solid var(--plan); }
.lg.none { border: 1px dashed var(--line); background: var(--surface-2); }
.lg.taken { border: 1.5px dashed var(--plan); background: color-mix(in oklab, var(--plan) 14%, transparent); }
.lg-dots { display: inline-flex; align-items: center; gap: 3px; }
.lg-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--plan); }
.lg-dots i.on { background: var(--plan); }
.lg-dots i.club { border: 1.5px dashed var(--danger); margin-right: 4px; }
.lg.club { border: 1px solid var(--line); background: repeating-linear-gradient(45deg, var(--hatch) 0 3px, transparent 3px 6px); }

/* -- day tabs (when not every day fits) ---------------------------------------------- */
.tabs-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.day-tabs {
  display: flex; gap: 8px; overflow-x: auto; flex: 1; padding: 2px; scrollbar-width: none;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex: 1 0 auto; min-width: 84px; min-height: 60px; border-radius: 14px; border: 1px solid var(--line); scroll-snap-align: start;
  background: var(--surface); text-align: left; padding: 7px 11px; display: flex; flex-direction: column; gap: 1px;
}
.day-tab b { font-size: 15px; white-space: nowrap; }
.day-tab small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.day-tab.future { border-style: dashed; }
.day-tab.future .st { color: var(--plan); }
.day-tab.on { background: var(--court); border: 1px solid var(--court); color: var(--court-ink); }
.day-tab.on small { color: color-mix(in oklab, var(--court-ink) 80%, transparent); }

/* -- board --------------------------------------------------------------------------- */
.board {
  --row: 58px;   /* one 45 min row; a 1h30 block spans two */
  display: grid; gap: 5px; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px; box-shadow: var(--shadow);
  touch-action: pan-y;
}
.dh {
  position: sticky; top: var(--top); z-index: 5; background: var(--surface); padding: 6px 2px 2px; text-align: center;
  border-radius: 10px; min-width: 0;
}
.dh .wd { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh .dt { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.dh .tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-top: 2px; white-space: nowrap; }
.dh.today .tag { background: var(--ball); color: var(--ball-ink); }
.dh.future .tag { background: var(--plan-soft); color: var(--plan); }
.sh {
  font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0 6px;
  border-bottom: 2px solid var(--line);
}
.sh.d90 { border-bottom-color: color-mix(in oklab, var(--court) 60%, var(--line)); }
.sh.future { border-bottom-style: dashed; }
.tl { font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; }
.tl.now { color: var(--court); }

.cell {
  position: relative; min-height: 0; border-radius: 12px; border: 1px solid transparent; padding: 6px 8px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left; overflow: hidden;
  font-size: 12.5px; line-height: 1.15; min-width: 0; background: none;
}
.cell .n { font-weight: 800; font-size: 14px; white-space: nowrap; }
.cell .end { font-size: 11.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.free {
  --f: .5;
  background: color-mix(in oklab, var(--court) calc(14% + var(--f) * 46%), var(--surface));
  color: var(--text); border-color: color-mix(in oklab, var(--court) 30%, transparent);
  transition: transform .1s, box-shadow .15s;
}
.cell.free.hi { color: var(--court-ink); }
.cell.free:active, .cell.plan:active { transform: scale(.97); }
.cell.sel { box-shadow: 0 0 0 3px var(--ball), 0 6px 18px rgba(0, 0, 0, .2) !important; }
.dots { display: flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .5; }
.dots i.on { background: currentColor; opacity: 1; }
.dots i.club { border: 1.5px dashed var(--danger); opacity: .9; }   /* kept by the club */
.cell.plan .dots { color: var(--plan); }
.cell.none { border: 1px dashed var(--line); color: var(--muted); align-items: center; }
.cell.past {
  background: repeating-linear-gradient(-45deg, var(--hatch) 0 6px, transparent 6px 12px);
  border: 1px solid var(--line); opacity: .55;
}
.cell.blank, .cell.gap { visibility: hidden; }
/* kept by the club for itself (lesson, course, stage): not pre-bookable */
.cell.club {
  background: repeating-linear-gradient(45deg, var(--hatch) 0 4px, transparent 4px 9px);
  border: 1px solid var(--line); color: var(--muted); font-weight: 700; align-items: center; justify-content: center;
}
.cell.planned.warn { border-color: var(--danger); background: color-mix(in oklab, var(--danger) 10%, var(--surface)); }
.cell.planned.warn .n { color: var(--danger); }
.cell.loading { background: linear-gradient(90deg, var(--surface-2), color-mix(in oklab, var(--surface-2) 60%, var(--line)), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.cell.plan {
  border: 1.5px dashed color-mix(in oklab, var(--plan) 45%, var(--line)); color: var(--muted);
  font-weight: 600;
}
.cell.plan .n { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.cell.plan .plus { font-size: 17px; line-height: 1; color: var(--plan); font-weight: 800; }
.cell.planned { background: var(--plan-soft); border: 1.5px solid var(--plan); color: var(--text); }
.cell.plan.taken { border-color: var(--plan); background: color-mix(in oklab, var(--plan) 12%, transparent); color: var(--text); flex-direction: column; gap: 2px; }
.cell .who { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell.planned .who { color: var(--plan); }
.who-box { border: 1px solid var(--plan); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 0 0 12px; }
.cell.planned .n { font-size: 12.5px; }
.cell.planned .n, .cell.mine .n { white-space: normal; line-height: 1.15; }
.cell.mine { background: var(--ball); color: var(--ball-ink); border-color: var(--ball-line); font-weight: 700; }
.cell.mine .n { font-size: 13px; }
@media (hover: hover) {
  .cell.free:hover { box-shadow: 0 0 0 2px color-mix(in oklab, var(--court) 60%, transparent); }
  .cell.plan:hover { border-color: var(--plan); color: var(--plan); background: color-mix(in oklab, var(--plan) 9%, transparent); }
  .menu-item:hover { background: var(--surface-2); }
}
/* five or seven days side by side: tighter cells */
.board.dense { --row: 56px; gap: 4px; padding: 8px; }
.board.dense .cell { padding: 5px 6px; }
.board.dense .cell .unit, .board.dense .cell.plan .lbl { display: none; }
.board.dense .dh .dt { font-size: 15px; }

/* -- my bookings --------------------------------------------------------------------- */
.mine-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 26px 0 10px; }
.mine-head h2 { font-size: 17px; margin: 0; }
.mine-head span { font-size: 12.5px; }
.mine-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.booking {
  display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0;
}
.booking .when { flex: 1; min-width: 0; }
.booking .when b { display: block; font-size: 15px; }
.booking .when span { font-size: 13px; color: var(--muted); }
.badge {
  width: 46px; height: 46px; border-radius: 12px; background: var(--ball); color: var(--ball-ink); flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; text-align: center; line-height: 1.05;
}
.booking.planned .badge { background: var(--plan-soft); color: var(--plan); border: 1.5px solid var(--plan); }
.booking.failed { opacity: .8; }
.booking.failed .badge { background: color-mix(in oklab, var(--danger) 16%, var(--surface)); color: var(--danger); }
.empty { color: var(--muted); font-size: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; }

/* -- bottom sheet -------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(4, 8, 18, .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 50; width: 100%; max-width: 520px;
  transform: translate(-50%, 110%); transition: transform .28s cubic-bezier(.2, .9, .25, 1);
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--sheet-shadow);
  padding: 8px max(20px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
}
.sheet.open { transform: translate(-50%, 0); }
.grabber { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 4px auto 14px; }
.slot-time { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 6px; }
.slot-time .arrow { color: var(--muted); font-weight: 500; }
.sheet-title { font-size: 22px; margin: 2px 0 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.chip.court { background: var(--court); color: var(--court-ink); border-color: var(--court); }
.label { font-size: 13px; font-weight: 700; margin: 8px 0; }
.courts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.court-opt { position: relative; }
.court-opt input { position: absolute; opacity: 0; pointer-events: none; }
.court-opt span {
  display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); font-weight: 700; background: var(--surface-2); cursor: pointer;
}
.court-opt span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.court-opt input:checked + span { border-color: var(--court); background: color-mix(in oklab, var(--court) 14%, var(--surface)); }
.court-opt input:checked + span::before { border-color: var(--court); background: var(--court); box-shadow: inset 0 0 0 3px var(--surface); }
.court-opt input:focus-visible + span { outline: 2px solid var(--court); outline-offset: 2px; }
.court-opt.club span { opacity: .55; cursor: not-allowed; border-style: dashed; }
.court-opt.club span::before { border-style: dashed; }
.court-opt .star, .star-note .star { color: var(--plan); font-weight: 800; margin-left: -4px; }
.star-note { margin-top: 6px; }
.star-note .star { margin: 0 2px 0 0; }
.court-opt.club small.by { color: var(--plan); text-transform: none; letter-spacing: 0; }
.cell.plan.taken.full { cursor: default; opacity: .8; }
.court-opt.club small { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--danger); text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions .btn { flex: 1; }
.note { background: var(--plan-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 14px 0 0; }
.warn-box { border: 1.5px solid var(--plan); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }
/* players picker: you + up to 3 */
.picker { display: grid; gap: 8px; margin-top: 16px; }
.picker .label { margin: 0; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-row .wide { flex-basis: 100%; margin: 2px 0 0; }
.pchip {
  min-height: 38px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; color: var(--text);
}
.pchip.me { background: var(--court); color: var(--court-ink); border-color: var(--court); }
.pchip.on { gap: 8px; padding-right: 6px; background: color-mix(in oklab, var(--court) 14%, var(--surface)); border-color: var(--court); cursor: pointer; }
/* remove: a round, red x; the whole chip turns red on hover */
.pchip .x {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 17px; font-weight: 800;
  line-height: 1; color: var(--danger); background: color-mix(in oklab, var(--danger) 16%, var(--surface));
}
.pchip.on:focus-visible { border-color: var(--danger); color: var(--danger); }
.pick-more { display: grid; gap: 18px; margin-top: 8px; }
.pick-block { display: grid; gap: 6px; }
.sublabel { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.plist { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.presult {
  display: flex; align-items: center; gap: 10px; text-align: left; min-height: 44px; padding: 0 12px; border: 1px solid transparent;
  border-radius: 10px; background: var(--surface-2); font-weight: 600; color: var(--text); cursor: pointer;
}
.presult .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.presult .pmeta { font-size: 12px; font-weight: 600; color: var(--muted); }
.presult .padd { font-size: 18px; font-weight: 800; color: var(--court); }
@media (hover: hover) {
  .presult:hover, .pchip:not(.me):not(.on):hover { border-color: var(--court); background: color-mix(in oklab, var(--court) 10%, var(--surface)); }
  .pchip.on:hover { border-color: var(--danger); color: var(--danger); background: color-mix(in oklab, var(--danger) 12%, var(--surface)); }
  .pchip.on:hover .x { background: var(--danger); color: #fff; }
}
.reminder {
  display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 0; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in oklab, var(--court) 12%, var(--surface)); border: 1px solid color-mix(in oklab, var(--court) 35%, var(--line));
}
.reminder .ico { font-size: 22px; line-height: 1.2; }
.reminder p { margin: 2px 0 0; font-size: 14px; }
.recap { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 6px 0 4px; font-size: 14.5px; }
.recap dt { color: var(--muted); }
.recap dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.club-msg { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }
details { margin-top: 12px; font-size: 13px; color: var(--muted); }
details pre { background: var(--surface-2); border-radius: 10px; padding: 10px; overflow: auto; max-height: 200px; font-size: 12px; color: var(--text); }
.sheet-err { color: var(--danger); font-weight: 600; }
.done { text-align: center; padding: 8px 0 4px; }
.done h2 { font-size: 26px; margin: 10px 0 4px; }
.done p { margin: 0; color: var(--muted); }
.check { width: 84px; height: 84px; margin: 6px auto 0; border-radius: 50%; background: var(--ball); display: grid; place-items: center; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.check svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .15s forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.news { display: flex; flex-direction: column; gap: 8px; }
.news-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.news-item .ni { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; }
.news-item.booked .ni { background: var(--ball); color: var(--ball-ink); }
.news-item.failed .ni { background: color-mix(in oklab, var(--danger) 18%, var(--surface)); color: var(--danger); }
.news-item b { display: block; }
.news-item span { font-size: 13px; color: var(--muted); }

/* -- toast --------------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  width: max-content; max-width: calc(100vw - 32px); box-shadow: var(--shadow); animation: drop .25s;
}
.toast.err { background: var(--danger); color: #fff; }
@keyframes drop { from { transform: translate(-50%, -10px); opacity: 0; } }

/* -- phones (one day at a time) ------------------------------------------------------ */
@media (max-width: 899px) {
  .hero { padding: 14px 0 10px; }
  .hero h1 { font-size: 21px; }
  .legend { display: none; }
  .quota { margin: 8px 0 0; }
  .sync .long { display: none; }
  .club-link { padding: 0 9px; }
  .board { padding: 8px; border-radius: 16px; gap: 6px; }
  .sh { position: sticky; top: var(--top); z-index: 5; background: var(--surface); font-size: 13px; }
  .board { --row: 60px; }
  .tl { font-size: 13px; }
  .cell { padding: 7px 8px; }
  .brand span { display: none; }
  .mine-list { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .cell { padding: 7px 8px; }
  .cell .n { font-size: 13px; }
  .slot-time { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
