/* =============================================
   BANK SHOT — Styles (BPL-matched)
   ============================================= */

/* ── Reset ─────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* ── Design Tokens ─────────────────────────── */

:root {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --bg3:       #1c2128;
  --stroke:    rgba(255,255,255,.08);
  --stroke2:   rgba(255,255,255,.15);
  --stroke3:   rgba(255,255,255,.20);
  --text:      #e6edf3;
  --muted:     #8b949e;
  --muted2:    #6e7681;

  --gold:      #d4a843;
  --gold-dim:  rgba(212,168,67,.15);
  --gold-ring: rgba(212,168,67,.30);

  --danger:    #da3633;
  --danger-dim: rgba(218,54,51,.12);
  --ok:        #3fb950;

  --radius-card: 10px;
  --radius-pill: 20px;
  --radius-sm:   6px;

  --shadow: 0 8px 24px rgba(0,0,0,.4);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --header-h: 70px;
  --nav-h:    62px;
}

/* ── Base ──────────────────────────────────── */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  min-height: 100%;
}

/* ── Header ────────────────────────────────── */

#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  z-index: 100;
}

.logo-row {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

#app-header-league {
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: .1px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#header-league-logo {
  justify-self: start;
  display: flex;
  align-items: center;
}

.header-league-logo-img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}

.header-app-logo {
  height: 60px;
  width: auto;
  display: block;
}

#app-header-user {
  justify-self: end;
  font-size: 12px;
  color: var(--muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
}

/* ── Main Content ──────────────────────────── */

#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

/* ── Bottom Nav ────────────────────────────── */

#app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg2);
  border-top: 1px solid var(--stroke);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

#app-nav[hidden] { display: none; }

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-pill);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 8px 4px;
  text-transform: uppercase;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.nav-btn:hover { background: rgba(255,255,255,.05); }

.nav-btn--active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 800;
}

.nav-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .4px;
}

/* ── Toast Container ───────────────────────── */

#toast-container {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(480px, calc(100% - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg2);
  border: 1px solid var(--stroke3);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease;
  text-align: center;
}

.toast--visible  { opacity: 1; transform: translateY(0); }
.toast--hiding   { opacity: 0; transform: translateY(6px); }

