/* 速蹬英雄榜 · 六维蹬力: hero page, the shared rider card and its radar, and the live ladder's name card.
   Dark radar room with the fluorescent green brand; each axis has one accent used for its icon and label
   only, while the radar body stays brand green. The hero page follows the live ladder dark theme. */
:root {
  --pw-volume: #39ff88; --pw-investment: #6fe3c2; --pw-burst: #f2c14e; --pw-solo: #7dd3fc; --pw-endurance: #b69cff; --pw-days: #ff9f6b;
  --pw-glass: rgba(9, 19, 13, .86); --pw-glass-2: rgba(12, 26, 18, .72); --pw-edge: rgba(57, 255, 136, .18);
  --pw-fill: rgba(57, 255, 136, .22); --pw-fill-strong: rgba(57, 255, 136, .34); --pw-hatch: rgba(139, 164, 150, .22);
  --pw-shadow: 0 18px 48px rgba(0, 0, 0, .45);
}


/* ---------- page ---------- */
.pw-page { max-width: 1280px; margin: 0 auto; padding: 28px var(--gutter) 72px; }
.pw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 32px; margin-bottom: 22px; }
.pw-head-text { min-width: 0; max-width: 720px; }
.pw-kicker-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.pw-kicker-row .pw-kicker { margin: 0; }
.pw-claude-streak {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  white-space: nowrap;
  text-decoration: none;
  font: 600 12px/1.2 var(--sans);
}
.pw-claude-streak:hover,.pw-claude-streak:focus-visible { border-color: var(--accent); color: var(--ink); }
.pw-claude-streak span[aria-hidden] { color: var(--accent); }
.pw-kicker { margin: 0 0 6px; font: 600 12px/1.4 var(--mono); letter-spacing: .18em; color: var(--accent); text-transform: uppercase; }
.pw-head h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: .02em; }
.pw-lede { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; }
.pw-head-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.pw-asof { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font: 12px/1.4 var(--mono); color: var(--ink-2); background: var(--panel); }
.pw-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pw-asof[data-state="live"] .pw-pulse { background: var(--accent); box-shadow: 0 0 0 0 var(--glow); animation: pw-pulse 2.4s ease-out infinite; }
.pw-asof[data-state="stale"] .pw-pulse { background: var(--warn); }
@keyframes pw-pulse { 0% { box-shadow: 0 0 0 0 var(--glow); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.pw-coverage { margin: 0; font-size: 12px; color: var(--warn); }
.pw-banner { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 8px; background: var(--panel); font-size: 14px; }
.pw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--accent-2);
  border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 650; font-size: 14px; cursor: pointer; }
.pw-btn.ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.pw-btn:hover { border-color: var(--accent); }
.pw-btn.ghost:hover { background: var(--pw-fill); }
.pw-btn:disabled { opacity: .4; cursor: default; }
.pw-muted { color: var(--ink-2); }

/* the seven views */
.pw-dims { display: grid; grid-template-columns: 1.25fr repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.pw-dim { --c: var(--accent); position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); color: var(--ink); cursor: pointer; overflow: hidden;
  transition: border-color .2s, background-color .2s, transform .2s; }
.pw-dim[data-view="volume"] { --c: var(--pw-volume); } .pw-dim[data-view="investment"] { --c: var(--pw-investment); } .pw-dim[data-view="burst"] { --c: var(--pw-burst); }
.pw-dim[data-view="solo"] { --c: var(--pw-solo); } .pw-dim[data-view="endurance"] { --c: var(--pw-endurance); } .pw-dim[data-view="days"] { --c: var(--pw-days); }
.pw-dim:hover { border-color: var(--line); transform: translateY(-1px); }
.pw-dim[aria-pressed="true"] { border-color: var(--c); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, var(--panel)), var(--panel) 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent), 0 8px 24px color-mix(in srgb, var(--c) 14%, transparent); }
.pw-dim[aria-pressed="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--c); border-radius: 2px; }
.pw-dim-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pw-dim-text b { font-size: 15px; }
.pw-dim-text small { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--c, var(--accent)); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }


