/* Little League Managers — public pages. One stylesheet, no build step. */

:root {
  color-scheme: light dark;
  --green: #1d6b45;
  --green-deep: #15523a;
  --clay: #b5562a;

  --bg: #f5f3ec;
  --surface: #ffffff;
  --sunken: #eae7dd;
  --ink: #16241c;
  --muted: #4f5d54;
  --line: #d6d2c6;
  --field-line: #75817a;

  --accent: #1d6b45;          /* text + borders that mean "go" */
  --accent-soft: #e4f1e9;
  --btn: #1d6b45;
  --btn-hover: #15523a;
  --btn-ink: #ffffff;
  --clay-ink: #8c3d19;
  --clay-soft: #f8e7dd;
  --clay-line: #dcae95;
  --danger: #a3271b;
  --danger-soft: #fbe9e6;
  --focus: #16241c;
  --mast: #1d6b45;
  --seg-on: #ffffff;
  --mast-stripe: #1a6240;
  --shadow: 0 1px 2px rgb(22 36 28 / 0.06), 0 6px 20px rgb(22 36 28 / 0.06);

  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1612;
    --surface: #17221c;
    --sunken: #1f2c25;
    --ink: #edf2ee;
    --muted: #a9b6ad;
    --line: #2c3b32;
    --field-line: #7c8b82;

    --accent: #7fd3a6;
    --accent-soft: #173426;
    --btn: #23794f;
    --btn-hover: #2a8a5b;
    --btn-ink: #ffffff;
    --clay-ink: #f0a783;
    --clay-soft: #33211a;
    --clay-line: #6b3f2b;
    --danger: #ff9d91;
    --danger-soft: #3a1c19;
    --focus: #ffffff;
    --mast: #15523a;
    --seg-on: #3a4d42;
    --mast-stripe: #134b35;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  overflow-wrap: anywhere;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 560px; }
main.wrap { flex: 1; padding-top: 20px; padding-bottom: 40px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--surface); color: var(--ink); padding: 12px 16px; border-radius: 8px;
  font-weight: 600;
}
.skip:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.masthead :focus-visible { outline-color: #fff; }

/* ---------- masthead ---------- */
.masthead {
  background:
    repeating-linear-gradient(100deg, transparent 0 56px, var(--mast-stripe) 56px 112px),
    var(--mast);
  color: #fff;
  border-bottom: 5px solid var(--clay);
  padding: 22px 0 18px;
}
.eyebrow {
  font: 600 0.95rem/1 var(--display);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgb(255 255 255 / 0.88);
  display: flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ""; width: 10px; height: 10px; flex: none;
  background: #f0b08f; transform: rotate(45deg); border-radius: 1px;
}
.masthead h1 {
  font: 700 clamp(2rem, 7.5vw, 3.25rem)/1 var(--display);
  text-transform: uppercase; letter-spacing: 0.01em;
  margin-top: 10px;
  text-wrap: balance;
}
.masthead .sub { margin-top: 8px; color: rgb(255 255 255 / 0.9); font-size: 0.95rem; }

/* ---------- controls ---------- */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--sunken); border-radius: 12px; padding: 4px; gap: 4px;
  margin-bottom: 18px; max-width: 460px;
}
.segmented button {
  min-height: 44px; border: 0; border-radius: 9px; background: transparent;
  font-weight: 600; color: var(--muted); padding: 6px 10px;
}
.segmented button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: var(--shadow); }

.weekbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.weekbar h2 {
  flex: 1; text-align: center;
  font: 600 1.35rem/1.1 var(--display); letter-spacing: 0.02em; text-transform: uppercase;
}
.iconbtn {
  flex: none; min-width: 44px; min-height: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font-weight: 600; font-size: 0.9rem;
}
.iconbtn:hover:not(:disabled) { border-color: var(--field-line); }
.iconbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.iconbtn svg { width: 18px; height: 18px; flex: none; }
.iconbtn .txt { display: none; }
@media (min-width: 520px) { .iconbtn .txt { display: inline; } }

