/* God Stats (/stats/gods/) — page-specific design-system styles.

   This page is a PARTIAL migration and still imports leaderboards.css. The
   matchup heat map is a JS-driven widget: god_matchup_heatmap.js binds to
   .god-matchup-tab, .god-matchup-tabpanel, .god-matchup-tabs-wrap,
   .god-matchup-table and .god-matchup-cell, and stats.test_god_performance
   asserts on `class="god-matchup-table god-matchup-table-pantheon"` and on
   god-matchup-panel-wide. That whole subsystem — plus the sortable column
   headers (.leaderboards-sort-link) — is left on its existing classes and
   styling rather than rebuilt, so the page chrome moves to the design
   system while the widget keeps working exactly as before.

   Prefix `gds-`. Requires ds_tokens.css, ds_patterns.css, ds_bridge.css and
   ds_stats_shared.css. */

/* ---------- hero portrait shelf ---------- */

.gds-hero-gods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  width: 352px;
  max-width: 100%;
}

.gds-hero-god {
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  width: 72px;
  padding: 0.6rem 0.35rem 0.5rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: rgba(10, 17, 32, 0.72);
  color: inherit;
  text-align: center;
  transition: transform var(--ease-standard), border-color var(--ease-standard),
    box-shadow var(--ease-standard);
}

.gds-hero-god:hover,
.gds-hero-god:focus-visible {
  border-color: var(--border-hover);
  box-shadow: var(--glow-gold-soft);
  color: inherit;
  transform: translateY(-2px);
}

.gds-hero-god img {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(213, 177, 101, 0.5);
  border-radius: var(--radius-pill);
  object-fit: cover;
}

.gds-hero-god strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.gds-hero-god span {
  color: var(--gold-200);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.gds-hero-empty {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

/* ---------- two-column comparison lists ---------- */

/* "Winning More / Struggling" and the four per-god matchup lists share one
   row shape: portrait, name over sample size, headline percentage. */
.gds-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gds-split--quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gds-split > section {
  padding: 0.9rem 1rem 1rem;
  border-right: 1px solid rgba(213, 177, 101, 0.18);
}

.gds-split > section:last-child {
  border-right: 0;
}

.gds-split h3 {
  margin: 0 0 0.6rem;
  color: var(--gold-200);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gds-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(213, 177, 101, 0.1);
}

.gds-row:last-child {
  border-bottom: 0;
}

.gds-row img {
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid rgba(213, 177, 101, 0.45);
  border-radius: var(--radius-pill);
  object-fit: cover;
}

.gds-row > span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.gds-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gds-row small {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.gds-row em {
  color: var(--gold-100);
  font-family: var(--font-title);
  font-size: 1rem;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.gds-empty {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

/* ---------- sortable headers inside a .ps-table ---------- */

/* The sort links keep their leaderboards.css markup and icons; only the
   colour is re-pointed so they sit correctly on the engraved header band. */
.ps-table th .leaderboards-sort-link {
  color: inherit;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .gds-split--quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gds-split--quad > section:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 760px) {
  .gds-split,
  .gds-split--quad {
    grid-template-columns: minmax(0, 1fr);
  }

  .gds-split > section {
    border-right: 0;
    border-bottom: 1px solid rgba(213, 177, 101, 0.18);
  }

  .gds-split > section:last-child {
    border-bottom: 0;
  }

  .gds-hero-gods {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gds-hero-god {
    transition: none;
  }

  .gds-hero-god:hover,
  .gds-hero-god:focus-visible {
    transform: none;
  }
}

/* ---------- Top Gods · Highest Win Rate ----------
   God Stats.dc.html section 3: a standalone engraved panel with a four-column
   grid of god cards, not a shelf inside the hero. */

.gds-topgods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gds-topgod {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid rgba(213, 177, 101, 0.18);
  color: inherit;
}

.gds-topgod:last-child { border-right: 0; }

.gds-topgod:hover,
.gds-topgod:focus-visible {
  background: rgba(255, 236, 176, 0.05);
  color: inherit;
}

.gds-topgod img,
.gds-topgod .gds-topgod-monogram {
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid rgba(213, 177, 101, 0.55);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  object-fit: cover;
}

.gds-topgod-monogram {
  display: grid;
  place-items: center;
  border-style: dashed;
  background: rgba(20, 34, 58, 0.9);
  color: var(--gold-300);
  font-family: var(--font-title);
  font-size: 0.86rem;
}

.gds-topgod-body { display: grid; min-width: 0; }

.gds-topgod-name {
  overflow: hidden;
  color: #fff6dd;
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gds-topgod-rate {
  color: var(--status-win);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .gds-topgods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gds-topgod:nth-child(2n) { border-right: 0; }
}

@media (max-width: 560px) {
  .gds-topgods { grid-template-columns: minmax(0, 1fr); }
  .gds-topgod { border-right: 0; }
}