.pw-scope { margin: 0 0 18px; }
.pw-scope h2 { margin: 0 0 4px; font-size: 22px; }
.pw-scope h2:focus { outline: none; }
.pw-scope-rule { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.pw-scope-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.pw-chip { padding: 2px 9px; border: 1px solid var(--line-soft); border-radius: 999px; font-size: 12px; color: var(--ink-2); background: var(--panel); }

.pw-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 24px; align-items: start; }
.pw-main { min-width: 0; }

/* leaders */
.pw-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.pw-podium:empty { display: none; }
.pw-lead { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 152px; padding: 14px; overflow: hidden;
  border: 1px solid var(--line-soft); border-radius: 14px; background: linear-gradient(170deg, var(--pw-glass-2), var(--panel)); }
.pw-lead[data-rank="1"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px var(--pw-edge), 0 10px 32px var(--glow); }
.pw-lead.is-selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.pw-lead-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.pw-lead-who { display: flex; flex-direction: column; min-width: 0; position: relative; z-index: 1; }
.pw-lead-sub { font: 12px var(--mono); color: var(--ink-3); }
.pw-lead-value { position: relative; z-index: 1; margin-top: auto; font: 700 24px/1.1 var(--mono); color: var(--accent); }
.pw-lead-value small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.pw-mini { position: absolute; right: -18px; bottom: -14px; width: 132px; height: auto; opacity: .55; pointer-events: none; }

/* ranking */
.pw-board { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); overflow: hidden; }
.pw-board[aria-busy="true"] .pw-table tbody { opacity: .55; }
.pw-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pw-table th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.pw-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.pw-table tbody tr:last-child td { border-bottom: 0; }
.pw-table tbody tr:hover { background: var(--pw-glass-2); }
.pw-table tr.is-selected { background: var(--pw-fill); box-shadow: inset 3px 0 0 var(--accent); }
.pw-table tr.is-me .pw-name bdi { color: var(--accent); }
.pw-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pw-table .c-rank { width: 72px; white-space: nowrap; }
.pw-table .c-done { width: 84px; color: var(--ink-2); font: 12px var(--mono); }
.pw-table .c-score { width: 132px; }
.pw-table .c-result { width: 150px; }
.pw-table .c-pct { width: 170px; }
.pw-empty td, .pw-skeleton td { padding: 28px 16px; text-align: center; color: var(--ink-2); }
.pw-empty td > span { display: block; margin-bottom: 10px; }   /* a load error: the message, then Retry centred under it */
.pw-tie { margin-left: 6px; font-size: 11px; color: var(--ink-3); }
.pw-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pw-avatar { flex: none; border-radius: 8px; background: var(--panel-2); image-rendering: auto; object-fit: cover; }
.pw-avatar.pixel-avatar { image-rendering: pixelated; }
.pw-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 2px 0; border: 0; background: none; color: var(--ink);
  font-weight: 600; cursor: pointer; text-align: left; }
