/* ---------- theme tokens ---------- */
:root {
  /* Team colors are set from JS (team.js) when a team is chosen. */
  --hero: linear-gradient(135deg, var(--team-hero, #17305c) 0%, var(--team-hero-2, #0e1f3d) 100%);

  --bg: #edf2f8;
  --bg-accent: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, #edf2f8) 0%, #edf2f8 260px);
  --surface: #ffffff;
  --surface-2: #f3f7fb;
  --border: #d7e1ee;
  --text: #10233d;
  --muted: #5d7190;
  --accent: var(--team-light, #1f4b99);
  --accent-text: #ffffff;
  --win: #1d9a5f;
  --loss: #d3363c;
  --live: #e0552b;
  --shadow: 0 1px 2px rgba(16, 35, 61, 0.06), 0 8px 24px -12px rgba(16, 35, 61, 0.18);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1626;
    --bg-accent: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, #0b1626) 0%, #0b1626 280px);
    --surface: #12213a;
    --surface-2: #182b48;
    --border: #23395c;
    --text: #e6edf7;
    --muted: #97a9c4;
    --accent: var(--team-dark, #5b9cff);
    --accent-text: var(--team-dark-text, #08192e);
    --win: #4ccb8f;
    --loss: #f27676;
    --live: #ff8a5b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1626;
  --bg-accent: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, #0b1626) 0%, #0b1626 280px);
  --surface: #12213a;
  --surface-2: #182b48;
  --border: #23395c;
  --text: #e6edf7;
  --muted: #97a9c4;
  --accent: var(--team-dark, #5b9cff);
  --accent-text: var(--team-dark-text, #08192e);
  --win: #4ccb8f;
  --loss: #f27676;
  --live: #ff8a5b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-accent), var(--bg);
  background-color: var(--bg);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; line-height: 1.15; }
.standings { margin: 2px 0 0; font-size: 13.5px; }
.standings b { color: var(--text); font-weight: 650; }
.standings .sep { opacity: .5; margin: 0 6px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.link-btn[hidden] { display: none; }
.side-filter { display: flex; gap: 4px; padding: 10px 16px 0; }
.side-filter button {
  padding: 3px 11px; border-radius: 999px; border: 1px solid var(--border); background: transparent;
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.side-filter button[aria-pressed="true"] { background: var(--surface-2); border-color: var(--accent); color: var(--text); }
.next-line { margin: 3px 0 0; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-line[hidden] { display: none; }
.next-line:hover b { color: var(--accent); }
.next-line .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; margin-right: 6px; vertical-align: 1px; animation: livepulse 1.4s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: .35; } }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow);
}
.icon-btn:hover { border-color: var(--accent); }
:root[data-theme="dark"] .icon-sun, :root:not([data-theme]) .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon, :root:not([data-theme]) .icon-moon { display: block; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .icon-sun { display: block; }
  :root:not([data-theme]) .icon-moon { display: none; }
}

/* Multi-column rather than a grid: a grid keeps a collapsed widget's row at the
   height of its tallest sibling, leaving a hole. Columns let everything below
   pack upward when one closes. */
.grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 20px 24px;
  column-gap: 18px;
}
@media (min-width: 980px) {
  .grid { columns: 2; }
}

/* ---------- widgets ---------- */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  height: 680px;
  /* Columns must never split a widget down the middle. */
  break-inside: avoid;
  margin-bottom: 18px;
}
.widget-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.widget-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px; }
.widget-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.widget-body::-webkit-scrollbar { width: 8px; }
.widget-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.widget-foot {
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.error { padding: 24px 16px; color: var(--loss); }

/* segmented control */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
}
.segmented button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  line-height: 1.2;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* search */
.search {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 9px; padding: 6px 10px; font-size: 13.5px; min-width: 160px; outline: none;
}
.search:focus { border-color: var(--accent); }

/* skeletons */
.skeleton-list { padding: 14px 16px; display: grid; gap: 12px; }
.skeleton-list > div {
  height: 52px; border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- schedule ---------- */
.hero {
  margin: 14px 16px 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--hero);
  color: #fff;
  display: block;
  position: relative;
  overflow: hidden;
}
.hero:hover { text-decoration: none; filter: brightness(1.05); }
.hero .kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; opacity: .8; font-weight: 700; }
.hero .kicker.live { color: #ffd6c7; }
.hero .kicker.live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff6a3d; margin-right: 6px; animation: pulse 1.4s infinite; vertical-align: 1px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.hero .matchup { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.hero .matchup img { width: 44px; height: 44px; background: rgba(255,255,255,.92); border-radius: 50%; padding: 5px; flex: none; }
.hero .matchup .vs { font-size: 20px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.2; }
.hero .matchup .vs small { font-size: 13px; font-weight: 500; opacity: .85; display: block; }
.hero .score { margin-left: auto; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; }
.hero .score small { display: block; font-size: 12px; font-weight: 600; opacity: .85; margin-top: 4px; }
.hero .details { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; opacity: .92; }
.hero .details span::before { content: "·"; margin-right: 8px; opacity: .6; }
.hero .details span:first-child::before { content: none; }

.game-list { list-style: none; margin: 0; padding: 4px 8px 12px; }
.game-list .day-label { padding: 12px 8px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.game {
  display: grid;
  grid-template-columns: 54px 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 10px;
}
.game:hover { background: var(--surface-2); text-decoration: none; }
.game .date { font-size: 13px; font-weight: 600; line-height: 1.15; }
.game .date small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.game .logo { width: 28px; height: 28px; object-fit: contain; }
.game .who { min-width: 0; }
.game .who .opp { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game .who .opp .ha { color: var(--muted); font-weight: 500; margin-right: 3px; }
.game .who .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game .right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.game .right .res { font-weight: 700; }
.game .right .res.w { color: var(--win); }
.game .right .res.l { color: var(--loss); }
.game .right .res.live { color: var(--live); }
.game .right small { display: block; color: var(--muted); font-size: 11.5px; }
.game.today { outline: 1px solid var(--accent); outline-offset: -1px; }
.game .who .promo { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game .who .promo .more { color: var(--muted); font-weight: 500; }
.game.venue-ev .ve-ico { display: grid; place-items: center; font-size: 18px; }
.game.venue-ev .who .opp { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal a.cell.venue-day { color: var(--text); }
.cal .cell .ve { font-size: 10.5px; line-height: 1.25; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.cal-legend { flex-wrap: wrap; }
.hero .promos { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(255,255,255,.22); display: grid; gap: 4px; font-size: 13px; }
.hero .promos small { opacity: .8; margin-left: 4px; }

/* calendar */
.cal-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.cal-nav h3 { margin: 0; font-size: 15px; }
.cal-nav button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }
.cal-nav button:disabled { opacity: .35; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 12px 14px; }
.cal .dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal .cell {
  min-height: 64px; border-radius: 8px; padding: 5px 5px 4px;
  background: var(--surface-2); border: 1px solid transparent;
  display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted);
}
.cal .cell.pad { background: transparent; }
.cal .cell.today { border-color: var(--accent); }
.cal .cell .d { font-weight: 700; font-size: 11px; display: flex; justify-content: space-between; }
.cal .cell .d .pm { font-size: 11px; line-height: 1; color: var(--accent); }
.cal .cell.has-game { color: var(--text); }
.cal a.cell:hover { text-decoration: none; border-color: var(--accent); }
.cal .cell.home { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.cal .cell .opp { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 11.5px; }
.cal .cell .opp img { width: 16px; height: 16px; }
.cal .cell .r { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal .cell .r.w { color: var(--win); }
.cal .cell .r.l { color: var(--loss); }
.cal .cell .r.live { color: var(--live); }
.cal .cell .t { font-size: 10.5px; color: var(--muted); }
.cal-legend { display: flex; gap: 14px; padding: 0 16px 12px; font-size: 11.5px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- news ---------- */
.news-list { list-style: none; margin: 0; padding: 6px 8px 10px; }
.news-item { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 10px 8px; border-radius: 10px; }
.news-item.has-img { grid-template-columns: 92px 1fr; }
.news-item:hover { background: var(--surface-2); }
.news-item img { width: 92px; height: 62px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.news-item .title { font-weight: 600; line-height: 1.3; display: block; }
.news-item .title:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.news-item .summary { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-item .meta { color: var(--muted); font-size: 11.5px; margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; }
.news-item .meta .src { font-weight: 700; color: var(--accent); }

/* ---------- roster ---------- */
.roster-group { padding: 12px 8px 0; }
.roster-group h3 { margin: 0 8px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.roster-group h3 span { font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.player {
  display: grid; grid-template-columns: 38px 34px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 10px;
}
.player:hover { background: var(--surface-2); text-decoration: none; }
.player img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.player .num { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; text-align: center; }
.player .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .name .pos { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.player .bt { color: var(--muted); font-size: 12px; }
.player .stat { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.player .stat b { color: var(--text); font-weight: 650; }

/* ---------- page footer ---------- */
.page-foot { max-width: 1280px; margin: 0 auto; padding: 4px 20px 32px; }

@media (max-width: 560px) {
  .topbar { padding: 16px 14px 10px; }
  .grid { padding: 6px 12px 20px; gap: 14px; }
  .widget { height: 600px; }
  .widget-head { padding: 12px 14px 10px; }
  .hero { margin: 12px 12px 6px; }
  .hero .score { font-size: 24px; }
  .cal .cell { min-height: 56px; padding: 4px; }
  .cal .cell .opp img { display: none; }
  .news-item.has-img { grid-template-columns: 72px 1fr; }
  .news-item img { width: 72px; height: 50px; }
}

/* =========================================================
   Round two: standings, trades, roster tabs, Bluesky, drawer
   ========================================================= */

.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.thinking { display: flex; align-items: center; gap: 14px; padding: 40px 20px; color: var(--text); }
/* A switched-off widget holds no content; don't reserve a full column of height for it. */
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* generic data table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 6px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tr.us td { background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 650; }
.tbl tr.us td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl td.pos { color: var(--win); }
.tbl td.neg { color: var(--loss); }
.tbl .team { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tbl .team img { width: 20px; height: 20px; }
.tbl .team .clinch { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.tbl-wrap { overflow-x: auto; }

/* ---------- standings ---------- */
.stand-section { padding: 12px 16px 4px; }
.stand-section h3 { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; justify-content: space-between; }
.stand-section h3 span { font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ---------- trades ---------- */
.btn-accent {
  border: 0; border-radius: 10px; padding: 10px 20px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 650;
}
.btn-accent:hover { filter: brightness(1.08); }
.btn-accent:active { transform: translateY(1px); }

/* ---------- roster: IL & moves ---------- */
.il-tag { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--loss) 15%, transparent); color: var(--loss); }
.player { cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font: inherit; color: inherit; }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(5, 12, 24, .55); z-index: 40; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); z-index: 41;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -20px 0 50px -20px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  animation: slide-in .22s ease-out;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-body { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 24px; }
.drawer .section { padding: 14px 16px 4px; }
.drawer .section h3 { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.drawer .section h3 span { font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.promo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.promo-list li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; }
.promo-list img, .promo-list .promo-ph { width: 52px; height: 52px; border-radius: 8px; object-fit: contain; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; }
.promo-list small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.promo-list b { display: block; line-height: 1.3; }
.promo-list b a { color: inherit; }
.promo-list span { display: block; color: var(--muted); font-size: 12.5px; }
.drawer .ext { padding: 12px 16px; }
.drawer .ext a { color: var(--accent); font-weight: 600; }
.drawer .kv { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.drawer .kv b { color: var(--text); font-weight: 600; }

.score-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px; background: var(--hero); color: #fff; }
.score-head .side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.score-head .side.right { flex-direction: row-reverse; text-align: right; }
.score-head img { width: 44px; height: 44px; background: rgba(255,255,255,.92); border-radius: 50%; padding: 5px; flex: none; }
.score-head .side b { display: block; font-size: 15px; line-height: 1.2; }
.score-head .side small { opacity: .8; font-size: 12px; }
.score-head .mid { text-align: center; }
.score-head .mid .sc { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.score-head .mid .st { font-size: 12px; opacity: .85; margin-top: 4px; font-weight: 600; }
.score-head .mid .st.live { color: #ffd6c7; }

.linescore th, .linescore td { padding: 5px 6px; text-align: center; }
.linescore th:first-child, .linescore td:first-child { text-align: left; }
.linescore td.tot { font-weight: 750; border-left: 1px solid var(--border); }

.plays { list-style: none; margin: 0; padding: 0; }
.plays li { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.plays .inn { color: var(--muted); font-size: 11.5px; font-weight: 700; padding-top: 2px; }
.plays .sc { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.plays .ev { font-weight: 650; }

.bio { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 16px; align-items: center; }
.bio img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.bio h4 { margin: 0 0 4px; font-size: 18px; }
.bio .num { color: var(--muted); font-weight: 700; margin-right: 6px; }

@media (max-width: 640px) {
  .score-head { padding: 12px; gap: 8px; }
  .score-head img { width: 34px; height: 34px; }
  .score-head .mid .sc { font-size: 26px; }
}

/* ---------- video grid ---------- */

.drawer[hidden], .drawer-backdrop[hidden] { display: none; }

/* ---------- collapsible widgets ---------- */
.collapse-btn {
  margin-left: auto; flex: none;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  border-radius: 8px; cursor: pointer; padding: 0;
  transition: transform .18s ease, border-color .15s, color .15s;
}
.collapse-btn:hover { border-color: var(--accent); color: var(--text); }
.collapse-btn svg { display: block; }
.widget[data-collapsed] { height: auto; }
.widget[data-collapsed] .widget-body,
.widget[data-collapsed] .widget-foot { display: none; }
.widget[data-collapsed] .widget-head { border-bottom: 0; }
.widget[data-collapsed] .collapse-btn { transform: rotate(-90deg); }
/* Header controls only make sense against visible content. */
.widget[data-collapsed] .segmented,
.widget[data-collapsed] .chips,
.widget[data-collapsed] .search { display: none; }
@media (prefers-reduced-motion: reduce) { .collapse-btn { transition: none; } }

/* ---------- drag to reorder ---------- */
.head-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.drag-handle {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--muted); cursor: grab;
  transition: border-color .15s, color .15s;
}
.drag-handle:hover { border-color: var(--border); color: var(--text); }
.drag-handle:active { cursor: grabbing; }
.widget.dragging { opacity: .4; }
@media (prefers-reduced-motion: reduce) { .drag-handle { transition: none; } }

/* payroll metrics — one headline figure per row, tap for the arithmetic */


/* =========================================================
   Multi-team: favorites bar, picker, welcome, scoreboard
   ========================================================= */

.logo-ph {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  font-size: 10px; font-weight: 800; letter-spacing: .02em; flex: none;
}
.brand-logo { object-fit: contain; }
.brand .logo-ph.brand-logo { width: 44px; height: 44px; font-size: 24px; background: none; border: 0; }
#brand-mark { display: contents; }
.lg-tag {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em;
  padding: 1px 6px; border-radius: 5px; background: var(--accent); color: var(--accent-text); vertical-align: 1px;
}
.standings .sep:first-of-type { margin-left: 8px; }

.star-btn svg { fill: none; transition: fill .15s, color .15s; }
.star-btn[aria-pressed="true"] { color: #e6b93a; border-color: color-mix(in srgb, #e6b93a 60%, var(--border)); }
.star-btn[aria-pressed="true"] svg { fill: currentColor; }

.favbar {
  max-width: 1280px; margin: 0 auto; padding: 0 20px 10px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.favbar::-webkit-scrollbar { display: none; }
.fav {
  flex: none; display: inline-flex; align-items: center;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 650; white-space: nowrap;
}
.fav:hover { border-color: var(--accent); }
.fav-link { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border-radius: 999px; color: inherit; }
.fav-link:hover { text-decoration: none; }
.fav:has(.fav-x) .fav-link { padding-right: 4px; }
.fav img, .fav .logo-ph { width: 24px; height: 24px; object-fit: contain; font-size: 8px; }
.fav small { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.fav-x {
  width: 22px; height: 22px; margin-right: 5px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: none; color: var(--muted);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.fav-x:hover { background: color-mix(in srgb, var(--loss) 16%, transparent); color: var(--loss); }
.fav.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.fav.on small, .fav.on .fav-x { color: inherit; opacity: .8; }
.fav.on .fav-x:hover { background: rgba(255,255,255,.22); color: inherit; opacity: 1; }
/* The pill is filled with the team color, so its own logo would vanish; set it on a white disc. */
.fav.on img { background: #fff; border-radius: 50%; padding: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.fav.unsaved { border-style: dashed; }
.fav.add { padding: 6px 14px; gap: 7px; color: var(--muted); background: var(--surface-2); box-shadow: none; border-style: dashed; cursor: pointer; }
.fav.add span { font-size: 16px; line-height: 1; }
.fav.add:hover { color: var(--text); }

/* First visit: the dashboard waits behind a welcome card. */
.welcome { display: none; max-width: 640px; margin: 40px auto; padding: 32px 24px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.welcome h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -0.01em; }
.welcome p { margin: 0 auto 18px; max-width: 48ch; color: var(--muted); line-height: 1.55; }
body.no-team .welcome { display: block; }
body.no-team .grid, body.no-team #updated { display: none; }

/* picker */
.picker {
  width: min(860px, calc(100% - 24px)); max-height: min(88vh, 900px); padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
}
.picker[open] { display: flex; flex-direction: column; }
.picker::backdrop { background: rgba(5, 12, 24, .55); backdrop-filter: blur(2px); }
.picker-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 6px; }
.picker-head h2 { margin: 0; font-size: 18px; }
.picker-head p { margin: 3px 0 0; }
.picker-tools { padding: 8px 18px 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--border); }
.picker-tools .search { width: 100%; font-size: 15px; padding: 10px 12px; }
.picker-body { overflow-y: auto; flex: 1; min-height: 0; padding: 6px 18px 18px; overscroll-behavior: contain; }
.picker-body section h3, .picker-mine h3 { margin: 14px 0 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.pick {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 13.5px; font-weight: 600; line-height: 1.25;
  box-shadow: inset 3px 0 0 var(--c);
}
.pick:hover { border-color: var(--accent); background: var(--surface); }
.pick img, .pick .logo-ph { width: 30px; height: 30px; object-fit: contain; flex: none; }
.pick i { margin-left: auto; color: #e6b93a; font-style: normal; }
.pick.on { border-color: color-mix(in srgb, #e6b93a 60%, var(--border)); }
.picker-mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.picker-mine li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.picker-mine li img, .picker-mine li .logo-ph { width: 26px; height: 26px; object-fit: contain; }
.picker-mine .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; }
.picker-mine .nm small { margin-left: 6px; color: var(--muted); font-size: 10.5px; font-weight: 700; }
.mini { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; padding: 0; color: var(--muted); }
.mini:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.mini:disabled { opacity: .35; cursor: default; }
.mini.rm:hover { border-color: var(--loss); color: var(--loss); }

#roster .head-tools { flex: 1; justify-content: flex-end; flex-wrap: nowrap; min-width: 0; }
#roster-search { flex: 0 1 160px; min-width: 70px; width: auto; }

/* schedule extras */
.game .logo { object-fit: contain; }
.hero .matchup img, .hero .matchup .logo-ph { width: 44px; height: 44px; object-fit: contain; }

/* standings extras */
.tbl .team img { object-fit: contain; }
.tbl .team .logo-ph { width: 20px; height: 20px; font-size: 7px; }
.tbl td.seedn { color: var(--muted); font-weight: 700; width: 1%; }
.note-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 2px; flex: none; }
.note-key { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; }
.note-key i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
#standings-views[hidden] { display: none; }

/* roster extras */
.player img { object-fit: cover; object-position: top; }
.avatar-ph { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.avatar-ph.sm { width: 32px; height: 32px; }
.avatar-ph.lg { width: 84px; height: 84px; }

/* scoreboard */
#scores { height: auto; max-height: 680px; }
#scores .widget-body { min-height: 120px; }
.scores { list-style: none; margin: 0; padding: 10px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sb { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.sb:hover { text-decoration: none; border-color: var(--accent); }
.sb.ours { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.sb-team { display: grid; grid-template-columns: 22px 1fr auto auto; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.sb-team img, .sb-team .logo-ph { width: 22px; height: 22px; object-fit: contain; font-size: 7px; }
.sb-team .nm { font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-team small { font-size: 11px; }
.sb-team b { font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; color: var(--text); }
.sb-team.win b, .sb-team.win .nm { font-weight: 800; }
.sb-status { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.live-dot { color: var(--live); font-weight: 700; }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; animation: pulse 1.4s infinite; }

/* game drawer extras */
.score-head img, .score-head .logo-ph { object-fit: contain; }
.linescore td.tot { border-left: 1px solid var(--border); font-weight: 750; }
.compare td { text-align: center !important; width: 30%; }
.compare td.lbl { color: var(--muted); font-size: 12px; width: 40%; white-space: normal; }
.compare th { text-align: center !important; }
.leaders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lead-col h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.lead-col h4 img { width: 20px; height: 20px; object-fit: contain; }
.lead { display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.lead img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); }
.lead small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.lead b { display: block; font-size: 13px; }
.lead span { color: var(--muted); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.plain-list a { color: var(--text); }
.plain-list a:hover { color: var(--accent); }
.bio img { object-position: top; }

@media (max-width: 560px) {
  .favbar { padding: 0 12px 8px; }
  .brand h1 { font-size: 19px; }
  .pick-grid { grid-template-columns: 1fr 1fr; }
  .picker-head, .picker-tools, .picker-body { padding-left: 12px; padding-right: 12px; }
  .leaders { grid-template-columns: 1fr; }
  #updated { display: none; }
}

[hidden] { display: none !important; }

/* ---------- funny feeds (Bluesky video grid) ---------- */
.vgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
.vcard { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.vthumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border: 0; padding: 0; background: #000; cursor: pointer; }
.vthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .15s; }
.vthumb:hover img { opacity: 1; }
.vthumb .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.6); border: 2px solid rgba(255,255,255,.85); color: #fff; display: grid; place-items: center; font-size: 16px; padding-left: 3px; }
.vplayer { width: 100%; aspect-ratio: 16 / 10; background: #000; display: block; }
.vcard figcaption { padding: 7px 9px 8px; display: grid; gap: 3px; }
.vcard .cap { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .meta { font-size: 11px; color: var(--muted); }
.vcard .meta a:hover { color: var(--accent); }
#social-foot a { color: var(--accent); }
@media (max-width: 480px) { .vgrid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .vthumb img { transition: none; } }

/* ---------- roster: transactions ---------- */
.tx { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 8px 8px; border-radius: 10px; align-items: baseline; }
.tx:hover { background: var(--surface-2); }
.tx-date { color: var(--muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-text { line-height: 1.45; }
.tx-kind { display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; vertical-align: 1px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tx-kind.add { background: color-mix(in srgb, var(--win) 15%, transparent); border-color: transparent; color: var(--win); }
.tx-kind.out { background: color-mix(in srgb, var(--loss) 15%, transparent); border-color: transparent; color: var(--loss); }
.tx-kind.trade { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: transparent; color: var(--accent); }
.tx-player { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 2px; }
.tx-player:hover { color: var(--accent); }
.tx-month + .tx-month { margin-top: 10px; }
