/*
  Restyled 2026-07-16 after a harbiner-supplied Figma reference: "Group Event
  (Community)" (figma.com/site/Q55Y8OH56HbKdb01wWE7PR) — a dark, bold, athletic
  event-site template. Colors pulled directly from its published style guide
  (Background 1 #000000, Background 4 #95FF8D, text #FFFFFF, card surface
  #1D1D1D), not guessed. Adapted rather than copied wholesale: that site is a
  marketing/landing page (photo hero, "upcoming event" blocks) built for a
  single-event running club, while the Gauntlet is a live multi-team scoring
  dashboard — so the layout/structure stayed as-is and only the visual
  language moved (near-black surfaces, one bold lime accent, pill CTAs, tight
  punchy headline type). Team colors are unchanged in hue (still purple/amber/
  teal/coral so the four teams stay visually distinct) but reuse the site's
  already-dark-tuned lighter variants, since the whole site is dark now, not
  just an optional dark mode. Superseded the previous "DashStack" light theme.
  Font stays Nunito Sans — already a rounded/geometric family in the same
  spirit as the reference's display type.
*/
:root {
  --bg: #0A0A0A;
  --surface: #19191A;
  --surface-2: #232324;
  --text: #F5F5F3;
  --text-muted: #9B9B9B;
  --border: #2B2B2C;
  --accent: #95FF8D;
  --accent-ink: #0A0A0A;
  --flash-bg: rgba(149, 255, 141, 0.14);
  --danger: #FF5C5C;
  --success: #95FF8D;

  --team-a: #A6A4FF;
  --team-b: #FFD873;
  --team-c: #2FD9BC;
  --team-d: #FF8FA0;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 16px 40px rgba(0, 0, 0, 0.6);
  --page-pad-x: clamp(1rem, 5vw, 3.5rem);

  --font-display: "Nunito Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Nunito Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-data: "Nunito Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Preserved for reference / a future toggle — not currently reachable from
   the UI (no theme switch exists), but kept rather than deleted. */
:root[data-theme="light"] {
  --bg: #F2F2F5;
  --surface: #FFFFFF;
  --surface-2: #F5F6FC;
  --text: #12163C;
  --text-muted: #6B7699;
  --border: #E6E9F4;
  --accent: #4880FF;
  --accent-ink: #FFFFFF;
  --flash-bg: rgba(72, 128, 255, 0.10);
  --danger: #FD5B71;
  --success: #00B69B;
  --team-a: #8280FF;
  --team-b: #FEC53D;
  --team-c: #00B69B;
  --team-d: #FD5B71;
  --shadow-card: 0 2px 6px rgba(18, 22, 60, 0.04), 0 10px 24px rgba(18, 22, 60, 0.06);
  --shadow-pop: 0 12px 32px rgba(18, 22, 60, 0.14);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body {
  padding: clamp(1.25rem, 4vw, 3rem) var(--page-pad-x) 4rem;
  max-width: 1180px;
  margin: 0 auto;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.conn-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--text-muted); display: inline-block; }
.conn-dot.live { background: var(--success); }
.admin-badge {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.72rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.98;
  text-wrap: balance;
  margin: 0;
  color: var(--text);
}

header.masthead {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 2rem;
}
.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.9rem 1.25rem;
}
h1.title { font-size: clamp(1.9rem, 5vw, 2.75rem); line-height: 1.05; }
h1.title span { color: var(--accent); }
.subhead { font-size: 1rem; color: var(--text-muted); max-width: 52ch; line-height: 1.55; }

.team-session-banner {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
}
.team-session-banner b { color: var(--text); }
.team-session-banner a { font-weight: 800; }

