/* WheelReady — clean scheduling aesthetic (Cal.com-inspired). Mobile-first, no JS. */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --ring: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --ring-strong: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  --focus: #111111;
  --radius: 10px;
  --radius-sm: 8px;
  --green: #15803d; --green-bg: #ecfdf5; --green-line: #a7f3d0;
  --amber: #b45309; --amber-bg: #fffbeb; --amber-line: #fde68a;
  --red: #b91c1c;   --red-bg: #fef2f2;   --red-line: #fecaca;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 600; }
h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 0 0 0.5rem; }
a { color: inherit; }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; }

.container { max-width: 640px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.container.wide { max-width: 1040px; }
.footer { color: var(--muted); font-size: 0.85rem; text-align: center; padding-top: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--fg); color: #fff; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Top bar */
.topbar { border-bottom: 1px solid var(--line); background: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--fg); color: #fff; font-size: 0.85rem; }
.nav { display: flex; gap: 0.25rem; }
.nav a { text-decoration: none; color: var(--muted); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.95rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav a[aria-current="page"] { color: var(--fg); background: var(--soft); }
.nav a:hover { color: var(--fg); }

.hero { padding: 3rem 0; }
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.page-head { margin: 0.5rem 0 1.25rem; }
.page-head .muted { margin-top: 0.25rem; }

/* Layout */
.grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 840px) {
  .grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .col-side { position: sticky; top: 1rem; }
}
.stack > * + * { margin-top: 1rem; }
.col-main > * + * { margin-top: 1rem; }

/* Cards */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--ring); padding: 1.25rem; }
.card.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.meta { color: var(--muted); font-size: 0.95rem; margin: 0.25rem 0 0; }
.pill { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 0.8rem; color: var(--fg); }
.pills { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
label, legend { font-size: 0.9rem; font-weight: 500; }
input[type="text"], input:not([type]), input[type="datetime-local"], select {
  width: 100%; font: inherit; color: var(--fg); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; min-height: 44px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, .check:focus-within {
  outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm);
}
.hint { color: var(--muted); font-size: 0.85rem; margin: 0; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.checks legend { margin-bottom: 0.35rem; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 44px; cursor: pointer; font-weight: 400; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--fg); }
.invite { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  background: #fff; color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.6rem 1rem; min-height: 44px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.btn:hover { background: var(--soft); }
.btn-primary { background: var(--fg); color: #fff; border-color: var(--fg); }
.btn-primary:hover { background: #333; }
.btn-ghost { border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); }
.btn-sm { min-height: 36px; padding: 0.35rem 0.7rem; font-size: 0.9rem; }
.inline { display: inline; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--soft); }
.alert-error { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.alert-warn { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }

/* Admin dashboard event cards */
.event-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.counts { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.count { text-align: center; border-radius: var(--radius-sm); padding: 0.5rem 0.25rem; border: 1px solid var(--line); background: var(--soft); }
.count-n { display: block; font-size: 1.3rem; font-weight: 600; }
.count-l { font-size: 0.75rem; color: var(--muted); }
.count-yes { background: var(--green-bg); border-color: var(--green-line); } .count-yes .count-n { color: var(--green); }
.count-maybe { background: var(--amber-bg); border-color: var(--amber-line); } .count-maybe .count-n { color: var(--amber); }
.count-no { background: var(--red-bg); border-color: var(--red-line); } .count-no .count-n { color: var(--red); }
.groups { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .groups { grid-template-columns: repeat(4, 1fr); } }
.group-title { margin-bottom: 0.35rem; }
.status-yes { color: var(--green); } .status-maybe { color: var(--amber); } .status-no { color: var(--red); } .status-none { color: var(--muted); }
.names { list-style: none; padding: 0; margin: 0; font-size: 0.95rem; }
.names li { padding: 0.15rem 0; border-bottom: 1px solid var(--line); }
.names li:last-child { border-bottom: 0; }

/* Player lists */
.player-list { list-style: none; padding: 0; margin: 0; }
.player-row { padding: 0.9rem 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; }
.player-row:first-child { border-top: 0; padding-top: 0; }
.player-name { font-weight: 600; }
.player-teams { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.player-teams .checks legend { position: absolute; left: -9999px; }

/* Player page */
.day { margin-bottom: 1.5rem; }
.day-title { font-size: 0.9rem; font-weight: 600; color: var(--muted); text-transform: capitalize; margin-bottom: 0.6rem; }
.day .event-card + .event-card { margin-top: 0.75rem; }
.current { margin: 0.75rem 0 0.5rem; font-size: 0.95rem; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.btn-choice { min-height: 48px; font-weight: 600; }
.btn-choice[aria-pressed="true"] { box-shadow: var(--ring-strong); }
.choice-yes[aria-pressed="true"] { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.choice-maybe[aria-pressed="true"] { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.choice-no[aria-pressed="true"] { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.event-card[data-response="yes"] { border-left: 4px solid var(--green); }
.event-card[data-response="maybe"] { border-left: 4px solid var(--amber); }
.event-card[data-response="no"] { border-left: 4px solid var(--red); }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 120ms ease, box-shadow 120ms ease; }
}
