/* ───────────────────────────────────────────────────────────
   Stats page — character popularity chart
─────────────────────────────────────────────────────────── */

body.about-page {
  overflow: auto;
  height: auto;
  min-height: 100%;
}
body.about-page #site-header { position: sticky; top: 0; }

/* ── Main layout ─────────────────────────────────────────── */
#stats-main {
  background: #f4e8c1;
  min-height: calc(100vh - 68px);
  padding: 2.5rem 1.5rem 5rem;
}

.stats-wrap {
  max-width: 820px;
  margin: 0 auto;
}

/* ── Hero ────────────────────────────────────────────────── */
.stats-hero {
  margin-bottom: 1.5rem;
}

.stats-overline {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #8b6914;
  margin-bottom: 0.6rem;
}

.stats-title {
  font-family: 'IM Fell English', Georgia, serif;
  font-weight: 400;
  font-size: 2.2rem;
  color: #2a0808;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.stats-lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #3a1a08;
  font-style: italic;
  max-width: 600px;
  margin-bottom: 1rem;
}

.stats-vote-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: #2a0808;
  border: 1px solid #8b6914;
  border-radius: 3px;
  color: #f0dfa0;
  text-decoration: none;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}
.stats-vote-link:hover { background: #3d0f0f; }

.stats-rule {
  border: none;
  border-top: 1px solid #d4bc7a;
  margin: 1.5rem 0 2rem;
}

/* ── Loading ─────────────────────────────────────────────── */
.stats-loading {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  color: #7a5010;
}
.stats-loading .spinner { width: 32px; height: 32px; border-width: 2px; }

.hidden-until-loaded { display: none; }
.hidden { display: none !important; }

/* ── Podium ──────────────────────────────────────────────── */
.chart-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding: 0 1rem 0;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  max-width: 200px;
}

.podium-name {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1rem;
  color: #2a0808;
  text-align: center;
  line-height: 1.3;
}

.podium-votes {
  font-size: 0.8rem;
  color: #7a5010;
  font-style: italic;
  text-align: center;
}

.podium-block {
  width: 100%;
  height: var(--h, 140px);
  background: var(--clr, #8b6914);
  border-radius: 4px 4px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.6rem;
  font-size: 1.8rem;
  color: rgba(255,255,255,0.9);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.podium-rank {
  display: block;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.7);
  margin-top: 0.2rem;
}

/* ── Bar chart ───────────────────────────────────────────── */
.chart-bars {
  background: #faf3e0;
  border: 1px solid #d4bc7a;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: 36px;
}

.bar-row--top .bar-name {
  font-weight: 600;
  color: #1a0404;
}

.bar-label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  overflow: hidden;
}

.bar-rank {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 0.72rem;
  color: #9a7a4a;
  min-width: 1.6rem;
  text-align: right;
  flex-shrink: 0;
}

.bar-name {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 0.92rem;
  color: #2a0808;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-street {
  font-size: 0.72rem;
  color: #9a7a4a;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.bar-track {
  position: relative;
  height: 22px;
  background: rgba(139, 105, 20, 0.1);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  min-width: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-count {
  position: absolute;
  right: 0.5rem;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 0.78rem;
  color: #2a0808;
  mix-blend-mode: multiply;
}

/* ── No-votes message ────────────────────────────────────── */
.no-votes-msg {
  text-align: center;
  padding: 2.5rem;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #7a5010;
  line-height: 1.7;
}
.no-votes-msg a {
  color: #8b1a1a;
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
  #stats-main { padding: 1.5rem 1rem 4rem; }
  .stats-title { font-size: 1.7rem; }
  .stats-lead { font-size: 1rem; }

  .chart-podium { gap: 0.4rem; }
  .podium-name { font-size: 0.82rem; }

  .bar-row { grid-template-columns: 140px 1fr; gap: 0.4rem; }
  .bar-street { display: none; }
  .bar-name { font-size: 0.82rem; }

  .nav-link { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
}
