/* The creator's play stats (stats.html): Rally's night-arena surfaces, quiet charts. */

:root { --card: var(--arena-2); --card-2: var(--arena-3); }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--arena); color: var(--line); font: 15px/1.45 var(--sans); }
body { min-height: 100vh; }
body.loading #dash { opacity: 0.55; transition: opacity 0.2s; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-stretch: 112%; letter-spacing: 0.01em; }
button { font: inherit; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 20px max(16px, 4vw) 16px; border-bottom: 1px solid var(--hair); position: sticky; top: 0; background: color-mix(in srgb, var(--arena) 92%, transparent); backdrop-filter: blur(8px); z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 14px; margin-right: auto; }
.mark { font: 800 13px/1 var(--display); font-stretch: 130%; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ball); text-decoration: none; }
.brand h1 { font-size: 24px; font-weight: 800; }
.controls { display: flex; gap: 6px; flex-wrap: wrap; }
.controls button { background: var(--arena-2); color: var(--line-2); border: 1px solid var(--hair-strong); border-radius: var(--r-2); padding: 6px 12px; cursor: pointer; }
.controls button[aria-pressed='true'] { background: var(--court); color: var(--line); border-color: var(--court-hi); }
.controls button:hover { color: var(--line); }
.controls button:focus-visible, [tabindex]:focus-visible, summary:focus-visible { outline: 2px solid var(--ball); outline-offset: 2px; }
.meta { width: 100%; margin: 0; color: var(--line-3); font-size: 13px; }

main { padding: 20px max(16px, 4vw) 48px; max-width: 1280px; margin: 0 auto; }
.gate { max-width: 520px; margin: 12vh auto; text-align: center; }
.gate h2 { font-size: 28px; margin-bottom: 10px; }
.gate p { color: var(--line-2); }
.btn { display: inline-block; margin-top: 12px; background: var(--ball); color: var(--ball-ink); font-weight: 700; padding: 10px 18px; border-radius: var(--r-2); text-decoration: none; }

.tiles, .ret-tiles, .shop-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-3); padding: 14px 16px; display: grid; gap: 2px; min-width: 0; }
.ret-tiles .tile, .shop-sum .tile { background: var(--card-2); }
.tile-label { color: var(--line-2); font-size: 13px; }
.tile-value { font: 800 30px/1.15 var(--display); font-stretch: 110%; font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--line-3); font-size: 12.5px; }

.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-3); padding: 18px 18px 14px; margin-bottom: 16px; min-width: 0; }
.card > header { margin-bottom: 12px; }
.card h2 { font-size: 17px; font-weight: 750; }
.card > header p { margin: 4px 0 0; color: var(--line-3); font-size: 13px; }
.card h3 { font: 600 12px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--line-3); margin: 16px 0 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 0 16px; }
.chart { width: 100%; min-height: 40px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .base { stroke: var(--hair-strong); stroke-width: 1; }
.chart .axis { fill: var(--line-3); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .cross { stroke: var(--line-3); stroke-width: 1; }
.chart .bar { transition: opacity 0.1s; }
.note { margin: 0 0 6px; color: var(--line-2); font-size: 13px; }
.legend { display: flex; gap: 16px; margin-bottom: 6px; color: var(--line-2); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.line { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }

.as-table { margin-top: 6px; }
.as-table summary { color: var(--line-3); font-size: 12px; cursor: pointer; width: max-content; }
.as-table table { margin-top: 6px; max-height: 260px; display: block; overflow: auto; }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--line-3); font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--hair-strong); white-space: nowrap; }
td { padding: 6px 10px; border-bottom: 1px solid var(--hair); }
td.dim { color: var(--line-3); }
td.empty, p.empty { color: var(--line-3); }
.table-wrap { overflow-x: auto; }
td.heat { background: color-mix(in srgb, #3987e5 calc(var(--p) * 85% + 6%), transparent); text-align: center; }
td.na { color: var(--line-3); text-align: center; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.bl-name { color: var(--line); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-val { color: var(--line-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.bl-track { grid-column: 1 / -1; height: 6px; background: var(--hair); border-radius: 3px; overflow: hidden; }
.bl-track i { display: block; height: 100%; background: #3987e5; border-radius: 0 3px 3px 0; }

.tip { position: fixed; left: 0; top: 0; z-index: 10; pointer-events: none; background: var(--arena-3); border: 1px solid var(--hair-strong); border-radius: var(--r-2); padding: 8px 10px; box-shadow: var(--lift-2); font-size: 13px; display: grid; gap: 3px; min-width: 120px; }
.tip[hidden] { display: none; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { font-variant-numeric: tabular-nums; }
.tip-row span { color: var(--line-2); }
.tip-row .key { width: 12px; height: 2px; border-radius: 1px; }
.tip-row:first-child span { color: var(--line-3); font-size: 12px; }

.foot { color: var(--line-3); font-size: 12.5px; max-width: 760px; }

@media (max-width: 560px) {
  .tile-value { font-size: 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
