:root {
  --bg: #0b0d12;
  --bg-elev: #141821;
  --bg-elev-2: #1c2030;
  --border: #252b3a;
  --text: #e6e9f0;
  --text-dim: #9aa3b2;
  --accent: #ffb43c;
  --accent-2: #5865f2;
  --green: #2ecc71;
  --red: #e74c3c;
  --purple: #9b59b6;
  /* "Us / STTT" brand gradient — cyan → green. Used for the STTT logo, the US
     chip, and every our-clan marker. Tweak these stops to fine-tune. */
  --us-grad-from: #00f4ff;
  --us-grad-to: #71ff9e;
  --us-grad: linear-gradient(135deg, var(--us-grad-from), var(--us-grad-to));
  --radius: 12px;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Per-clan accent gradients. The whole UI keys off --us-grad / --us-grad-from /
   --us-grad-to, so setting these on ANY element re-colours every gradient use
   within it: on a clan's <body class="clan-x"> it themes the whole page (brand
   badge, current nav link, chips, bars, progress); on a single element like a
   home-page hero button it themes just that button. --us-grad is re-declared
   with literal stops so it's independent of where the nested var() resolves.
   .clan-sttt restates the :root cyan→green default so all three are explicit. */
.clan-sttt {
  --us-grad-from: #00f4ff;
  --us-grad-to: #71ff9e;
  --us-grad: linear-gradient(135deg, #00f4ff, #71ff9e);
}
.clan-bums {
  --us-grad-from: #aa3b3b;
  --us-grad-to: #ff4848;
  --us-grad: linear-gradient(135deg, #aa3b3b, #ff4848);
}
.clan-chaos {
  --us-grad-from: #ff4abe;
  --us-grad-to: #ffff00;
  --us-grad: linear-gradient(135deg, #ff4abe, #ffff00);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--bg-elev-2);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- Header / Nav ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
}
.brand-mark {
  background: var(--us-grad);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  color: #111;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-name { color: var(--text-dim); font-weight: 500; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.site-nav a {
  color: var(--text-dim);
  font-weight: 500;
}
.site-nav a[aria-current="page"] {
  background: var(--us-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  /* Mobile: kill the 300ms tap delay iOS still applies in some contexts and
     give a visible tap highlight so users see immediate feedback. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 180, 60, 0.25);
  user-select: none;
  text-decoration: none;
}
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn-primary {
  background: var(--us-grad);
  color: #111;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-elev-2); }
.btn:active { transform: translateY(1px); }

/* ---------- Landing ---------- */
.page-landing {
  /* FXO Collective homepage identity — the clan links below override this
     locally, preserving STTT, Bums, and FS Chaos as their own page colors. */
  --us-grad-from: #8d73e8;
  --us-grad-to: #f2a8d3;
  --us-grad: linear-gradient(135deg, #8d73e8 0%, #f2a8d3 50%, #8d73e8 100%);
}
@keyframes fxo-landing-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.page-landing .brand-mark,
.page-landing .site-nav a[aria-current="page"],
.page-landing .site-nav a:hover,
.page-landing .btn-ghost,
.page-landing .hero h1,
.page-landing .feature h3,
.page-landing .feature code,
.page-landing .section-title,
.page-landing .cmd-grid code,
.page-landing .cmd-group::before {
  background-size: 200% 200%;
  animation: fxo-landing-gradient-shift 10s ease-in-out infinite;
}
.page-landing .feature,
.page-landing .cmd-grid > div {
  background-size: 100% 100%, 200% 200%;
  animation: fxo-landing-gradient-border-shift 10s ease-in-out infinite;
}
@keyframes fxo-landing-gradient-border-shift {
  0%, 100% { background-position: 0 0, 0% 50%; }
  50% { background-position: 0 0, 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .page-landing .brand-mark,
  .page-landing .site-nav a[aria-current="page"],
  .page-landing .site-nav a:hover,
  .page-landing .btn-ghost,
  .page-landing .hero h1,
  .page-landing .feature h3,
  .page-landing .feature code,
  .page-landing .section-title,
  .page-landing .cmd-grid code,
  .page-landing .cmd-group::before,
  .page-landing .feature,
  .page-landing .cmd-grid > div { animation: none; }
}
.page-landing .site-header {
  border-top: 5px solid transparent;
  border-image: var(--us-grad) 1;
}
.page-landing .site-nav a:hover {
  background: var(--us-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}
.page-landing .btn-ghost {
  background: var(--us-grad);
  border-color: transparent;
  color: #111;
}
.page-landing .btn-ghost:hover { filter: brightness(1.08); }
.hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin: 0 0 1rem;
  background: var(--us-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 2rem;
}
.cta-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.page-landing .feature,
.page-landing .cmd-grid > div {
  border-color: transparent;
  background:
    linear-gradient(var(--bg-elev), var(--bg-elev)) padding-box,
    var(--us-grad) border-box;
}
.feature {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  background: var(--us-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}
/* Command names inside the "Discord Commands" feature card — match the gradient. */
.feature code {
  padding: 0;
  background: var(--us-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.feature p  { margin: 0; color: var(--text-dim); font-size: 0.95rem; }

.commands {
  max-width: 1100px;
  margin: 3rem auto 4rem;
  padding: 0 1.5rem;
}
.commands h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  width: fit-content;
  margin-inline: auto;
  background: var(--us-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cmd-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.75rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.cmd-group::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: var(--us-grad);
}
/* Admin group gets a distinct (red) accent bar + lock so it reads as restricted. */
.cmd-group-admin { color: var(--text-dim); }
.cmd-group-admin::before { background: var(--red); }
.cmd-group-admin::after {
  content: "🔒";
  font-size: 0.85em;
}
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
}
.cmd-grid > div {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cmd-grid code {
  align-self: flex-start;
  padding: 0;
  background: var(--us-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cmd-grid span { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- Harvest (live dashboard card) ---------- */
.harvest-status {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.harvest-status.is-active { color: var(--green); border-color: var(--green); }
.harvest-status.is-inactive { color: var(--text-dim); }
.harvest-sub {
  margin: 0 0 1.1rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.harvest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.85rem;
}
.harvest-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.harvest-card.is-maxed { border-color: var(--green); }
.harvest-good { font-weight: 600; font-size: 1.05rem; }
.harvest-holder { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; min-height: 1.9rem; }
.harvest-id {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.harvest-id:hover { filter: brightness(1.1); }
.harvest-id.copied { background: var(--green); }
.harvest-name { color: var(--text-dim); font-size: 0.85rem; }
.harvest-empty { color: var(--text-dim); font-style: italic; font-size: 0.9rem; }
.harvest-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.harvest-bar > span {
  display: block;
  height: 100%;
  background: var(--us-grad);
  border-radius: 999px;
}
.harvest-card.is-maxed .harvest-bar > span { background: var(--green); }
.harvest-val { color: var(--text-dim); font-size: 0.85rem; }
.harvest-max { color: var(--green); font-weight: 600; }
.harvest-foot { margin: 1rem 0 0; color: var(--text-dim); font-size: 0.8rem; }

/* ---------- Dashboard ---------- */
.dashboard, .admin {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 460px; margin: 3rem auto; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.card-header h2 { margin: 0; font-size: 1.2rem; }

/* Collapsible cards — every dashboard card except the matchup gets a clickable
   header (or clan title) with a caret that toggles a .collapsed state. */
.card.is-collapsible > .card-header,
.card.is-collapsible > .clan-title {
  cursor: pointer;
  user-select: none;
}
.card.is-collapsible > .card-header > h2::before,
.card.is-collapsible > .clan-title > h1::before {
  content: "▾ ";
  color: var(--text-dim);
  font-size: 0.8em;
}
.card.is-collapsible.collapsed > .card-header > h2::before,
.card.is-collapsible.collapsed > .clan-title > h1::before {
  content: "▸ ";
}
/* When collapsed, hide everything but the header/title row. */
.card.is-collapsible.collapsed > :not(.card-header):not(.clan-title) {
  display: none;
}
/* The clan summary is a grid; collapsing it should drop back to one column so
   the lone title row doesn't keep the tall grid gaps. */
.card.is-collapsible.collapsed.clan-summary { display: block; }

/* Tab bar (used by the Phase 3 tracker: Our Roster / Opponents). */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  margin: 0.25rem 0 1rem;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font: inherit;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--us-grad-from);
}

.clan-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.clan-summary .clan-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
}
.clan-summary .clan-title h1 {
  margin: 0;
  font-size: 1.6rem;
}
.clan-summary .clan-title small {
  color: var(--text-dim);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-label { color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.3rem; font-weight: 700; }
.stat-delta-up   { color: var(--green); font-size: 0.9rem; }
.stat-delta-down { color: var(--red); font-size: 0.9rem; }
.stat-delta-flat { color: var(--text-dim); font-size: 0.9rem; }

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.controls label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.controls select,
.controls input,
.stack input {
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  font-size: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
}
table.roster-table, table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table th, table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table th {
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: var(--bg-elev-2);
  position: sticky;
  top: 0;
}
table tbody tr:hover { background: rgba(255, 180, 60, 0.05); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.stat-icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 4px;
  display: inline-block;
}
th .stat-icon { vertical-align: -2px; }
.rank-cell { color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Player avatar + decorative frame, shown next to guild player names. The head
   sits inside the frame; the frame PNG is overlaid at full size. */
.name-cell { display: inline-flex; align-items: center; gap: 0.5rem; }
.player-avatar {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  vertical-align: middle;
}
.player-avatar .pa-head {
  position: absolute;
  left: 15%;
  top: 15%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  object-fit: cover;
}
.player-avatar .pa-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.leader-tag {
  background: var(--us-grad);
  color: #111;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.4rem;
}
.ee-chip {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-elev-2);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Horizontal progress bar used in the LME per-player card. */
.lme-bar {
  position: relative;
  width: 100%;
  min-width: 120px;
  height: 8px;
  background: var(--bg-elev-2);
  border-radius: 4px;
  overflow: hidden;
}
.lme-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 4px;
  transition: width 0.3s ease;
}
.lme-bar-fill.lme-bar-up   { background: linear-gradient(90deg, var(--green), #58d68d); }
.lme-bar-fill.lme-bar-down { background: linear-gradient(90deg, #c0392b, var(--red)); }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.lunar-body, .matchup-body { display: flex; flex-direction: column; gap: 0.75rem; }
.lunar-meta, .matchup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.lunar-meta strong, .matchup-meta strong { color: var(--text); }

/* Inside the merged Lunar Eclipse · Matchup card, space the meta row from
   the per-clan blocks underneath. */
#lunar-matchup-card #lunar-meta {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
#lunar-matchup-card #matchup-compare-wrap {
  margin-bottom: 1rem;
}

/* Side-by-side clan comparison: stat label on the left, one column per clan. */
.matchup-compare-table th.stat-label {
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
}
.matchup-compare-table thead th {
  font-size: 0.9rem;
}
.matchup-compare-table thead th.mine {
  background: var(--us-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.matchup-compare-table td.mine {
  background: linear-gradient(135deg, rgba(0, 244, 255, 0.12), rgba(113, 255, 158, 0.12));
}
.matchup-compare-table tbody tr:nth-child(odd) td:not(.mine),
.matchup-compare-table tbody tr:nth-child(odd) th {
  background: rgba(255, 255, 255, 0.015);
}
.matchup-compare-table .leader-tag {
  margin-left: 0.3rem;
}

/* Current-week LME standings table (Phase-1 medals ranking) inside the Lunar
   Eclipse · Matchup card, sitting just under the meta line. */
#lunar-matchup-card .matchup-standings {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.matchup-standings-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.matchup-standings-sub {
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
}
.matchup-standings-table td.standings-elo,
.matchup-standings-table td.standings-pts { white-space: nowrap; font-weight: 600; }
.matchup-standings-table td.standings-pos {
  width: 2.75rem;
  font-size: 1.05rem;
  text-align: center;
}
.matchup-standings-table td.standings-clan { font-weight: 600; }
.matchup-standings-table .leader-tag { margin-left: 0.35rem; }
.matchup-standings-table tr.mine td {
  background: linear-gradient(135deg, rgba(0, 244, 255, 0.12), rgba(113, 255, 158, 0.12));
}

/* Lunar Rivals predicted-matchup view (shown in the matchup card Mon 9pm→Wed 9am PDT). */
.rivals-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.rivals-badge {
  background: var(--us-grad);
  color: #111;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}
.rivals-scalars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}
.rivals-scalars strong { color: var(--text); }
.rivals-subhead {
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
  color: var(--text);
}
.rivals-subhead .muted { font-weight: 400; }

.medal-list, .clan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.medal-list li, .clan-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: var(--bg-elev-2);
  border-radius: 6px;
  font-size: 0.92rem;
}
.clan-list li.mine {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-elev-2), var(--bg-elev-2)) padding-box,
    var(--us-grad) border-box;
}

/* ---------- Matchup detail (per-clan player breakdown) ---------- */
.matchup-detail-clan {
  background: var(--bg-elev-2);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.matchup-detail-clan.mine {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-elev-2), var(--bg-elev-2)) padding-box,
    var(--us-grad) border-box;
}
.matchup-detail-clan:last-child { margin-bottom: 0; }

.matchup-detail-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font: inherit;
}
.matchup-detail-header:hover { background: rgba(255, 255, 255, 0.04); }
.matchup-detail-caret {
  font-size: 0.85rem;
  width: 1ch;
  color: var(--text-dim);
}
.matchup-detail-title {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.matchup-detail-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.matchup-detail-meta strong { color: var(--text); }

/* Top-30 scoring power line — spans the full header width on its own row so it
   stays visible when the clan card is collapsed/minimized. */
.matchup-detail-power {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1rem;
  padding-left: calc(1ch + 0.75rem);
  margin-top: 0.15rem;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.matchup-detail-power strong { color: var(--text); }
.matchup-detail-power .mdp-label {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.matchup-detail-power .stat-icon { vertical-align: -0.15em; }

.matchup-detail-body {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.matchup-detail-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}
.matchup-detail-totals strong { color: var(--text); }

@media (max-width: 700px) {
  .matchup-detail-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .matchup-detail-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: calc(1ch + 0.75rem);
  }
}

.footnote { text-align: center; color: var(--text-dim); font-size: 0.85rem; }

.loading { color: var(--text-dim); padding: 1rem 0; text-align: center; }
.error {
  background: rgba(231, 76, 60, 0.12);
  color: #ffb3aa;
  border: 1px solid rgba(231, 76, 60, 0.4);
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.muted { color: var(--text-dim); font-size: 0.9rem; }

.card-meta {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.pagination .page-info {
  font-variant-numeric: tabular-nums;
  min-width: 9ch;
  text-align: center;
}
.pagination button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
/* Bigger tap targets for pagination on phones — meets the ~44px minimum
   Apple/Google recommend so a thumb doesn't have to be pixel-precise. */
@media (max-width: 600px) {
  .pagination {
    gap: 0.75rem;
    margin-top: 0.85rem;
  }
  .pagination .btn-sm {
    min-height: 44px;
    min-width: 80px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
  }
}

/* ---------- Admin lock ---------- */
/* While body has .locked, hide everything except the password card. */
.page-admin.locked .site-header,
.page-admin.locked .site-footer,
.page-admin.locked #admin-panel,
.page-admin.locked dialog { display: none !important; }
.page-admin.locked main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.page-admin.locked #login-card { margin: 0; width: 100%; max-width: 360px; }

/* ---------- Admin ---------- */
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--text-dim); }
.row { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.5rem; }

dialog {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-width: 320px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }

@media (max-width: 600px) {
  .site-header { padding: 0.75rem 1rem; }
  .site-nav { gap: 0.75rem; font-size: 0.9rem; }
  .brand-name { display: none; }
}

/* ---------- Clan Exploration (CX) card ---------- */
.cx-mission {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.25rem 0 1rem;
}
.cx-mission-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.cx-bar {
  position: relative;
  width: 100%;
  height: 14px;
  background: var(--bg-elev-2);
  border-radius: 7px;
  overflow: hidden;
}
.cx-bar-fill {
  height: 100%;
  width: 0;
  background: var(--us-grad);
  border-radius: 7px;
  transition: width 0.3s ease;
}
.cx-bar-fill.cx-bar-done { background: linear-gradient(90deg, var(--green), #58d68d); }

/* Zero-score rows in the badge-score table: red-tinted row + red score cell. */
tr.cx-zero { background: rgba(231, 76, 60, 0.07); }
tr.cx-zero:hover { background: rgba(231, 76, 60, 0.13); }
.cx-zero-score { color: var(--red); font-weight: 600; }

.cx-chart-head { margin: 0.75rem 0 0.35rem; font-size: 1rem; }
.chart-wrap {
  position: relative;
  height: 300px;
  margin: 0.25rem 0 1rem;
}

/* ---- Scheduled auto-post switches (admin) ---- */
.toggle-list {
  display: flex;
  flex-direction: column;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row.is-off .toggle-label { color: var(--text-dim); }
.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.toggle-label { font-weight: 600; }
.toggle-desc { font-size: 0.9rem; }
.toggle-sched { font-size: 0.8rem; }
.reminder-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.45rem 0.7rem;
  margin-top: 0.45rem;
}
.reminder-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.76rem;
  color: var(--text-dim);
}
.reminder-controls input {
  width: 12.5rem;
  min-height: 2rem;
}
.reminder-time { display: inline-flex; align-items: center; gap: 0.25rem; }
.reminder-controls .reminder-time input { width: 3.75rem; }

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
  pointer-events: none;
}
.switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.15s ease, background 0.15s ease;
}
.switch input:checked + .switch-slider {
  background: rgba(46, 204, 113, 0.2);
  border-color: var(--green);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
  background: var(--green);
}
.switch input:disabled + .switch-slider { opacity: 0.5; }
.switch input:focus-visible + .switch-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
