/* ============================================================
   AFL Standings — redesigned (standings / tiers / playoff bracket)
   Page-specific styles, loaded after style.css.
   ============================================================ */
.standings-page {
  padding-block: 1.75rem 3rem;
}

/* ---------- header + view tabs ---------- */
.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.sb-title {
  margin: 0;
  font-size: var(--fs-700);
  font-weight: var(--fw-bold);
  text-transform: lowercase;
  line-height: 1;
}

.sb-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.3rem;
  background: var(--color-neutral-250);
  border: 1px solid var(--color-neutral-300);
  border-radius: 999px;
}
.sb-tab {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--fs-400);
  font-weight: var(--fw-bold);
  color: var(--color-neutral-800);
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.sb-tab:hover { color: var(--color-primary-400); }
.sb-tab.is-active {
  background: var(--color-primary-400);
  color: var(--color-neutral-100);
}

/* ---------- conference filter ---------- */
.sb-conf-filter {
  display: inline-flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.sb-chip {
  appearance: none;
  font: inherit;
  font-size: var(--fs-300);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--color-neutral-800);
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-300);
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.sb-chip:hover { border-color: var(--color-primary-300); }
.sb-chip.is-active {
  background: var(--color-neutral-900);
  color: var(--color-neutral-100);
  border-color: var(--color-neutral-900);
}

/* conference column visibility driven by the filter */
.sb-root[data-conf="afc"] .conf-nfc { display: none; }
.sb-root[data-conf="nfc"] .conf-afc { display: none; }

/* ---------- two-column grid of cards ---------- */
.sb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.standings-card {
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.9rem;
  background: var(--color-neutral-100);
  overflow: hidden;
}

.sc-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  color: var(--color-neutral-100);
}
.sc-head--afc { background: linear-gradient(90deg, var(--color-primary-600), var(--color-primary-400)); }
.sc-head--nfc { background: linear-gradient(90deg, #1f2a44, #33446e); }
.sc-conf {
  font-size: var(--fs-600, 1.25rem);
  font-weight: var(--fw-bold);
  letter-spacing: .04em;
}
.sc-sub {
  font-size: var(--fs-300);
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .85;
}

/* ---------- tables ---------- */
.sb-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sb-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  background: transparent;
}
.sb-table thead th {
  font-size: var(--fs-300);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--color-neutral-600);
  text-align: center;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--color-neutral-300);
  white-space: nowrap;
}
.sb-table thead th.th-left { text-align: left; padding-left: 1rem; }

.sb-table td {
  text-align: center;
  font-size: var(--fs-400);
  color: var(--color-neutral-900);
  padding: 0.5rem 0.5rem;
  border-top: 1px solid var(--color-neutral-300);
  white-space: nowrap;
}
.sb-row:hover { background: var(--color-neutral-250); }
.sb-row.team-hl { background: var(--color-neutral-250); }

