/* LEAGUE7 static site — dark theme (replaces docsify + docsify-themeable). */

:root {
  --gold: #ffbd00;
  --sb-w: 18rem;
  --bg: #15161a;          /* page background */
  --panel: #1e2025;       /* cards / tables / code */
  --panel-2: #262931;     /* table headers / hover */
  --ink: #d8dbe1;         /* main text */
  --muted: #969ca5;
  --link: #ffce4d;        /* lighter gold for links on dark */
  --border: #34373e;
  --base-font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";

  /* Read at runtime (literal hex) by owls-standings.js + team/match styles. */
  --base-background-color: #1e2025;
  --sidebar-border-color: #34373e;

  /* Bridge legacy (docsify-era) token names still used by team/match styles. */
  --sidebar-background: #1e2025;
  --strong-color: #f1f2f4;
  --strong-font-weight: 700;
  --search-input-background-color: #262931;
}

* { box-sizing: border-box; }

/* No rounded corners anywhere (overrides widget/DataTables/injected styles too). */
*, *::before, *::after { border-radius: 0 !important; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--base-font-family);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.layout { display: flex; align-items: flex-start; }

.sidebar {
  width: var(--sb-w);
  min-width: var(--sb-w);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  background: linear-gradient(180deg, #25272c 0%, #17181b 100%);
  color: #c7cad1;
  padding: 1.25rem 0.9rem 3rem;
  border-right: 1px solid #000;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #44464c; border-radius: 8px; }

.sidebar-logo {
  display: block;
  width: 132px;
  margin: 0.25rem auto 1.4rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.sidebar p { margin: 1.35rem 0 0.35rem; }
.sidebar p strong {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sidebar ul { list-style: none; margin: 0 0 0.3rem; padding: 0; }
.sidebar li { margin: 0; }
.sidebar a {
  display: block;
  color: #c2c5cc;
  padding: 0.42rem 0.7rem;
  border-radius: 7px;
  font-size: 0.92rem;
  line-height: 1.3;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar a:hover { background: rgba(255, 189, 0, 0.13); color: #fff; text-decoration: none; }
.sidebar a.active {
  background: var(--gold);
  color: #1b1c1f;
  font-weight: 700;
}

.sidebar details { margin-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 0.8rem; }
.sidebar details > summary {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  padding: 0.2rem;
}
.sidebar details > summary::-webkit-details-marker { display: none; }
.sidebar details > summary::after { content: " ▾"; }
.sidebar details[open] > summary::after { content: " ▴"; }
.sidebar details p b {
  display: block;
  color: #8d929b;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0.9rem 0 0.2rem;
}
.sidebar details ul { padding: 0; }
.sidebar details a { color: #a9adb5; padding: 0.3rem 0.7rem; font-size: 0.88rem; }

/* Previous-seasons group: many collapsibles under one header read as a single
   nested hierarchy, not as separate top-level sections. */
.sidebar .prev-seasons { margin: 0.1rem 0 0.3rem; }
.sidebar .prev-seasons details {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}
.sidebar .prev-seasons details > summary {
  color: #c2c5cc;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.42rem 0.7rem;
  border-radius: 7px;
}
.sidebar .prev-seasons details > summary:hover { background: rgba(255, 189, 0, 0.12); color: #fff; }
.sidebar .prev-seasons details[open] > summary { color: var(--gold); }
.sidebar .prev-seasons details ul {
  margin: 0.1rem 0 0.3rem 0.85rem;
  padding-left: 0.6rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar .prev-seasons details a { font-size: 0.84rem; padding: 0.24rem 0.7rem; }

/* ── Content / prose ────────────────────────────────────────────────────── */
.content { flex: 1 1 auto; min-width: 0; padding-bottom: 5rem; color: var(--ink); }
.prose { max-width: 62rem; margin: 0 auto; padding: 2.5rem 2.25rem 0; }

.prose h1 {
  color: #fff;
  font-size: 2.15rem;
  line-height: 1.2;
  margin: 0 0 1.1rem;
  padding-bottom: 0.45rem;
  border-bottom: 3px solid var(--gold);
  display: inline-block;
}
.prose h2 { color: #f1f2f4; font-size: 1.55rem; margin: 2.3rem 0 0.85rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
.prose h3 { color: #eceef1; font-size: 1.22rem; margin: 1.7rem 0 0.55rem; }
.prose h4 { color: var(--muted); font-size: 1.05rem; margin: 1.25rem 0 0.4rem; }
.prose p, .prose li { line-height: 1.75; }
.prose a { color: var(--link); font-weight: 500; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.28rem 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.2rem 0; }
.prose code { background: var(--panel); color: #e8cf94; padding: 0.12em 0.4em; border-radius: 5px; font-size: 0.88em; }
.prose pre { background: var(--panel); padding: 1rem; border-radius: 8px; overflow-x: auto; }
.prose blockquote {
  border-left: 4px solid var(--gold);
  margin: 1.2rem 0;
  padding: 0.4rem 1.1rem;
  background: var(--panel);
  color: #c2c6cd;
  border-radius: 0 6px 6px 0;
}
.prose img { border-radius: 8px; }

/* Homepage stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.8rem 0 2.2rem;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.4rem 1rem;
  background: linear-gradient(160deg, #23262d, #1a1c20);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.stat-num { font-size: 2.1rem; font-weight: 800; color: var(--gold); line-height: 1.1; }
.stat-label { margin-top: 0.35rem; font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

/* ── Stat leaders (top-5 cards per category) ─────────────────────────────── */
.lb-nav { margin-top: 1.4rem; }
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0 1rem;
}
.lb-card {
  background: linear-gradient(160deg, #23262d, #1a1c20);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem 0.6rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.lb-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.lb-head { display: flex; align-items: center; gap: 0.55rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.lb-cat { font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.lb-role {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.12rem 0.45rem; border-radius: 999px; color: #15161a; white-space: nowrap;
}
.role-seeker { background: #ffd24d; }
.role-chaser { background: #6fd3ff; }
.role-beater { background: #ff8d6f; }
.role-keeper { background: #9be08a; }
.lb-list { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.lb-row { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.3rem 0; line-height: 1.3; font-size: 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { width: 1.5rem; flex: none; text-align: center; color: var(--muted); font-weight: 700; font-size: 0.8rem; }
.lb-name { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.lb-value { flex: none; font-weight: 700; font-size: 0.9rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.lb-note { color: var(--muted); font-size: 0.82rem; font-style: italic; margin-top: 0.8rem; }

.prose iframe { max-width: 100%; border: 0; border-radius: 10px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4); }

.prose table { border-collapse: collapse; width: 100%; margin: 1.25rem 0; font-size: 0.93rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; }
.prose thead th { background: var(--panel-2); color: var(--gold); font-weight: 700; }
.prose tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }

/* DataTables controls (no DataTables CSS is loaded, so style them for dark). */
.dataTables_wrapper { color: var(--ink); }
.dataTables_filter input,
.dataTables_length select {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
}
.dataTables_info { color: var(--muted); }
.dataTables_paginate .paginate_button { color: var(--ink) !important; padding: 0.4em 0.9em !important; margin: 0 0.15em !important; }
.dataTables_paginate .paginate_button.current { background: var(--gold) !important; color: #1b1c1f !important; border-radius: 6px; }
.table { width: 100% !important; }

/* Click-to-sort headers (added by scripts/sortable-tables.js). */
th.th-sortable { cursor: pointer; user-select: none; }
th.th-sortable:hover { color: var(--gold); }
th.th-sortable::after { content: " ⇅"; opacity: 0.35; font-size: 0.85em; }
th.th-sortable.sort-asc::after { content: " ↑"; opacity: 1; color: var(--gold); }
th.th-sortable.sort-desc::after { content: " ↓"; opacity: 1; color: var(--gold); }

/* ── Hall of Fame — League Champions showcase ───────────────────────────── */
.champions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 2.5rem;
}
.champion-card {
  position: relative;
  text-align: center;
  padding: 2.2rem 1.5rem 1.6rem;
  background: linear-gradient(180deg, #2a2c33 0%, #191a1e 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.champion-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ffbd00, #ffe7a0, #ffbd00);
}
.champion-card::after {
  content: "🏆";
  position: absolute;
  top: 0.7rem; right: 0.9rem;
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.champion-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 16px 38px rgba(0, 0, 0, 0.45); }
.champion-card .champion-eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.champion-card .champion-logo {
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin: 0.3rem auto 0.8rem;
  border-radius: 0;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}
.champion-card .champion-name { margin: 0 0 0.7rem; border: none; padding: 0; font-size: 1.6rem; }
.champion-card .champion-name a { color: var(--gold); font-weight: 800; }
.champion-card .champion-name a:hover { text-decoration: none; filter: brightness(1.08); }
.season-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-bottom: 1rem; }
.season-badge {
  background: rgba(255, 189, 0, 0.14);
  color: var(--gold);
  border: 1px solid rgba(255, 189, 0, 0.4);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.champion-card .champion-blurb { color: var(--ink); font-size: 0.95rem; line-height: 1.65; margin: 0 auto 1.1rem; max-width: 36ch; }
.champion-card .champion-link { color: var(--gold); font-weight: 700; }

/* ── Team page champion hero ────────────────────────────────────────────── */
.team-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.8rem;
  padding: 2rem;
  margin: 0.5rem 0 2.2rem;
  background: linear-gradient(135deg, #2a2c33 0%, #191a1e 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.team-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ffbd00, #ffe7a0, #ffbd00);
}
.team-hero .team-hero-logo {
  flex: 0 0 auto;
  width: 175px;
  height: 175px;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55));
}
.team-hero-body { flex: 1 1 auto; min-width: 0; }
.team-hero-eyebrow {
  color: var(--gold);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.team-hero .team-hero-name { display: block; margin: 0 0 0.7rem; padding: 0; border: none; color: #fff; font-size: 2.4rem; line-height: 1.1; }
.team-hero-desc { color: var(--ink); line-height: 1.65; margin: 0.6rem 0 1rem; }
.team-showcase { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.team-showcase li { position: relative; padding-left: 1.8rem; color: var(--ink); }
.team-showcase li::before { content: "🏆"; position: absolute; left: 0; top: 0; }
@media (max-width: 640px) {
  .team-hero { flex-direction: column; text-align: center; padding: 1.5rem; }
  .team-hero .team-hero-name { font-size: 1.9rem; }
  .season-badges { justify-content: center; }
}

/* ── Watch Matches (video grid) ─────────────────────────────────────────── */
.watch-links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 0.5rem 0 1.6rem; }
.btn-gold, .btn-outline {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn-gold { background: var(--gold); color: #1b1c1f; }
.btn-outline { border: 1px solid var(--gold); color: var(--gold); }
.btn-gold:hover, .btn-outline:hover { transform: translateY(-2px); text-decoration: none; }
.btn-outline:hover { background: rgba(255, 189, 0, 0.1); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.video-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.video-card:hover { border-color: var(--gold); }
.video-frame { position: relative; padding-top: 56.25%; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-title { padding: 0.7rem 0.9rem; font-size: 0.92rem; font-weight: 600; color: var(--ink); }

/* ── Playerbase table ───────────────────────────────────────────────────── */
.pb-count { color: var(--muted); margin: 0 0 0.6rem; }
.pb-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.pb-table th, .pb-table td { border: 1px solid var(--border); padding: 0.45rem 0.65rem; text-align: left; }
.pb-table thead th { background: var(--panel-2); color: var(--gold); position: sticky; top: 0; }
.pb-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.pb-table tbody tr:hover { background: rgba(255, 189, 0, 0.07); }
.pb-name { font-weight: 700; color: #fff; }
.pb-social a { margin-right: 0.3rem; font-size: 0.85rem; }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { margin: 1.5rem 0; }
.tab-nav { display: flex; flex-wrap: wrap; gap: 0.3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; }
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  padding: 0.55rem 1.05rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.tab-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; animation: fadeIn 0.18s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Back-to-top button ─────────────────────────────────────────────────── */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  width: 2.6rem;
  height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: var(--gold);
  color: #1b1c1f;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ── Calendar / table filter input ──────────────────────────────────────── */
.table-filter {
  width: 100%;
  max-width: 22rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.8rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}
.table-filter:focus { outline: none; border-color: var(--gold); }

/* ── Hero / cover (homepage) ────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(460px, 78vh, 760px);
  padding: 3rem 1.5rem;
  overflow: hidden;
  background: #15161a;
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(12, 13, 16, 0.45) 0%, rgba(12, 13, 16, 0.55) 45%, rgba(12, 13, 16, 0.85) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 48rem; text-align: center; }
.landing-logo { width: min(320px, 70%); max-height: 300px; object-fit: contain; margin: 0 auto 1.2rem; filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55)); }
.landing-title { color: var(--gold); font-family: "Trebuchet MS", sans-serif; letter-spacing: 0.5rem; font-size: 2.2rem; }
.landing-subtitle { color: var(--gold); font-family: "Trebuchet MS", sans-serif; letter-spacing: 0.3rem; }
.landing-description {
  color: #fff;
  max-width: 46rem;
  margin: 0.8rem auto 1.8rem;
  font-size: 1.14rem;
  line-height: 1.65;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}
.hero p { margin: 0; }
.hero a {
  display: inline-block;
  margin: 0.4rem;
  padding: 0.62rem 1.3rem;
  background: var(--gold);
  color: #1b1c1f;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.hero a:hover { transform: translateY(-2px); filter: brightness(1.06); text-decoration: none; }

/* ── Match calendar table ───────────────────────────────────────────────── */
.match-calendar-table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.match-calendar-table th, .match-calendar-table td { border: 1px solid var(--border); padding: 0.6rem 0.8rem; }
.match-calendar-table thead th { background: var(--panel-2); color: var(--gold); text-align: left; letter-spacing: 0.03em; }
.match-calendar-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.match-calendar-table .mc-team { font-weight: 600; }
.match-calendar-table .mc-vs { color: var(--muted); text-align: center; font-style: italic; }
.mc-empty { color: var(--muted); font-style: italic; padding: 1.5rem 0; }

/* ── HP quote helper (carried from the old inline styles) ───────────────── */
.hp-quote-wrapper { padding: 0 20px; margin: 0 50px 0 30px; color: var(--muted); }
.hp-quote-text { font-size: 110%; font-style: italic; text-align: left; }
.hp-quote-author { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
.menu-toggle {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  background: #1b1c1f;
  color: var(--gold);
  border: none;
  border-radius: 8px;
  font-size: 1.3rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .prose { padding: 3.5rem 1.25rem 0; }
  .hero { min-height: 68vh; }
}

/* ── Live league views (standings / results / activity) ─────────────────────── */
.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.standings-table td:first-child { color: var(--muted); width: 2.2rem; text-align: center; }
.standings-table th:not(:first-child):not(:nth-child(2)),
.standings-table td:not(:first-child):not(:nth-child(2)) { text-align: center; }

.match-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 0 0 0.8rem;
  background: var(--panel-2);
}
.match-card h4 { margin: 0 0 0.35rem; }
.match-card .match-meta { color: var(--muted); font-size: 0.8rem; font-weight: normal; }
.match-card p { margin: 0.2rem 0; }
.match-card details { margin-top: 0.4rem; }
.match-card summary { cursor: pointer; color: var(--gold); }

.activity-feed { list-style: none; padding: 0; margin: 0; }
.activity-feed li {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.2rem;
  font-size: 0.9rem;
}
.activity-when { color: var(--muted); font-size: 0.8rem; margin-right: 0.4rem; }
.activity-tag {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--gold);
  background: rgba(255, 189, 0, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  margin-right: 0.4rem;
}
.activity-actor { color: var(--muted); }

/* ── Match list (calendar + results), clean single-list style ───────────────── */
.mc-panel { display: none; }
.mc-panel.active { display: block; }
.match-list { margin-top: 0.6rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.match-item { border-bottom: 1px solid var(--border); }
.match-item:last-child { border-bottom: none; }
.match-item:nth-child(even) .match-row { background: rgba(255, 255, 255, 0.02); }
.match-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
}
.mr-logo { width: 24px; height: 24px; object-fit: contain; flex: 0 0 auto; }
.mr-team { font-weight: 600; }
.mr-mid { color: var(--muted); margin: 0 0.15rem; }
.mr-score { font-weight: 800; color: var(--gold); margin: 0 0.3rem; white-space: nowrap; }
.mr-date { color: var(--muted); font-size: 0.82rem; white-space: nowrap; flex: 0 0 auto; min-width: 15rem; }
.match-item.expandable .match-row { cursor: pointer; }
.mr-detail { display: none; padding: 0 0.9rem 0.7rem; font-size: 0.85rem; color: #d6d9df; }
.match-item.open .mr-detail { display: block; }
.mr-detail .mr-dsec { margin-top: 0.35rem; }
.mr-detail .mr-dlabel { color: var(--gold); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; margin-right: 0.4rem; }
@media (max-width: 560px) {
  .match-row { flex-wrap: wrap; }
  .mr-date { flex-basis: 100%; min-width: 0; }
}

/* ── Playerbase showcase (card grid) ────────────────────────────────────────── */
.pb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 760px) { .pb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .pb-grid { grid-template-columns: 1fr; } }
.pb-card {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid var(--pb-a, var(--border));
  background: var(--panel);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pb-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); }
/* Background = the player's avatar, blurred + darkened so text stays readable. */
.pb-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.1);
  filter: blur(2px) brightness(0.5);
}
.pb-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0.88));
}
.pb-team-logo {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}
.pb-house-logo {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
}
/* Crown: marks players holding an org/leadership role (top-centre of the card). */
.pb-crown {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 1.15rem;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.95));
  pointer-events: none;
}
/* Player info (region · platform · input) at the very bottom of the card. */
.pb-info {
  margin-top: 0.2rem;
  font-size: 0.66rem;
  color: #cfd2d8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}
.pb-acc-row {
  display: flex;
  justify-content: center;
  gap: 1px;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
}
/* Click-to-expand detail: all of a player's roles. */
.pb-detail {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(10, 11, 13, 0.94);
  padding: 0.7rem 0.75rem;
  overflow-y: auto;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}
.pb-card.open .pb-detail { opacity: 1; visibility: visible; }
.pb-detail-head { font-weight: 800; font-size: 0.95rem; color: #fff; margin-bottom: 0.5rem; }
.pb-detail-handle { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.pb-dsec { margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.pb-dlabel {
  display: block;
  width: 100%;
  color: var(--gold);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.12rem;
}
.pb-dval { color: #d6d9df; font-size: 0.8rem; }
.pb-badge {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}
.pb-detail .pb-social { margin-top: 0.3rem; font-size: 0.8rem; }
.pb-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.5rem 0.6rem 0.7rem;
  text-align: center;
}
.pb-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
  border-top: 2px solid var(--pb-a, var(--gold));
  padding-top: 0.35rem;
  word-break: break-word;
}
.pb-roles {
  margin-top: 0.25rem;
  color: #ffd86b;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}
.pb-joined {
  margin-top: 0.15rem;
  color: #d6d9df;
  font-size: 0.66rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}
.pb-socials { display: flex; justify-content: center; gap: 0.45rem; margin-top: 0.3rem; }
.pb-social-ic img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95));
}
.pb-social-ic:hover img { opacity: 1; }

/* ── Player profile page ────────────────────────────────────────────────────── */
.pp-back { display: inline-block; margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; }

/* Hall-of-Fame-style two-column hero: identity (left) + affiliations (right) */
.pp-hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 1.8rem 2rem;
  margin: 0.2rem 0 1.8rem;
  background: linear-gradient(135deg, #2a2c33 0%, #191a1e 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}
.pp-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pb-a, #ffbd00), var(--pb-b, #ffe7a0), var(--pb-a, #ffbd00));
}
.pp-left { flex: 0 0 240px; max-width: 240px; padding-right: 1.8rem; text-align: center; }
.pp-right { flex: 1 1 auto; min-width: 0; padding: 0.4rem 0 0 1.8rem; border-left: 1px solid var(--border); }
.pp-left .pp-avatar {
  width: 168px; height: 168px;
  display: block; margin: 0 auto 0.9rem;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--pb-a, var(--gold));
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
}
.pp-name { margin: 0 0 0.2rem; padding: 0; border: none; color: #fff; font-size: 1.6rem; line-height: 1.15; font-weight: 800; word-break: break-word; }
.pp-handle { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.7rem; }
.pp-crests { display: flex; justify-content: flex-start; align-items: center; gap: 0.6rem; margin: 0.3rem 0 0.5rem; }
.pp-crests img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); }
.pp-meta { color: var(--muted); font-size: 0.84rem; line-height: 1.5; margin-top: 0.5rem; }
.pp-joined { color: var(--muted); font-size: 0.76rem; margin-top: 0.15rem; }
.pp-right .pb-socials { justify-content: flex-start; margin-top: 0.7rem; }

/* Team history — a crest per season, newest first */
.pp-teams { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 1rem; margin: 0 0 0.9rem; }
.pp-team { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.pp-team img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.6)); }
.pp-team-s {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.pp-right .pb-badges { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0.45rem; margin: 0 0 0.8rem; }
.pp-right .pb-badges.positions .pb-badge { background: rgba(255, 189, 0, 0.14); color: var(--gold); border-color: rgba(255, 189, 0, 0.4); }
.pp-right .pb-badges.accolades .pb-badge,
.pp-right .pb-badges.events .pb-badge { background: rgba(255, 189, 0, 0.1); color: #ffd86b; }
/* Full role list on the profile, with org/leadership roles highlighted. */
.pp-roles-label {
  width: 100%;
  color: var(--gold);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin-bottom: 0.35rem;
}
.pb-badge--key {
  background: rgba(255, 189, 0, 0.22);
  color: var(--gold);
  border-color: var(--gold);
  font-weight: 700;
}
@media (max-width: 640px) {
  .pp-hero { flex-direction: column; }
  .pp-left { flex-basis: auto; max-width: none; width: 100%; padding-right: 0; }
  .pp-right {
    border-left: none; padding: 1rem 0 0;
    border-top: 1px solid var(--border); margin-top: 1rem;
  }
  .pp-right .pb-badges, .pp-teams, .pp-crests, .pp-right .pb-socials { justify-content: center; }
  .pp-name { font-size: 1.5rem; }
}

/* QC stats dashboard */
.qc-title { margin: 1.8rem 0 0.6rem; }
.qc-disclaimer {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
  margin: 2rem 0 0;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 8px 8px 0;
}
.qc-meta { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.9rem; }
.qc-updated { color: var(--muted); font-size: 0.8rem; }
.qc-refresh {
  margin-left: auto;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.82rem; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.qc-refresh:hover { border-color: var(--gold); color: #fff; }
.qc-refresh:disabled { opacity: 0.5; cursor: default; }
.qc-loading { color: var(--muted); }
.qc-panel { display: none; }
.qc-panel.active { display: block; }

.qc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}
.qc-stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  transition: border-color 0.15s, transform 0.15s;
}
.qc-stat:hover { border-color: var(--gold); transform: translateY(-2px); }
.qc-stat--wide { grid-column: 1 / -1; }
.qc-stat-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.qc-stat-value { color: #fff; font-size: 1.3rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.qc-stat-sub { display: inline-block; color: var(--gold); font-size: 0.8rem; font-weight: 700; margin-left: 0.15rem; }

/* MMR distribution histogram (per role tab) */
.mmr-dist {
  margin: 0 0 1.3rem;
  padding: 0.9rem 1rem 0.7rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.mmr-dist-head { color: var(--muted); font-size: 0.8rem; line-height: 1.5; margin-bottom: 0.6rem; }
.mmr-you-t { color: var(--gold); font-weight: 700; }
.mmr-bars {
  position: relative;
  display: flex; align-items: flex-end; gap: 2px;
  height: 110px;
  border-bottom: 1px solid var(--border);
}
.mmr-bar { flex: 1 1 0; min-width: 0; background: var(--panel-2); border-radius: 2px 2px 0 0; }
.mmr-bar--you { background: var(--gold); }
.mmr-marker { position: absolute; top: -6px; bottom: 0; width: 2px; background: #fff; pointer-events: none; }
.mmr-marker::before {
  content: ""; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #fff;
}
.mmr-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.7rem; margin-top: 0.3rem; }

.pb-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0 0.8rem; }
.pb-tab {
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pb-tab:hover { color: #fff; border-color: var(--gold); }
.pb-tab.active { background: var(--gold); color: #1b1d22; border-color: var(--gold); font-weight: 700; }
.pb-tab-n { opacity: 0.7; font-size: 0.78rem; }
.pb-tab.active .pb-tab-n { opacity: 0.85; }
