/* Revolver FC app. Crest colors: red #D63232, black #111, white, gold #A88C64.
   Layout: one phone-width column, sticky crest bar on top, tab bar on the bottom. */
:root {
  --bg: #f4f3f1; --surface: #ffffff; --ink: #141414; --muted: #5f5b56; --line: #e4e1dc;
  --red: #d63232; --red-ink: #b02424; --black: #111111; --gold: #8f744d; --gold-soft: #f3ece1;
  --on: #1f7a3d; --on-soft: #e4f3e8; --delay: #9a6200; --delay-soft: #fbefd6; --off: #b02424; --off-soft: #fbe4e4;
  --bar: #111111; --bar-ink: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d; --surface: #1a1a1a; --ink: #f2f0ed; --muted: #a8a39c; --line: #2c2a28;
    --red: #e04848; --red-ink: #ff8a8a; --gold: #c9a978; --gold-soft: #2a2419;
    --on: #5fd08a; --on-soft: #16301f; --delay: #f0b54a; --delay-soft: #33270e; --off: #ff7b7b; --off-soft: #3a1717;
    --bar: #000000; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d; --surface: #1a1a1a; --ink: #f2f0ed; --muted: #a8a39c; --line: #2c2a28;
  --red: #e04848; --red-ink: #ff8a8a; --gold: #c9a978; --gold-soft: #2a2419;
  --on: #5fd08a; --on-soft: #16301f; --delay: #f0b54a; --delay-soft: #33270e; --off: #ff7b7b; --off-soft: #3a1717;
  --bar: #000000; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.bar {
  position: sticky; top: 0; z-index: 5; background: var(--bar); color: var(--bar-ink);
  display: flex; gap: 12px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  border-bottom: 4px solid var(--red);
}
.crest { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; }
.brand { display: grid; line-height: 1.15; min-width: 0; }
.brand b { font-size: 19px; letter-spacing: .02em; text-transform: uppercase; }
.brand span { font-size: 12.5px; color: #cfcac3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

main { max-width: 640px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left, 0px)) 24px max(16px, env(safe-area-inset-right, 0px)); }
.loading, .empty { color: var(--muted); }
h2 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
h2:first-child { margin-top: 4px; }