.progress-line { display: flex; align-items: center; gap: 0.7rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.progress-line .bar-track { flex: 1; max-width: 220px; }

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.legend-item {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.legend-item:hover { box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.legend-item::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--team-color);
  flex: none;
  margin-top: 0.35rem;
  align-self: flex-start;
}
.legend-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.legend-name { font-weight: 800; font-size: 0.9rem; line-height: 1.25; }
.legend-roles { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }

#sticky-board {
  position: sticky;
  top: 0.75rem;
  z-index: 5;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  margin: 0 0 1rem;
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
#sticky-board.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sticky-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); flex: none; }
#sticky-board-entries { display: flex; gap: 1.1rem; }
#sticky-board-entries .entry { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
#sticky-board-entries .entry b { color: var(--text-muted); font-weight: 700; }

section { margin-bottom: 2.5rem; }
section > h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); margin-bottom: 0.35rem; }
.section-note { font-size: 0.9rem; color: var(--text-muted); max-width: 62ch; margin-bottom: 1.1rem; line-height: 1.5; }
.section-note.empty-note { color: var(--accent); font-weight: 700; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; white-space: nowrap; }
thead th {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--surface-2);
  font-weight: 700;
}
thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
td.rank { font-weight: 800; color: var(--text-muted); text-align: center; width: 2.2rem; }
tr.leader td.rank { color: var(--accent); }

.team-cell { display: flex; align-items: center; gap: 0.55rem; font-weight: 800; color: inherit; text-decoration: none; }
.team-cell:hover { color: var(--accent); }
.team-swatch { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--tc); flex: none; }

.bar-cell { min-width: 130px; }
.bar-track { position: relative; height: 0.5rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--tc); border-radius: 999px; transition: width 220ms ease; }

.schedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.1rem; }
.schedule-card { min-width: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 1.2rem 1.3rem 1.4rem; }
.schedule-day { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.7rem; }
.schedule-head { display: flex; align-items: center; gap: 0.7rem; }
.schedule-head h3 { font-size: 1.02rem; }
.schedule-card:nth-child(4n+1) .event-icon-badge { --badge-color: var(--team-a); }
.schedule-card:nth-child(4n+2) .event-icon-badge { --badge-color: var(--team-b); }
.schedule-card:nth-child(4n+3) .event-icon-badge { --badge-color: var(--team-c); }
.schedule-card:nth-child(4n+4) .event-icon-badge { --badge-color: var(--team-d); }
.schedule-time { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-top: 0.7rem; font-variant-numeric: tabular-nums; }
.schedule-venue { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-top: 0.25rem; }

.events-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 1.5rem; }
.event-panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 1.4rem 1.5rem 1.6rem; min-width: 0; }
.event-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.2rem; }
.event-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: color-mix(in srgb, var(--badge-color, var(--accent)) 16%, transparent);
  color: var(--badge-color, var(--accent));
}
.event-panel:nth-child(4n+1) .event-icon-badge { --badge-color: var(--team-a); }
.event-panel:nth-child(4n+2) .event-icon-badge { --badge-color: var(--team-b); }
.event-panel:nth-child(4n+3) .event-icon-badge { --badge-color: var(--team-c); }
.event-panel:nth-child(4n+4) .event-icon-badge { --badge-color: var(--team-d); }
.event-icon { width: 22px; height: 22px; flex: none; }
.event-head h3 { font-size: 1.1rem; }
.round-chips { display: flex; gap: 0.32rem; margin-left: auto; align-items: center; }
.round-chip { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--border); }
.round-chip.partial { background: #FEC53D; }
.round-chip.complete { background: var(--success); }
.event-unit { font-size: 0.76rem; color: var(--text-muted); font-weight: 700; margin: 0.15rem 0 0.5rem; }
.event-format-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin: 0 0 1.1rem; padding: 0.6rem 0.8rem; background: var(--surface-2); border-radius: var(--radius-sm); }

.round-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin: 1.1rem 0 0.6rem; }
.round-label:first-of-type { margin-top: 0; }

