/* Stats subpage — reuses the design tokens from styles.css (:root) and the
   shared nav/footer/btn/section/h2 classes. Only the chart-specific bits
   live here so the landing page CSS stays untouched. */

.stats-hero {
  position: relative;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 48px 22px 8px;
  text-align: center;
}
.stats-hero__kicker {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.stats-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: 3px;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--ink);
  margin-bottom: 26px;
}

/* Big odometer-style total */
.bignum {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 9px 10px 0 var(--shadow);
  padding: 22px 38px 18px;
  transform: rotate(-1deg);
}
.bignum__digits {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 12vw, 6.4rem);
  line-height: 1;
  letter-spacing: 4px;
  color: var(--yellow);
  text-shadow: 0 0 18px rgba(255, 123, 8, 0.55);
  font-variant-numeric: tabular-nums;
}
.bignum__label {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.78rem;
  color: var(--paper-2);
  opacity: 0.85;
}

.stats-state {
  max-width: 640px;
  margin: 30px auto 0;
  text-align: center;
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.stats-state__big {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 1px;
  color: var(--ink);
  margin-bottom: 8px;
}
.stats-state--err {
  background: #fff3d6;
  border: 3px solid var(--orange);
  border-radius: 12px;
  box-shadow: 5px 5px 0 rgba(255, 111, 31, 0.4);
  padding: 22px 24px;
}
.stats-state .spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 4px solid var(--paper-line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .stats-state .spinner { animation: none; }
}

/* Quick-stat card row */
.statgrid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 8px;
}
.statcard {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 18px 20px;
  text-align: center;
}
.statcard:nth-child(2) { transform: rotate(-1deg); }
.statcard:nth-child(3) { transform: rotate(1deg); }
.statcard__k {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 2px;
}
.statcard__v {
  font-family: var(--font-display);
  font-size: 2.1rem;
  letter-spacing: 1px;
  color: var(--red-deep);
  line-height: 1.1;
}
.statcard__v small {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink-soft);
  letter-spacing: 0;
}

/* Bar list (platforms + releases) */
.bars {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.bars--scroll {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}
.bar {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 12px 16px;
}
a.bar { transition: transform 0.08s ease, box-shadow 0.08s ease; }
a.bar:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow);
  color: inherit;
}
.bar__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.bar__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.05rem;
}
.bar__icon { font-size: 1.2rem; }
.bar__val {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar__val strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 1px;
  color: var(--ink);
}
.bar__pct { color: var(--ink-soft); font-weight: 700; font-size: 0.9rem; }
.bar__track {
  height: 16px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.bar__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--orange);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .bar__fill { transition: none; }
}

/* Desktop vs handheld split */
.split {
  max-width: 760px;
  margin: 0 auto;
}
.split__bar {
  display: flex;
  height: 54px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 5px 5px 0 var(--shadow);
}
.split__seg {
  height: 100%;
  width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  font-size: 1.05rem;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
}
.split__seg--pc { background: var(--navy); }
.split__seg--hh { background: var(--green-deep); }
@media (prefers-reduced-motion: reduce) {
  .split__seg { transition: none; }
}
.split__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 28px;
  margin-top: 18px;
}
.split__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.split__dot {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.split__dot--pc { background: var(--navy); }
.split__dot--hh { background: var(--green-deep); }
.split__item b { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 1px; }

.stats-note {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 34px;
}
.stats-note code { font-size: 0.85em; }

.section__sub {
  text-align: center;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: -14px auto 26px;
}