.pw-name bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-name:hover bdi { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pw-me-tag { padding: 0 5px; border-radius: 4px; font: 700 10px/1.6 var(--mono); background: var(--accent); color: var(--accent-ink); }
.pw-cell-value, .pw-score-cell { font: 600 15px var(--mono); }
.pw-cell-value small { margin-left: 4px; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.pw-bar { display: block; height: 3px; margin-top: 5px; border-radius: 2px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); width: calc(var(--p, 0) * 100%); margin-left: auto; }
.pw-pct { display: block; }
.pw-pct b { font: 600 13px var(--mono); color: var(--ink-2); }
.pw-pct .pw-bar { margin-left: 0; }
/* Six-axis strip: one continuous Viridis colour per cell from axisStrip (--pw-percentile-color, fixed
   t = (p/100)^3, COLOR_DESIGN.md), the same for every list that uses it. A thin neutral rim keeps the
   darkest (P0) cells visible as solid cells; not-qualified stays a grey hatch. */
.pw-strip { display: inline-grid; grid-template-columns: repeat(6, 16px); gap: 3px; vertical-align: middle; }
.pw-strip-cell { display: block; height: 18px; border-radius: 3px; background: var(--pw-percentile-color, #440154);
  box-shadow: inset 0 0 0 1px rgba(221, 234, 225, .16); forced-color-adjust: none; }
.pw-strip-cell.is-missing { background: repeating-linear-gradient(135deg, rgba(139, 164, 150, .34) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--line); }
.pw-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 4px 12px; margin: 0; padding: 8px 12px 2px;
  font: 10px/1 var(--mono); color: var(--ink-3); }
.pw-legend[hidden] { display: none; }
.pw-legend-scale { position: relative; display: block; width: 184px; max-width: 100%; height: 22px; }
.pw-legend-bar { position: absolute; inset: 0 0 auto; height: 7px; border-radius: 2px; background: var(--pw-legend-gradient);
  box-shadow: inset 0 0 0 1px rgba(221, 234, 225, .16); forced-color-adjust: none; }
.pw-legend-tick { position: absolute; top: 7px; left: var(--pw-x); padding-top: 4px; transform: translateX(-50%); white-space: nowrap; }
.pw-legend-tick::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 3px; background: var(--ink-3); }
.pw-legend-tick[data-edge="start"] { transform: none; }
.pw-legend-tick[data-edge="start"]::before { left: 0; }
.pw-legend-tick[data-edge="end"] { transform: translateX(-100%); }
.pw-legend-tick[data-edge="end"]::before { left: auto; right: 0; }
.pw-legend-item { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.pw-legend .pw-strip-cell { width: 9px; height: 7px; border-radius: 2px; }
.pw-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-2); }
.pw-pager:has(#pw-prev[hidden]) #pw-pager-info { margin-right: auto; }

.pw-unranked { margin-top: 14px; border: 1px dashed var(--line); border-radius: 12px; padding: 0 14px; background: var(--panel); }
.pw-unranked summary { padding: 12px 0; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.pw-unranked-hint { margin: 0 0 10px; font-size: 13px; color: var(--ink-3); }
.pw-unranked-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; margin: 0 0 14px; padding: 0; list-style: none; }
.pw-unranked-list li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 0; }
.pw-unranked-list li.is-selected .pw-name bdi { color: var(--accent); }
.pw-unranked-list .pw-name { flex: 1; }
.pw-unranked-list .pw-strip { grid-template-columns: repeat(6, 9px); gap: 2px; }
.pw-unranked-list .pw-strip-cell { height: 12px; }
.pw-done { font: 12px var(--mono); color: var(--ink-3); }

/* profile panel */
.pw-profile { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 92px); overflow: auto;
  padding: 16px; border: 1px solid var(--pw-edge); border-radius: 18px; background: var(--pw-glass); box-shadow: var(--pw-shadow); backdrop-filter: blur(10px);
  scrollbar-width: thin; }