.toast--success { border-color: rgba(63,185,80,.4);   color: var(--ok); }
.toast--error   { border-color: rgba(218,54,51,.4);   color: #f85149; }
.toast--warning { border-color: var(--gold-ring);     color: var(--gold); }
.toast--info    { border-color: rgba(88,166,255,.4);  color: #58a6ff; }

/* ── Loading State ─────────────────────────── */

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--stroke2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards ─────────────────────────────────── */

.card {
  background: var(--bg2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 16px;
}

.card + .card { margin-top: 10px; }

.card--clickable {
  cursor: pointer;
  transition: border-color .14s ease;
}

.card--clickable:hover { border-color: var(--gold-ring); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
}

/* ── Buttons ───────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-pill);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  transition: background .14s ease, border-color .14s ease, opacity .14s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #0d1117;
  font-weight: 700;
}

.btn--primary:hover:not(:disabled) {
  background: #c99a38;
  border-color: #c99a38;
}

.btn--secondary {
  background: transparent;
  border-color: var(--stroke2);
  color: var(--text);
}

.btn--secondary:hover:not(:disabled) { background: rgba(255,255,255,.05); }

.btn--danger {
  background: var(--danger-dim);
  border-color: rgba(218,54,51,.4);
  color: #f85149;
}

.btn--danger:hover:not(:disabled) {
  background: rgba(218,54,51,.18);
}

.btn--warning {
  background: rgba(202,138,4,.15);
  border-color: rgba(202,138,4,.5);
  color: #facc15;
}

.btn--warning:hover:not(:disabled) {
  background: rgba(202,138,4,.25);
}

/* ── Inline Buttons ─────────────────────────── */

.btn-inline {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-pill);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .14s ease, border-color .14s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-inline:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.btn-inline:disabled { opacity: .4; cursor: not-allowed; }

.btn-inline--accent {
  border-color: var(--gold-ring);
  color: var(--gold);
}

.btn-inline--accent:hover:not(:disabled) {
  background: var(--gold-dim);
}

.btn-inline--danger {
  border-color: rgba(218,54,51,.35);
  color: #f85149;
}

.btn-inline--danger:hover:not(:disabled) {
  background: var(--danger-dim);
}

/* ── Auth Screen ───────────────────────────── */

.auth-screen {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 32px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 32px 24px;
  box-shadow: var(--shadow);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
  letter-spacing: .2px;
}

.auth-subtitle {
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
  margin-bottom: 24px;
  font-size: 13px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-error {
  color: #f85149;
  font-size: 12px;
  text-align: center;
}

/* ── Forms ─────────────────────────────────── */

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .2px;
}

.form-hint {
  font-weight: 400;
  opacity: .7;
  font-size: 11px;
}

.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  padding: 10px 12px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .14s ease, box-shadow .14s ease;
}

.form-input::placeholder { color: var(--muted2); }

.form-input:focus {
  border-color: var(--gold-ring);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.form-input:disabled { opacity: .5; cursor: not-allowed; }

/* Restore native picker UI for date/time/datetime inputs */
.form-input[type="date"],
.form-input[type="time"],
.form-input[type="datetime-local"] {
  -webkit-appearance: auto;
  appearance: auto;
}

.form-input option { background: var(--bg2); color: var(--text); }
.form-input option:checked { background: rgba(212,168,67,.2); }

/* ── Badges / Pills ─────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
  border: 1px solid var(--stroke3);
  background: transparent;
  color: var(--text);
}

.badge--neutral {
  border-color: var(--stroke2);
  color: var(--muted);
}

.badge--accent {
  border-color: var(--gold-ring);
  color: var(--gold);
}

.badge--admin {
  border-color: rgba(88,166,255,.35);
  color: #58a6ff;
}

.badge--muted {
  border-color: var(--stroke);
  color: var(--muted);
}

.badge--danger {
  border-color: rgba(218,54,51,.4);
  color: #f85149;
}

.badge--warning {
  border-color: var(--gold-ring);
  color: var(--gold);
}

/* ── Admin Shell / Tabs ─────────────────────── */

.admin-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-pill);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover { background: rgba(255,255,255,.05); }

.tab-btn--active {
  background: var(--gold-dim);
  border-color: var(--gold-ring);
  color: var(--gold);
  font-weight: 700;
}

/* ── Admin Sections ─────────────────────────── */

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  letter-spacing: .2px;
}

.section-subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── List Block ─────────────────────────────── */

.list-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  transition: border-color .14s ease;
}

.list-row--active {
  border-color: var(--gold-ring);
}

.list-row--inactive { opacity: .45; }

.list-row--highlight {
  border-color: var(--gold-ring);
  background: var(--gold-dim);
}

.list-row-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.list-row-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.list-row-sub {
  font-size: 12px;
  color: var(--muted);
}

.list-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
}

/* ── Detail List ────────────────────────────── */

.detail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.detail-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--stroke);
}

.detail-list li:last-child { border-bottom: none; }

.detail-label { color: var(--muted); font-size: 12px; }

/* ── Player Groups ──────────────────────────── */

.player-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.player-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gold);
  padding: 6px 0 4px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 4px;
}

/* ── Overview / General Screen ─────────────── */

.overview-screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overview-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.overview-email {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.ov-greeting {
  font-size: 13px;
  color: var(--muted);
}

/* ── Ticker ─────────────────────────────────── */

.ticker-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  overflow: hidden;
}

.ticker-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-scroll {
  overflow: hidden;
  flex: 1;
}

.ticker-track {
  display: flex;
  align-items: center;
  animation: ticker-slide 20s linear infinite;
  width: max-content;
}

.ticker-track:hover { animation-play-state: paused; }

.ticker-set {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 100%;
  padding-right: 24px;
}

@keyframes ticker-slide {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text);
}

