/* ---------- Tokens ---------- */
:root {
  --bg: #f5f4ee;
  --surface: #ffffff;
  --surface-2: #ece9df;
  --surface-3: #e2ded0;
  --text: #201d16;
  --text-muted: #6b6656;
  --border: #ddd8c8;
  --accent: #c85a1e;
  --accent-hover: #ad4b17;
  --accent-ink: #fffaf4;
  --accent-soft: #f4dfc8;
  --pine: #2f5d4f;
  --pine-soft: #dfe9e2;
  --success: #2f7d4f;
  --success-soft: #ddefe1;
  --warning: #a8791f;
  --warning-soft: #f3e7cc;
  --danger: #b23a2e;
  --danger-soft: #f6dfda;
  --focus-ring: #c85a1e;
  --shadow: 0 1px 2px rgba(32, 29, 22, 0.06), 0 6px 20px -8px rgba(32, 29, 22, 0.18);
  --radius: 10px;
  --radius-sm: 6px;
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1d2023;
    --surface-2: #262a2e;
    --surface-3: #313539;
    --text: #efece3;
    --text-muted: #a5a196;
    --border: #383c40;
    --accent: #e5813f;
    --accent-hover: #f0954f;
    --accent-ink: #17110a;
    --accent-soft: #3c2c1c;
    --pine: #7fb09c;
    --pine-soft: #1e2c27;
    --success: #63bf8b;
    --success-soft: #1c2e24;
    --warning: #d9ac52;
    --warning-soft: #322a17;
    --danger: #e07a6c;
    --danger-soft: #3a2320;
    --focus-ring: #e5813f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1d2023;
  --surface-2: #262a2e;
  --surface-3: #313539;
  --text: #efece3;
  --text-muted: #a5a196;
  --border: #383c40;
  --accent: #e5813f;
  --accent-hover: #f0954f;
  --accent-ink: #17110a;
  --accent-soft: #3c2c1c;
  --pine: #7fb09c;
  --pine-soft: #1e2c27;
  --success: #63bf8b;
  --success-soft: #1c2e24;
  --warning: #d9ac52;
  --warning-soft: #322a17;
  --danger: #e07a6c;
  --danger-soft: #3a2320;
  --focus-ring: #e5813f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset-ish ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Shell ---------- */
.app-shell { max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; }

.site-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 28px 0 20px; flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.brand-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--pine); font-weight: 500;
}
.brand-name {
  font-size: clamp(30px, 5vw, 44px); line-height: 0.98; letter-spacing: 0.01em;
  text-transform: uppercase; color: var(--text);
}
.brand-tagline { color: var(--text-muted); font-size: 14.5px; max-width: 46ch; }

.header-actions { display: flex; align-items: flex-start; gap: 10px; flex-shrink: 0; }

.status-pill, .pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; text-transform: uppercase;
}
.pill-open { background: var(--success-soft); color: var(--success); }
.pill-closed { background: var(--surface-3); color: var(--text-muted); }
.pill-paid { background: var(--success-soft); color: var(--success); }
.pill-pending { background: var(--warning-soft); color: var(--warning); }
.pill-mine { background: var(--accent-soft); color: var(--accent); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.admin-chip {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13.5px;
}
.admin-chip strong { font-weight: 700; }

details.login-box { position: relative; }
details.login-box > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
}
details.login-box > summary::-webkit-details-marker { display: none; }
.login-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 200;
  width: 280px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
