
:root {
  --bg: #07111f;
  --surface: #0d1a2d;
  --surface-2: #112039;
  --surface-3: #162848;
  --border: #1a2e47;
  --border-light: #1e3555;
  --text: #e2e8f0;
  --text-muted: #8ab4cc;
  --text-faint: #5a8aaa;
  --accent: #38bdf8;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --atlantic: #e879f9;
  --metro: #38bdf8;
  --central: #fb923c;
  --pacific: #818cf8;
  --t: 0.18s ease;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.brand-icon img { width: 30px; height: 30px; object-fit: contain; }
h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.last-updated { font-size: 11px; color: var(--text-muted); }

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
}
nav button {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 13px; font-weight: 500;
  padding: 11px 14px;
  border-bottom: 2px solid transparent;
  transition: var(--t);
}
nav button:hover { color: var(--text); }
nav button.active { color: var(--accent); border-bottom-color: var(--accent); }
nav button.nav-live { color: #e05252; }
nav button.nav-live::after { content: ' ●'; font-size: .55em; vertical-align: middle; animation: nav-pulse 1.4s ease-in-out infinite; }
nav button.nav-live.active { color: #e05252; border-bottom-color: #e05252; }
@keyframes nav-pulse { 0%,100% { opacity:1; } 50% { opacity:.35; } }

/* ── Layout ──────────────────────────────────────────────── */
main { max-width: 1440px; margin: 0 auto; padding: 20px 20px 40px; }
.view { display: none; }
.view.active { display: block; }

/* ── Conference grid ─────────────────────────────────────── */
.conf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.conf-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.conf-header {
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

/* ── Division section ────────────────────────────────────── */
.div-section { border-bottom: 1px solid var(--border); }
.div-section:last-child { border-bottom: none; }

.div-label {
  padding: 8px 16px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.div-label::before {
  content: '';
  width: 3px; height: 13px;
  border-radius: 2px;
  background: var(--dcolor, var(--accent));
}

/* ── Table ───────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
thead th {
  padding: 4px 7px 6px;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th:first-child,
thead th:nth-child(2) { text-align: left; }

tbody tr {
  border-bottom: 1px solid rgba(26,46,71,0.5);
  transition: background var(--t);
}
tbody tr:hover { background: var(--surface-3); }
tbody tr:last-child { border-bottom: none; }

td {
  padding: 6px 7px;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
}
td:first-child {
  text-align: left;
  padding-left: 14px;
  color: var(--text-muted);
  font-size: 11px;
  width: 42px;
  min-width: 42px;
}
td:nth-child(2) { text-align: left; }

/* Playoff boundary row */
tr.boundary td {
  padding: 0;
  height: 0;
  border-bottom: 1.5px solid rgba(251,191,36,0.35) !important;
  font-size: 0;
}

/* ── Team cell ───────────────────────────────────────────── */
.tc { display: flex; align-items: center; gap: 7px; }
.tc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tlogo { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; background: rgba(255,255,255,0.9); }
.tname { font-weight: 500; }

/* ── Live score chip (inline in standings row) ───────────── */
.live-chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .62rem; font-weight: 600; letter-spacing: .02em;
  padding: 1px 5px; border-radius: 3px; white-space: nowrap;
  vertical-align: middle; flex-shrink: 0;
}
.live-chip:empty { display: none; }
.live-chip-live         { background: rgba(224,82,82,.15); color: #e05252; border: 1px solid rgba(224,82,82,.3); }
.live-chip-live.chip-winning { background: rgba(111,224,160,.15); color: #6fe0a0; border: 1px solid rgba(111,224,160,.3); }
.live-chip-live.chip-winning .chip-dot { background: #6fe0a0; }
.live-chip-live.chip-losing  { background: rgba(224,82,82,.15);  color: #e05252; border: 1px solid rgba(224,82,82,.3); }
.live-chip-live.chip-losing  .chip-dot { background: #e05252; }
.live-chip-fut  { background: rgba(255,255,255,.05); color: var(--muted); border: 1px solid var(--border); }
.live-chip-fin  { background: rgba(255,255,255,.04); color: var(--muted); border: 1px solid var(--border); }
.chip-dot { width: 5px; height: 5px; background: #e05252; border-radius: 50%; flex-shrink: 0; }
.chip-w { color: #6fe0a0; font-weight: 800; }
.chip-l { color: var(--muted); }
.tabbr { display: none; font-weight: 500; }
@media (max-width: 560px) { .tname { display: none; } .tabbr { display: inline; } }

.clinch {
  font-size: 8.5px; font-weight: 700;
  padding: 1px 3px; border-radius: 3px; margin-left: 3px;
  vertical-align: middle;
}
.cx { background: rgba(74,222,128,0.2); color: #4ade80; }
.cy { background: rgba(56,189,248,0.2); color: #38bdf8; }
.cz { background: rgba(251,191,36,0.3); color: #fbbf24; }
.ce { background: rgba(248,113,113,0.2); color: #f87171; }

/* ── Cell variants ───────────────────────────────────────── */
.pts { font-weight: 700; }
.gp  { color: var(--text-muted); }
.l10 { font-size: 11px; color: var(--text-muted); }

.strk { font-weight: 600; font-size: 11.5px; }
.sW { color: var(--green); }
.sL { color: var(--red); }
.sOT { color: var(--yellow); }

.gd-pos { color: var(--green); }
.gd-neg { color: var(--red); }
.gd-neu { color: var(--text-muted); }

.pb-pos { color: var(--green); font-weight: 600; font-size: 11.5px; }
.pb-neg { color: var(--red);   font-weight: 600; font-size: 11.5px; }
.pb-bub { color: var(--yellow);font-weight: 600; font-size: 11.5px; }

/* In wild card table: show division badge */
.div-badge {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.5px;
  padding: 1px 4px; border-radius: 3px; margin-left: 4px;
  vertical-align: middle;
  opacity: 0.75;
}

/* Bubble row highlight */
tr.bubble { background: rgba(251,191,36,0.04) !important; }

/* ── Legend ──────────────────────────────────────────────── */
.legend {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 11px; color: var(--text-muted);
}
.legend span { display: flex; align-items: center; gap: 5px; }

/* ── Draft Lottery ───────────────────────────────────────── */
.lottery-pick { font-size: 13px; font-weight: 700; color: var(--yellow); padding-left: 14px !important; width: 36px; }
.lottery-pick-out { color: var(--text-faint) !important; }
.lottery-odds { font-size: 12px; font-weight: 700; color: var(--yellow); text-align: center !important; }

/* ── Team Rankings ───────────────────────────────────────── */
.rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .rank-grid { grid-template-columns: 1fr; } }
.rank-group { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rank-group-hdr { padding: 9px 14px; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid rgba(26,46,71,0.4); }
.rank-row:last-child { border-bottom: none; }
.rank-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); width: 120px; flex-shrink: 0; }
.rank-val   { font-size: 13px; font-weight: 700; color: var(--text); width: 52px; flex-shrink: 0; text-align: right; }
.rank-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.rank-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.rank-fill-1 { background: var(--green); }
.rank-fill-2 { background: var(--yellow); }
.rank-fill-3 { background: #fb923c; }
.rank-fill-4 { background: var(--red); }
.rank-num { font-size: 11px; font-weight: 700; width: 38px; flex-shrink: 0; text-align: right; white-space: nowrap; }
.rank-num.r1 { color: var(--green); }
.rank-num.r2 { color: var(--yellow); }
.rank-num.r3 { color: #fb923c; }
.rank-num.r4 { color: var(--red); }
.rank-team-hdr { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; }
.rank-team-logo { width: 64px; height: 64px; object-fit: contain; border: 1.5px solid rgba(255,255,255,0.12); border-radius: 6px; background: rgba(255,255,255,0.9); }
.rank-team-name { font-size: 18px; font-weight: 700; }
.rank-team-rec  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.rank-goalie-sub { font-size: 10.5px; color: #8ab4cc; margin-top: 1px; }

/* ── Goalie cards in rankings ────────────────────────────────── */
.rank-goalies { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid rgba(26,46,71,0.4); }
.rank-goalie-card { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.rank-goalie-role { font-size: 9px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px; }
.rank-goalie-name { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-goalie-stats { display: flex; gap: 10px; }
.rank-goalie-stat { display: flex; flex-direction: column; gap: 1px; }
.rank-goalie-stat-val { font-size: 13px; font-weight: 700; color: var(--accent); }
.rank-goalie-stat-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); }
.rank-goalie-rec { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }

/* ── History controls ────────────────────────────────────── */
.h-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
  margin-bottom: 20px;
}
.cg { display: flex; flex-direction: column; gap: 5px; }
.cg label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-muted);
}
.cg select, .cg input[type="date"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color var(--t);
  cursor: pointer;
}
.cg select:focus, .cg input:focus { border-color: var(--accent); }
.cg select { min-width: 190px; }

.load-btn {
  background: var(--accent);
  border: none; border-radius: 6px;
  color: #03111e; font-size: 13px; font-weight: 700;
  padding: 8px 22px; cursor: pointer;
  transition: opacity var(--t);
}
.load-btn:hover { opacity: 0.85; }
.load-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Chart blocks ────────────────────────────────────────── */
.chart-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.chart-title {
  font-size: 13px; font-weight: 600; margin-bottom: 14px; color: var(--text);
}
.chart-wrap { position: relative; height: 300px; }

/* ── Progress ────────────────────────────────────────────── */
.prog-bar {
  width: 100%; height: 2px;
  background: var(--surface-3);
  border-radius: 2px; margin-bottom: 12px; overflow: hidden;
}
.prog-fill {
  height: 100%; background: var(--accent);
  border-radius: 2px; transition: width 0.25s ease; width: 0%;
}

/* ── Stat cards ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-top: 16px;
}
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
}
.stat-card .slabel {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px;
}
.stat-card .sval {
  font-size: 22px; font-weight: 700; color: var(--text); line-height: 1;
}
.stat-card .ssub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── Loading / Error ─────────────────────────────────────── */
.loading {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 13px;
}
.loading-rink {
  text-align: center; padding: 48px 24px 40px;
}
.loading-puck {
  font-size: 40px;
  animation: puck-slide 1.4s ease-in-out infinite alternate;
  display: inline-block;
  margin-bottom: 16px;
}
@keyframes puck-slide {
  from { transform: translateX(-24px) rotate(-10deg); }
  to   { transform: translateX(24px)  rotate(10deg); }
}
.loading-phrase {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 6px; min-height: 24px;
  transition: opacity 0.4s ease;
}
.loading-sub {
  font-size: 11.5px; color: var(--text-faint);
  letter-spacing: 0.3px;
}
.spin {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.err {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px; padding: 14px 16px;
  color: var(--red); font-size: 13px;
}

/* ── Playoff Matchups ────────────────────────────────────── */
.pm-section { margin-bottom: 24px; }
.pm-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.pm-title::before { content:''; width:3px; height:13px; border-radius:2px; background:var(--accent); display:block; }

.pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
@media (max-width: 1060px) { .pm-grid { grid-template-columns: 1fr; } }

.pm-conf { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pm-conf-hdr {
  padding: 9px 14px; font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}

/* ── Matchup card ──────────────────────────────────────────────────────── */
.mmc { border-bottom: 1px solid var(--border); overflow: hidden; }
.mmc:last-child { border-bottom: none; }

/* Collapsed summary bar */
.mmc-collapsed { cursor: pointer; }
.mmc-summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px; }
.mmc-series { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); }
.mmc-toggle { font-size: 11px; color: var(--text-faint); transition: transform 0.2s; }
.mmc-open .mmc-toggle { transform: rotate(180deg); }

/* Probability bar row */
.mmc-probrow { display: flex; align-items: center; gap: 10px; padding: 4px 14px 12px; cursor: pointer; }
.mmc-pside { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mmc-pside-r { flex-direction: row-reverse; }
.mmc-wpct { font-size: 15px; font-weight: 700; white-space: nowrap; }
.mmc-abbr { font-size: 13px; font-weight: 700; color: var(--text); }
.mmc-abbr.pw { color: var(--green); }
.mmc-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; border: 1.5px solid rgba(255,255,255,0.12); border-radius: 5px; background: rgba(255,255,255,0.9); }
.prob-bar { flex: 1; height: 8px; border-radius: 4px; overflow: hidden; display: flex; min-width: 0; }
.prob-fill { height: 100%; transition: width 0.4s ease; }
.mmc-xg-row { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 10px; }
.mmc-xg-team { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.mmc-xg-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-faint); }

/* Expand/collapse detail */
.mmc-detail { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.mmc-open .mmc-detail { max-height: 1400px; }
.mmc-detail-inner { padding: 0 14px 14px; }

/* Teams row inside detail */
.mmc-teams { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.mmc-side { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.mmc-seed { font-size: 10px; font-weight: 700; color: #8ab4cc; }
.mmc-logo.tlogo { width: 60px; height: 60px; object-fit: contain; border: 1.5px solid rgba(255,255,255,0.12); border-radius: 7px; background: rgba(255,255,255,0.9); }
.mmc-rec  { font-size: 11px; color: #8ab4cc; }
.mmc-vs   { font-size: 11px; font-weight: 700; color: var(--text-faint); width: 22px; text-align: center; flex-shrink: 0; }
.mmc-series-pick { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--green); background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.25); border-radius: 4px; padding: 2px 6px; margin-top: 2px; }
.mmc-even { font-size: 10px; font-weight: 600; color: #8ab4cc; background: var(--surface-3); border-radius: 4px; padding: 2px 8px; }

/* Stat comparison rows */
.mmc-stats  { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.mmc-stat   { display: flex; align-items: center; gap: 8px; }
.sv         { width: 46px; font-size: 12.5px; font-weight: 700; color: #c8dce8; flex-shrink: 0; }
.sv-l       { text-align: right; }
.sv-r       { text-align: left; }
.sv.win     { color: var(--green); }
/* Bar + label stacked in a column */
.mmc-bar-col { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; }
.mmc-bar    { display: flex; height: 5px; border-radius: 3px; overflow: hidden; }
.mmc-bl     { height: 100%; background: rgba(255,255,255,0.08); border-radius: 3px 0 0 3px; transition: width 0.5s ease; }
.mmc-br     { height: 100%; background: rgba(255,255,255,0.08); border-radius: 0 3px 3px 0; transition: width 0.5s ease; }
.mmc-bl.win { background: var(--green); }
.mmc-br.win { background: var(--green); }
.mmc-slbl   { font-size: 9.5px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-faint); text-align: center; }

/* Goalie comparison */
.mmc-goalies { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 10px; }
.goalie-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.goalie-team { font-size: 10px; font-weight: 700; color: #8ab4cc; width: 28px; flex-shrink: 0; }
.goalie-name { flex: 1; color: var(--text); font-weight: 600; }
.goalie-sv   { color: var(--accent); font-weight: 700; font-size: 12.5px; }
.goalie-gaa  { color: #8ab4cc; font-size: 11px; white-space: nowrap; }

/* ── Series prediction ───────────────────────────────────── */
.pred-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(26,46,71,0.5); }
.pred-title { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
/* Game 1 */
.pred-g1 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pred-g1-lbl { font-size: 10px; font-weight: 700; color: var(--text-faint); flex-shrink: 0; }
.pred-g1-team { font-size: 12px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.pred-g1-team.pw { color: var(--green); }
.pred-g1-score { font-size: 13px; font-weight: 700; color: var(--text); flex-shrink: 0; }
.pred-g1-pct { font-size: 11px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
/* Factor breakdown */
.pred-factors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pred-fadv { background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; }
.pred-fadv-hdr { font-size: 9.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.pred-fadv-hdr.dim { color: var(--text-faint); }
.pred-fitem { font-size: 10.5px; padding: 2px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; border-bottom: 1px solid rgba(26,46,71,0.4); }
.pred-fitem:last-child { border-bottom: none; }
.pred-fitem-lbl { color: var(--text); font-weight: 600; white-space: nowrap; }
.pred-fitem-val { color: var(--text-faint); white-space: nowrap; font-size: 10px; }
/* Result */
.pred-result { font-size: 13px; font-weight: 700; color: var(--green); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pred-sprob { font-size: 11px; font-weight: 600; color: #8ab4cc; }

/* Export buttons */
.export-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted); cursor: pointer;
  font-size: 11px; font-weight: 600; padding: 6px 12px;
  transition: border-color var(--t), color var(--t);
}
.export-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Standings section title */
.playoff-standings-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.playoff-standings-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--yellow); display: block;
}

/* ── Prediction Weights Panel ────────────────────────────────── */
/* ── Matchups side-by-side layout ────────────────────────── */
.matchups-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.matchups-sidebar {
  width: 256px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.matchups-main { flex: 1; min-width: 0; }
@media (max-width: 860px) {
  .matchups-layout { flex-direction: column; }
  .matchups-sidebar { position: static; width: 100%; max-height: none; overflow-y: visible; }
}

.weights-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.weights-panel-hdr {
  padding: 10px 14px 9px;
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 2px;
}
.weights-toggle-lbl { font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-muted); }
.weights-toggle-sub { font-size: 10px; color: var(--text-faint); }
.weights-body { padding: 4px 14px 14px; }
.weights-grid {
  display: grid;
  grid-template-columns: 1fr;
}
.weight-group-hdr {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-faint);
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.weight-row {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(26,46,71,0.35);
}
.weight-row:last-child { border-bottom: none; }
.weight-lbl { font-size: 11px; color: var(--text); width: 95px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weight-slider {
  flex: 1 1 0; width: 0; min-width: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.weight-val {
  font-size: 11px; font-weight: 700; color: var(--accent);
  width: 32px; text-align: right; flex-shrink: 0; white-space: nowrap;
}
.weight-val.dim { color: var(--text-faint); font-style: italic; }
.weights-footer {
  display: flex; flex-direction: column; align-items: flex-start;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  gap: 8px;
}
.weights-footer-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.export-btn.btn-danger:hover { border-color: #e05252; color: #e05252; }
.export-btn.btn-rand:hover  { border-color: #a78bfa; color: #a78bfa; }
.weights-note { font-size: 10px; color: var(--text-faint); line-height: 1.5; }

/* ── What If Tab ─────────────────────────────────────────────── */
.wi-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end;
  margin-bottom: 20px;
}
.wi-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.wi-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer; font-size: 12px; font-weight: 600;
  padding: 6px 12px;
  transition: all var(--t);
}
.wi-pill:hover { color: var(--text); border-color: var(--border-light); }
.wi-pill.active { background: rgba(56,189,248,0.12); color: var(--accent); border-color: var(--accent); }
.wi-section { margin-bottom: 28px; }
.wi-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.wi-section-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--accent); display: block;
}
.wi-badge-in  { font-size: 8.5px; font-weight: 700; padding: 1px 4px; border-radius: 3px; background: rgba(74,222,128,0.2); color: #4ade80; margin-left: 4px; vertical-align: middle; }
.wi-badge-out { font-size: 8.5px; font-weight: 700; padding: 1px 4px; border-radius: 3px; background: rgba(248,113,113,0.2); color: #f87171; margin-left: 4px; vertical-align: middle; }
.wi-changes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.wi-change-card { display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 8px 12px; }
.wi-change-card.in  { background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.25); }
.wi-change-card.out { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.25); }
.wi-change-abbr.in  { font-weight: 700; color: var(--green); font-size: 12px; }
.wi-change-abbr.out { font-weight: 700; color: var(--red);   font-size: 12px; }
.wi-change-label { color: var(--text-muted); font-size: 11px; }


/* ── xG divergence notice ────────────────────────────────────── */
.mmc-xg-team.xg-lead { color: var(--accent); }
.mmc-xg-diverge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--yellow); text-align: center;
  padding: 0 14px 8px;
  opacity: 0.85;
}

/* ── Scores Tab ─────────────────────────────────────────────────────── */
.scores-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}
.scores-date {
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.scores-section-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 20px 0 10px;
  padding-left: 4px;
}
.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.score-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.score-card-live {
  border-color: #e05252;
  box-shadow: 0 0 0 1px #e05252;
}
.score-status {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-align: center;
  padding: 3px 8px;
  border-radius: 4px;
  align-self: center;
}
.live-status {
  background: rgba(224,82,82,.18);
  color: #e05252;
}
.final-status {
  background: rgba(255,255,255,.06);
  color: var(--muted);
}
.future-status {
  color: var(--text);
  font-size: .85rem;
  font-weight: 400;
}
.score-teams {
  display: flex;
  align-items: center;
  gap: 10px;
}
.score-team {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.score-team.home-team {
  flex-direction: row-reverse;
}
.score-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
.score-team-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.score-team-info.text-right {
  text-align: right;
}
.score-abbrev {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.team-record {
  font-size: .7rem;
  color: var(--muted);
}
.sog-label {
  font-size: .68rem;
  color: var(--muted);
}
.score-nums {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.team-score {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  min-width: 28px;
  text-align: center;
}
.score-winner {
  color: #6fe0a0;
}
.score-dash {
  color: var(--muted);
  font-size: 1.2rem;
}
.future-score {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}
.score-goals {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.goal-line {
  font-size: .73rem;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}
.goal-team-abbrev {
  font-weight: 700;
  color: var(--text);
  min-width: 28px;
}
.goal-scorer {
  color: var(--text);
}
.goal-time {
  margin-left: auto;
  opacity: .6;
  white-space: nowrap;
}
.goal-assists {
  color: var(--muted);
  font-size: .68rem;
  width: 100%;
  padding-left: 33px;
}
.goal-period-hdr {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: .55;
  padding: 2px 0 1px;
}
.goal-period-sep {
  border-top: 1px solid var(--border);
  margin: 4px 0 2px;
  opacity: .5;
}
/* ── Games week nav ───────────────────────────────────────── */
.games-week-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.games-week-nav::-webkit-scrollbar { display: none; }
.week-nav-arrow {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  transition: var(--t);
}
.week-nav-arrow:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }
.week-nav-arrow:disabled { opacity: .3; cursor: default; }
.week-day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  transition: var(--t);
  flex-shrink: 0;
}
.week-day-pill:hover { background: var(--surface-2); color: var(--text); }
.week-day-pill.wdp-active { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.week-day-pill .wdp-day { font-size: .62rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.week-day-pill .wdp-date { font-size: .72rem; font-weight: 500; }
.week-day-pill .wdp-count { font-size: .6rem; opacity: .55; }
.week-day-pill.wdp-today .wdp-day { color: var(--accent); }
.week-day-pill.wdp-active.wdp-today .wdp-day { color: var(--accent); }

/* ── Cup Prediction Banner ────────────────────────────────── */
.cup-banner {
  display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.cup-banner-hdr {
  font-size: 9.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--yellow);
  margin-bottom: 12px;
}
.cup-champion-block { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.cup-champ-logo {
  width: 64px; height: 64px; object-fit: contain;
  border: 2px solid rgba(251,191,36,0.35); border-radius: 10px;
  background: rgba(255,255,255,0.9);
}
.cup-champ-info { display: flex; flex-direction: column; gap: 3px; }
.cup-champ-abbr { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.cup-champ-name { font-size: .8rem; color: var(--muted); }
.cup-champ-prob { font-size: 1rem; font-weight: 700; color: var(--yellow); }
.cup-path { flex: 1; min-width: 200px; }
.cup-path-label {
  font-size: 9px; font-weight: 700; letter-spacing: .9px;
  text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 9px;
}
.cup-path-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cup-path-step {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
}
.cup-path-step.cup-final-step { border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.07); }
.cup-path-step-round { font-size: .58rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.cup-path-step-opp { font-size: .8rem; font-weight: 700; color: var(--text); }
.cup-path-step-prob { font-size: .62rem; font-weight: 600; color: var(--green); }
.cup-path-arrow { color: var(--text-faint); font-size: 14px; flex-shrink: 0; }
.pm-proj-label {
  font-size: 8.5px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 5px; margin-left: 7px; vertical-align: middle;
}

/* ── Eliminated Teams Banner ──────────────────────────────── */
.eliminated-section {
  margin-top: 32px;
  padding: 28px 24px 24px;
  background: linear-gradient(135deg, rgba(13,26,45,0.9) 0%, rgba(17,32,57,0.95) 100%);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 12px;
  text-align: center;
}
.eliminated-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.eliminated-subtitle {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 22px;
  letter-spacing: 0.3px;
}
.eliminated-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.eliminated-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex: 1;
  max-width: 380px;
}
.elim-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
  filter: grayscale(60%);
}
.elim-logo-wrap:hover { opacity: 1; filter: grayscale(0%); }
.elim-logo-wrap img {
  width: 52px; height: 52px;
  object-fit: contain;
}
.elim-logo-wrap .elim-abbr {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.eliminated-mj {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.eliminated-mj img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: top;
  border-radius: 12px;
  border: 2px solid rgba(248,113,113,0.4);
  box-shadow: 0 0 24px rgba(248,113,113,0.15);
}
.eliminated-mj .mj-caption {
  font-size: 10px;
  color: var(--text-faint);
  font-style: italic;
}
/* Countdown */
.eliminated-countdown {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.countdown-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.countdown-timer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  min-width: 64px;
}
.cd-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-unit {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  margin-top: 3px;
}
.cd-sep {
  font-size: 22px;
  font-weight: 700;
  color: var(--border-light);
  margin-bottom: 14px;
}
.countdown-season-note {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 10px;
}
