:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-2: #20242d;
  --text: #e8e8ea;
  --muted: #9aa0ab;
  --accent: #E81F3E;
  --accent-2: #6f9bff;
  /* Republic Red plays three roles that one value can't cover: as a fill
     behind white text it must be darker (#C8102E is 5.88:1 with white,
     the brand red only 4.47:1), and as small text on our dark surfaces it
     must be lighter (#F0455F is 5.1:1, the brand red only 4.19:1). Use
     --accent for borders/graphics, --accent-strong for filled controls,
     --accent-text for accent-colored copy. --accent-rgb exists because
     rgba() can't take a hex custom property. */
  --accent-strong: #C8102E;
  --accent-text: #F0455F;
  --accent-rgb: 232, 31, 62;
  --on-accent: #ffffff;
  --border: #2a2e37;
  --live: #e64980;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;

  /* Categorical palette, dark-surface steps, fixed hue order -- never
     reassign a slot's hue, never cycle. Also read directly by charts.js. */
  --series-1: #3987e5; /* blue */
  --series-2: #d95926; /* orange */
  --series-3: #199e70; /* aqua */
  --series-4: #c98500; /* yellow */
  --series-5: #d55181; /* magenta */
  --series-6: #008300; /* green */
  --series-7: #9085e9; /* violet */
  --series-8: #e66767; /* red */

  /* Status palette -- reserved for actual state (win/loss, live/offline),
     never reused as a generic series color. */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --status-neutral: #6b6f7a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% -10%, #1b2130 0%, var(--bg) 45%) fixed, var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* --- Top nav ------------------------------------------------------------ */
.site-header {
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-right: auto;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.brand-tagline { color: var(--muted); font-size: 0.85rem; }

.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }

.site-nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.site-nav a.active { color: var(--on-accent); background: var(--accent-strong); }

.nav-account { display: flex; align-items: center; gap: 0.6rem; }

.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--border);
  object-fit: cover;
}

.staff-pill {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--accent-text); border: 1px solid var(--accent);
  border-radius: 999px; padding: 0.1rem 0.5rem;
}

/* --- Layout --------------------------------------------------------------- */
main { flex: 1; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem;
}

.page.narrow { max-width: 720px; }

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.page-head h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; letter-spacing: -0.01em; }
.page-lede { color: var(--muted); margin: 0.35rem 0 0; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* --- Flash messages ------------------------------------------------------- */
.flash-stack { max-width: 1080px; margin: 1rem auto 0; padding: 0 2rem; display: grid; gap: 0.5rem; }
.flash {
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--panel);
}
.flash.ok { border-color: var(--status-good); }
.flash.error { border-color: var(--status-critical); }

/* --- Discord invite banner ---------------------------------------------- */
.discord-banner {
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
  background: #2c2f7a; color: #fff; padding: 0.6rem 1.5rem; font-size: 0.85rem; text-align: center;
}
.discord-banner .btn.discord { flex: none; padding: 0.4rem 0.9rem; }

/* --- Buttons / forms -------------------------------------------------- */
input, select, textarea, button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

button, .btn {
  cursor: pointer;
  background: var(--accent-strong);
  color: var(--on-accent);
  border: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

button:hover, .btn:hover { opacity: 0.9; transform: translateY(-1px); text-decoration: none; }
button:active, .btn:active { transform: translateY(0); }

.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: transparent; color: var(--status-critical); border: 1px solid var(--status-critical); }

.field { display: grid; gap: 0.35rem; margin-bottom: 1.1rem; }
.field label { font-weight: 600; font-size: 0.85rem; color: var(--muted); }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row .field { flex: 1 1 200px; }
.field-hint { color: var(--muted); font-size: 0.78rem; margin: 0; }