.pw-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pw-profile h2 { margin: 0; font: 600 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.pw-profile h2:focus { outline: none; }
.pw-close { min-height: 32px; width: 32px; padding: 0; font-size: 18px; }
.pw-profile-hint { margin: 0; font-size: 12px; color: var(--ink-3); }
.pw-profile-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-profile-actions[hidden] { display: none; }
.pw-profile-actions .pw-btn { min-height: 32px; padding: 0 10px; font-size: 13px; }

/* method */
.pw-method { margin-top: 28px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); }
.pw-method summary { padding: 14px 18px; cursor: pointer; font-weight: 650; }
.pw-method-body { padding: 0 18px 18px; font-size: 14px; color: var(--ink-2); }
.pw-method-body h3 { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.pw-method-axes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin: 0 0 14px; }
.pw-method-axes > div { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; }
.pw-method-axes dt { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--ink); }
.pw-method-axes dt span { color: var(--ink-3); font-size: 12px; }
.pw-method-axes dd { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.pw-method-axes dd small { color: var(--ink-3); }
.pw-method-axes .pw-icon { stroke: var(--accent); }
.pw-method-facts { margin: 0 0 10px; padding-left: 18px; }
.pw-method-facts li { margin: 4px 0; }
.pw-method-foot { margin: 0; font: 12px var(--mono); color: var(--ink-3); }

/* ---------- the rider card ---------- */
html[lang="en"] .pw-card { --pw-name-w: 88px; }
.pw-card { --c-gap: 12px; display: flex; flex-direction: column; gap: var(--c-gap); color: var(--ink); }
.pw-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.pw-card-head .pw-avatar { border-radius: 12px; box-shadow: 0 0 0 1px var(--pw-edge); }
.pw-card-id { min-width: 0; }
.pw-card-name { margin: 0; font-size: 18px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-card-sub { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.pw-tag { padding: 0 6px; border: 1px solid var(--line-soft); border-radius: 4px; }
.pw-best { color: var(--ink-2); }
.pw-card-overall { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.15; }
.pw-score { font: 800 30px/1 var(--mono); color: var(--accent); text-shadow: 0 0 18px var(--glow); }
.pw-score-label { font-size: 11px; color: var(--ink-3); }
.pw-orank { font: 600 12px var(--mono); color: var(--ink-2); margin-top: 2px; }
.pw-card-overall.is-unranked .pw-orank { font-family: var(--sans); color: var(--ink-2); }
.pw-card-body { display: flex; flex-direction: column; gap: var(--c-gap); }
.pw-radar-wrap { margin: 0; display: flex; justify-content: center; padding: 6px 0; border-radius: 14px;
  background: radial-gradient(closest-side, var(--pw-fill), transparent 75%), var(--pw-glass-2); border: 1px solid var(--line-soft); }
.pw-radar { width: 100%; max-width: 310px; height: auto; overflow: visible; }
.pw-r-ring { fill: none; stroke: var(--line-soft); stroke-width: 1; }
.pw-r-rim { fill: color-mix(in srgb, var(--accent) 4%, transparent); stroke: var(--line); stroke-width: 1.2; }
.pw-r-spoke { stroke: var(--line-soft); stroke-width: 1; }
.pw-r-spoke.is-missing { stroke: var(--ink-3); stroke-dasharray: 3 4; opacity: .8; }
.pw-r-wedge { fill: var(--pw-fill); }
.pw-r-edge { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--glow)); }
.pw-r-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; }
.pw-r-void { fill: var(--bg); stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 2 2; }
.pw-r-label { font: 600 12.5px var(--sans); fill: var(--ink); }
.pw-r-label .pw-r-val { font: 600 11.5px var(--mono); fill: var(--accent); }
.pw-r-label.is-missing .pw-r-name { fill: var(--ink-3); }
.pw-r-label.is-missing .pw-r-val { fill: var(--ink-3); font-family: var(--sans); font-weight: 500; }
.pw-r-label[data-axis="volume"] .pw-r-name { fill: var(--pw-volume); } .pw-r-label[data-axis="investment"] .pw-r-name { fill: var(--pw-investment); }
.pw-r-label[data-axis="burst"] .pw-r-name { fill: var(--pw-burst); } .pw-r-label[data-axis="solo"] .pw-r-name { fill: var(--pw-solo); }
.pw-r-label[data-axis="endurance"] .pw-r-name { fill: var(--pw-endurance); } .pw-r-label[data-axis="days"] .pw-r-name { fill: var(--pw-days); }
.pw-card[data-animate] .pw-r-shape { transform-origin: 0 0; animation: pw-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pw-grow { from { transform: scale(.35); opacity: 0; } }

.pw-axes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pw-axis { --c: var(--accent); position: relative; display: grid; grid-template-columns: var(--pw-name-w, 52px) minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px;
  padding: 7px 10px 9px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); }