.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: var(--radius-sm);
  transition: background-color 500ms ease;
}
.match-row + .match-row { border-top: 1px solid var(--border); border-radius: 0; }
.match-row.just-updated { background-color: var(--flash-bg); }
.match-side { display: flex; align-items: center; gap: 0.5rem; }
.match-side.away { flex-direction: row-reverse; text-align: right; justify-content: flex-start; }
.match-side label { font-weight: 800; font-size: 0.85rem; }
.match-vs { color: var(--text-muted); font-size: 0.76rem; font-weight: 700; padding: 0 0.15rem; text-align: center; }
.match-time { display: block; font-size: 0.66rem; font-weight: 800; color: var(--accent); margin-top: 0.2rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

input.score-input {
  width: 3.4rem;
  text-align: center;
  font-family: var(--font-data);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.5rem 0.3rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
}
input.score-input:focus-visible { outline: none; border-color: var(--accent); }
input.score-input:disabled { opacity: 0.5; cursor: not-allowed; }
input.score-input::-webkit-outer-spin-button, input.score-input::-webkit-inner-spin-button { opacity: 0.4; }

.score-display {
  width: 3.4rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 0.5rem 0.3rem;
  color: var(--text);
}
.score-display.empty { color: var(--text-muted); font-weight: 500; }

.match-result { grid-column: 1 / -1; margin-top: 0.4rem; }

.result-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}
.result-chip.pending { background: var(--surface-2); color: var(--text-muted); }
.result-chip.decided { background: var(--tc, var(--text-muted)); color: #fff; }
.result-chip.loss { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.result-chip.draw { background: var(--text-muted); color: #fff; }
.result-chip .winner-name { font-weight: 800; }

/* ---------- team page ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--accent); }

.team-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.75rem;
}
.team-hero-badge {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  flex: none;
  background: color-mix(in srgb, var(--tc) 18%, transparent);
  color: var(--tc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.8rem;
}
.team-hero-label { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tc); margin-bottom: 0.1rem; }
.team-hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.team-hero-roles { font-size: 0.9rem; color: var(--text-muted); font-weight: 700; margin-top: 0.3rem; }
.team-hero-roles b { color: var(--text); }

/* ---------- score page ---------- */
.score-hero { display: flex; align-items: center; gap: 1.1rem; }
.score-hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.score-hero-label { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.1rem; }
.score-hero-sub { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; margin-top: 0.2rem; }
.event-icon-badge.lg { width: 56px; height: 56px; border-radius: 16px; }
.event-icon-badge.lg .event-icon { width: 30px; height: 30px; }

.score-matches-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 0.4rem 1.5rem 1.2rem; }
.score-matches-card .round-label:first-child { margin-top: 1rem; }

/* Larger touch targets for live in-hand scorekeeping, not just glancing at results. */
.score-match-row { padding: 1rem 0.6rem; }
.score-match-row .match-side label { font-size: 1rem; }
.score-match-row input.score-input,
.score-match-row .score-display { width: 4.4rem; font-size: 1.25rem; padding: 0.7rem 0.4rem; }
.score-match-row .team-swatch { width: 0.85rem; height: 0.85rem; }

.event-format-note { margin-top: 0.9rem; }

.event-link {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.event-link:hover { text-decoration: underline; }

.roster-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.roster-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  padding: 0.4rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}
.roster-chip.leader { background: color-mix(in srgb, var(--tc) 12%, var(--surface)); }
.role-tag {
  background: var(--tc, var(--accent));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat-card {
  min-width: 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.25rem;
}
.stat-card.total { background: color-mix(in srgb, var(--tc) 10%, var(--surface)); }
.stat-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.stat-card-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--badge-color, var(--accent)) 16%, transparent);
  color: var(--badge-color, var(--accent));
  flex: none;
}
.stat-card-badge svg { width: 18px; height: 18px; }
.stat-card-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.stat-card-value { font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat-card-sub { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; margin-top: 0.2rem; }

.match-group { margin-bottom: 1.75rem; }
.match-group-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.match-group-head h3 { font-size: 1rem; }
.match-group-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 0.4rem 1.4rem; }

footer {
  margin-top: 2.5rem;
  padding-top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-note { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

button.btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--surface);
  color: var(--text);
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  padding: 0.65rem 1.4rem;
  cursor: pointer;
}
button.btn:hover:not(:disabled) { box-shadow: var(--shadow-pop); }
button.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
button.btn.confirming { background: var(--danger); color: #fff; }
button.btn.primary { background: var(--accent); color: var(--accent-ink); }

/* ---------- inline admin login panel ---------- */
.admin-toggle-wrap { position: relative; }
button.admin-toggle {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--text-muted);
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
}
button.admin-toggle:hover { color: var(--accent); }
button.admin-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.admin-toggle.active { background: var(--accent); color: var(--accent-ink); }