.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0 -4px 22px; }
.day {
  min-height: 64px; padding: 6px 0 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.day .dow { font: 600 0.8rem/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.day .num { font: 700 1.5rem/1 var(--display); }
.day .pip { width: 6px; height: 6px; border-radius: 50%; background: transparent; margin-top: 2px; }
.day.has-open .pip { background: var(--accent); }
.day.is-empty .num, .day.is-empty .dow { color: var(--muted); font-weight: 500; }
.day[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.day[aria-pressed="true"] .dow, .day[aria-pressed="true"] .num { color: #fff; font-weight: 700; }
.day[aria-pressed="true"].has-open .pip { background: #fff; }
@media (min-width: 640px) { .days { gap: 8px; margin-inline: 0; } .day { min-height: 72px; } }

.dayhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.dayhead h2 { font: 700 1.75rem/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.dayhead p { color: var(--muted); font-size: 0.9rem; }

/* ---------- board ---------- */
.board { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.board[aria-busy="true"] { opacity: 0.55; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.card-head h3 { font: 700 1.4rem/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.card-head .count { flex: none; font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.card-head .count.none { color: var(--muted); }
.card .meta { color: var(--muted); font-size: 0.875rem; }
.slots { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.slots.wide { grid-template-columns: 1fr; }

.slot {
  width: 100%; min-height: 56px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--sunken);
  text-align: center; line-height: 1.2;
}
.slot .t { font-weight: 600; font-size: 0.975rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slot .s { font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.slots.wide .slot { flex-direction: row; justify-content: space-between; gap: 12px; padding: 10px 14px; text-align: left; }
.slots.wide .slot .s { font-size: 0.85rem; text-align: right; }

button.slot.open { background: var(--surface); border-color: var(--accent); }
button.slot.open .s { color: var(--accent); font-weight: 600; }
button.slot.open:hover { background: var(--accent-soft); }
button.slot.open:active { transform: translateY(1px); }
.slot.full .t { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.slot.closed {
  border-color: var(--clay-line);
  background: repeating-linear-gradient(135deg, var(--clay-soft) 0 8px, transparent 8px 16px), var(--surface);
}
.slot.closed .t { color: var(--clay-ink); text-decoration: line-through; font-weight: 500; }
.slot.closed .s { color: var(--clay-ink); font-weight: 600; }
.slot.soon, .slot.account, .slot.offline { background: transparent; border-style: dashed; border-color: var(--field-line); }
.slot.soon .t, .slot.account .t, .slot.offline .t { font-weight: 500; }
.slot.past { background: transparent; border-color: transparent; }
.slot.past .t { color: var(--muted); font-weight: 400; }

/* ---------- messages ---------- */
.empty { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 28px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font: 700 1.4rem/1.2 var(--display); text-transform: uppercase; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.notice { border-radius: 10px; padding: 12px 14px; background: var(--danger-soft); color: var(--danger); font-weight: 500; border: 1px solid currentColor; }
.notice:empty { display: none; }

.skeleton { height: 150px; border-radius: var(--radius); background: var(--sunken); }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.5; } }
  .slot, .day, .btn { transition: background-color 0.12s, border-color 0.12s; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 20px; border-radius: 10px;
  border: 1.5px solid var(--btn); background: var(--btn); color: var(--btn-ink);
  font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--field-line); }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { background: var(--clay); border-color: var(--clay); color: #fff; }
.btn.danger:hover { background: #9c4721; border-color: #9c4721; }
.btn.block { width: 100%; }

/* ---------- booking sheet ---------- */
dialog.sheet {
  width: min(100%, 480px); max-width: 100%; max-height: 100dvh;
  margin: auto auto 0; padding: 0; border: 0;
  border-radius: 18px 18px 0 0;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 -8px 40px rgb(0 0 0 / 0.3);
  overflow-y: auto; overscroll-behavior: contain;
}
dialog.sheet::backdrop { background: rgb(10 20 15 / 0.6); }
@media (min-width: 560px) { dialog.sheet { margin: auto; border-radius: 16px; max-height: calc(100dvh - 32px); } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h2 { font: 700 1.7rem/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.sheet-head p { color: var(--muted); margin-top: 4px; font-weight: 500; }
.close {
  flex: none; width: 44px; height: 44px; margin: -6px -8px 0 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
}
.close:hover { background: var(--sunken); color: var(--ink); }
.close svg { width: 22px; height: 22px; }
.sheet-body { padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.925rem; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--surface); border: 1.5px solid var(--field-line); border-radius: 10px;
  font-size: 1rem;
}
.field input:focus-visible { outline-offset: 0; border-color: var(--focus); border-radius: 10px; }
.field input[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.field .hint { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.field .err { color: var(--danger); font-size: 0.875rem; font-weight: 500; margin-top: 6px; }
.field .err:empty { display: none; }
.pair { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 420px) { .pair { grid-template-columns: 1fr 1fr; } }
/* Honeypot: off-screen, out of the tab order and hidden from screen readers. */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin-bottom: 14px; }
.actions { display: grid; gap: 10px; margin-top: 4px; }
.fine { color: var(--muted); font-size: 0.85rem; margin-top: 12px; text-align: center; }

.done { text-align: center; padding: 8px 0 4px; }
.done .tick {
  width: 60px; height: 60px; margin: 4px auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.done .tick svg { width: 30px; height: 30px; }
.done h3 { font: 700 2rem/1 var(--display); text-transform: uppercase; }
.done h3:focus { outline: none; }
.done .what { margin-top: 10px; font-weight: 600; }
.done .next { margin-top: 6px; color: var(--muted); }
.done .btn { margin-top: 20px; }

/* ---------- cancel page ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 22px 18px; margin-top: 8px; }
.panel h2 { font: 700 1.9rem/1.05 var(--display); text-transform: uppercase; }
.panel h2:focus { outline: none; }
.panel > p { margin-top: 8px; color: var(--muted); }
.ticket { margin: 18px 0; padding: 14px 16px; border-radius: 10px; background: var(--sunken); border-left: 5px solid var(--clay); }
.ticket dl { margin: 0; display: grid; gap: 10px; }
.ticket dt { font: 600 0.8rem/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ticket dd { margin: 3px 0 0; font-weight: 600; font-size: 1.05rem; }
.panel .btn.ghost { margin-top: 4px; }
.ticket dd small { display: block; font-weight: 400; font-size: 0.875rem; color: var(--muted); }
.panel .notice { margin-top: 14px; }

/* ---------- landing ---------- */
.hero { padding: 36px 0 44px; }
.hero h1 { font-size: clamp(2.4rem, 10vw, 4.25rem); max-width: 14ch; }
.hero .sub { font-size: 1.1rem; max-width: 46ch; margin-top: 14px; }
.features { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.features h2 { font: 700 1.4rem/1.1 var(--display); text-transform: uppercase; margin-bottom: 6px; }
.features p { color: var(--muted); }
.find { margin-top: 28px; }
.find h2 { font: 700 1.6rem/1.1 var(--display); text-transform: uppercase; margin-bottom: 4px; }
.find > p { color: var(--muted); margin-bottom: 14px; }
.find form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.find .field { flex: 1 1 220px; margin: 0; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.875rem; text-align: center; }
.foot a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; display: inline-block; padding: 12px 6px; }
a { color: var(--accent); }

@media (max-width: 379px) { :root { --gutter: 12px; } }
