:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: 8px 0;
  border-bottom: 1px solid transparent;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--line);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.header-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}
.header-menu-btn:hover { border-color: #9ca3af; }
.brand h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.brand-link {
  color: inherit;
  text-decoration: none;
}
.brand-link:hover h1 { color: var(--primary); }
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 320px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.header-group { display: flex; align-items: center; }
.nav-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  white-space: nowrap;
}
.nav-link:hover { border-color: var(--ink); color: var(--primary); }
.search-bar {
  flex: 1 1 260px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
}
.search-bar svg { flex: 0 0 auto; color: var(--muted); }
.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 0.95rem;
  color: var(--ink);
}

/* Search dropdown */
.search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}
.search-wrap .search-bar { max-width: none; flex: 1 1 auto; }
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.18);
  padding: 6px;
  z-index: 50;
  max-height: 60vh;
  overflow-y: auto;
}
.search-result {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.search-result .search-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result:hover,
.search-result.hilite { background: #f3f4f6; }
.search-result.hilite { outline: 2px solid var(--primary); }
.search-result.team-tint { background: color-mix(in srgb, var(--conf) 14%, var(--panel)); }
.search-result.team-tint:hover,
.search-result.team-tint.hilite {
  background: color-mix(in srgb, var(--conf) 26%, #f3f4f6);
}
.search-result .conf-tag { margin-left: auto; align-self: center; flex: none; }
.search-empty {
  padding: 12px 10px;
  color: var(--muted);
  font-size: 0.85rem;
}
.search-hint {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Conference filter chips */
.conference-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  align-items: center;
}
.conference-filters .label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border 0.15s, transform 0.05s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #cbd5e1;
}
.chip:hover { border-color: #c4c4c4; }
.chip:active { transform: translateY(1px); }
.chip.active { color: #fff; }
.chip.inactive { opacity: 0.55; }

/* Rank-gap filter */
.rank-gap-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}
.rank-gap-filter .label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 0;
}
.rank-gap-select {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.rank-gap-select:hover { border-color: #9ca3af; }

/* Conference filter utility buttons */
.filter-actions {
  display: inline-flex;
  gap: 6px;
  margin-right: 4px;
}
.util-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border 0.15s, color 0.15s, transform 0.05s;
  user-select: none;
}
.util-btn:hover {
  border-color: #9ca3af;
  color: var(--ink);
}
.util-btn:active { transform: translateY(1px); }

/* Group favorites control */
.group-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.group-label {
  font-size: 0.75rem;
  color: var(--muted);
}
.group-code-input {
  width: 92px;
  padding: 5px 10px;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
}
.group-code-input:focus {
  outline: none;
  border-color: var(--primary);
}
.group-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}
.group-leave,
.group-join {
  padding: 5px 12px;
}

/* Panel cards */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-body { padding: 12px 18px; }

.watch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.watch-toggle input { cursor: pointer; accent-color: var(--primary); }
.header-toggles {
  display: flex;
  align-items: center;
  gap: 14px;
}
.fav-btn {
  font-size: 1.15rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, color 0.12s ease;
}
.fav-btn:hover { color: var(--ink); transform: scale(1.18); }
.fav-btn.active { color: #d97706; }

/* Top half layout */
.top-half {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}
.right-col {
  display: grid;
  gap: 20px;
}

/* Schedule */
.schedule-day { margin-bottom: 6px; }
.time-group { margin-bottom: 14px; }
.time-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 18px 0 0;
}
.time-head::before,
.time-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.time-head .time-text {
  color: var(--primary);
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
}
.game-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  position: relative;
}
.game-row:last-child { border-bottom: none; }
.game-row::before,
.game-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60%;
  pointer-events: none;
  opacity: 0.18;
}
.game-row::before {
  left: 0;
  background: linear-gradient(90deg, var(--cf-l, transparent), transparent);
}
.game-row::after {
  right: 0;
  background: linear-gradient(270deg, var(--cf-r, transparent), transparent);
}
.game-row .teams { flex: 1; min-width: 0; }
.game-row.clickable { cursor: pointer; }
.game-row.clickable:hover { background: rgba(17, 24, 39, 0.03); }
.game-row.clickable:hover .matchup { color: var(--primary); }
.game-row.clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
a.match-sep {
  color: var(--muted);
  text-decoration: none;
}
a.match-sep:hover { color: var(--primary); }
.rank-gap {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  margin: -14px 0 -14px -4px;
  padding: 0 10px 0 6px;
  background: #e5e7eb;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
  position: relative;
  z-index: 1;
}
.rank-gap-num {
  font-size: 1.17rem;
  font-weight: 800;
  line-height: 1;
}
.rank-gap-teams {
  font-size: 0.6rem;
  font-weight: 600;
  color: #6b7280;
  line-height: 1;
  margin-top: 3px;
}
.rank-gap.hot .rank-gap-num { color: #16a34a; }
.rank-gap.warm .rank-gap-num { color: #d97706; }
.rank-gap.mid .rank-gap-num { color: #ea580c; }
.rank-gap.cold .rank-gap-num { color: #dc2626; }
.matchline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.matchup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.match-sep { color: var(--muted); }
.game-row .matchup .away { color: var(--ink); }
.game-row .location {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.9;
  margin-top: 2px;
}
.game-row .side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.watch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
  width: fit-content;
  transition: transform 0.12s ease, background 0.12s ease;
}
.watch-btn:hover { background: #b91c1c; transform: scale(1.06); }
.conf-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.conf-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
a.conf-tag {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.08s ease;
}
a.conf-tag:hover { filter: brightness(1.12); transform: translateY(-1px); }
.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 20px 4px;
  text-align: center;
}
.loading, .error-state {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 16px 4px;
}

/* News */
.news-item {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.news-item:hover .news-title { color: var(--primary); }
.news-item:last-child { border-bottom: none; }
.news-item .news-date { font-size: 0.7rem; color: var(--muted); }
.news-item .news-title { font-weight: 600; margin: 2px 0; }
.news-item .news-excerpt { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 820px) {
  .top-half { grid-template-columns: 1fr; }
  .site-header { flex-wrap: nowrap; }
  .brand p { display: none; }
  .header-menu-btn { display: inline-flex; }
  .site-header .header-right {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.18);
    z-index: 120;
  }
  .site-header.menu-open .header-right { display: flex; }
  .search-wrap { max-width: none; }
  .schedule-nav .schedule-toolbar {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.18);
    z-index: 85;
  }
  .schedule-nav.open .schedule-toolbar { display: flex; flex-wrap: wrap; justify-content: center; }
  .cal-toggle { display: inline-flex; }
}


/* ===== Zine article view ===== */
#article {
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.06), transparent 45%),
    linear-gradient(180deg, #faf6ed 0%, #f3ecdc 100%);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(17, 24, 39, 0.14);
  padding: 18px;
  margin-bottom: 24px;
}
.zine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}
.zine-main { min-width: 0; }
.zine-loading { color: var(--muted); font-style: italic; }