.login-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  z-index: 8;
  width: min(300px, 80vw);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow-pop);
}
.login-panel p { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.45; }
.login-panel input[type="password"] {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
}
.login-panel input[type="password"]:focus-visible { outline: none; border-color: var(--accent); }
.login-panel select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  width: 100%;
}
.login-panel select:focus-visible { outline: none; border-color: var(--accent); }
.login-error { font-size: 0.8rem; font-weight: 700; color: var(--danger); min-height: 1.1em; }
.hidden { display: none !important; }

/* ---------- nomination display (public, read-only) ---------- */
.nomination-line {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.nomination-line-teamwide { margin: 0 0 1rem; padding: 0.6rem 0.8rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.nomination-team { white-space: nowrap; }

/* ---------- team captain lineup panel ---------- */
.captain-event-block { margin-bottom: 1.75rem; }
.captain-event-block h3 { font-size: 1rem; margin-bottom: 0.7rem; }
.captain-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 1.1rem 1.3rem; margin-bottom: 0.9rem; }
.captain-card-head { font-weight: 800; font-size: 0.92rem; margin-bottom: 0.8rem; }
.captain-card-readout { font-size: 0.86rem; color: var(--text-muted); line-height: 1.6; }
.captain-card-readout b { color: var(--text); }
.nomination-locked-badge { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); padding: 0.15rem 0.5rem; border-radius: 999px; margin-left: 0.4rem; }
.nomination-field { margin-bottom: 0.9rem; }
.nomination-field > label { display: block; font-size: 0.78rem; font-weight: 800; color: var(--text-muted); margin-bottom: 0.5rem; }
.roster-checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.roster-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0.4rem 0.8rem 0.4rem 0.6rem;
  cursor: pointer;
}
.roster-check input { accent-color: var(--accent); width: 1rem; height: 1rem; }

.position-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.position-row { display: flex; align-items: center; gap: 0.75rem; }
.position-label { flex: 0 0 9.5rem; font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }
.position-select {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  min-width: 0;
}
.position-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.position-select option:disabled { color: var(--text-muted); }

.subs-select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
}
.subs-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.subs-select option:disabled { color: var(--text-muted); }
.subs-select option { padding: 0.3rem 0.4rem; }
.subs-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.35rem; }

@media (max-width: 460px) {
  .position-row { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  .position-label { flex: none; }
}

.nomination-status { font-size: 0.8rem; font-weight: 700; color: var(--accent); min-height: 1.1em; margin-bottom: 0.6rem; }

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .match-row, #sticky-board { transition: none; }
}

/* ---------- mobile: tablet and down ---------- */
@media (max-width: 720px) {
  body { padding-bottom: 3rem; }
  section { margin-bottom: 1.9rem; }

  .masthead-row { padding: 0.75rem 1rem; }
  .subhead { max-width: none; }

  .events-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .event-panel { padding: 1.15rem 1.1rem 1.3rem; }

  .team-hero { padding: 1.25rem 1.35rem; gap: 1rem; }
  .team-hero-badge { width: 52px; height: 52px; font-size: 1.5rem; border-radius: 14px; }

  /* table cards scroll horizontally within their own card rather than
     the whole page — fades hint that there's more to swipe to. */
  .table-wrap {
    position: relative;
    -webkit-overflow-scrolling: touch;
  }

  /* larger tap targets throughout — 44px is the Apple/Google minimum */
  button.btn, button.admin-toggle { min-height: 44px; }
  input.score-input, .score-display { min-height: 44px; }
  .roster-chip, .legend-item { min-height: 44px; }
}

/* ---------- mobile: phone ---------- */
@media (max-width: 460px) {
  input.score-input, .score-display { width: 3.4rem; }
  .match-side label { font-size: 0.78rem; }
  .match-row { gap: 0.35rem; }

  header.masthead { gap: 0.85rem; margin-bottom: 1.5rem; }
  .masthead-row { flex-direction: row; }
  .eyebrow { font-size: 0.74rem; }
  h1.title { font-size: 1.7rem; }

  .legend { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; }
  .schedule-card { padding: 1rem 1.05rem 1.15rem; }


  .match-group-card { padding: 0.3rem 0.9rem; }
  .match-row { padding: 0.7rem 0.4rem; margin: 0 -0.4rem; }

  .login-panel { width: min(300px, 92vw); }

  footer { flex-direction: column; align-items: stretch; }
  footer .btn { width: 100%; }
}
