:root {
  --bg:         #080809;
  --surface:    #111114;
  --surface2:   #16161a;
  --surface3:   #1c1c22;
  --border:     #242429;
  --border2:    #2e2e36;
  --fg:         #f0f0f3;
  --fg2:        #9898a8;
  --fg3:        #5a5a6e;
  --accent:     #5b7fff;
  --accent-dim: rgba(91,127,255,.12);
  --green:      #3fcf8e;
  --red:        #f87171;
  --yellow:     #fbbf24;
  /* position colors */
  --qb:  #f87171;
  --rb:  #4ade80;
  --wr:  #60a5fa;
  --te:  #fb923c;
  --k:   #c084fc;
  --def: #94a3b8;
  --flex:#fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
#root {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
button, input, select { font-family: inherit; }
input:focus, select:focus { outline: none; border-color: var(--accent); }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40%            { transform: translateY(-5px); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50%      { opacity: .55; box-shadow: 0 0 2px var(--green); }
}

/* ── Top bar (2-row) ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  flex: 0 0 auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-row1 {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.topbar-row2 {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 20px;
}
.mobile-section-tabs {
  display: none;
}
.brand {
  font-size: 15px; font-weight: 800;
  letter-spacing: -.01em;
  margin-right: 8px;
  white-space: nowrap;
}
.brand .star { color: var(--accent); margin-right: 4px; }
.brand .accent { color: var(--accent); }

.field {
  display: flex; flex-direction: column;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 10px;
  min-width: 0;
}
.field-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0;
  color: var(--fg3);
  line-height: 1;
}
.field input, .field select {
  background: transparent;
  border: none;
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 0 0;
  width: 100%;
  min-width: 60px;
}
.field input:disabled {
  color: var(--fg3);
  cursor: not-allowed;
}
.field-provider select { width: 86px; }
.field-username input { width: 110px; }
.season-glass {
  display: flex;
  flex-direction: column;
  min-width: 126px;
  padding: 6px 8px;
  border: 1px solid rgba(91,127,255,.24);
  border-radius: 14px;
  background:
    radial-gradient(circle at 22% 0%, rgba(91,127,255,.18), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 8px 22px rgba(0,0,0,.18);
  backdrop-filter: blur(14px) saturate(135%);
}
.season-stepper {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}
.season-input {
  width: 56px;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--fg);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  appearance: textfield;
  -moz-appearance: textfield;
}
.season-input::-webkit-outer-spin-button,
.season-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.season-button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  color: var(--fg3);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.season-button:hover {
  color: var(--fg);
  border-color: rgba(91,127,255,.45);
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.week-glass {
  position: relative;
  flex: 999 1 420px;
  min-width: 360px;
  max-width: none;
  padding: 7px 16px 8px;
  border: 1px solid rgba(91,127,255,.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at var(--week-progress) 0%, rgba(63,207,142,.22), transparent 26%),
    linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.025) 48%, rgba(91,127,255,.10));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -1px 0 rgba(255,255,255,.04),
    0 10px 30px rgba(0,0,0,.22),
    0 0 0 1px rgba(255,255,255,.025);
  backdrop-filter: blur(18px) saturate(145%);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.week-glass:hover {
  border-color: rgba(91,127,255,.48);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -1px 0 rgba(255,255,255,.05),
    0 12px 34px rgba(0,0,0,.25),
    0 0 26px rgba(91,127,255,.13);
}
.week-glass::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  opacity: .45;
  pointer-events: none;
}
.week-glass-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}
.week-value {
  color: var(--fg);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.week-slider-wrap {
  position: relative;
}
.week-slider {
  width: 100%;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  display: block;
}
.week-slider:focus { outline: none; }
.week-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent), var(--green)) 0 / var(--week-progress) 100% no-repeat,
    rgba(255,255,255,.09);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: background-size .18s ease;
}
.week-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  margin-top: -6.5px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.62);
  background:
    radial-gradient(circle at 35% 30%, #fff, rgba(255,255,255,.55) 22%, rgba(91,127,255,.8) 54%, var(--accent));
  box-shadow:
    0 0 0 5px rgba(91,127,255,.13),
    0 0 22px rgba(91,127,255,.55),
    0 5px 14px rgba(0,0,0,.38);
  transition: transform .16s ease, box-shadow .16s ease;
}
.week-slider:hover::-webkit-slider-thumb {
  transform: scale(1.08);
  box-shadow:
    0 0 0 7px rgba(91,127,255,.17),
    0 0 30px rgba(91,127,255,.72),
    0 7px 18px rgba(0,0,0,.42);
}
.week-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent), var(--green)) 0 / var(--week-progress) 100% no-repeat,
    rgba(255,255,255,.09);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.week-slider::-moz-range-thumb {
  width: 19px;
  height: 19px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.62);
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(91,127,255,.13), 0 0 22px rgba(91,127,255,.55);
  transition: transform .16s ease, box-shadow .16s ease;
}
.week-slider:hover::-moz-range-thumb {
  transform: scale(1.08);
  box-shadow: 0 0 0 7px rgba(91,127,255,.17), 0 0 30px rgba(91,127,255,.72);
}
.week-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: -1px;
  padding: 0 2px;
}
.week-tick {
  border: none;
  background: transparent;
  color: var(--fg3);
  width: 18px;
  height: 14px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, text-shadow .15s, transform .15s, background .15s;
}
.week-tick:hover,
.week-tick.active {
  color: var(--fg);
  text-shadow: 0 0 12px rgba(91,127,255,.8);
  transform: translateY(-1px);
}
.week-tick.active {
  background: rgba(91,127,255,.18);
}

.spacer { flex: 0 0 0; }

.league-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  min-width: 160px;
  max-width: 240px;
}

.tb-btn {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.tb-btn:hover { background: rgba(91,127,255,.18); }
.tb-btn.secondary {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--fg2);
}
.tb-btn.secondary:hover { color: var(--fg); border-color: var(--fg3); }

.pill-tab {
  background: transparent;
  border: none;
  color: var(--fg3);
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pill-tab.active { background: var(--accent); color: #fff; }
.pill-tab:hover:not(.active) { color: var(--fg2); background: var(--surface2); }
.mobile-section-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--fg3);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}
.mobile-section-tab.active {
  background: linear-gradient(135deg, var(--accent), rgba(63,207,142,.88));
  border-color: rgba(255,255,255,.16);
  color: #fff;
  box-shadow: 0 8px 24px rgba(91,127,255,.20);
}

/* ── 3-col board ── */
.board {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  flex: 1 1 auto;
  min-height: 0;
}
.col-left, .col-right {
  display: flex; flex-direction: column;
  padding: 14px;
  overflow: hidden;
  min-height: 0;
}
.col-left { border-right: 1px solid var(--border); }
.col-right {
  position: sticky;
  top: var(--topbar-height, 0px);
  height: calc(100vh - var(--topbar-height, 0px));
  border-left: 1px solid var(--border);
}
.col-center {
  padding: 16px;
  overflow-y: auto;
  min-height: 0;
}

/* ── Left column: search + standings ── */
.search {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  margin-bottom: 10px;
}
.search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--fg);
  font-size: 12px;
}
.search input::placeholder { color: var(--fg3); }