.zine-article {
  background: #fffdf7;
  border: 1px solid var(--ink);
  padding: 26px 30px;
  box-shadow: 4px 4px 0 var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  color: #211a12;
  position: relative;
}
.zine-article::before {
  content: "✂";
  position: absolute;
  top: -4px;
  right: -8px;
  font-size: 1.4rem;
  color: var(--primary);
  transform: rotate(14deg);
}
.zine-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.zine-date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
.zine-tag {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: #faf6ed;
  padding: 3px 8px;
  margin: 0;
}
.zine-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}
.zine-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 5px;
  background: var(--primary);
  margin-top: 8px;
}
.zine-body { font-size: 1.05rem; line-height: 1.7; }
.zine-body p { margin: 0 0 1em; }
.zine-body h1,
.zine-body h2,
.zine-body h3 {
  font-family: Georgia, "Times New Roman", serif;
  margin: 1.2em 0 0.4em;
  line-height: 1.2;
}
.zine-body h2 { border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.zine-body strong { color: var(--primary); }
.zine-body a { color: #1d4ed8; }
.zine-body a:hover { text-decoration-thickness: 2px; }

/* Sidebar (More Articles) */
.zine-list {
  background: #fffdf7;
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(17, 24, 39, 0.2);
  padding: 8px 14px;
}
.zine-list .zine-list-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 2px solid var(--ink);
  padding: 8px 0 6px;
  margin-bottom: 4px;
}
.zine-list .news-item { padding: 10px 2px; }
.zine-list .news-item:hover .news-title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.panel:has(#news-panel) .panel-header {
  background: #fffdf7;
  color: var(--primary);
  border-bottom: 2px solid var(--ink);
}
#news-panel .zine-list {
  border: none;
  box-shadow: none;
}
.zine-404 { color: var(--ink); }

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

