/* bookpadel — one stylesheet for the site, the desk and the club pages.
   Plain and descriptive, as the brief asks: a court-green accent, a ball-yellow
   highlight, and everything else out of the way. */
:root {
  color-scheme: light dark;
  --ink: #14201a;
  --bg: #f6f8f4;
  --panel: #ffffff;
  --line: #dde4dc;
  --muted: #5d6b63;
  --accent: #14532d;
  --accent-ink: #ffffff;
  --ball: #d9f24b;
  --online: #2563eb;
  --bad: #b42318;
  --good: #15803d;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7eee9; --bg: #0d1310; --panel: #141c17; --line: #26332b; --muted: #95a59b;
    --accent: #4ade80; --accent-ink: #0d1310; --online: #60a5fa; --bad: #f87171; --good: #4ade80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}

a { color: var(--accent); }
h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
h2 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.error { color: var(--bad); min-height: 0; }
.error:empty { display: none; }
.ok { color: var(--good); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--panel); padding: 8px; z-index: 10; }

main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 36px 20px 56px; }
main.wide { max-width: 1280px; }

/* ── Header and footer ─────────────────────────────────────────────────── */
.site-header { display: flex; align-items: center; gap: 18px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; font-size: 18px; }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.site-header nav a[aria-current="page"] { color: var(--accent); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.sync-dot[data-state="synced"] { background: var(--good); }
.sync-dot[data-state="syncing"] { background: var(--ball); }
.sync-dot[data-state="error"], .sync-dot[data-state="offline"] { background: var(--bad); }
.claim { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 20px; background: var(--ball); color: #14201a; font-weight: 600; }
.claim[hidden] { display: none; }
.site-footer { border-top: 1px solid var(--line); padding: 22px 20px; display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; color: var(--muted); font-size: 14px; background: var(--panel); }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── Controls ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.big { padding: 14px 24px; font-size: 18px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
label.inline { display: flex; gap: 8px; align-items: center; font-weight: 500; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); }
input[type="checkbox"] { width: auto; }
textarea { min-height: 110px; resize: vertical; }
.honeypot { position: absolute; left: -9999px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); }
.pill.good { color: var(--good); border-color: var(--good); }
.pill.online { color: var(--online); border-color: var(--online); }
.pill.bad { color: var(--bad); border-color: var(--bad); }

dialog { border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(560px, 94vw); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(10, 20, 14, .45); }
dialog .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
dialog .field:has(textarea), dialog .field:has(input[type="checkbox"]) { grid-column: 1 / -1; }
@media (max-width: 520px) { dialog .fields { grid-template-columns: 1fr; } }

/* ── Marketing pages ───────────────────────────────────────────────────── */
.hero { padding: 24px 0 8px; }
.hero h1 { max-width: 760px; }
.hero .lead { font-size: 20px; color: var(--muted); max-width: 680px; }
.section { margin-top: 56px; }
.feature h3 { display: flex; gap: 8px; align-items: center; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; padding-left: 44px; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ball); color: #14201a; font-weight: 800; display: grid; place-items: center; }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.plans ul { padding-left: 18px; margin: 8px 0 0; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { font-weight: 700; cursor: pointer; }

/* ── The desk ──────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 12px 0 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.daybar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.daybar input[type="date"] { width: auto; }
.daybar strong { font-size: 18px; margin: 0 6px; }
.calendar { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.cal { display: grid; position: relative; min-width: max-content; }
.cal .corner, .cal .court-head { position: sticky; top: 0; background: var(--panel); z-index: 2; padding: 8px 10px; font-weight: 700; border-bottom: 1px solid var(--line); font-size: 14px; }
.cal .time { font-size: 12px; color: var(--muted); padding: 0 8px; border-top: 1px solid var(--line); text-align: right; }
.cal .cell { border-top: 1px solid var(--line); border-left: 1px solid var(--line); cursor: pointer; min-height: 26px; }
.cal .cell:hover { background: color-mix(in srgb, var(--ball) 25%, transparent); }
.cal .slot { margin: 2px; border-radius: 8px; padding: 4px 8px; font-size: 13px; line-height: 1.3; overflow: hidden; cursor: pointer; z-index: 1; border: 1px solid transparent; text-align: left; font-family: inherit; color: inherit; }
.cal .slot.desk { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.cal .slot.block { background: repeating-linear-gradient(45deg, var(--line), var(--line) 6px, var(--panel) 6px, var(--panel) 12px); }
.cal .slot.online { background: color-mix(in srgb, var(--online) 14%, var(--panel)); border-color: color-mix(in srgb, var(--online) 45%, transparent); }
.cal .slot.pending { opacity: .7; border-style: dashed; }
.cal .slot.clash { border: 2px solid var(--bad); }
.cal .slot strong { display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .l-desk::before { background: color-mix(in srgb, var(--accent) 30%, var(--panel)); }
.legend .l-online::before { background: color-mix(in srgb, var(--online) 30%, var(--panel)); }
.legend .l-block::before { background: var(--line); }
.legend .l-clash::before { border: 2px solid var(--bad); }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.list tr[data-id] { cursor: pointer; }
table.list tr[data-id]:hover { background: color-mix(in srgb, var(--ball) 15%, transparent); }
.hours { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 6px 10px; align-items: center; }
.notice { border-left: 4px solid var(--ball); background: var(--panel); padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; }
.notice.bad { border-left-color: var(--bad); }

/* ── The club page ─────────────────────────────────────────────────────── */
.club-photo { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.days button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 6px 12px; font: inherit; cursor: pointer; text-align: center; color: var(--ink); line-height: 1.25; }
.days button small { display: block; font-size: 12px; color: var(--muted); }
.days button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.days button[aria-pressed="true"] small { color: inherit; }
.court-slots { margin-bottom: 18px; }
.times { display: flex; flex-wrap: wrap; gap: 6px; }
.times button { border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 8px; padding: 5px 10px; font: inherit; font-weight: 700; cursor: pointer; }
.times button:disabled { border-color: var(--line); color: var(--muted); text-decoration: line-through; cursor: default; font-weight: 400; }
.times button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.game { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.players { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.players span { background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; font-size: 13px; }
.players span.open { border-style: dashed; color: var(--muted); }
