/* league — Hattrick-style "Series" hub: main column + right rail of sections */

.league-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 16px;
  align-items: start;
}

.league-rail {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-panel { margin-bottom: 0; }

/* ----------------------------------------------------------- section nav -- */

.sec-nav { display: flex; flex-direction: column; gap: 2px; }

.sec-link {
  display: block;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.sec-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

.sec-link.active {
  background: rgba(227, 183, 101, 0.12);
  border-color: rgba(227, 183, 101, 0.28);
  color: var(--gold);
}

/* ----------------------------------------------------- division switcher -- */

.tier-tabs { margin-bottom: 10px; }

.div-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.div-chip {
  position: relative;
  min-width: 38px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font: 600 var(--fs-cap) / 1 var(--font);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.div-chip:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }

.div-chip.active { background: var(--gold); border-color: transparent; color: #1a1408; }

.div-chip .chip-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--bg);
  border-radius: 50%;
  background: var(--steel);
}

.div-chip.active .chip-dot { background: #1a1408; }

/* quick standings in the rail */
.mini-standings { list-style: none; margin: 0; padding: 0; }

.mini-standings li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: var(--r-sm);
  font-size: var(--fs-cap);
  cursor: pointer;
}

.mini-standings li.me { background: rgba(227, 183, 101, 0.08); cursor: default; }

.mini-standings li.clickable:hover { background: var(--surface-2); }

.ms-pos { width: 16px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }

.ms-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }

.ms-pts { color: var(--text); }

/* ----------------------------------------------------------- series head -- */

.series-kicker {
  color: var(--gold);
  font-size: var(--fs-cap);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.series-name { margin: 2px 0 4px; font-size: clamp(22px, 2.6vw, 30px); }

.series-sub { color: var(--text-2); font-size: var(--fs-sm); }

/* --------------------------------------------------------------- standings -- */

.series-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }

.lead-stat.clickable { cursor: pointer; transition: border-color 0.18s ease, transform 0.18s ease; }

.lead-stat.clickable:hover { border-color: rgba(227, 183, 101, 0.4); transform: translateY(-1px); }

.league-table.standings th,
.league-table.standings td { padding: 10px 7px; }

.league-table.standings tbody tr:last-child td { border-bottom: 0; }

.league-table .rank { width: 24px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.trend-col { width: 12px; padding-left: 0 !important; padding-right: 0 !important; text-align: center; }

.trend { font-size: 9px; }

.trend.up { color: var(--good); }

.trend.down { color: var(--bad); }

.trend.none { color: var(--text-3); }

.league-table .club-cell { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }

.you-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: rgba(227, 183, 101, 0.16);
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.league-table .pts-col { color: var(--text); }

.league-table .gd.pos { color: var(--good); }

.league-table .gd.neg { color: var(--bad); }

.league-table .form-col { white-space: nowrap; }

tr.zone-promo .rank { box-shadow: inset 2px 0 0 var(--good); }

tr.zone-releg .rank { box-shadow: inset 2px 0 0 var(--bad); }

tr.zone-promo td { background: linear-gradient(90deg, rgba(67, 209, 124, 0.06), transparent 40%); }

tr.zone-releg td { background: linear-gradient(90deg, rgba(255, 90, 82, 0.06), transparent 40%); }

tr.zone-promo.me td,
tr.zone-releg.me td { background: rgba(227, 183, 101, 0.07); }

.zone-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}

.zone-legend .lz { display: inline-flex; align-items: center; gap: 6px; }

.zone-legend b { color: var(--text); }

.lz-dot { width: 9px; height: 9px; border-radius: 2px; }

.lz-dot.promo { background: var(--good); }

.lz-dot.releg { background: var(--bad); }

.league-copy { margin: var(--s3) 0 0; font-size: var(--fs-sm); line-height: 1.55; }

/* prior / next round */
.round-grid { margin-top: 16px; }

.rnd-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}

.rnd-row:last-child { border-bottom: 0; }

.rnd-row.clickable { cursor: pointer; }

.rnd-row.clickable:hover .rnd-home,
.rnd-row.clickable:hover .rnd-away { color: var(--gold); }