@media (max-width: 640px) {
  /* On narrow screens a 280px dropdown anchored to a small button only covers
     part of the hero banner, leaving the title visible around its edges. Pin
     it as a full-width overlay instead so it fully covers whatever's behind it. */
  .login-panel {
    position: fixed; left: 16px; right: 16px; top: 72px;
    width: auto; max-height: calc(100vh - 100px); overflow-y: auto;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13.5px;
  cursor: pointer; transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.06s ease;
  text-decoration: none;
}
.btn:hover { border-color: var(--text-muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn-danger:hover { border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; padding: 6px 8px; }
.btn-small { padding: 6px 11px; font-size: 12.5px; }
.btn-full { width: 100%; }

/* ---------- Info strip ---------- */
.info-strip {
  display: flex; gap: 10px 28px; flex-wrap: wrap; align-items: baseline;
  padding: 14px 18px; margin-bottom: 28px; background: var(--pine-soft);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 13px; color: var(--pine);
}
.info-strip b { font-weight: 600; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) {
  .layout { grid-template-columns: 1.62fr 1fr; }
}
.col-side { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Section headers ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 16px;
}
.section-head h2 {
  font-size: 22px; text-transform: uppercase; letter-spacing: 0.01em;
}
.section-head .count { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 0; }
.card-title {
  font-family: var(--font-display); font-size: 18px; text-transform: uppercase; letter-spacing: 0.01em;
  margin-bottom: 12px;
}
.card-sub { color: var(--text-muted); font-size: 13px; margin-top: -6px; margin-bottom: 12px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="password"], .field textarea, .field select {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; width: 100%; color: var(--text);
}
.field textarea { resize: vertical; min-height: 78px; font-family: inherit; }
.field-hint { font-size: 12px; color: var(--text-muted); }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 12px; }

/* ---------- Feed ---------- */
.feed { display: flex; flex-direction: column; gap: 16px; }
.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.post-photo { width: 100%; height: 100%; max-height: 420px; object-fit: cover; background: var(--surface-2); display: block; }
.post-photos { display: grid; gap: 2px; }
.post-photos-1 { grid-template-columns: 1fr; }
.post-photos-1 .post-photo { max-height: 420px; }
.post-photos-2 { grid-template-columns: 1fr 1fr; }
.post-photos-2 .post-photo { aspect-ratio: 1; max-height: none; }
.post-photos-3plus { grid-template-columns: repeat(3, 1fr); }
.post-photos-3plus .post-photo { aspect-ratio: 1; max-height: none; }
.post-photo-btn { display: block; padding: 0; margin: 0; border: none; background: none; cursor: pointer; overflow: hidden; }
.post-body { padding: 16px 18px; }
.post-meta {
  display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px;
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }
.post-title { font-size: 19px; margin-bottom: 6px; }
.post-text { color: var(--text); white-space: pre-wrap; }
.post-actions { display: flex; justify-content: flex-end; padding: 0 18px 14px; }
.post-delete-confirm { align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.post-meta { flex-wrap: wrap; }
.post-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); letter-spacing: 0.05em;
}
.post-league-tag {
  display: inline-flex; align-items: center; margin-bottom: 8px; font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.03em;
  background: var(--pine-soft); color: var(--pine); border: none; cursor: pointer; text-transform: uppercase;
}
.post-league-tag:hover { text-decoration: underline; }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 50%; background: var(--pine-soft); color: var(--pine);
  font-family: var(--font-mono); font-weight: 500; object-fit: cover; text-transform: uppercase;
}
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.user-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }

/* ---------- Replies ---------- */
.comments-toggle {
  display: block; margin-top: 14px; padding: 0; background: none; border: none; cursor: pointer;
  color: var(--accent); font-weight: 700; font-size: 13.5px;
}
.comments-toggle:hover { text-decoration: underline; }
.replies { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.reply { display: flex; gap: 10px; align-items: flex-start; }
.reply-main { min-width: 0; flex: 1; }
.reply-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.reply-meta strong { color: var(--text); }
.reply-meta .icon-x { margin-left: auto; }
.reply-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.reply-form { display: flex; gap: 8px; margin-top: 14px; }
.reply-form input {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
}

.empty-state {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 32px 20px;
  text-align: center; color: var(--text-muted); font-size: 14px;
}

/* ---------- Roster ---------- */
.table-wrap { overflow-x: auto; }
.roster-list { display: flex; flex-direction: column; gap: 0; }
.roster-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.roster-row:last-child { border-bottom: none; }
.roster-name { font-weight: 700; }
.roster-sub { color: var(--text-muted); font-size: 12.5px; font-family: var(--font-mono); }
.roster-admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 480px; }
.roster-admin-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); padding: 6px 8px; border-bottom: 2px solid var(--text);
}
.roster-admin-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.roster-admin-table tr:last-child td { border-bottom: none; }

/* ---------- Photo picker ---------- */
.photo-picker { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-thumb { position: relative; width: 84px; height: 84px; }
.photo-thumb img {
  width: 100%; height: 100%; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--border);
}
.photo-thumb-remove {
  position: absolute; top: -6px; right: -6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 50%; width: 22px; height: 22px; line-height: 1; box-shadow: var(--shadow);
}