.ticker-teams {
  font-weight: 600;
}

.ticker-score {
  color: var(--muted);
}

.ticker-pts {
  font-size: 11px;
  color: var(--muted2);
}

.ticker-sep {
  color: var(--stroke3);
  font-size: 14px;
  flex-shrink: 0;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ticker-dot--live {
  background: var(--ok);
  box-shadow: 0 0 4px var(--ok);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.ticker-dot--done { background: var(--gold); }
.ticker-dot--idle { background: var(--muted2); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ── Overview Match Card ────────────────────── */

.ov-match-card {
  padding-bottom: 4px;
}

.ov-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ov-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gold);
}

/* Team vs Team row */
.ov-vs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 12px;
}

.ov-team {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.ov-team--home {
  align-items: flex-start;
}

.ov-team--away {
  align-items: flex-end;
  text-align: right;
}

.ov-team-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.ov-team-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}

.ov-vs {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

/* Match meta: date · time · location */
.ov-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* KPI strip */
.ov-kpi-row {
  display: flex;
  align-items: stretch;
  background: var(--bg3);
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 14px;
}

.ov-kpi {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
}

.ov-kpi-divider {
  width: 1px;
  background: var(--stroke2);
  flex-shrink: 0;
}

.ov-kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.ov-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.ov-kpi-sep {
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
  margin: 0 1px;
}

.ov-kpi-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.ov-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Next match card */
.ov-next-teams {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 4px;
}

/* ── Schedule View ──────────────────────────── */

.sched-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sched-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sched-filter-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.sched-empty-banner {
  background: var(--bg3);
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
}

.sched-week-card {
  cursor: pointer;
  transition: border-color .14s ease;
}

.sched-week-card:hover {
  border-color: var(--gold-ring);
}

.sched-week-card--current {
  border-color: var(--gold-ring);
}

.sched-matches {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.sched-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--stroke2);
}

.sched-match-row:first-child {
  border-top: none;
  padding-top: 0;
}

.sched-match-row--mine {
  padding-left: 8px;
  border-left: 3px solid var(--gold);
  margin-left: -8px;
}

.sched-match-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sched-match-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.sched-vs {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.sched-match-meta {
  font-size: 12px;
  color: var(--muted);
}

/* ── Placeholder Pages ──────────────────────── */

.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  gap: 8px;
  text-align: center;
}

.placeholder-sub {
  font-size: 13px;
  font-weight: 400;
  max-width: 280px;
}

/* ── Tables ─────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  border: 1px solid var(--stroke);
}

.standings-table,
.verify-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
}

.standings-table th,
.verify-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: left;
  color: var(--muted);
  background: var(--bg3);
}

.standings-table td,
.verify-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  font-size: 13px;
  color: var(--text);
}

.standings-table tr:last-child td,
.verify-table tr:last-child td { border-bottom: none; }

.standings-row--mine td { color: var(--gold); font-weight: 700; }
.standings-rank { color: var(--muted); font-size: 12px; }
.standings-team { font-weight: 600; }

.autosave-status {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  min-height: 16px;
  margin-bottom: 6px;
}

.team-email { font-size: 12px; color: var(--muted); }
.team-stat-pos { color: var(--ok); font-weight: 600; }
.team-stat-neg { color: #f85149; font-weight: 600; }

.captain-edit-panel {
  background: var(--bg3);
  border: 1px solid var(--stroke);
  border-top: none;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 0 14px 12px;
  margin-bottom: 8px;
}

.league-logo-display {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  margin-bottom: 10px;
}

.verify-row--mismatch td { background: rgba(218,54,51,.08); color: #f85149; }
.verify-match { text-align: center; font-weight: 700; }

/* ── Match Score Entry ──────────────────────── */

.lineup-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lineup-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.round-block {
  background: var(--bg2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.round-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gold-ring);
}

.round-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gold);
}

.break-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.break-b {
  font-weight: 800;
  color: var(--gold);
}