.rnd-home { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rnd-away { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rnd-score { min-width: 46px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.rnd-score.todo { color: var(--text-3); font-weight: 600; font-size: var(--fs-cap); }

/* ----------------------------------------------------------------- charts -- */

.chart-box { margin-top: var(--s2); }

.ch-svg { display: block; width: 100%; height: auto; }

.ch-grid { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }

.ch-ylab { fill: var(--text-3); font-size: 9px; text-anchor: end; }

.ch-xlab { fill: var(--text-3); font-size: 9px; text-anchor: middle; }

.ch-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }

.ch-leg { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: var(--fs-cap); cursor: pointer; }

.ch-leg:hover { color: var(--text); }

.ch-leg i { width: 10px; height: 10px; border-radius: 2px; }

.h-note { font-size: var(--fs-cap); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ----------------------------------------------------------- results grid -- */

.matrix-wrap { overflow-x: auto; }

.matrix { width: 100%; border-collapse: collapse; font-size: var(--fs-cap); }

.matrix th,
.matrix td { padding: 7px 6px; text-align: center; border: 1px solid var(--line); }

.mx-corner { border: 0; background: transparent; }

.mx-colh { color: var(--text-3); font-weight: 600; }

.mx-rowh { text-align: left; white-space: nowrap; }

.mx-rowh .mini-crest { vertical-align: middle; margin-right: 6px; }

.mx-rowh span { vertical-align: middle; font-weight: 600; }

.mx-rowh.clickable { cursor: pointer; }

.mx-rowh.clickable:hover span { color: var(--gold); }

.mx-diag { background: rgba(255, 255, 255, 0.035); }

.mx-cell { color: var(--text-2); font-variant-numeric: tabular-nums; }

.mx-cell.clickable { cursor: pointer; }

.mx-cell.clickable:hover { background: var(--surface-2); }

.mx-cell.win { color: var(--good); font-weight: 700; }

.mx-cell.loss { color: var(--bad); }

.mx-cell.draw { color: var(--text); font-weight: 700; }

.mx-todo { color: var(--text-3); font-size: 10px; }

/* --------------------------------------------------------------- fixtures -- */

.round-nav { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }

.round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.round-btn:hover:not(:disabled) { border-color: var(--line-strong); transform: translateY(-1px); }

.round-btn:disabled { opacity: 0.35; cursor: default; }

.round-label { min-width: 96px; text-align: center; font-size: var(--fs-sm); letter-spacing: 0.04em; }

.round-label b { font-size: 16px; }

.round-jump { margin-left: auto; padding: 7px 10px; font-size: var(--fs-cap); }

.fx-list { display: grid; gap: 8px; }

.fx {
  display: grid;
  grid-template-columns: 1fr auto 1fr 64px;
  align-items: center;
  gap: var(--s3);
  padding: 10px var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.fx.clickable { cursor: pointer; }

.fx.clickable:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); transform: translateY(-1px); }

.fx.mine { border-color: rgba(227, 183, 101, 0.4); background: rgba(227, 183, 101, 0.05); }

.fx-team { display: flex; align-items: center; gap: 8px; min-width: 0; }

.fx-team.home { justify-content: flex-end; }

.fx-team.away { justify-content: flex-start; }

.fx-name { font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fx-pos {
  flex: 0 0 auto;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.fx-score { min-width: 56px; text-align: center; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.fx-score i { color: var(--text-3); font-style: normal; font-weight: 400; padding: 0 3px; }

.fx-score.todo { color: var(--text-3); font-size: var(--fs-cap); font-weight: 600; }

.fx-link { text-align: right; color: var(--text-3); font-size: var(--fs-cap); font-weight: 600; white-space: nowrap; }

.fx.clickable:hover .fx-link { color: var(--gold); }

/* ---------------------------------------------------------------- scorers -- */

.scorer-table th,
.scorer-table td { padding: 9px 8px; }

.scorer-table tbody tr:last-child td { border-bottom: 0; }

.scorer-table .rank { width: 26px; color: var(--text-3); }

.scorer-table .sc-name { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }

.sc-club { display: inline-flex; align-items: center; gap: 6px; }

.sc-club-name { color: var(--text-2); font-size: var(--fs-cap); font-weight: 600; letter-spacing: 0.04em; }

/* ------------------------------------------------------------- statistics -- */

.perf-table th,
.perf-table td { padding: 9px 7px; }

.perf-table tbody tr:last-child td { border-bottom: 0; }

.stats-lower { margin-top: 0; }

.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.rec-card { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); }

.rec-label { color: var(--text-3); font-size: 9px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

.rec-value { margin: 3px 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

.rec-sub { font-size: 10px; line-height: 1.4; }

.ha-bar { display: flex; height: 30px; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-pill); }

.ha-seg { display: flex; align-items: center; justify-content: center; min-width: 0; font-size: 10px; font-weight: 700; color: #0d0d10; }

.ha-seg.home { background: var(--good); }

.ha-seg.draw { background: rgba(245, 245, 247, 0.32); color: var(--text); }

.ha-seg.away { background: var(--steel); }

.ha-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; color: var(--text-2); font-size: var(--fs-cap); }

.ha-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: middle; }

.ha-dot.home { background: var(--good); }

.ha-dot.draw { background: rgba(245, 245, 247, 0.32); }

.ha-dot.away { background: var(--steel); }

.ha-legend b { color: var(--text); }

.ha-table td { padding: 7px 4px; }

.ha-table tr:last-child td { border-bottom: 0; }

/* ----------------------------------------------------------- shared bits -- */

.mini-crest { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; }

.mini-crest canvas { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28)); }

/* --------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .league-layout { grid-template-columns: 1fr; }

  .league-rail { position: static; order: -1; flex-direction: row; flex-wrap: wrap; }

  .league-rail .rail-panel { flex: 1 1 240px; }

  .quick-panel { display: none; }

  .sec-nav { flex-direction: row; flex-wrap: wrap; }

  .sec-link { flex: 1 1 auto; text-align: center; }
}

@media (max-width: 860px) {
  .series-stats { grid-template-columns: repeat(2, 1fr); }

  .rec-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .league-table.standings th,
  .league-table.standings td { padding: 8px 4px; }

  .league-table .gd { display: none; }

  .fx { grid-template-columns: 1fr auto 1fr; }

  .fx-link { display: none; }
}

/* ---- match plans (per-game prep) ---- */
.rnd-row.mine .rnd-home,
.rnd-row.mine .rnd-away { font-weight: 600; }
.rnd-row.has-pill { grid-template-columns: 1fr auto 1fr auto; }

.plan-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line2);
  color: var(--dim);
  white-space: nowrap;
}
.plan-pill.custom { color: var(--good); border-color: var(--good); }
.plan-pill.def { color: var(--text-3); }
.fx-link .plan-pill { margin-right: 4px; }

.plan-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: var(--s3) 0 var(--s2);
}

.fx-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: var(--s2);
}
.fx-panel-head h3 { margin: 0; }