/* --- Cover image focal-point picker ------------------------------------- */
.focal-picker {
  position: relative; display: inline-block; max-width: 320px; width: 100%;
  margin: 0.5rem 0; cursor: crosshair; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.focal-picker[hidden] { display: none; }
.focal-preview { display: block; width: 100%; aspect-ratio: 21/9; object-fit: cover; background: var(--panel-2); }
.focal-marker {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid #fff; border-radius: 50%; background: rgba(var(--accent-rgb), 0.85);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); pointer-events: none;
}
.checkbox-field { flex-direction: row; align-items: center; gap: 0.5rem; }
.checkbox-field input { width: auto; }

/* --- Article editor: clip embeds ---------------------------------------- */
.ql-editor clip-embed {
  display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0;
  padding: 0.6rem 0.8rem; border-radius: 8px;
  background: var(--panel-2); border: 1px dashed var(--border);
  color: var(--muted); font-size: 0.88rem; cursor: default; user-select: none;
}
.clip-picker-wrap { position: relative; display: inline-block; margin-bottom: 0.5rem; }
.clip-picker-panel {
  position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 5;
  width: 320px; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); padding: 0.4rem;
}
.clip-picker-panel[hidden] { display: none; }
.clip-picker-empty { margin: 0; padding: 0.6rem; color: var(--muted); font-size: 0.85rem; }
.clip-picker-row {
  display: flex; flex-direction: column; gap: 0.1rem; width: 100%; text-align: left;
  background: none; border: none; border-radius: 6px; padding: 0.5rem 0.6rem;
  color: var(--text); cursor: pointer; font: inherit;
}
.clip-picker-row:hover { background: var(--panel-2); }
.clip-picker-row-title { font-weight: 600; font-size: 0.88rem; }
.clip-picker-row-meta { font-size: 0.75rem; color: var(--muted); }

.form-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.25rem; }

/* --- Cards ----------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* --- Hero: full-bleed featured story banner ---------------------------- */
.hero-featured {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(76vh, 620px);
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  isolation: isolate;
  color: var(--text);
}
.hero-featured::before {
  content: "";
  position: absolute;
  inset: -4%;
  /* `background: inherit` already pulls background-position from the parent
     (which carries the article's focal point via inline style) -- an
     explicit background-position here would silently override it back to
     dead-center for every featured story. */
  background: inherit;
  background-size: cover;
  animation: heroZoom 22s ease-in-out infinite alternate;
  z-index: -2;
}
.hero-featured.no-image {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 46px),
    radial-gradient(circle at 25% 20%, rgba(var(--accent-rgb), 0.35), transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(57, 135, 229, 0.25), transparent 50%),
    linear-gradient(160deg, #3d0f1a 0%, #0b0f14 65%);
}
.hero-featured.no-image::before { content: none; }

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 8, 11, 0.05) 0%, rgba(6, 8, 11, 0.55) 55%, rgba(6, 8, 11, 0.97) 100%);
  z-index: -1;
}

.hero-content {
  position: relative;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 2rem 4.5rem;
}

.hero-kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-text);
  margin-bottom: 0.6rem;
}
.hero-content .category-badge { margin-left: 0.6rem; vertical-align: middle; }

.hero-content h1 {
  margin: 0.4rem 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.hero-content h1 a { color: inherit; }
.hero-content h1 a:hover { text-decoration: none; color: var(--accent-text); }
.hero-content p { margin: 0 0 1.25rem; color: #d7d9de; max-width: 620px; font-size: 1.1rem; }

.hero-meta { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.hero-meta .article-meta { color: #b7bac2; }
.hero-cta { padding: 0.7rem 1.4rem; }

.scroll-cue {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  animation: bounceCue 2s ease-in-out infinite;
}

@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.09); } }
@keyframes bounceCue { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

@media (prefers-reduced-motion: reduce) {
  .hero-featured::before { animation: none; }
  .scroll-cue { animation: none; }
}

/* --- Match center ribbon ------------------------------------------------- */
.match-center {
  background: linear-gradient(135deg, #3d0f1a, #0d1720 65%);
  border-bottom: 1px solid var(--border);
}
.match-center-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.mc-kicker-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-text);
  flex: none;
}
.mc-matchup { display: flex; align-items: center; gap: 1rem; flex: 1 1 auto; min-width: 240px; }
.mc-team { display: flex; align-items: center; gap: 0.6rem; }
.crest {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--panel-2); border: 2px solid var(--border);
  font-family: var(--font-display); font-weight: 800; font-size: 0.9rem;
  flex: none;
}
/* Real club colors from EA's crestColor, when available -- see
   ea_client.crest_colors(). White text with a shadow reads fine against
   the saturated colors EA actually issues (team kit colors), even though
   it isn't a true contrast check against arbitrary values. */