.league-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--surface2);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.stat-card .num {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}
.stat-card .label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg3);
  margin-top: 2px;
}
.stat-card.teams .num  { color: var(--accent); }
.stat-card.week .num   { color: var(--yellow); }
.stat-card.format .num { color: var(--green); }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--fg3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 8px;
}
.section-count {
  background: var(--surface3);
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 10px;
  color: var(--fg2);
  letter-spacing: 0;
}

.members {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.member:hover { background: var(--surface2); }
.member.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.member .rank {
  font-size: 10px;
  font-weight: 700;
  color: var(--fg3);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.member .rank.top { color: var(--yellow); }
.member-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.member-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member.active .member-name { color: var(--accent); }
.member-name .me-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 8px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 1px 5px;
  border-radius: 99px;
  vertical-align: middle;
  letter-spacing: .04em;
}
.winbar {
  height: 3px;
  border-radius: 99px;
  background: var(--surface3);
  overflow: hidden;
}
.winbar-fill { height: 100%; border-radius: 99px; }
.member-points {
  font-size: 10px;
  color: var(--fg3);
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

/* ── Initials avatar ── */
.avatar {
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; border-width: 1.5px; border-style: solid; }
.avatar-lg { width: 38px; height: 38px; font-size: 13px; border-width: 1.5px; border-style: solid; }

/* ── Center column: roster ── */
.team-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.team-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.team-pills {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.team-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.team-pill.record { background: rgba(63,207,142,.12); color: var(--green); }
.team-pill.rank   { background: var(--surface3); color: var(--fg3); }
.team-pill.points { background: var(--accent-dim); color: var(--accent); }
.team-header-right {
  margin-left: auto;
  text-align: right;
}
.team-header-right .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--fg3);
}
.team-header-right .value {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}
.team-header-right .subvalue {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.pos-overview {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pos-chip {
  padding: 6px 10px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  min-height: 31px;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .12s;
}
.pos-chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.pos-chip.active {
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.pos-chip.all .pos,
.pos-chip.active .pos {
  color: var(--accent);
}
.pos-chip .pos {
  font-size: 10px;
  font-weight: 700;
}
.pos-chip .depth {
  font-size: 9px;
  font-weight: 700;
  color: var(--fg3);
  background: var(--surface3);
  padding: 1px 5px;
  border-radius: 99px;
}

/* ── Player cards ── */
.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 15px;
  border-radius: 11px;
  margin-bottom: 5px;
  position: relative;
  overflow: hidden;
}
.player-card.starter {
  background: var(--surface2);
  border: 1px solid var(--border2);
}
.player-card.bench, .player-card.taxi {
  background: var(--surface);
  border: 1px solid var(--border);
}
.pos-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 11px 0 0 11px;
}
.pos-badge {
  width: 32px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.player-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.player-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-meta {
  font-size: 11px;
  color: var(--fg3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.value-badge {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}
.proj-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  flex-shrink: 0;
  font-size: 11px;
}
.player-compare-btn {
  flex-shrink: 0;
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--fg2);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.player-compare-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.player-compare-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.proj-cell .row {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}
.proj-cell .label { color: var(--fg2); }
.proj-cell .wk    { color: var(--green); font-weight: 700; }
.proj-cell .ros   { color: #60a5fa; font-weight: 700; }

/* ── Pick chips ── */
.pick-row {
  display: flex;
  flex-wrap: wrap;
}
.pick-chip {
  display: inline-flex;
  flex-direction: column;
  padding: 5px 10px;
  border-radius: 8px;
  margin: 0 5px 5px 0;
  min-width: 78px;
}
.pick-chip.own {
  background: rgba(63,207,142,.08);
  border: 1px solid rgba(63,207,142,.25);
  color: var(--green);
}
.pick-chip.traded {
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.25);
  color: var(--yellow);
}
.pick-chip .pri  { font-size: 11px; font-weight: 700; }
.pick-chip .sub  { font-size: 9px; color: var(--fg3); margin-top: 1px; }

/* ── Matchup cards ── */
.matchup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.matchup-card.selected {
  background: var(--surface2);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 4px 24px rgba(91,127,255,.08);
}
.matchup-header { padding: 12px 14px; }
.your-matchup-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.your-matchup-label::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--accent);
}
.matchup-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.matchup-card-top .your-matchup-label {
  margin-bottom: 0;
}
.matchup-outlook-btn {
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--fg2);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.matchup-outlook-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.matchup-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}
.matchup-side .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.matchup-side .total {
  font-size: 22px;
  font-weight: 800;
  margin-top: 2px;
  color: var(--fg);
}
.matchup-side.right { text-align: right; }
.matchup-side .total.win { color: var(--green); }
.vs-divider { text-align: center; }
.vs-divider .vs {
  font-size: 10px;
  font-weight: 800;
  color: var(--fg3);
  letter-spacing: .1em;
}
.vs-divider .delta {
  font-size: 9px;
  color: var(--fg3);
  margin-top: 2px;
}
.winprob {
  margin-top: 4px;
}
.winprob-bar {
  height: 5px;
  border-radius: 99px;
  background: var(--surface3);
  overflow: hidden;
}
.winprob-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 99px;
  transition: width .25s;
}
.winprob-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 9px;
  color: var(--fg3);
  font-weight: 600;
}