.round-total-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0 2px;
  margin-top: 8px;
  border-top: 1px solid var(--stroke);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.round-total-hc {
  font-size: 10px;
  font-weight: 400;
  color: var(--gold);
  margin-left: 4px;
}

.round-handicap {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .2px;
}

.game-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.game-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  text-align: center;
  padding-top: 6px;
}

.game-player {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* When game-player is a direct child of game-row (read-only), stretch to fill */
.game-row > .game-player {
  flex: 1;
  min-width: 0;
}

.game-player--home { text-align: right; }
.game-player--away { text-align: left; }

.game-player-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.game-player-col--home { align-items: flex-end; }
.game-player-col--away { align-items: flex-start; }

.sub-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-ring);
  border-radius: 3px;
  padding: 1px 4px;
}

.swap-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 10px;
  font-family: var(--font);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
}
.swap-btn:hover { color: var(--gold); }

.swap-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.swap-modal {
  background: var(--bg2);
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-card);
  padding: 20px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.swap-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.swap-modal-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

.swap-panel-btns {
  display: flex;
  gap: 8px;
}

.btn--sm {
  padding: 7px 14px;
  font-size: 12px;
  width: auto;
}

.btn--ghost {
  background: transparent;
  border-color: var(--stroke2);
  color: var(--muted);
}
.btn--ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--stroke3, var(--stroke2));
  background: rgba(255,255,255,.04);
}

.score-input {
  width: 52px;
  flex-shrink: 0;
  background: var(--bg3);
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  outline: none;
  padding: 6px 8px;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  -moz-appearance: textfield;
  transition: border-color .14s ease, box-shadow .14s ease;
}

.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.score-input:focus {
  border-color: var(--gold-ring);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.score-input:disabled { opacity: .5; }

.game-sep {
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.match-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

/* ── Match Waiting State ────────────────────── */

.match-waiting {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}

.match-waiting-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.match-waiting p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Review Panel ───────────────────────────── */

.review-panel-wrap { margin-bottom: 4px; }

.review-panel {
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-top: none;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Account Dropdown ───────────────────────── */

.account-dropdown {
  position: fixed;
  z-index: 200;
  background: var(--bg2);
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-dropdown-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.account-dropdown-email {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.league-switcher {
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  padding: 8px 0;
  margin: 2px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.league-switcher-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: 4px;
}

.league-switcher-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.league-switcher-btn:hover { background: rgba(255,255,255,.06); }

.league-switcher-btn--active {
  color: var(--gold);
  font-weight: 700;
}

/* ── Score Validation ───────────────────────── */

.score-input--invalid {
  border-color: rgba(218,54,51,.6) !important;
  box-shadow: 0 0 0 3px var(--danger-dim) !important;
}

.score-warn {
  display: block;
  width: 100%;
  font-size: 11px;
  color: #f85149;
  margin-top: 2px;
}

.game-row { flex-wrap: wrap; }

.score-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

/* ── Substitutions ──────────────────────────── */

.sub-section {
  background: var(--bg2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-card);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.sub-section-note {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 36px;
  flex-shrink: 0;
}

.sub-replaces {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.sub-select {
  flex: 1;
  min-width: 100px;
  font-size: 12px;
  padding: 6px 8px;
}

.sub-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 10px;
}

.sub-summary-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.sub-chip {
  font-size: 11px;
  font-weight: 500;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-ring);
  border-radius: 4px;
  padding: 2px 7px;
}

/* ── Utility ────────────────────────────────── */

.text-muted {
  color: var(--muted);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: var(--stroke);
  margin: 12px 0;
}

/* ── PWA Install Prompt ──────────────────────────────────────────────────── */

.install-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 20px);
}

.install-modal {
  background: var(--bg2);
  border: 1px solid var(--stroke2);
  border-radius: var(--radius-card);
  padding: 22px 20px 18px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.install-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.install-modal-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
  line-height: 1.5;
}

.install-steps {
  margin: 0 0 10px 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.install-steps li {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.install-steps strong {
  color: var(--gold);
}

.install-icon {
  font-style: normal;
  color: var(--muted);
}

.install-modal-btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