.crest-branded { color: #fff; border-color: rgba(255, 255, 255, 0.35); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.mc-team-name { font-weight: 700; font-size: 0.95rem; }
.mc-vs { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; color: var(--muted); font-size: 0.72rem; }
.mc-vs-text { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--text); }
.mc-countdown { display: flex; gap: 0.5rem; flex: none; }
.cd-box {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 0.4rem 0.6rem; min-width: 44px;
}
.cd-box span { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1; }
.cd-box small { color: var(--muted); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; }
.mc-cta { flex: none; }
.mc-empty { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* --- News rail (horizontal scroll) --------------------------------------- */
.news-rail {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x proximity;
}
.news-rail::-webkit-scrollbar { height: 8px; }
.news-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.rail-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rail-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.rail-card-image { position: relative; aspect-ratio: 4/3; background: var(--panel-2); overflow: hidden; }
.rail-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.rail-card:hover .rail-card-image img { transform: scale(1.06); }
.rail-card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.rail-card-body h3 { margin: 0; font-size: 1rem; line-height: 1.3; }

.play-badge {
  position: absolute; inset: 0; margin: auto; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 16, 0.6); border-radius: 50%; color: #fff; font-size: 0.95rem;
  backdrop-filter: blur(2px);
}

/* --- Transfer centre band -------------------------------------------------- */
.section-band {
  background: linear-gradient(135deg, rgba(201, 133, 0, 0.1), transparent 60%), var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin: 2.5rem 0;
}
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.band-head a { font-size: 0.85rem; font-weight: 600; }
.band-list { display: grid; gap: 0.1rem; }
.band-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); color: var(--text); }
.band-row:last-child { border-bottom: none; }
.band-row:hover { text-decoration: none; color: var(--status-warning); }
.band-arrow { color: var(--status-warning); font-weight: 700; flex: none; }
.band-title { flex: 1; font-weight: 600; }

/* --- Featured stream (embedded Twitch player) ---------------------------- */
.featured-stream { padding: 0; overflow: hidden; margin-bottom: 1.5rem; }
.featured-stream-player { position: relative; aspect-ratio: 16/9; background: #000; }
.featured-stream-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.featured-stream-info {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem; flex-wrap: wrap;
}
.featured-stream-text { flex: 1; min-width: 0; }
.featured-pill {
  display: inline-block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--live); border: 1px solid var(--live);
  border-radius: 4px; padding: 0.05rem 0.4rem; vertical-align: middle; margin-left: 0.3rem;
}

/* --- Live banner ------------------------------------------------------------ */
.live-banner { margin: 2.5rem 0; }
.live-banner-head {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.9rem; margin-bottom: 1rem;
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); animation: pulseDot 1.6s ease-in-out infinite; }
@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(230, 73, 128, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(230, 73, 128, 0); }
}
.live-banner-row { display: flex; gap: 1.25rem; overflow-x: auto; padding-bottom: 0.5rem; }
.live-banner-card { flex: 0 0 280px; border-radius: 14px; overflow: hidden; border: 1px solid var(--live); background: var(--panel); color: var(--text); }
.live-banner-card:hover { text-decoration: none; }
.live-banner-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.live-banner-info { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem; }

/* --- Scroll reveal (see countup.js) --------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* --- Club standing hero band (home page) ---------------------------------- */
.standing-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #141a24 0%, #0b0f14 100%);
  padding: clamp(2rem, 5vw, 3.25rem) 2rem;
  margin-bottom: 1rem;
}
.standing-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.35), transparent 70%);
  animation: standingDrift 10s ease-in-out infinite alternate;
  z-index: -2;
  pointer-events: none;
}
.standing-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.08) 45%, transparent 60%);
  background-size: 250% 100%;
  animation: standingShine 6s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}
@keyframes standingDrift {
  from { transform: translate(-6%, -4%) scale(1); }
  to { transform: translate(6%, 4%) scale(1.15); }
}
@keyframes standingShine {
  0% { background-position: 150% 0; }
  55%, 100% { background-position: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .standing-glow, .standing-shine { animation: none; }
}

.standing-grid {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 6vw, 4.5rem);
  flex-wrap: wrap;
  text-align: center;
}
.standing-item { display: flex; flex-direction: column; align-items: center; gap: 0.65rem; }
.standing-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.division-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
  transition: transform 0.2s ease;
}
.division-ring:hover { transform: scale(1.06); }
.division-ring span { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--text); }
.division-ring--muted { border-color: var(--border); box-shadow: none; }

.standing-value--hero {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.5rem, 9vw, 5.5rem);
  line-height: 1;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