/* ---------- Photo lightbox ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 500; background: rgba(10, 8, 6, 0.92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox-content { max-width: 92vw; max-height: 88vh; }
.lightbox-content img { max-width: 92vw; max-height: 88vh; width: auto; height: auto; display: block; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute; top: 16px; right: 18px; background: rgba(255, 255, 255, 0.12); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.12); border: none;
  color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 24px; cursor: pointer; line-height: 1;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.03em;
}
@media (max-width: 640px) {
  .lightbox-nav { width: 38px; height: 38px; font-size: 20px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); z-index: 50;
}

/* ---------- Misc ---------- */
.muted { color: var(--text-muted); }
.divider { height: 1px; background: var(--border); border: none; margin: 14px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.footer-note { margin-top: 40px; text-align: center; color: var(--text-muted); font-size: 12px; font-family: var(--font-mono); }
.admin-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.admin-list-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
  font-size: 13.5px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.admin-list-row:last-child { border-bottom: none; }
.admin-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  .admin-list-row { flex-direction: column; align-items: flex-start; }
  .admin-row-actions { width: 100%; }
}
.activity-list { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.activity-row { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.activity-row:last-child { border-bottom: none; padding-bottom: 0; }
.activity-when { color: var(--text-muted); font-size: 11.5px; font-family: var(--font-mono); }
.activity-text { color: var(--text); }


/* ---------- Hero header (Cali-Vegas branding) ---------- */
.site-header.hero {
  position: relative;
  border-radius: var(--radius);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 26px 30px;
  gap: 20px;
  margin: 20px 0 28px;
  box-shadow: var(--shadow);
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  border-radius: inherit;
  overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(9,7,5,0.28) 0%, rgba(9,7,5,0.38) 45%, rgba(7,5,4,0.92) 100%),
    url("/hero.jpg");
  background-size: cover;
  background-position: center 26%;
}
.site-header.hero .header-actions { position: relative; z-index: 5; order: 1; align-self: flex-end; }
.site-header.hero .brand { position: relative; z-index: 1; order: 2; }
.site-header.hero .brand-eyebrow { color: #f4b184; }
.site-header.hero .brand-name { color: #fdfaf5; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55); }
.site-header.hero .brand-tagline { color: rgba(255, 255, 255, 0.85); }
.site-header.hero .pill { background: rgba(255, 255, 255, 0.16); color: #fff; }
.site-header.hero .pill-open::before { background: #7fe0a8; }
.site-header.hero .pill-closed::before { background: #e5e1d6; }
.site-header.hero .btn { background: rgba(255, 250, 244, 0.95); border-color: transparent; color: #221a12; }
.site-header.hero .btn:hover { background: #ffffff; }
.site-header.hero .admin-chip { background: rgba(15, 12, 9, 0.6); border-color: rgba(255, 255, 255, 0.25); color: #fff; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@media (max-width: 640px) {
  .site-header.hero { min-height: 230px; padding: 18px 18px 24px; }
}

/* ---------- Leagues, teams, archive (v2) ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
  text-decoration: none; margin-bottom: 16px; cursor: pointer; background: none; border: none; padding: 0;
}
.back-link:hover { color: var(--accent); }

.league-list { display: flex; flex-direction: column; gap: 10px; }
.league-card {
  display: block; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 14px; cursor: pointer; font-family: inherit;
  transition: border-color 0.12s ease;
}
.league-card:hover { border-color: var(--accent); }
.league-card-name { font-family: var(--font-display); font-size: 17px; text-transform: uppercase; margin-bottom: 4px; }
.league-card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }

.upcoming-games-list { display: flex; flex-direction: column; gap: 8px; }
.upcoming-game-row {
  display: block; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; font-family: inherit;
  transition: border-color 0.12s ease;
}
.upcoming-game-row:hover { border-color: var(--text-muted); }
.upcoming-game-row-mine { border-color: var(--accent); background: var(--accent-soft); }
.upcoming-game-teams { font-family: var(--font-display); font-size: 14.5px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.upcoming-game-teams .vs { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); text-transform: none; }
.upcoming-game-meta {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
.upcoming-game-league { color: var(--pine); }

.archive-list { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.archive-card {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 14px; cursor: pointer; font-family: inherit;
}
.archive-card:hover { border-color: var(--text-muted); }
.archive-card-name { font-family: var(--font-display); font-size: 16px; text-transform: uppercase; }
.archive-card-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

.league-head-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px; }
.league-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.league-head-name { font-size: 26px; text-transform: uppercase; }
.league-head-desc { color: var(--text-muted); margin-top: 6px; max-width: 60ch; }
.league-head-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-ended { background: var(--surface-3); color: var(--text-muted); }

.teams-section { margin-top: 28px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.team-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.team-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.team-name { font-family: var(--font-display); font-size: 18px; text-transform: uppercase; }
.team-record { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.wl-stepper { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 12px; }
.wl-stepper button { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; line-height: 1; padding: 0; }
.team-players { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.team-player-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.team-player-row:last-child { border-bottom: none; }
.team-player-tag { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.team-empty { color: var(--text-muted); font-size: 13px; padding: 6px 0; }
.team-add-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.team-add-row select, .team-add-row input { flex: 1; min-width: 110px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 9px; font-size: 13px; color: var(--text); }
.new-team-form { display: flex; gap: 8px; margin-top: 14px; }
.new-team-form input { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }

.confirm-banner {
  background: var(--danger-soft); border: 1px solid var(--danger); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px;
}
.confirm-banner-actions { display: flex; gap: 8px; }

.icon-x { border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; }
.icon-x:hover { color: var(--danger); }

/* ---------- Team rename + schedule/matchups ---------- */
.team-name-row { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.icon-edit { border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 2px 4px; flex-shrink: 0; }
.icon-edit:hover { color: var(--accent); }
.rename-form { display: flex; gap: 6px; flex: 1; }
.rename-form input { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 14px; color: var(--text); }

.schedule-section { margin-top: 28px; }
.matchup-list { display: flex; flex-direction: column; gap: 10px; }
.matchup-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.matchup-row-mine { border-color: var(--accent); background: var(--accent-soft); }
.matchup-teams { font-family: var(--font-display); font-size: 16px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.matchup-teams .vs { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: none; }
.matchup-meta { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.matchup-score { font-family: var(--font-mono); font-size: 15px; font-weight: 600; white-space: nowrap; }
.matchup-score .winner { color: var(--success); }
.matchup-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.score-form { display: flex; gap: 6px; align-items: center; }
.score-form input { width: 52px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; text-align: center; font-family: var(--font-mono); color: var(--text); }
.new-matchup-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; box-shadow: var(--shadow); }
.new-matchup-form .field { margin-bottom: 0; min-width: 130px; }