/* ===== Schedule → programme links ===== */
.game-title-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.game-title-link:hover .matchup { color: var(--primary); }
.team-inline {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.team-inline:hover { color: var(--primary); text-decoration: underline; }
.matchup .away.team-inline { color: var(--ink); }
.team-inline.away:hover { color: var(--primary); }
.programme-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 3px 10px;
  text-decoration: none;
  white-space: nowrap;
  width: fit-content;
}
.programme-link:hover { background: var(--primary); color: #fff; }

/* ===== Matchday programme page ===== */
.programme-loading { color: var(--muted); font-style: italic; padding: 16px 4px; }
.programme-back {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 14px;
}
.programme-back:hover { text-decoration: underline; }

.programme-header {
  background: var(--panel);
  border: 1px solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 5px 0 rgba(17, 24, 39, 0.12);
  padding: 22px 26px;
  margin-bottom: 22px;
}
.programme-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.programme-matchup {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
.programme-matchup .pg-away { color: var(--ink); }
.programme-matchup .pg-at { color: var(--muted); font-weight: 600; }
.programme-matchup .pg-home { color: var(--ink); }
.programme-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.programme-meta-rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 10px 0 0;
}
.programme-watch { margin-top: 12px; }

.programme-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
.programme-team {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 0;
}
.programme-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.programme-team-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.record-badge {
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.programme-sub {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 16px 0 8px;
}

.form-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.form-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}
.form-chip {
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  display: inline-block;
}
.form-chip.won { background: #dcfce7; color: #166534; }
.form-chip.lost { background: #fee2e2; color: #991b1b; }
a.form-chip { text-decoration: none; }
a.form-chip.won:hover { background: #bbf7d0; }
a.form-chip.lost:hover { background: #fecaca; }
.form-empty { font-size: 0.85rem; color: var(--muted); font-style: italic; }

.programme-h2h { margin-bottom: 20px; }
.h2h-tally { font-weight: 700; margin-bottom: 8px; font-size: 0.92rem; }
.meeting-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.meeting-row:last-child { border-bottom: none; }
.meeting-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}
.meeting-meta { color: var(--muted); font-size: 0.82rem; }

@media (max-width: 820px) {
  .programme-teams { grid-template-columns: 1fr; }
  .meeting-row { flex-direction: column; gap: 2px; }
}

/* ===== Programme: classic paper sheet ===== */
.programme-page { max-width: 1000px; margin: 0 auto; }
.programme-sheet {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 8px 8px 0 rgba(17, 24, 39, 0.15);
  padding: 30px 38px 26px;
  margin-bottom: 30px;
}
.programme-actions {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 5;
}
.prog-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.prog-btn:hover { border-color: var(--ink); background: #f3f4f6; }
.programme-title-wrap { text-align: center; margin-bottom: 26px; }
.programme-title-wrap .programme-kicker { margin-bottom: 10px; }
.programme-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}
.programme-title .pg-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.programme-title .pg-at {
  font-size: 1.3rem;
  font-weight: 700;
  font-style: italic;
  color: var(--muted);
}
.pg-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
  text-decoration: none;
}
a.pg-name:hover { color: var(--primary); text-decoration: underline; }
.stats-kicker {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-align: center;
  text-transform: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 0 0 12px;
  margin: 0 0 20px;
}
.programme-sheet .programme-meta {
  justify-content: center;
  margin-top: 14px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.programme-sheet .programme-watch { margin: 16px auto 0; }

.at-a-glance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 26px;
}
.glance-team {
  padding: 4px 2px;
  min-width: 0;
}
.glance-team-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.glance-team .leaders-list { margin-top: 12px; }
.glance-team .form-list {
  margin-bottom: 12px;
  row-gap: 6px;
  height: 48px;
  overflow: hidden;
  align-content: flex-start;
}

.roster-section {
  padding: 0 2px 10px;
  margin-bottom: 26px;
}
.roster-section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 3px double var(--ink);
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.roster-side {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  padding: 3px 10px;
  border-radius: 3px;
}
.roster-team-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
a.roster-team-name:hover { color: var(--primary); text-decoration: underline; }
.roster-sub {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 18px 0 8px;
  text-align: left;
}
.roster-sub:first-of-type { margin-top: 10px; }
.roster-section .form-list { margin: 8px 0 4px; }

.roster-section .mode-switch { margin: 16px 0 12px; }
.mode-switch {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
}
.mode-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 5px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.mode-btn:hover { color: var(--ink); }
.mode-btn.active {
  color: var(--ink);
  font-weight: 800;
  background: #f3f4f6;
  border-color: var(--line);
  position: relative;
  top: 1px;
}

.table-scroll { overflow-x: auto; }
.roster-table { min-width: 820px; }
.matches-table { min-width: 760px; }

.team-block .match-section { padding: 2px 14px 12px; }
.team-block .match-section .mode-switch { margin: 10px 0 0; }
.stat-grid-wrap .mode-switch { margin: 16px 0 12px; }
.roster-table th,
.roster-table td { border: 1px solid var(--line); }
.roster-table th {
  text-align: right;
  background: #f3f4f6;
  padding: 5px 6px;
}
.roster-table th:first-child,
.roster-table td:first-child { text-align: center; padding-left: 6px; }
.roster-table th:nth-child(2) { text-align: left; }
.roster-table td.td-num { text-align: right; }
.roster-table td:nth-child(2) { text-align: left; }
.roster-table td.leader {
  font-weight: 800;
  background: rgba(220, 38, 38, 0.08);
}
.roster-table td.leader-name { font-weight: 800; }

.leaders-list { border: 1px solid var(--line); border-radius: 4px; }
.leader-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem;
}
.leader-row:last-child { border-bottom: none; }
.leader-cat {
  flex: 0 0 74px;
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}
.leader-unit {
  color: var(--muted);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 2px;
}
.leader-names {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.leader-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.leader-link:hover .leader-name { color: var(--primary); text-decoration: underline; }
.leader-no {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78em;
}
.leader-value {
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-size: 0.92em;
}
.leader-link.rank-1 { font-size: 1.08rem; }
.leader-link.rank-1 .leader-name { font-weight: 800; }
.leader-link.rank-2, .leader-link.rank-3 { font-size: 0.96rem; font-weight: 400; }
.leader-link.rank-2 .leader-name, .leader-link.rank-3 .leader-name { font-weight: 400; }
.leader-link.rank-2 .leader-value, .leader-link.rank-3 .leader-value { font-weight: 600; color: var(--muted); }

.h2h-section { padding: 0 2px; margin-bottom: 26px; }
.h2h-tally { font-weight: 800; font-size: 0.95rem; margin-bottom: 10px; }
.h2h-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.h2h-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  padding: 5px 8px;
}
.h2h-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.h2h-table tr:last-child td { border-bottom: none; }
.h2h-table .h2h-score { font-weight: 800; }
.sheet-fine {
  margin-top: 22px;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  text-align: right;
}

/* Fan extras: hidden on screen, shown in print */
.fan-sketch, .fan-tables, .fan-notes { display: none; }

@media (max-width: 720px) {
  .programme-sheet { padding: 20px 12px 16px; }
  .programme-title { gap: 12px; }
  .programme-title .pg-at { font-size: 1rem; }
  .programme-actions { top: 10px; right: 10px; }
  .at-a-glance { grid-template-columns: 1fr; gap: 14px; }
  .leader-row { flex-direction: column; gap: 2px; }
  .leader-cat { flex-basis: auto; }
}

/* ===== Print / PDF: only the programme sheet ===== */
@media print {
  @page { size: Letter; margin: 0; }
  body { background: #fff !important; }
  .site-header,
  .site-footer,
  .search-wrap,
  .programme-back,
  .programme-actions,
  .site-chrome,
  .programme-watch { display: none !important; }
  body * { visibility: hidden !important; }
   .programme-page,
   .programme-page *,
   .team-page,
   .team-page *,
   .player-page,
   .player-page * { visibility: visible !important; }
   .programme-page,
   .team-page,
   .player-page {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  /* Layout for print: compact so page 1 = programme sheet, page 2 = both roster tables */
  .programme-sheet {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 6px 10px 6px;
    margin-bottom: 0;
  }
  .programme-title { display: none !important; }
  .programme-sheet .programme-meta { margin-top: 4px; font-size: 0.7rem; gap: 6px; }
  .programme-meta-rule { margin-top: 4px; }
  .watch-label { display: block !important; font-size: 0.7rem; color: #374151; margin-top: 4px; }

  .at-a-glance { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
  .glance-team { padding: 1px 1px; }
  .glance-team-head { margin-bottom: 1px; gap: 4px; }
  .glance-team .leaders-list { font-size: 0.64rem; margin-top: 2px; }
  .leader-row { flex-direction: column; align-items: flex-start; gap: 1px; padding: 2px 3px; font-size: 0.68rem; }
  .leader-cat { flex: none; font-size: 0.52rem; padding-bottom: 1px; }
  .leader-names { gap: 1px; }
  .leader-link.rank-2, .leader-link.rank-3 { font-weight: 400; }
  .leader-link.rank-2 .leader-name, .leader-link.rank-3 .leader-name { font-weight: 400; }
  .leader-link.rank-2 .leader-value, .leader-link.rank-3 .leader-value { font-weight: 600; color: var(--muted); }
  .form-list { gap: 2px; }
  .form-chip { font-size: 0.58rem; padding: 1px 4px; }
  .h2h-section { margin-top: 4px; }
  .h2h-section table { font-size: 0.72rem; }
  .h2h-section th, .h2h-section td { padding: 3px 5px; }

  .fan-sheet { page-break-before: always; display: flex; flex-direction: column; min-height: 100vh; }
  .stats-kicker { font-size: clamp(0.95rem, 2.2vw, 1.2rem); padding-bottom: 4px; margin-bottom: 4px; }
  .roster-section-head { padding: 2px 0 4px; gap: 4px; }
  .roster-section-head .roster-team-name { font-size: 0.85rem; }
  .roster-section-head .record-badge { font-size: 0.58rem; padding: 1px 5px; }
  .roster-section-head .form-list { display: none !important; }
  .glance-team .form-list { display: none !important; }
  .roster-section .mode-switch { display: none !important; }
  .roster-section { margin-bottom: 4px; }
  .sheet-fine { margin-top: 6px; font-size: 0.58rem; }

  .table-scroll { overflow-x: visible !important; }
  .roster-table, .matches-table { min-width: 0 !important; width: 100% !important; font-size: 0.52rem !important; line-height: 1.1 !important; table-layout: fixed; }
  .roster-table th, .roster-table td,
  .matches-table th, .matches-table td { padding: 1px 2px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.52rem !important; line-height: 1.1 !important; }
  .roster-table th { background: #ececec !important; font-size: 0.5rem !important; padding: 1px 2px !important; }
  .roster-table td:first-child, .roster-table th:first-child { padding-left: 2px !important; }
  .roster-table thead { display: table-header-group; }

  /* nth-col widths to keep names readable; stat cols share the rest. 16 cols total for roster. */
  .roster-table th:first-child, .roster-table td:first-child { width: 5.2%; }
  .roster-table th:nth-child(2), .roster-table td:nth-child(2) { width: 16%; }
  .roster-table th:nth-child(n+3), .roster-table td:nth-child(n+3) { width: auto; }

  .roster-section { break-inside: auto; }
  .h2h-section,
  .glance-team {
    break-inside: avoid;
  }
  .roster-table tr { break-inside: avoid; break-after: auto; }
  .roster-table td.leader,
  .roster-table td.leader-name {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Fan extras: page 1 sketch grid (6 cols x 2 rows, shared edges, square) and page 2 blank tracker */
  .fan-sketch, .fan-tables, .fan-notes { display: block !important; }
  .fan-sketch { margin-top: 6px; break-inside: avoid; }
  .fan-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    overflow: hidden;
  }
  .fan-box {
    aspect-ratio: 1 / 1;
    background: #fff;
    box-sizing: border-box;
    border-right: 1px solid #9ca3af;
    border-bottom: 1px solid #9ca3af;
  }
  .fan-box:nth-child(6n) { border-right: none; }
  .fan-box:nth-last-child(-n+6) { border-bottom: none; }
  .fan-tables { margin-top: 12px; break-inside: avoid; }
  .fan-notes {
    flex: 1;
    min-height: 90px;
    margin-top: 12px;
  }
  .fan-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .fan-table-wrap { min-width: 0; }
  .fan-table-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
  }
  .fan-team-name { font-size: 0.8rem !important; }
  .fan-blank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.6rem;
    table-layout: fixed;
  }
  .fan-blank-table th {
    background: #ececec;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--line);
    padding: 2px 3px;
    text-align: center;
  }
  .fan-blank-table th:first-child { width: 14%; }
  .fan-blank-table td {
    border: 1px solid var(--line);
    height: 22px;
    padding: 2px 3px;
  }
  .fan-blank-table thead { display: table-header-group; }
}

/* ===== Team page ===== */
.team-page, .player-page { max-width: 1000px; margin: 0 auto; }
.team-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}
.team-title-wrap .team-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}
.team-fav {
  font-size: 1.9rem;
  padding: 4px 6px;
}
.team-fav.active { color: #d97706; }
.team-title-wrap .team-confs { justify-content: center; margin-bottom: 12px; }
.team-title-wrap .team-form { margin-top: 10px; justify-content: center; }
.team-title-wrap .form-list { justify-content: center; }


.team-block {
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}
.team-block-title {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--ink);
}
.team-block .panel-body { padding: 10px 14px; }
.team-list {
  max-height: 320px;
  overflow-y: auto;
  padding-bottom: 4px;
}

/* roster & per-game tables */
.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.stat-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.stat-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-table tr:last-child td { border-bottom: none; }
.stat-table .td-num { text-align: right; }
.stat-table .td-name { font-weight: 600; }
.stat-table tbody tr:hover td { background: #fafafa; }
.stat-table th:first-child,
.stat-table td:first-child { padding-left: 4px; }

.stat-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.stat-table th.sortable:hover { color: var(--ink); }
.stat-table th.sortable::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}
.stat-table th.sortable.asc::after { border-bottom: 5px solid var(--ink); }
.stat-table th.sortable.desc::after { border-top: 5px solid var(--ink); }

.stat-table .row-lost td { color: var(--muted); }
.stat-table .row-lost .td-name,
.stat-table .row-lost .match-link { color: var(--muted); }

.player-inline {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.player-inline:hover { color: var(--primary); text-decoration: underline; }

/* results & upcoming lists */
.result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.result-row:last-child { border-bottom: none; }
.result-date {
  font-size: 0.72rem;
  color: var(--muted);
  width: 78px;
  flex: 0 0 auto;
}
.result-wl {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 8px;
  color: #fff;
}
.result-wl.won { background: #16a34a; }
.result-wl.lost { background: var(--primary); }
.result-opponent {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.result-opponent:hover { color: var(--primary); text-decoration: underline; }
.result-score {
  margin-left: auto;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-decoration: none;
}
a.result-score:hover { color: var(--primary); text-decoration: underline; }
.upcoming-row .programme-link { margin-left: auto; }

/* player page */
.programme-team-name {
  color: inherit;
  text-decoration: none;
}
.programme-team-name:hover { color: var(--primary); text-decoration: underline; }
.programme-matchup .pg-away,
.programme-matchup .pg-home {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.programme-matchup .pg-away:hover,
.programme-matchup .pg-home:hover {
  border-bottom-color: var(--primary);
  color: var(--primary);
}
.jersey-chip {
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
}
.player-team-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 10px;
}
.player-team-link:hover { text-decoration: underline; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  padding: 14px 18px 18px;
}
.stat-cell {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 820px) {
  .stat-table { font-size: 0.78rem; }
}

/* Schedule (calendar) page — no over-encompassing card; controls sit on page bg */
.schedule-page {
  padding-top: 2px;
}

/* Shared sticky controls */
.schedule-controls {
  position: sticky;
  top: var(--header-h, 0);
  z-index: 90;
  background: var(--bg);
  padding: 8px 0 12px;
  margin-bottom: 8px;
}
.controls-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.controls-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  text-align: left;
}
.controls-trigger:hover { color: var(--ink); }
.controls-caret {
  display: inline-block;
  font-size: 0.65rem;
  line-height: 1;
  transition: transform 0.15s ease;
}
.schedule-controls.open .controls-caret { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) {
  .schedule-controls:hover .controls-caret,
  .schedule-controls:focus-within .controls-caret { transform: rotate(180deg); }
}
.controls-summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}
.controls-panel {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.schedule-controls.open .controls-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.18);
  z-index: 95;
  max-height: 70vh;
  overflow-y: auto;
}
@media (hover: hover) and (pointer: fine) {
  .schedule-controls:hover .controls-panel,
  .schedule-controls:focus-within .controls-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.18);
    z-index: 95;
    max-height: 70vh;
    overflow-y: auto;
  }
  }
  .schedule-controls:hover .conference-filters,
  .schedule-controls:focus-within .conference-filters { margin-bottom: 0; }
  .schedule-controls:hover .controls-toggles,
  .schedule-controls:focus-within .controls-toggles { flex-direction: column; align-items: flex-start; }
}
.schedule-controls.open .conference-filters { margin-bottom: 0; }
.schedule-controls.open .controls-toggles {
  flex-direction: column;
  align-items: flex-start;
}