.matchup-toggle {
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--fg3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
}
.matchup-toggle:hover { color: var(--fg2); background: var(--surface2); }

.starters-grid {
  padding: 8px 12px 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.starter-row {
  padding: 5px 8px;
  border-radius: 7px;
  margin-bottom: 3px;
  background: var(--surface3);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.starter-row.winning { border-color: rgba(63,207,142,.2); }
.starter-row .pos {
  font-size: 9px;
  font-weight: 700;
  width: 22px;
  flex-shrink: 0;
}
.starter-row .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.starter-row .proj {
  font-weight: 700;
  font-size: 11px;
  color: var(--fg2);
  flex-shrink: 0;
}
.starter-row.winning .proj { color: var(--green); }

/* ── Right column: chat ── */
.chat-header { margin-bottom: 12px; }
.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
.chat-subtitle {
  font-size: 11px;
  color: var(--fg3);
  margin-top: 2px;
}

.quick-chips {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.quick-chip {
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--fg2);
  cursor: pointer;
  white-space: nowrap;
}
.quick-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chatlog-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.chatlog {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
  scroll-behavior: smooth;
}
.player-card.clickable {
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.player-card.clickable:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.04);
}
.player-card.clickable:focus-visible {
  outline: 2px solid rgba(120, 180, 255, 0.6);
  outline-offset: 2px;
}
.player-card.skeleton {
  pointer-events: none;
  opacity: 0.85;
}
.skeleton-shimmer {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.skeleton-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.jump-to-bottom {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(30, 30, 40, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: jumpToBottomFade 0.18s ease-out;
}
.jump-to-bottom:hover {
  background: rgba(40, 40, 55, 1);
}
@keyframes jumpToBottomFade {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  gap: 3px;
}
.msg.user      { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; align-items: flex-start; }
.msg-role {
  font-size: 9px;
  font-weight: 700;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.msg-body {
  padding: 9px 13px;
  font-size: 12.5px;
  line-height: 1.55;
}
.msg.user .msg-body {
  background: var(--accent);
  color: #fff;
  border-radius: 14px 14px 3px 14px;
}
.msg.assistant .msg-body {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 3px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--fg3);
  animation: bounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }

.chatin {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.chatin input {
  flex: 1;
  border-radius: 99px;
  background: var(--surface3);
  border: 1px solid var(--border2);
  padding: 9px 14px;
  color: var(--fg);
  font-size: 12.5px;
}
.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.send-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Markdown in chat ── */
.msg-body p  { margin: 0 0 6px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body ul, .msg-body ol { margin: 4px 0 6px; padding-left: 18px; }
.msg-body li { margin: 2px 0; }
.msg-body code {
  background: rgba(255,255,255,.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.msg-body pre {
  background: rgba(0,0,0,.35);
  padding: 8px 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 11px;
}
.msg.user .msg-body strong { color: #fff; }
.msg-body strong { color: var(--fg); }
.msg-body a { color: #74d7ff; }
.msg-body h1,.msg-body h2,.msg-body h3 {
  font-size: 13px; margin: 6px 0 3px; font-weight: 700;
}

/* ── Generic helpers ── */
.small { color: var(--fg3); font-size: 11px; }
.soft-error {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(248,113,113,.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(248,113,113,.10), rgba(255,255,255,.025));
  color: var(--fg2);
  font-size: 12px;
  line-height: 1.6;
}
.soft-error-title {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.soft-error-action {
  margin-top: 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.input, .select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 22px;
  width: 100%;
  max-width: 660px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-close {
  background: var(--surface3); border: none; color: var(--fg2);
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--border2); color: var(--fg); }
.analysis-modal {
  max-width: 680px;
}
.analysis-modal-title {
  font-size: 16px;
  font-weight: 800;
}
.analysis-modal-subtitle {
  color: var(--fg3);
  font-size: 11px;
  margin-top: 2px;
}
.analysis-modal-body {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg2);
  font-size: 13px;
  line-height: 1.65;
  max-height: min(60vh, 560px);
  overflow-y: auto;
  padding: 14px 16px;
}
.analysis-modal-body p {
  margin: 0 0 10px;
}
.analysis-modal-body p:last-child {
  margin-bottom: 0;
}
.analysis-modal-body ul,
.analysis-modal-body ol {
  margin: 8px 0 10px;
  padding-left: 20px;
}
.analysis-modal-body strong {
  color: var(--fg);
}
.analysis-modal-loading {
  color: var(--fg3);
  margin-top: 10px;
}

.trade-side-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; margin-bottom: 8px; padding: 3px 8px;
  border-radius: 6px; display: inline-block;
}
.trade-side-label.give    { background: rgba(248,113,113,.08); color: var(--red); }
.trade-side-label.receive { background: rgba(63,207,142,.08);  color: var(--green); }

.trade-suggestion-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.trade-suggestion-card:hover { border-color: var(--accent); }

@media (max-width: 1040px) {
  .topbar-row1 {
    flex-wrap: wrap;
  }

  .week-glass {
    order: 2;
    flex-basis: 100%;
    max-width: none;
  }
}

@media (max-width: 820px) {
  html, body, #root {
    height: auto;
    min-height: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .topbar {
    position: relative;
  }

  .topbar-row1 {
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .brand {
    flex: 1 0 100%;
    margin-right: 0;
    font-size: 17px;
  }

  .field {
    flex: 1 1 calc(50% - 8px);
    padding: 7px 10px;
  }

  .field input,
  .field select,
  .field-provider select,
  .field-username input,
  .season-input {
    width: 100%;
    min-width: 0;
    font-size: 13px;
  }

  .season-glass {
    flex: 1 1 calc(50% - 8px);
  }

  .week-glass {
    order: 3;
    flex: 1 0 100%;
    min-width: 0;
    padding: 10px 12px;
  }

  .week-tick {
    width: 15px;
    font-size: 7.5px;
  }

  .spacer {
    display: none;
  }

  .league-select {
    flex: 1 0 100%;
    max-width: none;
    min-width: 0;
    padding: 10px 12px;
  }

  .tb-btn {
    flex: 1 1 calc(50% - 8px);
    padding: 9px 10px;
  }

  .topbar-row2 {
    padding: 8px 12px;
    overflow-x: auto;
  }

  .pill-tab {
    flex: 1;
  }

  .mobile-section-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px 12px 10px;
    border-top: 1px solid rgba(255,255,255,.04);
    background:
      radial-gradient(circle at 50% 0%, rgba(91,127,255,.12), transparent 45%),
      var(--bg);
  }

  .board {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  .board.mobile-league .col-center,
  .board.mobile-league .col-right,
  .board.mobile-team .col-left,
  .board.mobile-team .col-right,
  .board.mobile-advisor .col-left,
  .board.mobile-advisor .col-center {
    display: none;
  }

  .col-left,
  .col-center,
  .col-right {
    width: 100%;
    min-height: auto;
    overflow: visible;
  }

  .col-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .members {
    max-height: 260px;
    overflow-y: auto;
  }

  .col-center {
    order: 2;
    padding: 14px 12px 18px;
  }

  .col-right {
    order: 3;
    position: relative;
    top: auto;
    height: min(72vh, 620px);
    border-left: none;
    border-top: 1px solid var(--border);
    background:
      radial-gradient(circle at 90% 0%, rgba(91,127,255,.12), transparent 34%),
      var(--bg);
  }

  .chatlog {
    max-height: none;
  }

  .team-header {
    align-items: flex-start;
  }

  .team-header-right {
    margin-left: 0;
    width: 100%;
    text-align: left;
  }

  .player-card {
    align-items: flex-start;
  }

  .proj-cell {
    min-width: 58px;
  }

  .starters-grid,
  .modal > div[style*='grid-template-columns'],
  .trade-suggestion-card div[style*='grid-template-columns'] {
    grid-template-columns: 1fr !important;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .modal {
    max-height: 92vh;
    border-radius: 18px;
    padding: 18px;
  }
}

@media (max-width: 460px) {
  .field {
    flex-basis: 100%;
  }

  .tb-btn {
    flex-basis: 100%;
  }

  .week-ticks {
    gap: 0;
  }

  .week-tick {
    width: 13px;
    font-size: 7px;
  }

  .matchup-grid {
    gap: 8px;
  }

  .msg {
    max-width: 94%;
  }
}

/* === Landing overlay === */
.landing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.78);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: landingFadeIn 0.25s ease-out;
}
@keyframes landingFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.landing-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: linear-gradient(180deg, #181a26 0%, #131520 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.landing-hero {
  text-align: center;
  margin-bottom: 14px;
}
.landing-brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.landing-brand .star {
  color: #ffcb47;
  margin-right: 6px;
}
.landing-brand .accent {
  background: linear-gradient(90deg, #7aa2ff, #b87aff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 4px;
}
.landing-tagline {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}
.landing-steps {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  gap: 8px;
}
.landing-steps li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.landing-steps li.active {
  border-color: rgba(122, 162, 255, 0.5);
  background: rgba(122, 162, 255, 0.08);
  color: #fff;
}
.landing-steps li.done {
  border-color: rgba(120, 220, 160, 0.4);
  background: rgba(120, 220, 160, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.landing-steps li.done .step-num {
  background: rgba(120, 220, 160, 0.3);
  color: #fff;
}
.landing-steps li.active .step-num {
  background: rgba(122, 162, 255, 0.3);
  color: #fff;
}
.landing-step {
  margin-bottom: 12px;
  transition: opacity 0.2s ease;
}
.landing-step.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.landing-step-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
}
.landing-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.landing-step-row .landing-step-title {
  margin-bottom: 0;
}
.season-chip-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.season-chip,
.season-chip-step {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  height: 30px;
  font-weight: 800;
  transition: all 0.15s ease;
}
.season-chip {
  font-size: 11px;
  min-width: 48px;
  padding: 0 9px;
}
.season-chip-step {
  font-size: 14px;
  width: 30px;
}
.season-chip:hover,
.season-chip-step:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}
.season-chip.selected {
  background: rgba(122, 162, 255, 0.12);
  border-color: rgba(122, 162, 255, 0.65);
  color: #fff;
}
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.sport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 6px;
}
.sport-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  min-height: 34px;
  padding: 7px 8px;
  text-align: left;
  transition: all 0.15s ease;
}
.sport-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}
.sport-card.selected {
  background: rgba(122, 162, 255, 0.12);
  border-color: rgba(122, 162, 255, 0.65);
}
.sport-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  width: 18px;
  flex-shrink: 0;
}
.sport-name {
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.provider-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s ease;
}
.provider-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}
.provider-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.provider-card:disabled:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
.provider-card.selected {
  border-color: rgba(122, 162, 255, 0.7);
  background: rgba(122, 162, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.15);
}
.provider-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.provider-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.landing-input-row {
  display: flex;
  gap: 8px;
}
.landing-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}
.landing-input:focus {
  border-color: rgba(122, 162, 255, 0.6);
}
.landing-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.landing-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}
.landing-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.landing-btn.primary {
  background: linear-gradient(90deg, #7aa2ff, #b87aff);
  border: none;
  margin-top: 10px;
  width: 100%;
  padding: 12px;
  font-weight: 600;
}
.landing-btn.primary:hover:not(:disabled) {
  filter: brightness(1.1);
}
.league-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(188px, 30vh);
  overflow-y: auto;
  margin-bottom: 4px;
}
.league-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  transition: all 0.12s ease;
}
.landing-submit {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  box-shadow: 0 -10px 20px rgba(19,21,32,.86);
}
.league-card:hover {
  background: rgba(255, 255, 255, 0.06);
}
.league-card.selected {
  border-color: rgba(122, 162, 255, 0.7);
  background: rgba(122, 162, 255, 0.1);
}
.landing-help {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  padding: 8px 0;
}
.landing-error {
  font-size: 13px;
  color: #ff8a8a;
  padding: 8px 12px;
  background: rgba(255, 90, 90, 0.08);
  border: 1px solid rgba(255, 90, 90, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
}

.info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border-radius: 50%;
  background: rgba(122, 162, 255, 0.18);
  color: #7aa2ff;
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  cursor: help;
  position: relative;
  vertical-align: middle;
  transition: background 0.15s ease;
}
.info-tooltip:hover,
.info-tooltip:focus {
  background: rgba(122, 162, 255, 0.32);
  outline: none;
}
.info-tooltip-bubble {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: #1a1c28;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.55;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.info-tooltip-bubble strong {
  color: #fff;
  display: block;
  margin-bottom: 4px;
}
.info-tooltip-bubble em {
  color: #7aa2ff;
  font-style: normal;
}
.info-tooltip:hover .info-tooltip-bubble,
.info-tooltip:focus .info-tooltip-bubble {
  display: block;
}

.chat-clear-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-clear-btn:hover {
  background: rgba(255, 90, 90, 0.1);
  border-color: rgba(255, 90, 90, 0.3);
  color: #ff8a8a;
}
.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-limit {
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.4);
}
.chat-limit.low {
  color: #fbbf24;
}
.starters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.waivers-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.optimize-btn {
  background: linear-gradient(90deg, rgba(122, 162, 255, 0.18), rgba(184, 122, 255, 0.18));
  border: 1px solid rgba(122, 162, 255, 0.35);
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.optimize-btn:hover:not(:disabled) {
  background: linear-gradient(90deg, rgba(122, 162, 255, 0.28), rgba(184, 122, 255, 0.28));
  border-color: rgba(122, 162, 255, 0.5);
  transform: translateY(-1px);
}
.optimize-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.optimize-btn.secondary {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--fg2);
}
.draft-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.draft-live-strip,
.draft-recent,
.draft-order-panel {
  border: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
}
.draft-order-panel {
  display: grid;
  gap: 8px;
}
.draft-order-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.draft-order-summary > div {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
}
.draft-order-label {
  color: var(--fg3);
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 3px;
}
.draft-order-primary {
  color: var(--fg);
  font-size: 13px;
  font-weight: 800;
}
.draft-turn-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.draft-turn-chip {
  display: grid;
  gap: 2px;
  min-width: 122px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 8px;
  background: var(--surface);
}
.draft-turn-chip.current {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.draft-turn-chip.mine {
  border-color: rgba(63, 207, 142, .55);
  background: rgba(63, 207, 142, .10);
}
.draft-turn-chip span,
.draft-turn-chip em {
  color: var(--fg3);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.draft-turn-chip strong {
  color: var(--fg);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.draft-live-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--fg3);
}
.draft-undo-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg2);
  border-radius: 99px;
  padding: 3px 8px;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.draft-recent-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg3);
  margin-bottom: 6px;
}
.draft-pick-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.draft-pick-chip {
  display: grid;
  gap: 2px;
  min-width: 112px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface);
}
.draft-pick-chip span,
.draft-pick-chip em {
  font-size: 10px;
  color: var(--fg3);
  font-style: normal;
}
.draft-pick-chip strong {
  font-size: 11px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.draft-board {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.draft-table-head,
.draft-player-row {
  display: grid;
  grid-template-columns: 28px minmax(150px, 1.7fr) 42px 46px 48px 54px 54px 32px;
  align-items: center;
  gap: 6px;
  min-width: 620px;
}
.draft-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 7px 8px;
  color: var(--fg3);
  font-size: 10px;
  font-weight: 800;
}
.draft-player-row {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.draft-player-row:last-child {
  border-bottom: none;
}
.draft-player-row:hover {
  background: var(--surface2);
}
.draft-player-row.selected {
  background: var(--accent-dim);
}
.draft-rank {
  color: var(--fg3);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.draft-player-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.draft-player-name,
.draft-compare-link {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.draft-player-name {
  color: var(--fg);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-compare-link {
  color: var(--fg3);
  font-size: 10px;
  font-weight: 700;
}
.draft-compare-link:hover,
.draft-player-name:hover {
  color: var(--accent);
}
.draft-pos,
.draft-team,
.draft-stat,
.draft-fit {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-pos {
  font-weight: 900;
}
.draft-team {
  color: var(--fg3);
}
.draft-stat {
  font-variant-numeric: tabular-nums;
}
.draft-fit {
  justify-self: start;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--fg3);
}
.draft-fit.need {
  color: var(--green);
  background: rgba(63, 207, 142, .12);
}
.draft-mark-btn {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--fg2);
  border-radius: 7px;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.draft-mark-btn:hover,
.draft-undo-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.yahoo-connected-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}
.landing-btn.small {
  padding: 4px 10px;
  font-size: 12px;
}

/* === Light mode === */
html[data-theme="light"] {
  --bg:         #f6f7fb;
  --surface:    #ffffff;
  --surface2:   #f0f1f5;
  --surface3:   #e7e9ef;
  --border:     #dcdee6;
  --border2:    #c7cad4;
  --fg:         #14151a;
  --fg2:        #50535e;
  --fg3:        #8a8d99;
  --accent:     #4863e5;
  --accent-dim: rgba(72,99,229,.10);
  --green:      #15a472;
  --red:        #d94545;
  --yellow:     #c89800;
  --qb:  #d94545;
  --rb:  #129a4d;
  --wr:  #2563d6;
  --te:  #d97400;
  --k:   #8e3fce;
  --def: #56607a;
  --flex:#c89800;
}

html[data-theme="light"] body {
  background: var(--bg);
  color: var(--fg);
}

/* Glass surfaces in topbar — soften gradients on light bg */
html[data-theme="light"] .season-glass,
html[data-theme="light"] .week-glass {
  background:
    radial-gradient(circle at 22% 0%, rgba(72,99,229,.10), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.85), rgba(72,99,229,.04));
  border-color: rgba(72,99,229,.25);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    0 6px 18px rgba(40,50,90,.06);
}
html[data-theme="light"] .season-input {
  color: var(--fg);
}
html[data-theme="light"] .season-button {
  background: rgba(72,99,229,.06);
  border-color: rgba(72,99,229,.16);
  color: var(--fg2);
}
html[data-theme="light"] .season-button:hover {
  background: rgba(72,99,229,.11);
  border-color: rgba(72,99,229,.35);
  color: var(--accent);
}
html[data-theme="light"] .week-slider::-webkit-slider-runnable-track {
  background:
    linear-gradient(90deg, var(--accent), var(--green)) 0 / var(--week-progress) 100% no-repeat,
    rgba(20,30,60,.08);
  box-shadow: inset 0 0 0 1px rgba(20,30,60,.06);
}
html[data-theme="light"] .week-slider::-webkit-slider-thumb {
  border: 1px solid rgba(72,99,229,.7);
  background:
    radial-gradient(circle at 35% 30%, #fff, rgba(255,255,255,.85) 22%, rgba(72,99,229,.7) 54%, var(--accent));
  box-shadow:
    0 0 0 4px rgba(72,99,229,.10),
    0 0 14px rgba(72,99,229,.30),
    0 4px 10px rgba(40,50,90,.18);
}

/* Landing card */
html[data-theme="light"] .landing-overlay {
  background: rgba(240, 242, 250, 0.78);
}
html[data-theme="light"] .landing-card {
  background: linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(40,50,90,0.18);
}
html[data-theme="light"] .landing-tagline,
html[data-theme="light"] .landing-help,
html[data-theme="light"] .landing-step-title {
  color: var(--fg2);
}
html[data-theme="light"] .provider-card,
html[data-theme="light"] .sport-card,
html[data-theme="light"] .league-card,
html[data-theme="light"] .landing-input,
html[data-theme="light"] .season-chip,
html[data-theme="light"] .season-chip-step {
  background: #fff;
  color: var(--fg);
  border-color: var(--border);
}
html[data-theme="light"] .provider-card:hover,
html[data-theme="light"] .sport-card:hover,
html[data-theme="light"] .league-card:hover,
html[data-theme="light"] .season-chip:hover,
html[data-theme="light"] .season-chip-step:hover {
  background: var(--surface2);
}
html[data-theme="light"] .provider-card.selected,
html[data-theme="light"] .sport-card.selected,
html[data-theme="light"] .league-card.selected,
html[data-theme="light"] .season-chip.selected {
  background: rgba(72,99,229,.08);
  border-color: rgba(72,99,229,.55);
  color: var(--accent);
}
html[data-theme="light"] .sport-name {
  color: var(--fg);
}
html[data-theme="light"] .landing-btn {
  background: var(--surface2);
  color: var(--fg);
  border-color: var(--border);
}
html[data-theme="light"] .landing-btn:hover:not(:disabled) {
  background: var(--surface3);
}
html[data-theme="light"] .landing-submit {
  box-shadow: 0 -10px 20px rgba(246,247,251,.92);
}
html[data-theme="light"] .landing-steps li {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--fg2);
}
html[data-theme="light"] .info-tooltip-bubble {
  background: #fff;
  color: var(--fg);
  border-color: var(--border);
  box-shadow: 0 12px 30px rgba(40,50,90,0.18);
}
html[data-theme="light"] .info-tooltip-bubble strong { color: var(--fg); }

/* Chat */
html[data-theme="light"] .msg.user .msg-body {
  background: var(--accent);
  color: #fff;
}
html[data-theme="light"] .msg.assistant .msg-body {
  background: var(--surface2);
  color: var(--fg);
}
html[data-theme="light"] .jump-to-bottom {
  background: rgba(255,255,255,0.95);
  color: var(--fg);
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(40,50,90,0.18);
}
html[data-theme="light"] .jump-to-bottom:hover {
  background: var(--surface2);
}

/* Skeleton shimmer on light bg */
html[data-theme="light"] .skeleton-shimmer {
  background: rgba(20,30,60,.06);
}
html[data-theme="light"] .skeleton-shimmer::after {
  background: linear-gradient(90deg, transparent 0%, rgba(20,30,60,.10) 50%, transparent 100%);
}

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--fg2);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.starters-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-card.compare-pick {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: var(--accent-dim);
}
.compare-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 4px 3px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.compare-pill-x {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
}
.compare-pill-x:hover { opacity: 1; }