.pw-axis[data-axis="volume"] { --c: var(--pw-volume); } .pw-axis[data-axis="investment"] { --c: var(--pw-investment); } .pw-axis[data-axis="burst"] { --c: var(--pw-burst); }
.pw-axis[data-axis="solo"] { --c: var(--pw-solo); } .pw-axis[data-axis="endurance"] { --c: var(--pw-endurance); } .pw-axis[data-axis="days"] { --c: var(--pw-days); }
.pw-axis-name { font-weight: 650; font-size: 13px; color: var(--c); }
.pw-axis-value { font: 600 14px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-axis-value small { margin-left: 3px; font: 400 11px var(--sans); color: var(--ink-3); }
.pw-axis-rank { display: flex; gap: 8px; font: 12px var(--mono); color: var(--ink-2); white-space: nowrap; }
.pw-axis-rank b { font-weight: 600; color: var(--ink); }
.pw-axis-pct { color: var(--accent); }
.pw-axis-bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.pw-axis-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--c); }
.pw-axis.is-missing { border-style: dashed; background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--pw-hatch) 45%, transparent) 6px 7px), var(--panel); }
.pw-axis.is-missing .pw-axis-value { font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--ink-2); }
.pw-axis-why { grid-column: 2 / -1; font-size: 12px; color: var(--ink-3); }
.pw-axis-progress { display: block; font: 11px var(--mono); color: var(--ink-2); }
.pw-card-totals-head { margin: 2px 0 -4px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pw-card-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.pw-card-totals > div { padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); }
.pw-card-totals dt { font-size: 12px; color: var(--ink-3); }
.pw-card-totals dd { margin: 0; display: flex; flex-direction: column; }
.pw-total { font: 700 16px var(--mono); }
.pw-total small { margin-left: 4px; font: 400 11px var(--sans); color: var(--ink-3); }
.pw-total.none { color: var(--ink-3); font-family: var(--sans); font-weight: 500; font-size: 13px; }
.pw-note { font-size: 11px; color: var(--ink-3); line-height: 1.35; }
/* Cost coverage notes are tips (ui/tooltip.mjs): a small ⓘ after a total's label, a "*" after the consumption axis name. */
.pw-info { position: relative; margin-left: 4px; color: var(--ink-3); font: 12px/1 var(--sans); cursor: help; }
.pw-info:hover, .pw-info:focus-visible { color: var(--accent); }
.pw-cost-flag { margin-left: 2px; color: var(--warn); font-weight: 700; cursor: help; }
.pw-axis-explanation .pw-cost-coverage { margin: 0 0 6px; }
.pw-card-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 11px var(--mono); color: var(--ink-3); }
.pw-card-registration { flex-basis: 100%; }
.pw-card-foot.is-stale .pw-stale { flex-basis: 100%; color: var(--warn); font-family: var(--sans); }