/* --- Quill rich text editor (dark theme override, see article-editor.js) - */
.ql-toolbar.ql-snow {
  border-color: var(--border);
  border-radius: 8px 8px 0 0;
  background: var(--panel-2);
}
.ql-container.ql-snow {
  border-color: var(--border);
  border-radius: 0 0 8px 8px;
  background: var(--panel);
  font-family: inherit;
  font-size: 0.95rem;
}
.ql-editor { min-height: 260px; color: var(--text); }
.ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.ql-snow .ql-stroke { stroke: var(--muted); }
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill { fill: var(--muted); }
.ql-snow .ql-picker { color: var(--muted); }
.ql-snow .ql-picker-options { background: var(--panel); border-color: var(--border) !important; }
.ql-snow .ql-picker-item:hover, .ql-snow .ql-picker-label:hover { color: var(--accent-text); }
.ql-snow.ql-toolbar button:hover, .ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active, .ql-snow .ql-toolbar button.ql-active {
  color: var(--accent-text);
}
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke, .ql-snow .ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--accent);
}
.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill, .ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: var(--accent);
}
.ql-snow .ql-tooltip {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.ql-snow .ql-tooltip input[type=text] {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 4px;
}
.ql-snow .ql-tooltip a.ql-action, .ql-snow .ql-tooltip a.ql-remove { color: var(--accent-2); }
.ql-editor pre.ql-syntax { background: var(--panel-2); color: var(--text); border-radius: 8px; }
.ql-editor blockquote { border-left: 3px solid var(--accent); color: var(--muted); margin: 0.5rem 0; padding-left: 1rem; }
.ql-editor img { max-width: 100%; border-radius: 8px; }

/* --- Category badges --------------------------------------------------- */
.category-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.35rem;
}
.category-badge.cat-news { background: rgba(57, 135, 229, 0.16); color: var(--accent-2); }
.category-badge.cat-transfer { background: rgba(201, 133, 0, 0.18); color: var(--status-warning); }
.category-badge.cat-match-highlight { background: rgba(var(--accent-rgb), 0.18); color: var(--accent-text); }

.category-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.category-pills .pill {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}
.category-pills .pill:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }
.category-pills .pill.active { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 2.5rem 0 1rem;
}
.section-head h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; }
.section-head a { font-size: 0.85rem; font-weight: 600; }

/* --- Articles ---------------------------------------------------------- */
.article-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.article-thumb { position: relative; }
.article-card .cover { aspect-ratio: 16/9; object-fit: cover; width: 100%; display: block; background: var(--panel-2); }
.article-card .body { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.article-card h3 { margin: 0; font-size: 1.1rem; }
.article-card p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }
.article-meta { color: var(--muted); font-size: 0.78rem; display: flex; gap: 0.5rem; align-items: center; }
.draft-pill {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--status-warning); border: 1px solid var(--status-warning); border-radius: 4px; padding: 0.05rem 0.35rem;
}

.article-body {
  font-size: 1.02rem;
  line-height: 1.7;
}
.article-body img { border-radius: 10px; margin: 0.5rem 0; }
.article-body h2, .article-body h3 { margin-top: 2rem; }
.clip-embed-card {
  margin: 1.25rem 0; border-radius: 10px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
}
.clip-embed-card .clip-video { border-radius: 0; }
.clip-embed-jump {
  display: block; padding: 0.6rem 0.9rem; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
}
.clip-embed-jump:hover { color: var(--accent-text); }
.clip-embed-missing {
  color: var(--muted); font-style: italic; padding: 0.75rem 1rem;
  background: var(--panel); border: 1px dashed var(--border); border-radius: 10px;
}
.article-body pre {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem; overflow-x: auto;
}
.article-body blockquote {
  border-left: 3px solid var(--accent); margin: 0; padding: 0.25rem 0 0.25rem 1rem; color: var(--muted);
}
.article-cover { width: 100%; border-radius: 14px; margin-bottom: 1.5rem; aspect-ratio: 21/9; object-fit: cover; }

/* --- Connect with us (home page) ---------------------------------------- */
.connect-band {
  margin-top: 2.5rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.16), transparent 70%), var(--panel);
}
.connect-band-text h2 { margin: 0 0 0.35rem; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; }
.connect-band-text p { margin: 0; color: var(--muted); }
.connect-band-cta { flex: none; padding: 0.75rem 1.5rem; }

