/* The public stats page: a station notice board of numbers. Same tokens as the game (base.css). */
.stats-page { background: var(--ground); color: var(--ink); font-family: var(--font-body); }

.st { max-width: 72rem; margin: 0 auto; padding: 18px var(--gutter, 16px) 48px; }
.st-langs { display: flex; gap: 10px; justify-content: flex-end; font-size: 0.85rem; }
.st-langs a { color: var(--ink-soft); }
.st-langs a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: none; }

.st-head { padding: 18px 0 8px; border-bottom: 6px solid var(--ink); }
.st h1 { margin: 0; font: 400 clamp(1.6rem, 1.1rem + 2.4vw, 2.6rem)/1.2 var(--font-display); }
/* Dela Gothic One lacks many Traditional Chinese characters; mixing faces mid-title looks broken. */
:lang(zh) .st h1, :lang(zh) .st h2, :lang(zh) .st-city h3 { font-family: var(--font-station); font-weight: 700; }
.st h2 { margin: 32px 0 6px; font: 400 clamp(1.2rem, 1rem + 1vw, 1.6rem)/1.3 var(--font-display); }
.st h3, .st h4 { margin: 0 0 8px; font-size: 0.95rem; }
.st-updated { margin: 10px 0 0; font-weight: 700; }
/* Live totals (stats-live.js): an on-air dot before the time of the last refresh. */
.st-updated[data-live]::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--stamp);
  vertical-align: 0.05em;
  animation: st-live 2s ease-in-out infinite;
}
@keyframes st-live { 50% { opacity: 0.35; transform: scale(0.8); } }
.st-method, .st-note { max-width: 46em; margin: 6px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.st-avg { margin: 0; font-weight: 600; }

.st-ranking { width: 100%; max-width: 36rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.st-ranking th, .st-ranking td { padding: 7px 10px; border-bottom: 1px solid var(--rule); text-align: left; }
.st-ranking thead th { font-size: 0.8rem; color: var(--ink-soft); }
.st-ranking tbody th a { color: var(--ink); font-weight: 700; }

/* Jump links to the three kinds of line, then one section per kind: its ranking, its editions. */
.st-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.st-group { margin-top: 36px; border-top: 6px solid var(--ink); scroll-margin-top: 12px; }
.st-group > h2 { margin-top: 14px; }
.st-group .st-ranking { margin-bottom: 18px; }

/* An edition folds into one row: chevron, name and size, average. The numbers stay in the HTML. */
.st-editions { border-bottom: 1px solid var(--rule); }
.st-city { border-top: 1px solid var(--rule); scroll-margin-top: 12px; }
.st-city > summary {
  display: grid;
  grid-template-columns: 0.8em minmax(0, 1fr) 6.5rem;
  align-items: center;
  gap: 4px 12px;
  max-width: 36rem; /* the ranking's width: name and average stay within one glance */
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
}
.st-city > summary::-webkit-details-marker, .st-more > summary::-webkit-details-marker { display: none; }
.st-city > summary::before, .st-more > summary::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.st-city[open] > summary::before, .st-more[open] > summary::before { transform: rotate(45deg); }
.st-city h3 { margin: 0; font: 400 clamp(1.05rem, 0.95rem + 0.6vw, 1.3rem)/1.3 var(--font-display); }
.st-city > summary:hover h3 { text-decoration: underline 2px; text-underline-offset: 0.18em; }
.st-facts { display: block; margin-top: 2px; font: 600 0.82rem/1.3 var(--font-body); color: var(--ink-soft); }
.st-sum-avg { display: grid; gap: 4px; text-align: right; font: 700 0.95rem var(--font-num); font-variant-numeric: tabular-nums; }
.st-body { padding-bottom: 12px; }

/* "All N lines": the rest of an edition's lines, numbered on from the ten shown (LINES_SHOWN). */
.st-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-size: 0.86rem;
  font-weight: 700;
}
.st-list.st-cont { counter-reset: st 10; }
.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 18px 28px;
  margin: 14px 0;
}

.st-list { margin: 0; padding: 0; list-style: none; counter-reset: st; }
.st-list li {
  display: grid;
  grid-template-columns: 1.6em minmax(0, 1fr) 5.5rem 3em;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--rule);
  font-size: 0.92rem;
  counter-increment: st;
}
.st-list li::before { content: counter(st); color: var(--ink-soft); font: 600 0.8rem var(--font-num); }
.st-name { overflow-wrap: anywhere; font-family: var(--font-station); }
.st-code { font-family: var(--font-num); }
.st-rate { text-align: right; font: 600 0.9rem var(--font-num); font-variant-numeric: tabular-nums; }

.st-bar { width: 100%; height: 8px; }
.st-bar::-webkit-meter-bar { background: var(--rail-off); border: 0; border-radius: 4px; }
.st-bar::-webkit-meter-optimum-value { background: var(--ink); border-radius: 4px; }
.st-bar::-moz-meter-bar { background: var(--ink); }
.st-bottom .st-bar::-webkit-meter-optimum-value { background: var(--stamp); }
.st-bottom .st-bar::-moz-meter-bar { background: var(--stamp); }

.st-faq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 16px 28px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 6px solid var(--ink);
}
.st-faq .faq-item { padding-top: 8px; border-top: 1px solid var(--rule); }
.st-faq p { margin: 0; font-size: 0.86rem; color: var(--ink-soft); }
.st-back { margin-top: 28px; }