/* group divider rows */
.sb-group td {
  text-align: left;
  font-size: var(--fs-300);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0.45rem 1rem;
  color: var(--color-neutral-100);
  border-top: 0;
}
.sb-group--top td { background: #1f9d57; }
.sb-group--wild td { background: #c8860a; }
.sb-group--hunt td { background: var(--color-neutral-600); }
.sb-group--tier td {
  background: var(--color-neutral-250);
  color: var(--color-primary-600);
}

/* rank / seed badge */
.sb-rank { width: 3rem; }
.seed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.35rem;
  border-radius: 50%;
  font-weight: var(--fw-bold);
  font-size: var(--fs-300);
  color: var(--color-neutral-100);
  background: var(--color-neutral-600);
}
.status-top .seed-badge { background: #1f9d57; }
.status-wild .seed-badge { background: #c8860a; }
.status-hunt .seed-badge { background: var(--color-neutral-600); }

/* team cell */
.sb-table td.sb-team { text-align: left; }
.sb-team-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-weight: var(--fw-semi-bold);
}
a.sb-team-link:hover .sb-team-name { text-decoration: underline; color: var(--color-primary-400); }
.sb-team-logo {
  width: 45px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}
.sb-team-name { text-transform: uppercase; font-weight: var(--fw-bold); letter-spacing: .02em; }
.sb-key { font-weight: var(--fw-bold); color: var(--color-primary-600); }

/* tier promotion / demotion — shown inside the rank circle */
.seed-badge--move { font-size: 0.72rem; line-height: 1; }
.seed-badge--up { background: #1f9d57; }
.seed-badge--down { background: var(--color-primary-400); }
.seed-badge--neutral { background: var(--color-neutral-600); }

/* legend */
.sb-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 1rem;
  font-size: var(--fs-300);
  color: var(--color-neutral-800);
}
.sb-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.sb-legend-dot { width: 0.85rem; height: 0.85rem; border-radius: 50%; display: inline-block; }
.dot-top { background: #1f9d57; }
.dot-wild { background: #c8860a; }
.dot-hunt { background: var(--color-neutral-600); }

/* ============================================================
   PLAYOFF BRACKET
   ============================================================ */
.bracket-note {
  margin: 0 0 1.25rem;
  font-size: var(--fs-300);
  color: var(--color-neutral-600);
  font-style: italic;
}
.bracket { display: flex; flex-direction: column; gap: 1.75rem; }

.bracket-conf-title {
  margin: 0 0 0.75rem;
  font-size: var(--fs-600, 1.25rem);
  font-weight: var(--fw-bold);
  letter-spacing: .05em;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 1rem;
  border-radius: 0.5rem;
  color: var(--color-neutral-100);
}
.bracket-conf-title--afc { background: var(--color-primary-400); }
.bracket-conf-title--nfc { background: #33446e; }

.bracket-rounds {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.bracket-round {
  flex: 1 0 170px;
  min-width: 170px;
  display: flex;
  flex-direction: column;
}
.round-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.2rem 0.7rem;
  font-weight: var(--fw-bold);
  font-size: var(--fs-300);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-neutral-800);
}
.round-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-neutral-250);
  border: 1px solid var(--color-neutral-300);
  color: var(--color-primary-400);
}
.round-icon svg { width: 1rem; height: 1rem; }

.round-games {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 0.85rem;
}

/* matchup card */
.matchup {
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--color-neutral-100);
}
.team-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  position: relative;
}
.team-slot + .team-slot { border-top: 1px solid var(--color-neutral-300); }
.team-slot.team-hl { background: var(--color-primary-100); }
.team-slot.is-tbd { color: var(--color-neutral-600); }

.slot-seed {
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
  font-size: var(--fs-200, 0.75rem);
  font-weight: var(--fw-bold);
  color: var(--color-neutral-600);
}
.slot-logo {
  width: 26px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.slot-logo-ph {
  width: 26px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--color-neutral-250);
}
.slot-abbr {
  font-size: var(--fs-400);
  font-weight: var(--fw-semi-bold);
  letter-spacing: .02em;
}

/* allegiance bowl */
.bracket-final {
  align-self: center;
  width: 100%;
  max-width: 320px;
  text-align: center;
}
.round-head--final {
  justify-content: center;
  color: var(--color-primary-600);
  font-size: var(--fs-400);
}
.round-head--final .round-icon {
  background: var(--color-primary-400);
  border-color: var(--color-primary-400);
  color: var(--color-neutral-100);
}
.matchup--final {
  border: 2px solid var(--color-primary-400);
  box-shadow: 0 6px 18px rgba(155, 3, 21, .12);
}
.matchup--final .team-slot { padding: 0.6rem 0.8rem; }
.matchup--final .slot-seed { color: var(--color-primary-400); }

@media (max-width: 50em) {
  .sb-head { gap: 0.75rem; }
  .sb-tab { padding: 0.45rem 0.8rem; font-size: var(--fs-300); }
}