/* Today's games: the main thing a player opens the app for */
.today { display: grid; gap: 12px; }
.game {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  display: grid; gap: 6px; border-left: 6px solid var(--line);
}
.game.on { border-left-color: var(--on); }
.game.delayed { border-left-color: var(--delay); }
.game.canceled { border-left-color: var(--off); }
.game .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.game h3 { margin: 0; font-size: 18px; line-height: 1.2; }
.game .when { font-weight: 600; }
.game .where { color: var(--muted); font-size: 14.5px; }
.game .where a { color: var(--red-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.game .note { font-size: 15px; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.game .by { font-size: 12.5px; color: var(--muted); }

.pill { flex: none; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.pill.sched { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.on { background: var(--on-soft); color: var(--on); }
.pill.delayed { background: var(--delay-soft); color: var(--delay); }
.pill.canceled { background: var(--off-soft); color: var(--off); }

.week { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.week li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.week li:first-child { border-top: 0; }
.week .d { grid-column: 1 / -1; font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--red-ink); }
.week .n { min-width: 0; }
.week .n b { display: block; font-size: 15px; }
.week .n span { font-size: 13px; color: var(--muted); }

.feed { display: grid; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.item .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.item .tag-k { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; color: var(--red-ink); }
.item b { display: block; }
.item p { margin: 2px 0 0; font-size: 15px; }
.item a.more { display: inline-block; margin-top: 6px; color: var(--red-ink); font-weight: 600; text-decoration: none; }

.coming { display: grid; gap: 10px; }
.coming .item { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start; }
.cal { background: var(--black); color: #fff; border-radius: 10px; text-align: center; padding: 6px 0; line-height: 1.05; }
.cal span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--gold); }
:root .cal span { color: #d9b98a; }
.cal b { font-size: 24px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card p { margin: 0 0 10px; }
.checks { display: grid; gap: 2px; margin: 8px 0 14px; }
.checks label { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checks label:last-child { border-bottom: 0; }
.checks input { width: 20px; height: 20px; accent-color: var(--red); }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin: 0 0 6px; }
.hint { font-size: 13.5px; color: var(--muted); }

.btn { appearance: none; border: 0; border-radius: 10px; padding: 13px 16px; font-weight: 700; cursor: pointer; background: var(--red); color: #fff; width: 100%; }
.btn.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding: 0 max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
}
.tabs a { flex: 1; text-align: center; padding: 16px 0 14px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--muted); border-top: 3px solid transparent; }
.tabs a[aria-current="page"] { color: var(--ink); border-top-color: var(--red); }

.footer { margin-top: 28px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; text-align: center; }
.footer a { color: var(--muted); }

/* Admin */
.admin-session { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-session:first-of-type { border-top: 0; }
.admin-session .t { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.admin-session .t b { font-size: 15px; }
.st { appearance: none; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 11px 6px; font-weight: 800; font-size: 13px; cursor: pointer; }
.st.on { color: var(--on); } .st.delayed { color: var(--delay); } .st.canceled { color: var(--off); }
.st[aria-pressed="true"].on { background: var(--on-soft); border-color: var(--on); }
.st[aria-pressed="true"].delayed { background: var(--delay-soft); border-color: var(--delay); }
.st[aria-pressed="true"].canceled { background: var(--off-soft); border-color: var(--off); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { appearance: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.field { display: grid; gap: 4px; margin: 0 0 10px; }
.field span { font-size: 13px; font-weight: 700; }
input[type="text"], input[type="date"], input[type="url"], input[type="password"], textarea {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 11px 12px;
}
textarea { min-height: 84px; resize: vertical; }
.stat { display: flex; gap: 8px; flex-wrap: wrap; }
.stat span { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.x { appearance: none; border: 0; background: none; color: var(--red-ink); font-weight: 700; cursor: pointer; padding: 4px; }

.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 8px 0; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; background: var(--red); width: 0; transition: width .25s; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 10;
  background: var(--black); color: #fff; padding: 12px 16px; border-radius: 12px; width: min(92vw, 520px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 15px; border-left: 5px solid var(--red);
}
.toast b { display: block; }
.toast[hidden] { display: none; }
.demo-banner { background: var(--gold-soft); color: var(--ink); border: 1px dashed var(--gold); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; }

/* Pickup RSVPs and schedule links */
.links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14.5px; }
.links a { color: var(--red-ink); font-weight: 700; text-decoration: none; }
.links a::after { content: " ↗"; font-weight: 400; }
.links.sm { font-size: 13px; margin-top: 2px; }
.rsvp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.going { color: var(--muted); font-size: 14px; }
.going-me { color: var(--on); font-weight: 700; font-size: 14px; }
.mini { appearance: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.mini.red { background: var(--red); border-color: var(--red); color: #fff; }
.week .side { display: grid; gap: 6px; justify-items: end; }

/* Sign up */
.stack { display: grid; gap: 12px; }
.top-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tags.sm { margin-top: 4px; gap: 4px; }
.tag { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; font-weight: 600; }
.tags.sm .tag { font-size: 11.5px; padding: 1px 7px; }
.seg, .pick { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label, .pick label { position: relative; }
.seg input, .pick input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span, .pick span { display: inline-block; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.seg input:checked + span, .pick input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.seg input:focus-visible + span, .pick input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14.5px; }
.agree input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--red); }
.agree a { color: var(--red-ink); font-weight: 700; }
.agree.tight { margin: 0; align-items: center; }
.invite { border: 2px solid var(--gold); }
.share { background: var(--gold-soft); border-radius: 10px; padding: 12px; margin-top: 10px; }
.share p { margin: 0 0 8px; font-size: 14.5px; }
.roster { list-style: none; margin: 10px 0 0; padding: 0; }
.roster li { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.ok { color: var(--on); font-weight: 700; } .owe { color: var(--delay); font-weight: 700; }
.choices { display: grid; gap: 8px; margin: 12px 0 6px; }
input[type="email"], input[type="tel"], select { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 11px 12px; }

/* Staff setup */
.checklist { list-style: none; margin: 0; padding: 4px 16px; }
.check-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.check-row:first-child { border-top: 0; }
.check-row p { margin: 2px 0 0; }
.dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.dot.ok { background: var(--on-soft); color: var(--on); } .dot.no { background: var(--delay-soft); color: var(--delay); }
.hs-lines { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; display: grid; gap: 4px; }
.hs-lines li::before { content: "✓ "; color: var(--on); font-weight: 800; }
.hs-lines li.bad { color: var(--off); } .hs-lines li.bad::before { content: "! "; color: var(--off); }

/* Waiver */
.waiver-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 4px; margin: 12px 0; background: var(--bg); }
.waiver-box .agree { margin: 8px 0 10px; }
.linkish { display: inline; appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--red-ink); font-weight: 700; text-decoration: underline; cursor: pointer; text-align: left; }
.waiver p { font-size: 14px; line-height: 1.5; margin: 8px 0; }
.waiver h3 { font-size: 17px; }

/* Bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card { background: var(--surface); width: min(100%, 560px); border-radius: 18px 18px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 4px; max-height: 90vh; overflow: auto; }
.sheet-card h3 { margin: 0 0 4px; font-size: 19px; }
.sheet-card p { margin: 4px 0; }
.sheet-card > .btn.secondary:last-child { margin-top: 10px; }

/* Staff */
.staff-head { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 10px; font-size: 14px; }
.segnav { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.segnav a { flex: 1; text-align: center; padding: 9px 4px; border-radius: 9px; text-decoration: none; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.segnav a[aria-current="page"] { background: var(--black); color: #fff; }
.chip.on { background: var(--black); color: #fff; border-color: var(--black); }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.filters select { padding: 9px 8px; font-size: 14px; }
.plist { list-style: none; margin: 4px 0 10px; padding: 0; }
.prow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.pmain { min-width: 0; } .pmain b { font-size: 15px; }
.pside { align-self: start; }
.pact { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13.5px; }
.pact a.x { text-decoration: none; }
.pact select { width: auto; padding: 6px 8px; font-size: 13.5px; }
.team .row { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
