/* League hub. Shares the draft room's tokens from styles.css; unlike the
   draft room this page scrolls normally, since standings and rosters are
   read-at-your-own-pace rather than a live board. */

body.league-page { overflow: auto; height: auto; min-height: 100%; display: block; }
body.league-page .topbar { position: sticky; top: 0; z-index: 20; }

.tabs { display: flex; gap: 2px; }

.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }

.league-main { max-width: 1240px; margin: 0 auto; padding: 20px 18px 60px; }

.view-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 10px;
  flex-wrap: wrap;
}
.view-head:first-child { margin-top: 4px; }
.view-head h2 { margin: 0; font-size: 15px; font-weight: 600; }

.hint { color: var(--text-faint); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.hint.pad { padding: 0 12px 8px; margin: 0; line-height: 1.5; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--text-faint);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }

/* ---------- tables ---------- */

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: right;
  padding: 7px 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  text-align: right;
  padding: 8px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.data-table th.tl, .data-table td.tl { text-align: left; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table .name { color: var(--text); font-weight: 600; }
.data-table .strong { color: var(--text); font-weight: 700; }

/* ---------- matchups ---------- */

.matchup-list { display: grid; gap: 12px; }

.matchup {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.matchup-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.matchup-head .side { display: flex; flex-direction: column; gap: 2px; }
.matchup-head .side.away { text-align: right; }
.matchup-head .tname { font-size: 14px; font-weight: 600; }
.matchup-head .towner { font-size: 10px; color: var(--text-faint); }
.matchup-head .score { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.matchup-head .vs { font-size: 10px; color: var(--text-faint); letter-spacing: .1em; }
.matchup.final .winner .score { color: var(--teal); }
.tag {
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  padding: 2px 7px; border-radius: 999px;
  background: var(--panel-2); color: var(--text-faint); border: 1px solid var(--line);
}
.tag.live { color: var(--amber); border-color: var(--amber); }
.tag.pulse { animation: livePulse 2s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .tag.pulse { animation: none; } }
.tag.final { color: var(--teal); border-color: var(--teal); }

.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.lineup { background: var(--panel); padding: 4px 0; }
.lineup-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 12px;
  font-size: 11px;
}
.lineup-row.bench { opacity: .5; }
.lineup-row .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lineup-row .ppts { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- roster / slots ---------- */

.slot-line {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.slot-line:last-child { border-bottom: 0; }
.slot-line:hover { background: var(--panel-2); }
.slot-line.selected { background: rgba(0, 212, 170, .12); box-shadow: inset 2px 0 0 var(--teal); }
.slot-line.target { box-shadow: inset 0 0 0 1px var(--teal); }
.slot-line .pname { font-size: 12px; color: var(--text); }
.slot-line .pname.empty { color: var(--text-faint); font-style: italic; }
.slot-line .meta { font-size: 10px; color: var(--text-faint); }

/* ---------- controls ---------- */

.ctl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.ctl-row:last-child { border-bottom: 0; }
.ctl-row label { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }

.btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
}
.btn:hover { border-color: #2f3a48; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #04231d; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 10px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.text-input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.text-input.tiny { width: 70px; }
.text-input:focus { border-color: #2f3a48; }

/* ---------- scoring editor ---------- */

.sport-block { border-top: 1px solid var(--line); }
.sport-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  flex-wrap: wrap;
}
.sport-block-head .label { font-size: 12px; font-weight: 600; }
.weights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}
.weight { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.weight span { font-size: 10px; color: var(--text-dim); }
.weight input { width: 62px; }

/* ---------- trades ---------- */

.trade-builder { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0; }
.trade-side { border-right: 1px solid var(--line); }
.trade-actions { display: flex; align-items: center; padding: 12px; }

.pick-list { max-height: 260px; overflow: auto; }
.pick-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; font-size: 12px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.pick-item:hover { background: var(--panel-2); }
.pick-item input { accent-color: var(--teal); }

.offer {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px;
}
.offer:last-child { border-bottom: 0; }
.offer .who { color: var(--text); font-weight: 600; }
.offer .arrow { color: var(--text-faint); }

/* ---------- misc lists ---------- */

.txn-list, #waiverList { max-height: 320px; overflow: auto; }

.wv-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.wv-row:last-child { border-bottom: 0; }
.wv-row.mine { background: rgba(0, 212, 170, .1); box-shadow: inset 2px 0 0 var(--teal); }
.wv-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-align: center;
}
.wv-row.mine .wv-rank { color: var(--teal); }
.wv-team { color: var(--text); }
.wv-claims { font-size: 10px; color: var(--amber); }
.txn {
  display: flex; gap: 10px; align-items: baseline;
  padding: 7px 12px; font-size: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.txn:last-child { border-bottom: 0; }
.txn .when { color: var(--text-faint); font-size: 10px; white-space: nowrap; }
.txn .what { color: var(--text-dim); }

.bracket { display: flex; gap: 14px; flex-wrap: wrap; }
.bracket .card { min-width: 250px; margin: 0; }

.empty-note { padding: 22px 14px; text-align: center; color: var(--text-faint); font-size: 12px; }

/* Collapsed by default: if the automation is working nobody should need these,
   and a wall of buttons implies they do. */
.overrides > summary { cursor: pointer; list-style: none; }
.overrides > summary::-webkit-details-marker { display: none; }
.overrides > summary::before { content: '▸ '; color: var(--text-faint); }
.overrides[open] > summary::before { content: '▾ '; }
.overrides > summary:hover { color: var(--text-dim); }

.auto-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.auto-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, .18);
  flex: 0 0 auto;
}
.auto-status.off .dot { background: var(--text-faint); box-shadow: none; }
.auto-status .what { color: var(--text); font-weight: 600; }
.auto-status .when { color: var(--text-faint); font-size: 11px; }

.live-ticker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--text-faint);
  transition: color .3s;
}
.live-ticker.on { color: var(--amber); }
.live-ticker.moved { color: var(--teal); }
.live-ticker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: livePulse 2s ease-in-out infinite;
}

/* A score that just moved flashes once, so a change is noticeable without
   anyone staring at the page. */
.score.bumped { animation: scoreBump .9s ease-out; }
@keyframes scoreBump {
  0%   { color: var(--teal); transform: scale(1.13); }
  100% { color: inherit; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .score.bumped { animation: none; }
  .live-ticker .dot { animation: none; }
}

.champion-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 8px;
  padding: 16px 20px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(0, 212, 170, .14), transparent);
  border: 1px solid var(--teal);
}
.champion-banner .c-crown { font-size: 30px; line-height: 1; }
.champion-banner .c-team { font-size: 17px; font-weight: 700; }
.champion-banner .c-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.lock-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
}
.lock-banner.locked { color: var(--amber); border-color: var(--amber); }
.lock-banner.open { color: var(--teal); border-color: var(--teal); }

/* A locked week must not look editable. */
.roster-locked .slot-line { cursor: not-allowed; opacity: .72; }
.roster-locked .slot-line:hover { background: transparent; }

@media (max-width: 900px) {
  .two-col, .lineups, .trade-builder { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
}
