:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text2: #8b949e;
  --green: #238636;
  --green-hover: #2ea043;
  --red: #da3633;
  --blue: #1f6feb;
  --gold: #d29922;
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Nav ─────────────────────────────────────────────────────────── */
.nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text2);
  font-size: 14px;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}

.admin-link { color: var(--gold) !important; }

/* ─── Main ─────────────────────────────────────────────────────────── */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--green);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s;
}
.btn-primary:hover { background: var(--green-hover); }
.btn-primary.btn-lg { padding: 12px 28px; font-size: 16px; }

.btn-sm {
  display: inline-block;
  background: var(--bg3);
  color: var(--text) !important;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none !important;
}
.btn-sm:hover { border-color: var(--text2); }

.btn-danger { color: var(--red) !important; border-color: var(--red) !important; }
.btn-admin {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.btn-admin:hover { opacity: .85; }
.btn-admin:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-open   { background: #1f4c1f; color: #7ee787; }
.badge-locked { background: #3d2b00; color: #e3b341; }
.badge-out    { background: #3d1212; color: #f85149; font-size: 11px; }
.you-badge { background: var(--bg3); color: var(--text2); padding: 1px 6px; border-radius: 10px; font-size: 11px; }
.lb-team-name { font-weight: 600; }
.lb-real-name { font-size: 12px; color: var(--text2); margin-left: 4px; }

/* ─── Avatars ──────────────────────────────────────────────────────── */
.avatar    { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 4px; }
.avatar-sm--logo { object-fit: contain; background: var(--surface2); border-radius: 4px; }

/* ─── Hero ─────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #58a6ff, #7ee787);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .5rem;
}
.hero-sub { color: var(--text2); font-size: 1.1rem; margin-bottom: 1.5rem; }

/* ─── Rules strip ──────────────────────────────────────────────────── */
.rules-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.rule-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.rule-icon { font-size: 1.8rem; margin-bottom: .5rem; }
.rule-card strong { display: block; margin-bottom: .25rem; }
.rule-card p { color: var(--text2); font-size: 13px; }

/* ─── Leaderboard ──────────────────────────────────────────────────── */
.leaderboard-table, .leaderboard-full {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lb-header {
  display: grid;
  grid-template-columns: 48px 1fr 100px;
  padding: 10px 16px;
  background: var(--bg3);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text2);
  letter-spacing: .04em;
}
.lb-row {
  display: grid;
  grid-template-columns: 48px 1fr 100px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  align-items: center;
  transition: background .1s;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.lb-row:hover { background: var(--bg3); text-decoration: none; }
.lb-row--me { background: #1a2332 !important; }
.lb-pts { text-align: right; font-weight: 600; color: var(--green); }
.lb-rank { color: var(--text2); font-size: 13px; }
.lb-empty { padding: 2rem; text-align: center; color: var(--text2); }
.link-more { display: block; text-align: center; padding: .75rem; font-size: 13px; border-top: 1px solid var(--border); }
.section { margin-top: 2.5rem; }
.section h2 { margin-bottom: 1rem; font-size: 1.1rem; }

/* ─── Podium ───────────────────────────────────────────────────────── */
@keyframes champion-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20%       { transform: translateY(-22px) rotate(-6deg); }
  40%       { transform: translateY(-18px) rotate(6deg); }
  60%       { transform: translateY(-22px) rotate(-4deg); }
  80%       { transform: translateY(-10px) rotate(3deg); }
}
@keyframes silver-taunt {
  0%, 100%  { transform: translateX(0) rotate(0deg); }
  30%       { transform: translateX(-10px) rotate(-5deg); }
  70%       { transform: translateX(4px) rotate(3deg); }
}
@keyframes bronze-shrug {
  0%, 60%, 100% { transform: rotate(0deg) translateY(0); }
  75%            { transform: rotate(8deg) translateY(-4px); }
  90%            { transform: rotate(-4deg) translateY(-2px); }
}

/* Comic speech bubbles — 20s conversation cycle */
/* Slot 1: visible ~0–6s  (0%–30%) */
@keyframes sb-talk-1 {
  0%    { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
  4%    { opacity:1; transform:translateX(-50%) scale(1)   translateY(0);   }
  26%   { opacity:1; transform:translateX(-50%) scale(1)   translateY(0);   }
  32%   { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
  100%  { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
}
/* Slot 2: visible ~7–13s (35%–65%) */
@keyframes sb-talk-2 {
  0%,33% { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
  37%    { opacity:1; transform:translateX(-50%) scale(1)   translateY(0);   }
  61%    { opacity:1; transform:translateX(-50%) scale(1)   translateY(0);   }
  67%    { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
  100%   { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
}
/* Slot 3: visible ~14–19s (68%–96%) */
@keyframes sb-talk-3 {
  0%,66% { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
  70%    { opacity:1; transform:translateX(-50%) scale(1)   translateY(0);   }
  93%    { opacity:1; transform:translateX(-50%) scale(1)   translateY(0);   }
  97%    { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
  100%   { opacity:0; transform:translateX(-50%) scale(.75) translateY(6px); }
}

.podium-wrap { margin: 2.5rem 0 2rem; }

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  overflow: visible;
}

.podium-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  overflow: visible;
}
.podium-spot:hover { text-decoration: none; }
.podium-spot--me .podium-block { outline: 2px solid var(--blue); outline-offset: 2px; }

.podium-crown      { font-size: 1.6rem; margin-bottom: 2px; }
.podium-dunce      { margin-bottom: 2px; line-height: 0; }
.podium-loser-hat  { margin-bottom: 2px; line-height: 0; }
.podium-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 6px;
  overflow: visible;
}

.podium-spot--1st .podium-figure { animation: champion-bounce 1.4s ease-in-out infinite; }
.podium-spot--2nd .podium-figure { animation: silver-taunt 2.2s ease-in-out infinite; }
.podium-spot--3rd .podium-figure { animation: bronze-shrug 3.5s ease-in-out infinite 0.8s; }

/* Comic speech bubble */
.speech-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scale(.75) translateY(6px);
  transform-origin: bottom center;
  background: #fff;
  color: #111;
  border: 2.5px solid #111;
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  box-shadow: 3px 3px 0 #111;
}
/* Tail: outline layer */
.speech-bubble::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #111;
}
/* Tail: fill layer (covers outline) */
.speech-bubble::before {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  margin-top: -3px;
  border: 7px solid transparent;
  border-top-color: #fff;
  z-index: 1;
}

.sb--1 { animation: sb-talk-1 20s ease-in-out infinite; }
.sb--2 { animation: sb-talk-2 20s ease-in-out infinite; }
.sb--3 { animation: sb-talk-3 20s ease-in-out infinite; }

.podium-av {
  width: 68px; height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}
.podium-av--gold { border-color: var(--gold); box-shadow: 0 0 12px rgba(210,153,34,.5); }
.podium-av--placeholder {
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}
.podium-belt  { margin-top: 4px; }
.belt-svg     { width: 160px; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(201,146,26,.5)); }
.podium-medal { font-size: 1.3rem; margin-top: 3px; }

.podium-label { text-align: center; margin-bottom: 6px; max-width: 110px; }
.podium-name  { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.podium-pts   { font-size: 12px; color: var(--text2); }

.podium-block {
  display: flex; align-items: center; justify-content: center;
  width: 110px;
  font-size: 1.6rem;
  font-weight: 800;
  color: rgba(255,255,255,.7);
  border-radius: var(--radius) var(--radius) 0 0;
}
.podium-block--1 { height: 120px; background: linear-gradient(160deg, #c8a830, #a07020); }
.podium-block--2 { height: 88px;  background: linear-gradient(160deg, #909090, #606060); }
.podium-block--3 { height: 64px;  background: linear-gradient(160deg, #a06030, #7a4020); }

/* ─── Roster detail page ───────────────────────────────────────────── */
.roster-header-row { display: flex; align-items: center; gap: 12px; }
.roster-header-row .avatar { width: 48px; height: 48px; }
.roster-breakdown {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
}
.roster-header {
  display: grid;
  grid-template-columns: 70px 1fr 44px 90px 80px;
  padding: 10px 16px;
  background: var(--bg3);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text2);
  letter-spacing: .04em;
}
.roster-row {
  display: grid;
  grid-template-columns: 70px 1fr 44px 90px 80px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  align-items: center;
  font-size: 14px;
}
.roster-row--eliminated { opacity: .55; }
.roster-row--dropped { opacity: .5; }
.roster-section-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0 .5rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
}
.roster-section-divider::before,
.roster-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.roster-row--hidden { opacity: .5; font-style: italic; }
.roster-row--empty { opacity: .65; border-style: dashed; text-decoration: none; color: inherit; }
.roster-row--empty .roster-slot,
.roster-row--empty .roster-hidden-label { color: #e74c3c; }
.roster-hidden-label { color: var(--text2); font-size: 13px; }
.roster-slot { font-weight: 700; font-size: 12px; color: var(--text2); }
.roster-player { display: flex; align-items: center; gap: 6px; }
.roster-team { display: flex; align-items: center; }
.team-logo-sm { width: 28px; height: 28px; object-fit: contain; }

@media (max-width: 600px) {
  /* Collapse to 3 columns: slot | player+team | mult+pts */
  .roster-header,
  .roster-row {
    grid-template-columns: 44px 1fr auto;
  }
  /* Hide Team and Multiplier header labels on mobile */
  .roster-header span:nth-child(3),
  .roster-header span:nth-child(4) { display: none; }
  /* Hide the separate team cell — team/pos is readable in the player cell */
  .roster-team { display: none; }
  /* Stack multiplier above points in the last cell */
  .roster-mult { display: none; }
  .roster-pts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }
  .roster-pts::before {
    content: attr(data-mult);
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    background: rgba(212,175,55,.15);
    border-radius: 4px;
    padding: 1px 5px;
  }
  .roster-player { font-size: 13px; }
  .roster-player .avatar-sm { width: 28px; height: 28px; }
}
.roster-mult { text-align: center; }
.roster-pts { text-align: right; font-weight: 700; color: var(--green); }

/* ─── Page header ──────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.season-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.season-tab { padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; text-decoration: none; background: var(--bg3); color: var(--text2); border: 1px solid var(--border); transition: background .15s; }
.season-tab:hover { background: var(--bg2); color: var(--text1); }
.season-tab--active { background: var(--blue); color: #fff; border-color: var(--blue); }
.historical-banner { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; margin-bottom: 1.25rem; font-size: 13px; color: var(--text2); }
.page-header h1 { font-size: 1.6rem; font-weight: 700; }
.page-sub { color: var(--text2); font-size: 14px; margin-top: .25rem; display: flex; align-items: center; gap: .5rem; }

/* ─── Picks grid ───────────────────────────────────────────────────── */
.picks-hint {
  background: #1a2332;
  border: 1px solid #1f6feb55;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  color: #58a6ff;
  margin-bottom: 1.25rem;
}

.picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.picks-row { margin-bottom: 1.75rem; }
.picks-row-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text2);
  margin-bottom: .6rem;
}

.pick-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  position: relative;
  transition: border-color .2s;
}
.pick-card:hover { border-color: var(--text2); }
.pick-card--eliminated { opacity: .6; border-color: var(--red) !important; }
.pick-card--locked { border-color: var(--gold) !important; cursor: default; }
.locked-label { font-size: 11px; color: var(--gold); font-weight: 600; margin-top: 2px; }

.schedule-list { display: flex; flex-direction: column; gap: 4px; }
.schedule-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.schedule-time { color: var(--text2); }

.player-item--locked { opacity: .45; cursor: not-allowed; }
.player-item--locked:hover { background: none; }

/* ─── Bracket ──────────────────────────────────────────────────────── */
.bracket {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: start;
}
.bracket-side { display: flex; gap: 1rem; }
.bracket-side--nfc { flex-direction: row-reverse; }
.bracket-conf-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--text2);
  align-self: center;
  padding: 0 4px;
}
.bracket-side--nfc .bracket-conf-label { transform: rotate(180deg); }

.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; flex: 1; min-width: 0; }
.bracket-round-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text2);
  text-align: center;
  margin-bottom: 4px;
}
.bracket-game {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.bracket-game--bye { opacity: .7; }
.bracket-game--sb { border-color: var(--gold); }
.bracket-team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
.bracket-team:first-child { border-bottom: 1px solid var(--border); }
.bracket-team--out { opacity: .4; text-decoration: line-through; }
.bracket-seed { font-size: 10px; color: var(--text2); width: 14px; text-align: center; flex-shrink: 0; }
.bracket-logo { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.bracket-score { font-size: 13px; font-weight: 700; color: var(--text); flex-shrink: 0; min-width: 24px; text-align: right; margin-left: auto; }
.bracket-bye-label { padding: 6px 10px; font-size: 11px; color: var(--text2); text-align: center; }

.bracket-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  padding-top: 2rem;
}
.bracket-sb-label { text-align: center; font-size: 12px; font-weight: 700; color: var(--gold); margin-bottom: 10px; line-height: 1.4; }
.bracket-sb-tbd { color: var(--text2); font-size: 13px; padding: 1rem; }

@media (max-width: 700px) {
  .bracket {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .bracket-side {
    flex-direction: column;
  }
  .bracket-side--nfc {
    flex-direction: column;
  }
  .bracket-conf-label {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    padding: 0;
    margin-bottom: .25rem;
  }
  .bracket-side--nfc .bracket-conf-label {
    transform: none;
  }
  .bracket-center {
    padding-top: 0;
    order: 3;
  }
}

/* ─── Home page "this week" matchup preview (simple cards, not full bracket) ─ */
.matchup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.matchup-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.matchup-team { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.matchup-abbr { font-weight: 700; font-size: 14px; width: 36px; }
.matchup-name { flex: 1; font-size: 13px; }
.matchup-at { text-align: center; color: var(--text2); font-size: 11px; padding: 2px 0; }

.pick-slot-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
  margin-bottom: .5rem;
}

.pick-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.player-headshot {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg3);
}

.pick-info { flex: 1; min-width: 0; }
.pick-player-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-team { font-size: 12px; color: var(--text2); }
.pick-pts { font-size: 14px; font-weight: 700; color: var(--green); margin-top: 2px; }
.multiplier { font-size: 11px; background: var(--gold); color: #000; padding: 1px 5px; border-radius: 10px; font-weight: 700; margin-left: 4px; }
.eliminated-label { font-size: 11px; color: var(--red); font-weight: 600; margin-top: 2px; }

.pick-empty { width: 100%; }
.btn-pick {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text2);
  border-radius: var(--radius);
  padding: 20px 0;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.btn-pick:hover { border-color: var(--blue); color: var(--blue); background: #1f2d40; }
.pick-empty-label { color: var(--text2); font-size: 13px; }

.pick-clear-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.pick-clear-btn:hover { background: var(--bg3); color: var(--red); }

/* ─── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1rem; }
.modal-close { background: none; border: none; color: var(--text2); font-size: 1.2rem; cursor: pointer; }

.modal-search { padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-search input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 14px;
}

.player-list {
  overflow-y: auto;
  flex: 1;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.player-item:hover { background: var(--bg3); }
.player-item img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg3);
}
.player-item-info { flex: 1; }
.player-item-name { font-weight: 500; font-size: 14px; }
.player-item-meta { font-size: 12px; color: var(--text2); }
.player-item-pts { font-size: 13px; font-weight: 600; color: var(--green); text-align: right; }
.player-item-pts-label { display: block; font-size: 10px; font-weight: 400; color: var(--text2); text-transform: uppercase; letter-spacing: .03em; }
.player-item-pts-playoff { display: block; font-size: 11px; color: var(--gold); font-weight: 600; margin-top: 2px; }

.loading { text-align: center; padding: 2rem; color: var(--text2); }

/* ─── Admin ─────────────────────────────────────────────────────────── */
.alert { background: #1a2332; border: 1px solid #1f6feb55; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 1.5rem; font-size: 14px; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.admin-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.admin-card h2 { font-size: 1rem; margin-bottom: .5rem; }
.admin-card p { color: var(--text2); font-size: 13px; margin-bottom: 1rem; }
.admin-card--wide { grid-column: 1 / -1; }
.admin-card--highlight { background: #1a2332; border-color: #1f6feb; }
.btn-admin--primary { background: var(--green); font-weight: 700; }
.btn-admin--primary:hover { background: var(--green-hover); }
.sim-preview { margin: 10px 0; }
.sim-preview-row { font-size: 13px; color: var(--text2); padding: 4px 0; }

.teams-grid { display: flex; flex-direction: column; gap: 6px; }
.team-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg3);
  border-radius: var(--radius);
  font-size: 13px;
}
.team-row--out { opacity: .5; }
.team-abbr { font-weight: 700; width: 36px; flex-shrink: 0; }
.team-name { flex: 1; }

/* ─── Error page ───────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-icon { font-size: 3rem; margin-bottom: 1rem; }
.error-page h1 { margin-bottom: 1.5rem; color: var(--text2); }

/* ─── Roster clickable rows ────────────────────────────────────────── */
.roster-row--clickable { cursor: pointer; transition: background .15s; }
.roster-row--clickable:hover { background: var(--bg3); }

/* ─── Player Stats Modal ───────────────────────────────────────────── */
.stats-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
}
.stats-modal-overlay[hidden] { display: none; }
.stats-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  position: relative;
}
.stats-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--text2);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.stats-modal-close:hover { color: var(--text); }

.stats-player-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 1.25rem;
}
.stats-headshot { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.stats-player-name { font-size: 1.1rem; font-weight: 700; }
.stats-player-meta { font-size: 13px; color: var(--text2); margin-top: 2px; }

.stats-week { margin-bottom: 1.25rem; }
.stats-week-header {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem; margin-bottom: .6rem;
}
.stats-week-name { font-weight: 600; font-size: 14px; }
.stats-week-pts { font-size: 13px; color: var(--text2); }

.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th { color: var(--text2); font-weight: 600; padding: 0 0 4px; text-align: left; }
.stats-table th:nth-child(2),
.stats-table th:nth-child(3) { text-align: right; }
.stats-table td { padding: 3px 0; }
.stat-val { text-align: right; padding-right: 16px; width: 60px; }
.stat-pts { text-align: right; color: var(--green); font-weight: 600; width: 60px; }
.stat-pts.neg { color: #e05c5c; }

.stats-total-row {
  border-top: 1px solid var(--border);
  padding-top: .75rem; margin-top: .5rem;
  text-align: right; font-size: 15px;
}
.stats-na { color: var(--text2); font-size: 13px; font-style: italic; margin: .25rem 0; }
.stats-loading { color: var(--text2); font-size: 13px; text-align: center; padding: 2rem; }

/* ─── Footer ───────────────────────────────────────────────────────── */
.footer { text-align: center; padding: 1.5rem; font-size: 12px; color: var(--text2); border-top: 1px solid var(--border); }

/* ─── League UI ────────────────────────────────────────────────────── */
.league-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1.5rem; }
.league-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface1); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; text-decoration: none; color: inherit; transition: background .15s;
}
.league-card:hover { background: var(--bg3); }
.league-card-name { font-weight: 700; font-size: 16px; flex: 1; }
.league-card-role { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.league-card-arrow { color: var(--text2); font-size: 18px; }
.league-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

.form-card {
  background: var(--surface1); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; max-width: 480px; margin: 0 auto;
}
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-group input { width: 100%; box-sizing: border-box; }
.form-group small { display: block; color: var(--text2); font-size: 12px; margin-top: 4px; }

.manage-section {
  background: var(--surface1); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 24px; margin-bottom: 1.25rem;
}
.manage-section h2 { margin: 0 0 .75rem; font-size: 15px; }
.manage-section h3 { margin: 0 0 .5rem; font-size: 13px; color: var(--text2); }
.invite-url-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; overflow: hidden;
}
.invite-url-box code { font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

.member-list { display: flex; flex-direction: column; gap: 8px; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-info { flex: 1; }

.btn-secondary {
  display: inline-block; padding: 10px 20px; border-radius: 8px; font-weight: 600;
  font-size: 14px; text-decoration: none; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface1); color: var(--text1); transition: background .15s;
}
.btn-secondary:hover { background: var(--bg3); }
.btn-danger { background: #3d1a1a; color: #e05c5c; border-color: #5a2020; }
.btn-danger:hover { background: #5a2020; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 1rem; font-size: 14px; }
.alert--success { background: #1a3d2b; border: 1px solid #2d6b45; color: #4ade80; }
.alert--error   { background: #3d1a1a; border: 1px solid #6b2d2d; color: #f87171; }