/* ---------- live ladder name card ---------- */
.power-peek { position: fixed; z-index: 45; left: 0; top: 0; width: min(380px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto;
  padding: 14px; border: 1px solid var(--pw-edge); border-radius: 16px; background: var(--pw-glass); box-shadow: var(--pw-shadow), 0 0 0 1px rgba(0, 0, 0, .3);
  backdrop-filter: blur(12px); scrollbar-width: thin; }
.power-peek[hidden] { display: none; }
@keyframes pw-peek { from { opacity: 0; transform: translateY(4px); } }
.power-peek .pw-card { --c-gap: 9px; }
/* The ladder card shows the whole nickname (ticket 408): a long one wraps instead of an ellipsis plus hover tip.
   On very narrow screens the avatar and overall score share the first row and the name block takes the full
   width below them, so the name is not squeezed into a sliver between the two. There each axis reading also wraps
   (number first, its unit as one piece) instead of an ellipsis, so the full formatted value and unit stay visible
   in the same two-column grid. */
.power-peek .pw-card-name { font-size: 16px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .power-peek .pw-card-head { grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; }
  .power-peek .pw-card-head .pw-card-overall { grid-column: 2; grid-row: 1; justify-self: end; }
  .power-peek .pw-card-head .pw-card-id { grid-column: 1 / -1; grid-row: 2; }
  .power-peek .pw-axis-value { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .power-peek .pw-axis-value small { display: inline-block; }
}
.power-peek .pw-score { font-size: 24px; }
.power-peek .pw-radar { max-width: 236px; }
.power-peek .pw-radar-wrap { padding: 2px 0; }
.power-peek .pw-card-totals > div { padding: 6px 8px; }
.power-peek .pw-total { font-size: 14px; }
.power-peek .pw-axes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.power-peek .pw-axis { grid-template-columns: minmax(0, 1fr) auto; padding: 5px 8px 7px; gap: 0 6px; }
.power-peek .pw-axis-name { font-size: 12px; }
.power-peek .pw-axis-value { grid-column: 1 / -1; font-size: 13px; }
.power-peek .pw-axis-rank { grid-column: 1 / -1; font-size: 11px; gap: 6px; }
.power-peek .pw-axis-why { grid-column: 1 / -1; font-size: 11px; }
.power-peek .pw-card-totals-head { display: none; }
.power-peek-msg { margin: 6px 0; font-size: 13px; color: var(--ink-2); }
.power-peek-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.power-peek-bar a { font-size: 13px; font-weight: 650; }
.power-peek-x { min-height: 30px; width: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 16px; }
.power-peek-x:hover { color: var(--ink); border-color: var(--accent); }
/* The opener beside a ladder nickname. Always shown (ticket 408): the ladder reveals nothing on hover, so the
   card's entry is visible on every row and device instead of appearing only while the pointer rests on a row. */
.power-peek-btn { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line-soft); border-radius: 7px;
  background: var(--panel-2); color: var(--accent); cursor: pointer; }
.power-peek-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.power-peek-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--pw-fill); }

