/* ── Stats Page ── */
.stats-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stats-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.stats-hero__ring {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.stats-hero__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.stats-hero__svg circle:last-of-type {
  transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-hero__pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(0, 225, 255, 0.4);
}

.stats-hero__text h2 {
  font-size: 1rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.stats-hero__text p {
  font-size: 0.84rem;
  color: var(--muted);
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

/* ── KPIs ── */
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stats-kpi {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
  transition: border-color 200ms ease;
}

.stats-kpi:hover { border-color: var(--line-glow); }

.stats-kpi__value {
  display: block;
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--accent-2);
  text-shadow: 0 0 10px rgba(0, 225, 255, 0.3);
  line-height: 1.2;
}

.stats-kpi__label {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ── Stats Module ── */
.stats-module {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.stats-module__title {
  font-size: 0.82rem;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.bar-row { margin-top: 14px; }

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

.bar-meta span:last-child {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 6px rgba(0, 225, 255, 0.2);
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}

.bar-fill {
  height: 100%;
  width: var(--bar, 0%);
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(0, 225, 255, 0.35);
  transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.bar-fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #fff;
  border-radius: 0 999px 999px 0;
  box-shadow: 0 0 6px #fff, 0 0 12px var(--accent);
  opacity: 0.8;
}

/* ── Insights ── */
.stats-insights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.insight-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.insight-card:hover {
  border-color: var(--line-glow);
  box-shadow: 0 0 14px rgba(0, 225, 255, 0.08);
}

.insight-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.insight-card--best::before { background: #00ff87; box-shadow: 0 0 6px #00ff87; }
.insight-card--worst::before { background: #ff3a6e; box-shadow: 0 0 6px #ff3a6e; }
.insight-card--variant::before { background: #c945ff; box-shadow: 0 0 6px #c945ff; }
.insight-card--myth::before { background: #ffcc00; box-shadow: 0 0 6px #ffcc00; }
.insight-card--full::before { background: #00e1ff; box-shadow: 0 0 6px #00e1ff; }

.insight-card__label {
  display: block;
  font-size: 0.7rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.insight-card__value {
  display: block;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
}

/* ── Community Stats ── */
.community-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.community-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(0, 225, 255, .08), transparent 35%),
    var(--surface);
}

.community-card--catalogue { grid-column: 1 / -1; }

.community-card__heading { margin-bottom: 14px; }

.community-card__eyebrow {
  display: block;
  margin-bottom: 5px;
  font: 700 .63rem var(--font-heading);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.community-card h3 {
  margin: 0;
  color: var(--text);
  font: 800 1rem/1.1 var(--font-heading);
  letter-spacing: .02em;
}

.community-card__heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.community-disclosure {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(5, 15, 37, .28);
}

.community-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font: 700 .74rem var(--font-heading);
}

.community-disclosure summary::-webkit-details-marker { display: none; }

.community-disclosure summary::before {
  content: "+";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-glow);
  border-radius: 50%;
  color: var(--accent);
  font: 400 1rem/1 sans-serif;
}

.community-disclosure[open] summary::before { content: "−"; }
.community-disclosure__action { margin-left: auto; color: var(--accent); font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; }
.community-disclosure__content { padding: 0 12px 12px; }
.community-disclosure__content > :first-child { margin-top: 0; }

.community-ranking {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.community-ranking__item {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding: 6px 7px;
  border-radius: 9px;
}

.community-ranking__item:nth-child(odd) { background: rgba(255, 255, 255, .025); }

.community-ranking__rank {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 225, 255, .28);
  border-radius: 50%;
  color: var(--accent);
  font: 800 .7rem var(--font-heading);
}

.community-ranking__name { min-width: 0; }
.community-ranking__name strong {
  display: block;
  color: var(--text);
  font-size: .73rem;
  line-height: 1.25;
}
.community-ranking__name small { display: block; margin-top: 1px; color: var(--muted); font-size: .63rem; }
.community-ranking__rate { color: var(--accent); font: 800 .76rem var(--font-heading); white-space: nowrap; }

.community-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 14px;
}

.community-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: var(--muted);
}

.community-table th,
.community-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.community-table th {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.community-table tbody tr:last-child td { border-bottom: 0; }

.community-table__name { color: var(--text); font-weight: 600; }
.community-table__rate { font-family: var(--font-heading); color: var(--accent); }
.community-table__rank { font-family: var(--font-heading); color: var(--accent-2); white-space: nowrap; }
.community-table__muted { color: var(--muted); font-size: 0.78rem; }

.community-legend {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.community-legend p { margin-bottom: 8px; color: var(--text); }

.community-legend ul { margin: 0; padding-left: 18px; }

.community-legend li { margin-bottom: 6px; }

.community-legend__dash {
  display: inline-block;
  width: 1.2em;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

.community-legend__zero {
  font-family: var(--font-heading);
  color: var(--accent);
}

.community-subtitle {
  font-size: 0.82rem;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 16px 0 10px;
}

.community-ownership__metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 13px;
}

.community-ownership__metric strong {
  color: var(--accent-2);
  font: 900 1.6rem/1 var(--font-heading);
  text-shadow: 0 0 10px rgba(0, 225, 255, 0.25);
}

.community-ownership__metric span { color: var(--muted); font-size: .74rem; }

.community-ownership__privacy {
  margin: -5px 0 13px;
  color: var(--muted);
  font-size: .65rem;
  line-height: 1.35;
}

.community-ownership__note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 640px) {
  .community-dashboard { grid-template-columns: 1fr; }
  .community-card--catalogue { grid-column: auto; }
  .community-card { padding: 15px; }
  .community-disclosure summary { padding: 0 10px; }
  .community-disclosure__action { font-size: .6rem; }
}

/* Sprite Graph community UI (Étapes 76–80) */
.sg-community-mount { margin: 12px 0 16px; }
.sg-community {
  padding: 12px 14px;
  border: 1px solid var(--line-glow, rgba(0,225,255,.15));
  border-radius: 12px;
  background: rgba(0, 225, 255, 0.03);
}
.sg-community__title {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.sg-community__subtitle {
  margin: 10px 0 6px;
  font-size: 0.85rem;
  opacity: 0.9;
}
.sg-community__lines {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.sg-community__label {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: 2px;
}
.sg-community__official,
.sg-community__ownership {
  margin: 0 0 8px;
}
.sg-community__note,
.sg-community__muted,
.sg-community__disclaimer {
  margin: 8px 0 0;
  font-size: 0.8rem;
  opacity: 0.75;
}
.sg-community__disclaimer { font-style: italic; }
.sg-community__series {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sg-community__series li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sg-community__evo,
.sg-community__prio-evo {
  margin: 6px 0 0;
  font-size: 0.85rem;
}
.sg-trends__section { margin: 16px 0; }
.sg-trends__title {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.sg-trends__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sg-trends__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.88rem;
}
.sg-trends__rarity {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  opacity: 0.7;
}
.sg-trends__metric { white-space: nowrap; }