.article-reactions { margin-top: 1.75rem; }
.like-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 0.5rem 1.1rem; font-weight: 600; cursor: pointer;
}
.like-btn:hover { border-color: var(--live); }
.like-btn.liked { color: var(--live); border-color: var(--live); }
.like-btn.static { color: var(--muted); cursor: default; }
.discord-reactions { border-color: rgba(88, 101, 242, 0.4); color: #a8adf5; }

.comments { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.comments-head { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin: 0 0 1rem; }
.comment-form { margin-bottom: 1.5rem; }
.comment-form textarea { width: 100%; min-height: 90px; }
.comment { display: flex; gap: 0.75rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--panel-2); border: 1px solid var(--border);
}
.comment-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; }
.comment-text { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
.link-btn {
  background: none; border: none; padding: 0; color: var(--muted); font-size: 0.78rem;
  text-decoration: underline; cursor: pointer; width: auto;
}
.link-btn:hover { color: var(--status-critical); }

/* --- Events -------------------------------------------------------------- */
.event-row {
  display: flex; gap: 1rem; align-items: center; padding: 1rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
}
.event-row + .event-row { margin-top: 0.75rem; }
.event-date {
  flex: none; width: 64px; text-align: center; background: var(--panel-2);
  border-radius: 10px; padding: 0.5rem 0.25rem; border: 1px solid var(--border);
}
.event-date .month { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.event-date .day { font-size: 1.3rem; font-weight: 700; }
.event-thumb {
  flex: none; width: 96px; height: 60px; border-radius: 8px;
  object-fit: cover; background: var(--panel-2);
}
.event-info { flex: 1; min-width: 0; }
.event-info h3 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.event-info p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.event-type-badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--accent-2); border: 1px solid var(--accent-2); border-radius: 4px; padding: 0.1rem 0.4rem;
}
.discord-sync-badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: #5865f2; border: 1px solid #5865f2; border-radius: 4px; padding: 0.1rem 0.4rem;
  margin-left: 0.35rem;
}
.event-result { font-weight: 700; font-size: 0.9rem; }
.event-result.win { color: var(--status-good); }
.event-result.loss { color: var(--status-critical); }