/* Beside the nickname: close to the name on wide rows, in the name line's last column on phones. */
.ladder .name-cell .power-peek-btn { margin-left: -16px; }
@media (max-width: 720px) {
  .ladder .name-cell:has(.power-peek-btn) { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ladder .name-cell .power-peek-btn { grid-area: 1 / 3; width: 26px; height: 24px; margin-left: 6px; }
  .ladder .name-cell:has(.power-peek-btn) .row-meta { grid-column: 1 / 4; }
}

/* ---------- narrow screens ---------- */
@media (max-width: 1240px) {
  .pw-layout { grid-template-columns: minmax(0, 1fr); }
  .pw-profile { position: static; max-height: none; order: -1; }
  .pw-dims { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 841px) and (max-width: 1240px) {
  .pw-profile .pw-card-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
}
@media (max-width: 840px) {
  .pw-page { padding-top: 18px; }
  .pw-kicker-row { gap: 8px; }
  .pw-kicker-row .pw-kicker { letter-spacing: .1em; }
  .pw-claude-streak { font-size: 11px; }
  .pw-head-meta { align-items: flex-start; text-align: left; }
  .pw-dims { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  /* The scroller clips: room above and below for the focus ring and the selected tab's glow, snap stops
     at the page gutter, and the gutters fade so a cut-off tab reads as "more this way". At either end
     the fade covers only the empty gutter. */
  .pw-dims { padding-block: 4px 12px; margin-block: -4px 10px; scroll-padding-inline: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent); }
  .pw-dims::-webkit-scrollbar { display: none; }
  .pw-dim { flex: none; min-width: 112px; scroll-snap-align: start; min-height: 52px; }
  .pw-podium { grid-template-columns: minmax(0, 1fr); }
  .pw-lead { min-height: 0; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .pw-lead-who { flex: 1; }
  .pw-lead-value { margin-top: 0; font-size: 20px; }
  .pw-mini { display: none; }
  .pw-table thead { display: none; }
  .pw-table, .pw-table tbody { display: block; }
  .pw-table tr { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
  .pw-table td { padding: 0; border: 0; }
  .pw-table td.c-rank { grid-row: span 2; width: auto; }
  .pw-table td.c-score, .pw-table td.c-result { width: auto; }
  .pw-table td.c-axes, .pw-table td.c-pct { grid-column: 2 / 3; width: auto; }
  .pw-table td.c-done { grid-column: 3 / 4; width: auto; }
  .pw-table td.c-done::before { content: attr(data-label) " "; color: var(--ink-3); }
  .pw-table tr.pw-empty, .pw-table tr.pw-skeleton { display: block; }
  .pw-profile { padding: 12px; border-radius: 14px; }
  .pw-card { --pw-name-w: 58px; }
  html[lang="en"] .pw-card { --pw-name-w: 84px; }
  .pw-card-head .pw-avatar { width: 46px; height: 46px; }
  .pw-score { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .pw-asof[data-state="live"] .pw-pulse, .pw-card[data-animate] .pw-r-shape, .power-peek { animation: none; }
  .pw-dim, .pw-dim:hover { transition: none; transform: none; }
}

/* Inline, keyboard-native explanations share the current snapshot; no nested modal. */
.pw-axis-explainer { grid-column:1/-1; min-width:0; }
.pw-axis-toggle { position:relative; display:grid; grid-template-columns:var(--pw-name-w,52px) minmax(0,1fr) auto; gap:3px 10px; align-items:baseline; min-height:40px; padding:3px 14px 6px 0; cursor:pointer; list-style:none; }
.pw-axis-toggle::-webkit-details-marker { display:none; }
.pw-axis-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:5px; }
.pw-axis-help { position:absolute; right:-4px; top:1px; color:var(--ink-3); font-size:12px; }
.pw-axis-detail { grid-column:1/-1; margin:3px 0 0; color:var(--ink-3); font-size:10px; line-height:1.4; }
.pw-axis-detail span { display:block; }
.pw-axis-explanation { border-top:1px solid var(--line-soft); margin-top:6px; padding-top:8px; font-size:12px; line-height:1.6; color:var(--ink-2); overflow-wrap:anywhere; }
.pw-axis-explanation dl { margin:0 0 8px; }
.pw-axis-explanation dl>div { margin:0 0 7px; }
.pw-axis-explanation dt { font-weight:650; color:var(--c); }
.pw-axis-explanation dd { margin:0; }
.pw-axis-explanation .pw-btn { min-height:36px; }
.power-peek .pw-axis-toggle { grid-template-columns:minmax(0,1fr); min-height:72px; }
.power-peek .pw-axis-explanation { font-size:11px; }
.pw-price-note { display:block; color:var(--warn); font:10px var(--sans); white-space:normal; }
.pw-axis-toggle { min-height:44px; }
.power-peek .pw-axis:has(.pw-axis-explainer[open]) { grid-column:1/-1; }

/* Featured leaders: real layout regions, never text over an absolute radar. */
.pw-lead { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"head value" "who who" "radar radar"; align-items:center; gap:8px 12px; min-height:0; }
.pw-lead-top { grid-area:head; }
.pw-lead-who { grid-area:who; min-width:0; }
.pw-lead-value { grid-area:value; margin:0; align-self:center; white-space:nowrap; }
.pw-mini { grid-area:radar; position:static; inset:auto; transform:none; width:100%; max-width:340px; height:auto; justify-self:center; opacity:1; pointer-events:none; }
.pw-mini .pw-r-label { font-size:14px; }
.pw-mini .pw-r-val { font-size:13px; }
.pw-lead-caption { grid-area:caption; margin:0; color:var(--ink-3); font-size:11px; text-align:center; }
.pw-lead-scores { display:none; }
@media(max-width:840px) {
 .pw-lead { display:grid; grid-template-areas:"head value" "who who" "scores scores"; }
 .pw-lead-scores { grid-area:scores; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
 .pw-lead-scores>span { display:flex; justify-content:space-between; gap:4px; padding:4px 6px; border:1px solid var(--line-soft); border-radius:6px; }
 .pw-lead-scores small { color:var(--ink-3); font-size:11px; }
 .pw-lead-scores b { color:var(--accent); font:600 12px var(--mono); }
 .pw-mini { display:none; }
}
.pw-lead-scores>span { flex-wrap:wrap; row-gap:2px; min-width:0; }
.pw-lead-value.pw-score-cell { font:700 26px var(--mono); }

.ladder .profile-avatar[data-person]{cursor:pointer}
.ladder .profile-avatar[data-person]:focus-visible{outline:2px solid #1de783;outline-offset:4px}

.power-peek-top{position:sticky;top:-14px;z-index:2;display:flex;justify-content:flex-end;margin:-14px -14px 8px;padding:6px 8px;background:var(--panel);border-radius:16px 16px 0 0}
.power-peek-top .power-peek-x{width:32px;min-height:32px}

/* Keep the averaging window visible beside podium speeds. */
.pw-lead-value .pw-average-note { display:block; margin:5px 0 0; font:500 12px/1.3 var(--sans); color:var(--ink-2); white-space:normal; }

.pw-rule-summary { margin: 0 0 16px; color: var(--ink-2); font: 400 14px/1.7 var(--sans); overflow-wrap: anywhere; }

/* Phones: main already holds the page gutter, so the hero column lines up with the header, notice and
   footer instead of indenting a second gutter (the dimension scroller still bleeds to the screen edge).
   The loading, empty and retry row spans the board so its message and Retry button share one centre. */
@media (max-width: 840px) {
  .pw-page { padding-inline: 0; }
  .pw-table tr.pw-empty td, .pw-table tr.pw-skeleton td { display: block; }
}
/* No rows yet: the pager has nothing to show, so no empty bordered strip hangs under the board. */
.pw-pager:has(#pw-pager-info:empty):has(#pw-prev[hidden]):has(#pw-next[hidden]) { display: none; }

/* Touch: buttons become 44px targets. The radar opener beside a ladder nickname keeps its size (rows keep
   fixed heights between frames); only its hit area grows. */
@media (pointer: coarse) {
  .pw-btn, .pw-profile-actions .pw-btn, .pw-axis-explanation .pw-btn { min-height: 44px; }
  .pw-close, .power-peek-x, .power-peek-top .power-peek-x { width: 44px; min-height: 44px; }
  .power-peek-btn { position: relative; }
  .power-peek-btn::after { content: ""; position: absolute; inset: -8px -6px; }
  .pw-info::after { content: ""; position: absolute; inset: -14px -14px; }
}
/* Forced colours replace the selected tab's tint and border colour, so it keeps a system outline. */
@media (forced-colors: active) {
  .pw-dim[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -4px; }
}

/* Phones: the "data as of" line wraps in English; a two-line text keeps a rounded rectangle instead of a
   stretched capsule, and the live dot stays beside its first line. */
@media (max-width: 840px) {
  .pw-asof { align-items: flex-start; border-radius: 10px; }
  .pw-asof .pw-pulse { flex: none; margin-top: 4px; }
}
/* Profile (h_u) on narrow phones in English: the axis names (Token volume, Peak total speed, Mean lane
   speed …) get their own line above value and rank instead of breaking inside an 84px column. */
@media (max-width: 420px) {
  html[lang="en"] .pw-profile .pw-axis-toggle { grid-template-columns: minmax(0, 1fr) auto; row-gap: 1px; }
  html[lang="en"] .pw-profile .pw-axis-toggle > .pw-axis-name { grid-column: 1 / -1; padding-right: 16px; }
  html[lang="en"] .pw-profile .pw-axis-toggle > .pw-axis-why { grid-column: 1 / -1; }
}

/* Podium six-axis scores on phones and tablets (#388): each cell is the axis name over its score, never a mix.
   Before, a cell kept name and score on one line only while both fitted, so "总速峰值 100.00", "Qualifying
   periods" or "Mean lane speed" dropped their score to a second line beside cells that did not, and a row's
   scores sat at different heights. Now every score sits at the foot of its cell in tabular figures, so the
   scores of one row share a baseline whatever the label length or language. */
@media (max-width: 840px) {
  .pw-lead-scores > span { flex-direction: column; flex-wrap: nowrap; justify-content: space-between; align-items: flex-start;
    gap: 2px; padding: 5px 7px 6px; }
  .pw-lead-scores small { line-height: 1.3; overflow-wrap: break-word; }
  .pw-lead-scores b { line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
}
