:root {
  --red: #c8102e;
  --red-dark: #9a0c23;
  --red-soft: #fde8ec;
  --white: #ffffff;
  --bg: #f3f3f3;
  --ink: #161616;
  --muted: #6a6a6a;
  --line: #e6e6e6;
  --card: #ffffff;
  --ok: #1f7a4d;
  --danger: #c8102e;
  --gold: #c8102e;
  --pitch: #c8102e;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(1rem + var(--safe-bottom));
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.7rem + env(safe-area-inset-top, 0px)) 1rem 0.7rem;
  background: var(--red);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--white); }
.topbar-end {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}
.nav-menu,
.settings-menu { position: relative; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--white);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 24px; height: 24px; }
.nav-menu.open .settings-dropdown,
.settings-menu.open .settings-dropdown { display: block; }
.nav-menu .settings-dropdown a.active {
  color: var(--red);
  background: var(--red-soft);
}
.nav-menu .settings-dropdown a:last-child { border-bottom: 0; }
.settings-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 180px;
  background: var(--white);
  color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 40;
  overflow: hidden;
}
.settings-dropdown a,
.settings-dropdown button.linkish {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.settings-dropdown a { border-bottom: 1px solid var(--line); }
.settings-dropdown a:hover,
.settings-dropdown button.linkish:hover { background: var(--red-soft); color: var(--red); text-decoration: none; }
.crest {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--white);
  border-radius: 50%;
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
  display: block;
}
.crest img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.crest-app {
  background: transparent;
}
.crest-app img {
  object-fit: contain;
}
.crest-lg {
  width: 6.6rem;
  height: 6.6rem;
  margin: 0 auto 0.9rem;
  border-color: var(--red);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.crest-lg.crest-app {
  border: 0;
  box-shadow: none;
}
.nav-desktop { display: none; }
.wrap { max-width: 720px; margin: 0 auto; padding: 1rem 0.9rem 1.5rem; }
.wrap-auth { max-width: 28rem; padding-top: 3rem; padding-bottom: 2rem; }
h1, h2, h3 { font-weight: 800; margin: 0 0 0.6rem; }
h1 { font-size: 1.45rem; }
.lede { color: var(--muted); margin-top: 0; line-height: 1.4; }
.grid { display: grid; gap: 0.85rem; }
.grid-2 { grid-template-columns: 1fr; }
.section-title {
  margin: 1.35rem 0 0.65rem;
  font-size: 1.15rem;
}
.card {
  background: var(--card);
  color: var(--ink);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  border: 1px solid var(--line);
}
.muted { color: var(--muted); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: stretch; }
.row .btn, .row form { flex: 1 1 140px; }
.row form { display: flex; }
.row form .btn { flex: 1; width: 100%; height: 100%; }
.space { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; flex-wrap: wrap; }
.btn, button.btn, input[type="submit"].btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: var(--white);
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  min-height: 48px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--red-dark); text-decoration: none; color: var(--white); }
.btn-gold { background: var(--red); color: var(--white); }
.btn-gold:hover { background: var(--red-dark); color: var(--white); }
.btn-ghost {
  background: var(--white);
  border: 2px solid var(--red);
  color: var(--red);
}
.btn-ghost:hover { background: var(--red-soft); color: var(--red); }
.btn-danger { background: var(--red-dark); }
.btn-sm { min-height: 44px; padding: 0.65rem 0.9rem; width: auto; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: #e8f6ee;
  color: var(--ok);
}
.pill-no { background: var(--red-soft); color: var(--red); }
.pill-gold { background: #fff3c4; color: #7a5b12; }
@media (min-width: 900px) {
  .wrap:has(.team-table) { max-width: 1320px; }
  .team-table-wrap { overflow-x: auto; }
  .team-table {
    width: 100%;
    min-width: 1280px;
  }
  .team-table th,
  .team-table td { white-space: nowrap; }
}
.team-table .select-compact { min-width: 150px; margin: 0; }
.pref-checks,
.pref-checks ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pref-checks label,
.pref-checks li label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  font-size: 0.9rem;
}
.pref-checks input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--red);
  flex: 0 0 auto;
}
.team-table .pref-checks { min-width: 12rem; white-space: normal; }
.label-text { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.signoff-table { table-layout: fixed; width: 100%; }
.signoff-table .signoff-date { width: 7.5rem; white-space: nowrap; }
.signoff-table .signoff-status { width: 13.5rem; }
.signoff-table .avail-when { margin-top: 0; }
.input, .select, .textarea {
  width: 100%;
  padding: 0.8rem 0.75rem;
  min-height: 48px;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
}
.textarea { min-height: 6rem; }
.form-row { margin-bottom: 0.85rem; }
.form-row label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.help { font-size: 0.85rem; color: var(--muted); }
.errorlist { color: var(--red); padding-left: 1.1rem; }
.messages { list-style: none; padding: 0; }
.messages li {
  background: var(--red);
  border: 0;
  color: var(--white);
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  margin-bottom: 0.8rem;
}
.messages li.error { background: var(--red-dark); }
.auth-head { text-align: center; margin-bottom: 1.2rem; }
.stat { font-size: 1.7rem; font-weight: 800; color: var(--red); }
.player { display: flex; gap: 0.8rem; align-items: flex-start; }
.player-body { flex: 1; min-width: 0; }
.player-body .select-compact { margin-top: 0.45rem; min-height: 42px; padding: 0.45rem 0.6rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.num {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}
.list-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .btn { width: auto; min-width: 88px; padding: 0.65rem 0.8rem; }
.duty-card {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem 1.2rem;
}
.duty-card + .duty-card { margin-top: 0.75rem; }
.duty-body { min-width: 0; }
.duty-body strong { display: block; font-size: 1.05rem; }
.duty-body .muted { margin: 0.25rem 0 0; }
.duty-who { margin: 0.15rem 0 0; font-weight: 600; }
.duty-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.duty-actions form { flex: 1 1 160px; margin: 0; }
.duty-actions .btn { flex: 1 1 160px; width: 100%; }
.history-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.history-item:last-child { border-bottom: 0; padding-bottom: 0; }
.history-item .meta { flex: 1; min-width: 0; }
.history-item .meta p { margin: 0.35rem 0 0; }
.history-item form { margin: 0; flex-shrink: 0; }
.history-item .btn { width: auto; }
.fine-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.fine-actions form { margin: 0; }
.fine-rates { list-style: none; padding: 0; margin: 0; }
.fine-rates li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.fine-rates li:last-child { border-bottom: 0; }
.fine-rates strong { display: block; }
.fine-rates li > div { margin-top: 0.12rem; }
.search-select { position: relative; }
.search-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.search-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.search-select-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0.85rem;
  font: inherit;
  cursor: pointer;
}
.search-select-option:last-child { border-bottom: 0; }
.search-select-option.is-on,
.search-select-option:hover { background: var(--red-soft); }
.notice-dialog {
  width: min(420px, calc(100vw - 2rem));
  border: 0;
  border-radius: 16px;
  padding: 1.1rem;
  background: var(--white);
  color: var(--ink);
  z-index: 90;
}
.notice-dialog::backdrop { background: rgba(0,0,0,0.45); }
.notice-dialog .row { margin-top: 0.85rem; }
.signoff-sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  background: var(--white);
  color: var(--ink);
  border-radius: 16px;
  padding: 1.15rem 1.1rem 1.2rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
  z-index: 90;
}
.signoff-sheet h2 { margin: 0 0 0.75rem; }
.signoff-reasons { display: grid; gap: 0.45rem; margin-bottom: 0.75rem; }
.signoff-reason {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.signoff-reason.is-on {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}
.signoff-sheet .row { margin-top: 0.85rem; }
.form-error { color: var(--red); font-weight: 700; margin: 0.4rem 0 0; }
.fixture-head-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.fixture-present {
  font-weight: 700;
  white-space: nowrap;
}
.guest-box { margin: 0.35rem 0 0.9rem; }
.guest-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.4rem; }
.guest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.guest-form { display: grid; gap: 0.65rem; }
.guest-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.form-row[hidden],
[data-signoff-note-row][hidden] { display: none; }
.fine-match-total {
  margin: 0.85rem 0 0;
  font-size: 1.05rem;
}
.match-card { display: grid; gap: 0.45rem; }
.match-card + .match-card { margin-top: 0.75rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.match-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.4rem; }
.fixture-list { display: grid; gap: 0.85rem; }
.fixture {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.fixture-head h2 { margin: 0; font-size: 1.15rem; }
.fixture-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.fixture-sub {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.fixture-date {
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: capitalize;
  white-space: nowrap;
}
.fixture-kind {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 800;
  background: #ececec;
  color: #333;
  flex-shrink: 0;
}
.fixture-kind.is-cup {
  background: var(--red-soft);
  color: var(--red);
}
.fixture-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0.55rem;
}
.fixture-side { text-align: center; min-width: 0; }
.fixture-crest {
  width: 52px;
  height: 56px;
  margin: 0 auto 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fixture-crest img {
  max-width: 52px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.fixture-crest-fallback {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.95rem;
}
.fixture-name {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}
.fixture-name.is-us { font-weight: 800; }
.fixture-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding-bottom: 1.15rem;
}
.fixture-score { letter-spacing: 0.04em; font-size: 1.2rem; font-weight: 800; }
.fixture-vs {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 700;
}
.fixture-schedule {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}
.fixture-schedule span { white-space: nowrap; }
.score-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.6rem;
  align-items: end;
  margin: 0.75rem 0 0.85rem;
}
.score-fields .form-row { margin-bottom: 0; }
.score-sep {
  font-weight: 800;
  font-size: 1.35rem;
  padding-bottom: 0.7rem;
  color: var(--muted);
}
.result-form { margin-top: 0.75rem; }
.result-line { font-size: 1.15rem; font-weight: 700; }
.scorer-list { list-style: none; padding: 0; margin: 0 0 0.85rem; }
.scorer-list li { padding: 0.2rem 0; font-weight: 700; }
.goal-edit-list { margin: 0.5rem 0 0.9rem; }
.gather-form .form-row { max-width: 12rem; }
.fixture-place {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 0.15rem;
}
.fixture-loc {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  min-width: 0;
}
.fixture-loc svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--red);
  margin-top: 0.15rem;
}
.maps-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fixture-loc .maps-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.fixture-loc .maps-link:hover { text-decoration: underline; color: var(--red); }
.lede .maps-link { color: inherit; }
.fixture-place-sub {
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.fixture-view {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  flex-shrink: 0;
}
.fixture-view:hover { background: none; color: var(--red-dark); text-decoration: underline; }
.fixture-view svg {
  width: 14px;
  height: 14px;
  color: currentColor;
}
.fixture-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}
.fixture-foot-main { min-width: 0; flex: 1; }
.fixture-foot-main:empty { display: none; }
.fixture-note {
  margin-top: 0.45rem;
  color: var(--ink);
  font-style: normal;
}
.fixture-note strong {
  display: block;
  font-weight: 800;
  margin-bottom: 0.15rem;
}
.fixture-note span {
  display: block;
  white-space: pre-wrap;
}
.fixture-foot .lbl {
  font-style: italic;
  color: var(--muted);
  margin-right: 0.4rem;
}
.fixture-wash {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.fixture-wash svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--red);
}
.fixture .avail-picker { margin-top: 0.85rem; }
.avail-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.15rem 0 0.15rem;
}
.avail-picker form { margin: 0; }
.avail-choice {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid;
  background: #fff;
  padding: 0.6rem 0.4rem;
  -webkit-tap-highlight-color: transparent;
}
.avail-choice .avail-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.avail-choice .avail-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.avail-yes { color: #fff; background: var(--ok); border-color: var(--ok); }
.avail-yes:not(.is-on) { opacity: 0.4; }
.avail-no { color: #fff; background: var(--red); border-color: var(--red); }
.avail-no:not(.is-on) { opacity: 0.4; }
.match-open { margin-top: 0.15rem; }
.match-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.match-open-link:hover { background: var(--red-dark); color: #fff; text-decoration: none; }
.avail-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
}
.avail-mark svg {
  width: 1.1rem;
  height: 1.1rem;
}
.avail-mark.is-yes { color: var(--ok); }
.avail-mark.is-no { color: var(--red); }
.avail-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}
.avail-when {
  display: block;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: break-word;
}
.avail-late {
  display: block;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--red);
  white-space: normal;
  overflow-wrap: break-word;
}
.avail-table { table-layout: fixed; width: 100%; }
.avail-table .avail-status-col { width: 14.5rem; }
.avail-table td:last-child { white-space: normal; }
.avail-group .avail-split th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  font-weight: 800;
  padding-top: 0.95rem;
  border-bottom: 0;
}
.avail-group.is-no .avail-split th { color: var(--red); }
.avail-group.is-yes .avail-split th { color: var(--ok); }
.avail-group.is-yes .avail-split th { padding-top: 1.15rem; }
.match-page { display: grid; gap: 1rem; }
.avail-own {
  margin-bottom: 1.2rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.avail-own .muted { margin: 0.45rem 0 0; }
h2.avail-next { margin-top: 1.35rem; }
.pitch-wrap {
  position: relative;
  max-width: 440px;
  margin: 0 auto 1rem;
  padding-left: 80px;
}
.pitch {
  position: relative;
  width: 100%;
  max-width: none;
  aspect-ratio: 2 / 3;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent 12%, transparent 88%, rgba(255,255,255,0.08)),
    repeating-linear-gradient(#2f9e57 0 12.5%, #278a4a 12.5% 25%);
  border: 3px solid var(--white);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.08);
}
.pitch::before, .pitch::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid rgba(255,255,255,0.9);
  pointer-events: none;
  z-index: 0;
}
.pitch::before { top: 50%; width: 72px; height: 72px; border-radius: 50%; margin-top: -36px; }
.pitch::after { top: 0; width: 55%; height: 16%; border-top: 0; }
.slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 76px;
  min-height: 70px;
  text-align: center;
  z-index: 2;
}
.slot-flagger {
  left: 38px;
  top: 73%;
  z-index: 3;
}
.slot-flagger .slot-name {
  color: var(--ink);
  text-shadow: none;
}
.slot-flagger .dot-wrap {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 0.15rem;
}
.slot-flagger .dot {
  background: #2a2a2a;
  border-color: var(--red);
  margin: 0;
}
.slot-flagger:not(.is-filled) .dot { display: none; }
.slot-flagger .role-icon-flag {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2a2a2a;
  border: 2px solid var(--red);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  box-sizing: border-box;
  padding: 6px;
}
.slot-flagger.is-filled .role-icon-flag {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 22px;
  height: 22px;
  padding: 2px;
  z-index: 2;
  background: #fff;
  border-color: var(--red);
}
.slot-flagger.is-filled .dot { background: var(--red); }
.role-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.slot-btn {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255,255,255,0.25);
  touch-action: manipulation;
}
.slot .dot, .slot-btn .dot {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.15rem;
  border-radius: 50%;
  background: rgba(200, 16, 46, 0.88);
  border: 2px solid var(--white);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.slot.is-filled .dot, .slot-btn.is-filled .dot { background: var(--red); }
.slot-name {
  display: block;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  line-height: 1.1;
}
.slot, .slot-btn {
  transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1), top 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
.slot-enter { opacity: 0; }
.slot-leave { opacity: 0; pointer-events: none; }
.picker-heading { margin: 0.9rem 0 0.35rem; font-weight: 800; }
.picker-sheet h2 { margin-bottom: 0.75rem; }
.picker-item {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 48px;
  padding: 0.85rem 0.2rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.picker-dialog {
  border: 0;
  padding: 1rem 1rem calc(1rem + var(--safe-bottom));
  width: min(100%, 440px);
  max-height: 80vh;
  overflow: auto;
  border-radius: 18px 18px 0 0;
  margin: auto 0 0;
  background: var(--white);
  color: var(--ink);
}
.picker-dialog::backdrop {
  background: rgba(0,0,0,0.45);
}
.picker-dialog h2 { margin-bottom: 0.5rem; }
.picker-dialog h2 { margin-bottom: 0.5rem; }
.picker-search {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 0.65rem;
  background: var(--white);
}
.picker-dialog.open {
  display: block;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 80;
}
.picker-dialog menu {
  margin: 0 0 0.5rem;
  padding: 0;
}
.slot-row { margin-bottom: 0.7rem; }
.slot-row label { display: flex; justify-content: space-between; gap: 0.5rem; }
.bench { display: grid; gap: 0.55rem; }
.inline { display: inline; }
.select-multi { min-height: 8rem; }
.toolbar { margin: 0.5rem 0 1rem; }
[hidden] { display: none !important; }
.period-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.period-tabs a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid var(--red);
  background: var(--white);
  color: var(--red);
  font-weight: 800;
  text-decoration: none;
}
.period-tabs a:hover { background: var(--red-soft); text-decoration: none; }
.period-tabs a.active {
  background: var(--red);
  color: var(--white);
}
.stand-table {
  width: 100%;
  table-layout: fixed;
}
.stand-table .stand-pos-col { width: 1.35rem; }
.stand-table .stand-team-col { width: auto; }
.stand-table .stand-num-col { width: 1.7rem; }
.stand-table .stand-diff-col { width: 2.15rem; }
.stand-table .stand-pos {
  width: 1.35rem;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
  text-align: center;
  white-space: nowrap;
}
.stand-table .stand-team {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stand-table .stand-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-left: 0.12rem;
  padding-right: 0.12rem;
}
.stand-table tr.is-us {
  background: var(--red-soft);
}
.stand-table tr.is-us td { font-weight: 800; }
.role-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.role-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  min-height: 64px;
  padding: 0.65rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.role-icon-captain {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3f3f3;
  border: 2px solid var(--line);
  padding: 4px;
  box-sizing: border-box;
}
.role-btn.is-filled .role-icon-captain { border-color: var(--red); background: #fff; }
.role-btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
button.role-btn:hover { border-color: var(--red); }
.role-btn.is-filled { border-color: var(--red); background: var(--red-soft); }
.role-btn .muted { font-size: 0.75rem; font-weight: 700; }
.sub-arrow { color: var(--muted); font-weight: 800; }
.sub-form { margin: 0 0 1rem; }
.mins-under { color: var(--ok); font-weight: 800; }
.under-mins {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
}
.under-mins-item { font-size: 0.95rem; }
.savebar {
  position: sticky;
  bottom: calc(var(--safe-bottom) + 8px);
  z-index: 15;
  padding-top: 0.5rem;
}
.sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 50;
}
.sheet-backdrop.open { display: block; }
[data-signoff-backdrop].open { z-index: 85; }
.sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--white);
  border-radius: 18px 18px 0 0;
  padding: 1rem 1rem calc(1rem + var(--safe-bottom));
  max-height: 80vh;
  overflow: auto;
}
.sheet.open { display: block; }
.sheet a, .sheet button.linkish {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.9rem 0.2rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  font: inherit;
  font-weight: 700;
}
.sheet a:last-child, .sheet form:last-child button { border-bottom: 0; }
@media (min-width: 900px) {
  body { padding-bottom: 1.5rem; }
  .wrap { max-width: 980px; padding: 1.4rem 1.2rem 2.5rem; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .btn { width: auto; }
  .row .btn, .row form { flex: 0 1 auto; }
  .nav-menu { display: none; }
  .nav-desktop {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1rem;
    align-items: center;
    margin-right: 0.45rem;
  }
  .nav-desktop a.active { text-decoration: underline; }
  .nav-desktop a, .nav-desktop .linkish {
    color: var(--white);
    background: none;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0.2rem 0;
  }
  .nav-desktop a:hover, .nav-desktop .linkish:hover { text-decoration: underline; color: var(--white); }
  .savebar { position: static; }
  .picker-dialog {
    margin: 10vh auto auto;
    width: min(420px, 92vw);
    border-radius: 16px;
    max-height: 70vh;
  }
}
@media (max-width: 899px) {
  .guest-fields { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.7rem;
  }
  .table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border: 0;
  }
  .table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    flex: 0 0 38%;
  }
  .table td[data-label=""]::before,
  .table td:not([data-label])::before {
    content: none;
    flex: 0;
  }
  .team-table td::before {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .avail-table tr.avail-split {
    border: 0;
    border-radius: 0;
    margin: 0 0 0.35rem;
    padding: 0.2rem 0;
    background: none;
  }
  .avail-table tr.avail-split th,
  .avail-table td[colspan] {
    display: block;
    padding: 0;
    border: 0;
  }
  .avail-table td[data-label="Status"]::before,
  .signoff-table td.signoff-status::before {
    flex: 0 0 4.8rem;
  }
  .avail-table td[data-label="Status"],
  .signoff-table td.signoff-status {
    align-items: flex-start;
  }
  .avail-status {
    flex: 1 1 0;
    min-width: 0;
    align-items: flex-end;
    text-align: right;
  }
  .signoff-table .signoff-date,
  .signoff-table .signoff-status {
    width: auto;
    white-space: normal;
  }
  .stand-table,
  .stand-table thead,
  .stand-table tbody,
  .stand-table tr,
  .stand-table th,
  .stand-table td {
    display: table;
  }
  .stand-table { display: table; width: 100%; table-layout: fixed; font-size: 0.82rem; }
  .stand-table thead { display: table-header-group; }
  .stand-table tbody { display: table-row-group; }
  .stand-table tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
    background: none;
  }
  .stand-table th,
  .stand-table td {
    display: table-cell;
    padding: 0.4rem 0.18rem;
    border-bottom: 1px solid var(--line);
  }
  .stand-table td::before { content: none; flex: 0; }
  .stand-table tr.is-us { background: var(--red-soft); }
}

.help-fab {
  position: fixed;
  left: 0.7rem;
  bottom: 0.55rem;
  z-index: 35;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: var(--white);
  color: var(--red);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.14);
}
.help-fab:hover { background: var(--red-soft); }
.help-sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  background: var(--white);
  color: var(--ink);
  border-radius: 16px;
  padding: 1.15rem 1.1rem 1.2rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
  z-index: 90;
}
.help-sheet h2 { margin: 0 0 0.75rem; }
.help-body p { margin: 0 0 0.7rem; }
.help-body p:last-child { margin-bottom: 0; }
.help-sheet .row { margin-top: 1rem; }
[data-help-backdrop].open { z-index: 85; }
.manual h2 {
  margin: 1.35rem 0 0.45rem;
  font-size: 1.15rem;
}
.manual h2:first-child { margin-top: 0; }
.manual h3 {
  margin: 0.85rem 0 0.35rem;
  font-size: 1rem;
}
.manual p { margin: 0 0 0.7rem; }
.manual ol {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}
.manual li { margin: 0 0 0.35rem; }

.app-version {
  position: fixed;
  right: 0.7rem;
  bottom: 0.4rem;
  z-index: 25;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  opacity: 0.7;
}