/* --- Clips ----------------------------------------------------------------- */
.clip-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.clip-card { padding: 0; overflow: hidden; }
.clip-video { width: 100%; aspect-ratio: 16/9; background: #000; display: block; }
.clip-info { padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.clip-title { margin: 0; font-weight: 600; font-size: 0.95rem; }

/* --- Streamers ----------------------------------------------------------- */
.streamer-card { padding: 0; overflow: hidden; }
.streamer-thumb { position: relative; aspect-ratio: 16/9; background: var(--panel-2); }
.streamer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-badge {
  position: absolute; top: 0.5rem; left: 0.5rem;
  background: var(--live); color: #fff; font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase; border-radius: 4px; padding: 0.15rem 0.45rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.viewer-count {
  position: absolute; bottom: 0.5rem; right: 0.5rem; background: rgba(0,0,0,0.65);
  color: #fff; font-size: 0.72rem; border-radius: 4px; padding: 0.1rem 0.4rem;
}

/* --- Article thumbnails: like/comment counts, same corner-badge family as
   .viewer-count above -- only rendered at all when there's something to
   show, so a fresh article's thumbnail isn't cluttered with zeroes. */
.engagement-badge {
  position: absolute; bottom: 0.5rem; left: 0.5rem; display: flex; align-items: center; gap: 0.55rem;
  background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 0.72rem; font-weight: 600;
  border-radius: 4px; padding: 0.15rem 0.45rem;
}
.engagement-badge .eng-item { display: inline-flex; align-items: center; gap: 0.25rem; }
.engagement-badge svg { width: 12px; height: 12px; flex: none; }
.streamer-info { padding: 0.9rem 1rem; display: flex; align-items: center; gap: 0.7rem; }
.streamer-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: none; }
.streamer-name { font-weight: 700; }
.streamer-status { color: var(--muted); font-size: 0.8rem; }
.streamer-status.is-live { color: var(--live); font-weight: 600; }

/* --- Login ----------------------------------------------------------------- */
.login-card { max-width: 380px; margin: 3rem auto; text-align: center; }
.login-card h1 { margin-top: 0; font-size: 1.4rem; }
.btn.discord { background: #5865f2; color: #fff; }
.login-card .btn.discord { width: 100%; justify-content: center; padding: 0.75rem; }
.login-card .divider { color: var(--muted); font-size: 0.8rem; margin: 1.25rem 0; }
.dev-login-form { display: grid; gap: 0.6rem; }

.empty-state { color: var(--muted); text-align: center; padding: 2.5rem 1rem; }

/* --- Stats dashboard (migrated from the old Flask app's style.css) ------ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: transform 0.15s ease;
}

.stat-card:hover { transform: translateY(-1px); }
.stat-card .label { color: var(--muted); font-size: 0.8rem; }
.stat-card .value { font-size: 1.35rem; font-weight: 700; }

#club-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), transparent 60%), var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.club-hero-identity { display: flex; align-items: baseline; gap: 0.75rem; }
#club-header h2 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; }
.club-hero-id { color: var(--muted); font-size: 0.85rem; }
.club-hero-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.hero-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.hero-badge.accent { border-color: var(--accent); color: var(--accent-text); }

#tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  flex-wrap: wrap;
}

#tabs button {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}

#tabs button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
#tabs button.active { color: var(--on-accent); background: var(--accent-strong); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}

th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 600; }

#status { padding: 0 2rem; color: var(--muted); }

pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.chart-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem;
  flex: 1 1 260px;
  min-width: 240px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chart-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), 0 10px 24px rgba(0, 0, 0, 0.28); }
.chart-card h3 { margin: 0 0 0.75rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.chart-caption { margin: 0.5rem 0 0; font-size: 0.75rem; color: var(--muted); }

.chart-bar, .chart-donut-seg { cursor: pointer; transition: opacity 0.1s ease; }
.chart-bar.chart-mark-hover, .chart-donut-seg.chart-mark-hover { opacity: 0.8; }
.chart-label { fill: var(--muted); font-size: 10px; }
.chart-value { fill: var(--text); font-size: 10px; font-weight: 600; }
.chart-baseline { stroke: var(--border); stroke-width: 1; }
.chart-empty { color: var(--muted); font-size: 0.85rem; margin: 0; }

.chart-area-line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area-point { transition: r 0.1s ease; }
.chart-area-hit { fill: transparent; cursor: pointer; }
.chart-area-hit.chart-mark-hover + .chart-area-point,
.chart-area-hit:hover + .chart-area-point { r: 4; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.legend-item i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }

.chart-tooltip {
  position: fixed; z-index: 1000; background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.45rem 0.65rem; font-size: 0.8rem; pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.chart-tooltip.hidden { display: none; }
.tt-row { display: flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.tt-row + .tt-row { margin-top: 0.25rem; }
.tt-key { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.tt-label { color: var(--muted); }

.member-row { cursor: pointer; }
.member-row:hover { background: rgba(255, 255, 255, 0.04); }
.member-row.expanded { background: rgba(var(--accent-rgb), 0.08); }
.member-detail-row td { background: var(--bg); padding: 1rem; border-bottom: 1px solid var(--border); }
.player-detail-head { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.75rem; font-size: 1rem; }
.player-detail-head .muted { color: var(--muted); font-size: 0.85rem; }

.stat-grid.compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.stat-grid.compact .stat-card { padding: 0.5rem 0.7rem; }
.stat-grid.compact .stat-card .value { font-size: 1.05rem; }

.search-row { margin-bottom: 1rem; }
.search-row input { width: 100%; max-width: 320px; }
.search-row .chart-caption { margin-top: 0.4rem; }

.match-row { cursor: pointer; }
.match-row:hover { background: rgba(255, 255, 255, 0.04); }
.match-row.expanded { background: rgba(var(--accent-rgb), 0.08); }
.match-detail-row td { background: var(--bg); padding: 1rem; border-bottom: 1px solid var(--border); }
.match-detail { align-items: flex-start; }
/* min-width: 0 overrides .chart-card's own min-width: 240px -- without it
   a flex item won't shrink below its content's natural size, so once this
   card gets squeezed by its sibling the wide (white-space: nowrap) table
   inside just spills out past the card's own edge instead of shrinking.
   overflow-x then gives that table somewhere to go: a scrollbar inside the
   card, not a bleed into the next column or off the page. */
.match-roster { flex: 1 1 460px; min-width: 0; overflow-x: auto; }
.mini-table { font-size: 0.8rem; }
.mini-table th, .mini-table td { padding: 0.35rem 0.5rem; white-space: nowrap; }
.match-controls { display: flex; gap: 0.5rem; }
.match-controls select { width: auto; }

.badge {
  display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; color: #0a0f0c;
}
.badge-motm { background: var(--series-4); }
.badge-warn { background: var(--status-warning); }
.badge-good { background: var(--status-good); color: #fff; }

/* --- Overview: recent-form strip (last N results, oldest -> newest) ------ */
.form-strip { display: flex; gap: 0.3rem; }
.form-chip {
  width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; font-family: var(--font-display); cursor: default;
}
.form-chip.W { background: rgba(12, 163, 12, 0.18); color: #7fe07f; }
.form-chip.D { background: rgba(107, 111, 122, 0.24); color: #c7cad2; }
.form-chip.L { background: rgba(208, 59, 59, 0.18); color: #ef9494; }

/* --- League table (auto-built from clubs we actually play, see db.py) --- */
.league-table-card { padding: 0; overflow-x: auto; }
.league-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.league-table th, .league-table td { padding: 0.75rem 1rem; text-align: left; }
.league-table thead th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.league-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.league-table .lt-num { text-align: center; white-space: nowrap; }
.league-table .lt-points { font-weight: 700; color: var(--text); }
.league-table .lt-club { display: flex; align-items: center; gap: 0.65rem; }
.lt-crest { width: 30px; height: 30px; font-size: 0.68rem; }
.lt-name { font-weight: 600; }
.lt-us td { background: rgba(var(--accent-rgb), 0.08); }
.lt-us-pill {
  display: inline-block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.03em;
  background: var(--status-good); color: #fff; border-radius: 4px; padding: 0.05rem 0.35rem; margin-left: 0.35rem;
}
.lt-no-form { color: var(--muted); }
.league-table-footnote { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.8rem; }
.league-excluded { margin-top: 1.5rem; }
.league-excluded-head { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.82rem; }
.league-excluded-list { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.82rem; display: grid; gap: 0.2rem; }

/* --- Overview: explore cards, linking into the other three reports ------- */
.explore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0 0.5rem; }
@media (max-width: 900px) { .explore-grid { grid-template-columns: 1fr; } }
.explore-card {
  display: block; text-align: left; width: 100%; cursor: pointer; background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px; padding: 1.15rem 1.3rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.explore-card:hover { border-color: rgba(var(--accent-rgb), 0.5); transform: translateY(-2px); }
.explore-card h4 { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; margin: 0 0 0.3rem; }
.explore-card p { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.65rem; line-height: 1.45; }
.explore-cta { font-size: 0.8rem; font-weight: 700; color: var(--accent-text); }

/* --- Players/Matches: sort + position/type filter row --------------------- */
.filter-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip-group { display: flex; gap: 0.3rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 0.2rem; }
.chip {
  border: none; background: none; color: var(--muted); font-size: 0.8rem; font-weight: 600;
  padding: 0.35rem 0.75rem; border-radius: 999px; cursor: pointer;
}
.chip.active { background: var(--accent-strong); color: var(--on-accent); }
.sort-select { margin-left: auto; width: auto; }

/* --- Matches: team-vs-team totals comparison strip ------------------------ */
.compare-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.compare-team { font-family: var(--font-display); font-weight: 800; font-size: 1rem; }
.compare-vs { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.team-compare { display: grid; gap: 0.6rem; margin-bottom: 1.15rem; }
.compare-stat { display: grid; gap: 0.2rem; }
.compare-label { font-size: 0.72rem; color: var(--muted); text-align: center; }
.compare-row { display: grid; grid-template-columns: 2.6rem 1fr 2.6rem; align-items: center; gap: 0.65rem; }
.compare-row .compare-value { font-family: var(--font-display); font-weight: 800; font-size: 0.92rem; }
.compare-row .compare-value:first-child { text-align: right; }
.compare-bar { height: 8px; border-radius: 4px; overflow: hidden; display: flex; gap: 2px; background: var(--panel-2); }
.compare-bar span:first-child { background: var(--series-1); border-radius: 4px 0 0 4px; }
.compare-bar span:last-child { background: var(--series-2); border-radius: 0 4px 4px 0; }

/* --- Competition: division ladder ----------------------------------------- */
.ladder { display: flex; flex-direction: column-reverse; gap: 0.3rem; }
.ladder.compact { gap: 0.22rem; }
.rung { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.6rem; border-radius: 8px; border: 1px solid transparent; }
.rung .rn { width: 2rem; font-family: var(--font-display); font-weight: 800; font-size: 0.82rem; color: var(--muted); flex: none; }
.rung .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.rung .bar > span { display: block; height: 100%; background: var(--border); }
.rung .rung-note { font-size: 0.7rem; color: var(--muted); min-width: 5.5rem; text-align: right; flex: none; }
.rung.current { border-color: rgba(var(--accent-rgb), 0.5); background: rgba(var(--accent-rgb), 0.08); }
.rung.current .rn, .rung.current .rung-note { color: var(--accent-text); }
.rung.current .bar > span { background: var(--accent); }
.rung.best .rn::after { content: " \2605"; color: var(--status-warning); font-size: 0.7em; }

/* --- Competition: head-to-head (rivals) table ------------------------------ */
.rival-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; width: 96px; background: var(--panel-2); }
.rival-bar span:first-child { background: var(--status-good); }
.rival-bar span:nth-child(2) { background: var(--status-neutral); }
.rival-bar span:last-child { background: var(--status-critical); }

/* --- Tactics board -------------------------------------------------------- */
.tactics-toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tactics-toolbar select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 0.5rem 0.7rem; font: inherit;
}
.tactics-layout { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }

.pitch-column { display: flex; flex-direction: column; gap: 1rem; width: min(480px, 100%); flex: none; }

.pitch {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.03) 0 10%, transparent 10% 20%),
    /* Grass, not brand color -- this stays green through any retheme, the
       same way a win stays --status-good. */
    linear-gradient(160deg, #1c6b3f, #0f4a2b);
  border: 1px solid var(--border);
  overflow: hidden;
  flex: none;
}
.pitch-markings { position: absolute; inset: 0; }
.pitch-center-line {
  position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.35);
}
.pitch-center-circle {
  position: absolute; top: 50%; left: 50%; width: 22%; aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.35); border-radius: 50%; transform: translate(-50%, -50%);
}
.pitch-box {
  position: absolute; left: 50%; width: 46%; height: 14%; transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,0.35); border-top: none;
}
.pitch-box-bottom { bottom: 0; border-top: none; border-bottom: none; border-radius: 0; }
.pitch-box-top { top: 0; transform: translateX(-50%) rotate(180deg); }

.pitch-slot {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  min-width: 64px; padding: 0.3rem 0.5rem; border-radius: 10px;
  background: rgba(10, 14, 11, 0.55); border: 1.5px dashed rgba(255,255,255,0.4);
  color: #eafff2; text-align: center; user-select: none;
}
.pitch-slot.filled { background: rgba(15, 20, 16, 0.85); border: 1.5px solid var(--accent); }
.pitch-slot.drag-over { border-color: #fff; background: rgba(var(--accent-rgb), 0.35); }
.pitch-slot-name { font-weight: 700; font-size: 0.75rem; line-height: 1.1; }
.pitch-slot-pos { font-size: 0.62rem; letter-spacing: 0.04em; color: rgba(234, 255, 242, 0.75); }
.pitch-slot.filled .pitch-slot-pos { color: var(--accent-text); }
[data-is-staff="true"] .pitch-slot { cursor: pointer; }

.tactics-subs { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1rem; }
.tactics-subs h3 { margin: 0 0 0.6rem; font-size: 0.9rem; }
.tactics-subs-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.sub-slot { position: static; transform: none; }

.tactics-roster { flex: 1 1 220px; min-width: 220px; }
.tactics-roster h3 { margin: 0 0 0.25rem; font-size: 0.9rem; }
.tactics-roster-list {
  display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem;
  max-height: 640px; overflow-y: auto;
}
.tactics-chip {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.5rem 0.75rem; cursor: grab; font-weight: 600; font-size: 0.88rem;
}
.tactics-chip:active { cursor: grabbing; }

@media (max-width: 640px) {
  .tactics-layout { flex-direction: column; }
  .pitch-column { width: 100%; }
  .pitch { width: 100%; }
  .page { padding: 1.25rem; }
  .site-header { padding: 0.85rem 1.25rem; }
  .hero-content { padding: 2rem 1.25rem 3rem; }
  .match-center-inner { padding: 1rem 1.25rem; }
  .mc-matchup { order: 1; width: 100%; justify-content: space-between; }
  .mc-kicker-label { order: 0; }
  .mc-countdown { order: 2; }
  .mc-cta { order: 3; }
  .section-band { padding: 1.25rem; }
}