/* Dropdowns (custom) */
.dd { position: relative; }
.dd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  user-select: none;
}
.dd-trigger:hover { border-color: #9ca3af; color: var(--ink); }
.dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 110;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.18);
  padding: 8px 6px;
  min-width: 120px;
  max-height: 260px;
  overflow-y: auto;
  flex-direction: column;
}
.dd-menu::-webkit-scrollbar { width: 8px; }
.dd-menu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.dd:hover .dd-menu,
.dd:focus-within .dd-menu,
.dd.open .dd-menu { display: flex; }
.dd-option {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.dd-option:hover { background: color-mix(in srgb, var(--panel) 0%, #f3f4f6 100%); }
.dd-option.active { background: color-mix(in srgb, #60a5fa 14%, var(--panel)); color: var(--ink); font-weight: 600; }
.rank-gap-dd { margin-top: 4px; }
.rank-gap-dd .dd-trigger { font-size: 0.78rem; }
  position: sticky;
  top: calc(var(--header-h, 0px) + var(--controls-h, 0px));
  z-index: 80;
  background: var(--bg);
  padding: 6px 0 14px;
  margin-bottom: 8px;
}
.cal-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.cal-toggle:hover { border-color: #9ca3af; }
.schedule-nav .schedule-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cal-nav {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.cal-nav:hover { border-color: var(--ink); }
.cal-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.schedule-body { margin-top: 12px; }

/* schedule agenda + viewing plan */
.schedule-main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.agenda-list { min-width: 0; }
.agenda-day { margin-bottom: 14px; }
.agenda-day.past { opacity: 0.45; }
.agenda-day > summary,
.agenda-time > summary {
  list-style: none;
  cursor: pointer;
}
.agenda-day > summary::-webkit-details-marker,
.agenda-time > summary::-webkit-details-marker {
  display: none;
}
.agg-caret {
  display: inline-block;
  color: var(--muted);
  font-size: 0.72rem;
  transform: rotate(0deg);
  transition: transform 0.12s ease;
  width: 0.8em;
}
.agenda-day[open] > .agenda-day-head .agg-caret,
.agenda-time[open] > .agenda-time-head .agg-caret {
  transform: rotate(90deg);
}
.agenda-day-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 2px 6px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 2px;
}
.agenda-time { margin: 0; }
.agenda-time .time-head { margin-top: 14px; }
.agenda-time-count {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.agenda-day.today .agenda-day-head { border-bottom-color: var(--ink); }
.agenda-day-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.agenda-day-count {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.agenda-day-favs {
  font-size: 0.7rem;
  font-weight: 800;
  color: #d97706;
}
.agenda-day-watch {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
}
.agenda-day .cal-empty {
  text-align: left;
  padding: 6px 2px;
}

/* viewing plan panel */
.plan-panel {
  position: sticky;
  top: calc(var(--header-h, 0px) + var(--controls-h, 0px) + var(--cal-h, 0px) + 12px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel);
  max-height: calc(100vh - (var(--header-h,0px) + var(--controls-h,0px) + var(--cal-h,0px) + 36px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 900px) {
  .schedule-main { grid-template-columns: 1fr; }
  .plan-panel { position: sticky; top: calc(var(--header-h,0px) + var(--controls-h,0px) + var(--cal-h,0px) + 12px); }
}
.plan-day-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.plan-day-line::before,
.plan-day-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--primary);
  opacity: 0.5;
}
.plan-item.plan-item-last { border-bottom: none; }
.plan-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}
.plan-total {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin: 4px 0 10px;
}
.plan-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.plan-item:last-child { border-bottom: none; }
.plan-when { flex: none; }
.plan-date {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.plan-time {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.plan-match-link {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.plan-match-link:hover .plan-match {
  color: var(--primary);
}
.plan-match {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-actions { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.plan-watch {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 2px 3px;
}
.plan-watch:hover { text-decoration: underline; }
.plan-later {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.plan-later summary {
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  user-select: none;
}
.plan-later summary:hover { color: var(--ink); }
.plan-later-body { margin-top: 4px; }

.cal-empty { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 8px 0; }

@media (max-width: 900px) {
  .schedule-main { grid-template-columns: 1fr; }
  .plan-panel { position: static; }
}

/* ── team-page panel unity (team page only) ─────────────────────────────── */
.team-page .team-duo {
  display:grid;
  grid-template-columns:1fr minmax(300px,360px);
  gap:20px;
  align-items:start;
  margin-bottom:20px;
}
.team-page .programme-sheet > .team-block { margin-bottom:20px }
.team-page .programme-sheet > .team-block:last-child { margin-bottom:0 }
.team-page .roster-section {
  border:none;
  border-radius:0;
  padding:8px 14px 16px;
  margin:0;
}
.team-page .roster-section-head {
  align-items:center;
  border-bottom:1px solid var(--ink);
  padding-bottom:10px;
  margin-bottom:2px;
}
.team-page .roster-section .mode-switch { margin:14px 0 12px }
.team-page .team-block .sheet-fine {
  margin:4px 0 0;
  padding:0 14px 12px;
}

/* vertical ranked leaders list */
.team-page .team-leaders { flex-direction:column }
.team-page .leader-group { padding:10px 0 6px }
.team-page .leader-group + .leader-group { border-top:1px solid var(--line) }
.team-page .leader-group-sub {
  display:flex;
  align-items:baseline;
  gap:0;
  font-size:0.68rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0.1em;
  color:var(--primary);
  margin-bottom:6px
}
.team-page .leader-rank {
  display:flex;
  align-items:baseline;
  gap:8px;
  padding:6px 2px;
  border-bottom:1px solid var(--line);
  color:var(--ink);
  text-decoration:none;
  min-width:0
}
.team-page .leader-rank:last-child { border-bottom:none }
.team-page .leader-rank-name { font-weight:700 }
.team-page .leader-rank:hover .leader-rank-name { color:var(--primary); text-decoration:underline }
.team-page .leader-no { margin-left:5px }
.team-page .leader-rank-value {
  margin-left:auto;
  font-weight:800;
  color:var(--primary);
  font-variant-numeric:tabular-nums
}
.team-page .leader-rank-1 { font-size:1.08rem }
.team-page .leader-rank-1 .leader-rank-name { font-weight:800 }
.team-page .leader-rank-2,
.team-page .leader-rank-3 { font-size:0.96rem }

/* matches table → roster-table look (grid borders + grey header) */
.team-page .matches-table th,
.team-page .matches-table td { border:1px solid var(--line) }
.team-page .matches-table th {
  text-align:right;
  background:#f3f4f6;
  padding:5px 6px
}
.team-page .matches-table th:first-child,
.team-page .matches-table th:nth-child(2) { text-align:left }
.team-page .matches-table td:first-child { text-align:left; padding-left:8px }

/* collapse duo to 1 column on narrow screens */
@media (max-width:900px) {
  .team-page .team-duo { grid-template-columns:1fr }
}

/* ---- Conferences index ---- */
.conferences-page { max-width: 1200px; margin: 0 auto; }
.conferences-head { margin-bottom: 18px; }
.conferences-title { margin: 0; font-size: 1.4rem; }
.conferences-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }
.conferences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.conference-card {
  border: 1px solid var(--line);
  border-top: 4px solid var(--conf, var(--primary));
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.conference-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.conference-card-head:hover .conference-card-name { text-decoration: underline; }
.conference-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.conference-card-name { font-weight: 800; font-size: 0.95rem; }
.conference-card-count {
  margin-left: auto;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.conference-rank-list {
  list-style: none;
  margin: 0;
  padding: 6px 14px 12px;
  counter-reset: conf-rank;
}
.conference-rank-item {
  counter-increment: conf-rank;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.conference-rank-item:last-child { border-bottom: none; }
.conference-rank-item::before {
  content: counter(conf-rank);
  flex: 0 0 1.4em;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.conference-rank-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conference-rank-link:hover { color: var(--primary); text-decoration: underline; }

/* ---- Conference detail ---- */
.conference-page { max-width: 1000px; margin: 0 auto; }
.conference-page .team-block { margin-bottom: 20px; }
.conference-page .team-block:last-child { margin-bottom: 0; }
.conference-title-wrap { margin: 8px 0 18px; }
.conference-title {
  margin: 0;
  font-size: 1.5rem;
  padding-left: 12px;
  border-left: 6px solid var(--conf, var(--primary));
}

.standings-block .panel-body { padding: 0; overflow-x: auto; }
.standings-table { min-width: 680px; }
.standings-table .standings-rank {
  color: var(--muted);
  font-weight: 700;
  width: 2.5em;
}
.standings-table .standings-team { font-weight: 600; }
.standings-table .standings-team a { color: var(--ink); text-decoration: none; }
.standings-table .standings-team a:hover { color: var(--primary); text-decoration: underline; }
.standings-table .standings-streak { font-weight: 700; }
.streak-win { color: #15803d; }
.streak-loss { color: var(--muted); }

.conf-schedule-body {
  max-height: 480px;
  overflow-y: auto;
}
.conf-game-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.conf-game-row:last-child { border-bottom: none; }
.conf-game-date {
  flex: 0 0 88px;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.conf-game-matchup {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.conf-game-team {
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conf-game-team:hover { color: var(--primary); text-decoration: underline; }
.conf-game-at { color: var(--muted); }
.conf-game-result {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.conf-score-sep { color: var(--muted); font-weight: 400; }
.conf-score-win { color: var(--ink); }
.conf-score-loss { color: var(--muted); font-weight: 600; }
.conf-game-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.conf-game-link { margin-left: 4px; }

.conf-leaders-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.conf-leaders-title .mode-switch { border-bottom: none; }
.conf-leaders-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.conf-leader-card { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.conf-leader-cat {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.conf-leader-list { list-style: none; margin: 0; padding: 0; }
.conf-leader-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.conf-leader-item:last-child { border-bottom: none; }
.conf-leader-name-wrap { flex: 1 1 auto; min-width: 0; }
.conf-leader-name {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.84rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conf-leader-name:hover { color: var(--primary); text-decoration: underline; }
.conf-leader-team {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conf-leader-team:hover { color: var(--primary); text-decoration: underline; }
.conf-leader-value {
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .conf-game-date { flex-basis: 64px; }
  .standings-table { font-size: 0.76rem; }
}
