/* ============================================================
   pingunt1 — tool-first ping tester
   Dark HUD design system. Per-game accent set at runtime via
   [data-game] on <html>. Numbers/codes in mono; UI in grotesk.
   Ported from the Claude Design handoff; locked choices baked in:
   hero=inline · bars=gradient · coloring=rowtint · density=compact
   · motion=waves. No tweaks panel.
   Fonts are loaded non-render-blocking from the HTML <head> (preconnect +
   async stylesheet), not via @import here — that import was a render-blocking
   request chain behind this file.
   ============================================================ */

:root {
  color-scheme: dark;
  /* near-black cool-neutral base */
  --bg:        oklch(0.145 0.006 264);
  --bg-1:      oklch(0.185 0.007 264);
  --bg-2:      oklch(0.225 0.008 264);
  --bg-3:      oklch(0.275 0.009 264);
  --line:      oklch(0.30 0.010 264);
  --line-soft: oklch(0.255 0.009 264);

  --text:  oklch(0.965 0.003 264);
  --muted: oklch(0.72 0.008 264);
  /* faint/ghost raised from 0.55/0.42 so small mono labels clear WCAG AA
     contrast on the near-black base (audit flagged low contrast). */
  --faint: oklch(0.64 0.008 264);
  --ghost: oklch(0.56 0.008 264);

  /* semantic 5-band quality scale (independent of game accent) */
  --q-excellent: oklch(0.81 0.13 195);
  --q-good:      oklch(0.80 0.15 150);
  --q-playable:  oklch(0.85 0.15 95);
  --q-rough:     oklch(0.74 0.16 55);
  --q-bad:       oklch(0.66 0.19 25);
  --q-none:      oklch(0.42 0.008 264);

  /* accent — overwritten per game */
  --accent:      oklch(0.64 0.20 27);
  --accent-soft: oklch(0.64 0.20 27 / 0.16);
  --accent-line: oklch(0.64 0.20 27 / 0.42);
  --accent-text: oklch(0.78 0.16 27);

  --radius: 4px;
  --radius-lg: 8px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;

  --maxw: 980px;

  /* legacy aliases consumed by 404.html + a few inline styles */
  --fg: var(--text);
  --fg-mute: var(--faint);
  --fg-dim: var(--muted);
  --brand: var(--accent-text);
  --rough: var(--q-rough);
}

/* per-game accents -------------------------------------------------- */
html[data-game="dota"] {
  --accent: oklch(0.63 0.21 27); --accent-text: oklch(0.80 0.16 30);
  --accent-soft: oklch(0.63 0.21 27 / 0.15); --accent-line: oklch(0.63 0.21 27 / 0.45);
}
html[data-game="cs2"] {
  --accent: oklch(0.80 0.15 78); --accent-text: oklch(0.86 0.14 82);
  --accent-soft: oklch(0.80 0.15 78 / 0.15); --accent-line: oklch(0.80 0.15 78 / 0.45);
}
html[data-game="deadlock"] {
  --accent: oklch(0.66 0.17 305); --accent-text: oklch(0.80 0.14 305);
  --accent-soft: oklch(0.66 0.17 305 / 0.15); --accent-line: oklch(0.66 0.17 305 / 0.45);
}
html[data-game="world"] {
  --accent: oklch(0.70 0.13 220); --accent-text: oklch(0.82 0.12 220);
  --accent-soft: oklch(0.70 0.13 220 / 0.15); --accent-line: oklch(0.70 0.13 220 / 0.45);
}
html[data-game="valorant"] {
  --accent: oklch(0.65 0.22 8); --accent-text: oklch(0.78 0.18 10);
  --accent-soft: oklch(0.65 0.22 8 / 0.15); --accent-line: oklch(0.65 0.22 8 / 0.45);
}
html[data-game="lol"] {
  --accent: oklch(0.74 0.13 250); --accent-text: oklch(0.84 0.12 250);
  --accent-soft: oklch(0.74 0.13 250 / 0.15); --accent-line: oklch(0.74 0.13 250 / 0.45);
}
html[data-game="mlbb"] {
  --accent: oklch(0.69 0.12 182); --accent-text: oklch(0.82 0.11 182);
  --accent-soft: oklch(0.69 0.12 182 / 0.15); --accent-line: oklch(0.69 0.12 182 / 0.45);
}
html[data-game="pubg"] {
  --accent: oklch(0.80 0.16 86); --accent-text: oklch(0.87 0.15 90);
  --accent-soft: oklch(0.80 0.16 86 / 0.15); --accent-line: oklch(0.80 0.16 86 / 0.45);
}
html[data-game="pubgm"] {
  --accent: oklch(0.71 0.18 47); --accent-text: oklch(0.82 0.16 50);
  --accent-soft: oklch(0.71 0.18 47 / 0.15); --accent-line: oklch(0.71 0.18 47 / 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1200px 600px at 50% -10%, oklch(0.22 0.02 264 / 0.5), transparent 70%);
  min-height: 100vh;
}

.wrap, .container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

::selection { background: var(--accent-soft); color: var(--text); }
a { color: inherit; }

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; }

/* quality color helpers (used by pills, dots, bars, ping text) */
.t-excellent { color: var(--q-excellent); } .b-excellent { background: var(--q-excellent); }
.t-good      { color: var(--q-good); }      .b-good      { background: var(--q-good); }
.t-playable  { color: var(--q-playable); }  .b-playable  { background: var(--q-playable); }
.t-rough     { color: var(--q-rough); }     .b-rough     { background: var(--q-rough); }
.t-bad       { color: var(--q-bad); }       .b-bad       { background: var(--q-bad); }
.t-none      { color: var(--q-none); }      .b-none      { background: var(--q-none); }

/* ===================== TOP BAR ===================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: oklch(0.145 0.006 264 / 0.82);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  display: flex; align-items: center; gap: 18px;
  height: 56px; max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
}
.brand {
  display: flex; align-items: center; gap: 9px; flex-shrink: 0;
  text-decoration: none; color: inherit; border-radius: var(--radius);
}
.brand:hover .brand-name { color: var(--text); }
.brand:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 12px var(--accent-line);
}
.brand-name { font-weight: 700; letter-spacing: -0.02em; font-size: 15px; }
.brand-name b { color: var(--accent-text); font-weight: 700; }

.tabs-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; flex: 1; min-height: 34px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs-fade {
  position: absolute; top: 0; bottom: 0; width: 34px; pointer-events: none; z-index: 2;
  opacity: 0; transition: opacity .18s;
}
.tabs-fade[data-on="true"] { opacity: 1; }
.tabs-fade-l { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.tabs-fade-r { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }

.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  background: none; font-family: var(--sans);
  transition: color .14s, background .14s, border-color .14s, padding .18s;
}
.tab:hover { color: var(--text); background: var(--bg-1); }
.tab[aria-selected="true"] { color: var(--text); background: var(--bg-1); border-color: var(--accent-line); }
.tab.compact { padding: 6px; gap: 0; }
.tab.compact .tab-label { display: none; }
.tabs.expanded .tab { font-size: 13.5px; padding: 8px 13px; }
.tab-mark, .gp-mark, .xl-mark, .gc-mark {
  width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--accent);
  border: 1px solid currentColor;
}
.tab-mark svg, .gp-mark svg, .xl-mark svg, .gc-mark svg { width: 13px; height: 13px; }

/* menu (top-right): games + alternate views popover */
.menu { position: relative; flex-shrink: 0; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 9px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-1);
  color: var(--muted); cursor: pointer; transition: color .14s, border-color .14s;
}
.menu-btn svg { width: 14px; height: 14px; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { color: var(--text); border-color: var(--accent-line); }
.menu-btn .caret { transition: transform .18s; }
.menu-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  width: min(460px, 90vw); background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: 0 18px 50px oklch(0 0 0 / 0.55); padding: 12px;
}
.menu-panel[hidden] { display: none; }
.pop-head {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint); padding: 6px 4px 8px; display: flex; align-items: center; gap: 8px;
}
.pop-head:not(:first-child) { border-top: 1px solid var(--line-soft); margin-top: 10px; padding-top: 12px; }
.pop-head span { color: var(--accent-text); }
.pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pop-item {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px;
  border-radius: var(--radius); border: 1px solid transparent; background: var(--bg-2);
  color: var(--text); cursor: pointer; font-family: var(--sans); text-decoration: none;
  transition: border-color .14s, background .14s;
}
.pop-item:hover { border-color: var(--accent-line); }
.pop-item[data-on="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.pop-item .gp-text { display: flex; flex-direction: column; min-width: 0; }
.pop-item .gp-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-item .gp-sub { font-size: 10.5px; color: var(--faint); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-item .gp-arrow { margin-left: auto; color: var(--faint); display: inline-flex; }
.pop-item .gp-arrow svg { width: 14px; height: 14px; }

.status {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
}
.status .live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--q-excellent);
  display: inline-block; margin-right: 6px; animation: pulse 2s ease-in-out infinite;
}
.status .sep { color: var(--ghost); }
@media (max-width: 900px){ .status .hide-md { display: none; } }
@media (max-width: 760px){ .status .hide-sm { display: none; } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ===================== H1 EYEBROW ===================== */
.page-head { padding: 30px 0 14px; }
.page-head h1, .h1 {
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint);
  margin: 0; display: flex; align-items: center; gap: 12px;
}
.page-head h1::after, .h1::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }

/* ===================== HERO RESULT (inline) ===================== */
.hero {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--accent-soft), transparent 120px), var(--bg-1);
  padding: 22px 24px 20px; overflow: hidden;
  /* reserve height so the JS-built hero doesn't cause layout shift (CLS) */
  min-height: 268px;
  /* own stacking context so the ::before activity layer sits below the content */
  isolation: isolate;
}
/* keep all hero content above the ::before activity sheen */
.hero > * { position: relative; z-index: 1; }
@media (max-width: 620px) { .hero { min-height: 320px; } }
.hero-top-rule { position:absolute; top:0; left:0; right:0; height:2px;
  background: linear-gradient(90deg, var(--accent), transparent 55%); transition: background .5s ease; }

/* ---- hero activity background: animated while probing, settled when done ----
   ::before sits beneath the hero's text (painted before the content children),
   so the moving sheen never washes out the numbers. */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0; transition: opacity .5s ease;
  background: linear-gradient(100deg, transparent 38%, var(--accent-soft) 50%, transparent 62%);
  background-size: 250% 100%; background-repeat: no-repeat;
}
/* probing: a light beam sweeps across the card + a beam scans the top rule */
.hero.is-probing::before { opacity: 1; animation: hero-sweep 2.1s linear infinite; }
.hero.is-probing .hero-top-rule {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 45% 100%; background-repeat: no-repeat;
  animation: hero-beam 1.5s linear infinite;
}
@keyframes hero-sweep { from { background-position: 135% 0; } to { background-position: -35% 0; } }
@keyframes hero-beam  { from { background-position: -45% 0; } to { background-position: 145% 0; } }
/* done: a soft success glow fades in from the top + the rule turns "excellent" */
.hero.is-done::before {
  opacity: 1; animation: none;
  background: radial-gradient(130% 75% at 50% -12%,
    color-mix(in oklch, var(--q-excellent) 16%, transparent), transparent 70%);
  background-size: 100% 100%;
}
.hero.is-done .hero-top-rule { background: linear-gradient(90deg, var(--q-excellent), transparent 58%); }
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-label {
  font-size: 12px; font-family: var(--mono); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.hero-label svg { width: 13px; height: 13px; }
.hero-geo {
  font-size: 12px; font-family: var(--mono); letter-spacing: 0.03em; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; margin-bottom: 8px;
}
.hero-geo svg { width: 12px; height: 12px; opacity: 0.65; }
.hero-geo .geo-flag { font-size: 13px; }
.hero-main { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; margin-top: 10px; min-width: 0; }
.hero-main.clickable { cursor: pointer; border-radius: var(--radius); transition: opacity .14s; }
.hero-main.clickable:hover { opacity: 0.86; }
.hero-main.clickable:hover .hero-region .rname-text { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bignum {
  font-family: var(--mono); font-weight: 800;
  font-size: clamp(64px, 12vw, 104px); line-height: 0.86;
  letter-spacing: -0.04em; color: var(--text); font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 6px;
}
.bignum .unit { font-size: 0.28em; font-weight: 600; color: var(--faint); letter-spacing: 0; }
.bignum.is-measuring { color: var(--ghost); }
.hero-region { padding-bottom: 8px; min-width: 0; flex: 1 1 auto; }
.hero-region .rname { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-region .rname .rflag { font-size: 20px; }
.hero-region .rcode { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 4px; letter-spacing: 0.04em; }

.qpill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 100px; border: 1px solid currentColor;
}
.qpill .qdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.qdot-static { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* top-3 chips */
.chips { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; min-height: 30px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; padding: 6px 11px 6px 8px; border-radius: 100px;
  background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--muted);
  cursor: pointer; transition: border-color .14s, color .14s; font-family: var(--sans);
}
.chip:hover { border-color: var(--accent-line); color: var(--text); }
.chip .rank { font-family: var(--mono); font-weight: 700; font-size: 10px; color: var(--faint); }
.chip .ms { font-family: var(--mono); font-weight: 600; color: var(--text); }

/* brief highlight when a hero chip jumps you to its region row */
.row-flash { animation: rowflash 1.3s ease; }
@keyframes rowflash {
  0%, 100% { background: transparent; }
  18% { background: color-mix(in oklch, var(--accent) 20%, transparent); }
}

/* hero actions */
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .14s, background .14s, transform .05s;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { border-color: var(--accent-line); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: oklch(0.16 0.01 264); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-tight { padding: 7px 12px; font-size: 12.5px; }
.hero-help { margin-left: auto; font-size: 12.5px; color: var(--faint); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; background: none; border: 0; font-family: var(--sans); }
.hero-help svg { width: 13px; height: 13px; }
.hero-help:hover { color: var(--muted); }
.hero-cmp { margin-top: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.hero-cmp b { color: var(--text); }

/* spinner */
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ===================== LIVE MONITOR ===================== */
.hero-live {
  margin-top: 18px; padding: 14px 18px 16px;
  border: 1px solid var(--accent-line); border-radius: var(--radius);
  background: color-mix(in oklch, var(--accent-soft) 42%, var(--bg-1));
  animation: live-in .28s ease both;
}
.hero-live.is-stopped { border-color: var(--line); background: var(--bg-1); opacity: .8; }
@keyframes live-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.live-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live-pip { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.live-pip.on { background: var(--accent); color: var(--accent); animation: live-pulse 1.6s ease-out infinite; }
.live-pip.off { background: var(--faint); }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.live-title { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.live-loc { font-size: 12.5px; color: var(--muted); min-width: 0; }
.live-loc .lock { color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.live-val { margin-left: auto; font-family: var(--mono); font-weight: 800; font-size: 30px; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.live-val i { font-style: normal; font-size: .42em; font-weight: 600; color: var(--faint); margin-left: 2px; }

.live-chart { position: relative; margin-top: 12px; }
.lg { display: block; width: 100%; height: 120px; }
.lg-axis { stroke: var(--line); stroke-width: 1; }
.lg-grid { stroke-width: 1; opacity: .2; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.lg-area { opacity: .14; }
.lg-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lg-drop { stroke: var(--q-bad); stroke-width: 1.5; opacity: .5; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.lg-over { stroke: var(--q-bad); stroke-width: 1.5; fill: none; opacity: .85; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.lg-dot { stroke: var(--bg-1); stroke-width: 1.5; }
.lg-axis-lbl { position: absolute; top: 0; right: 6px; height: 100%; display: flex; flex-direction: column;
  justify-content: space-between; align-items: flex-end; pointer-events: none;
  font-family: var(--mono); font-size: 10px; color: var(--ghost); }
.lg-peak { color: var(--q-bad); margin-left: 4px; }
.live-note { margin-top: 9px; font-family: var(--mono); font-size: 10.5px; color: var(--ghost); letter-spacing: .02em; }

.live-stats { display: flex; flex-wrap: wrap; gap: 9px 20px; margin-top: 12px; }
.ls { display: flex; flex-direction: column; gap: 2px; }
.ls-k { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.ls-v { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.ls-v i { font-style: normal; font-size: .7em; font-weight: 500; color: var(--faint); margin-left: 1px; }

.btn.is-watching { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); }
.btn.is-watching svg { animation: live-blink 1.6s ease-in-out infinite; }
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

@media (prefers-reduced-motion: reduce) {
  .hero-live { animation: none; }
  .live-pip.on, .btn.is-watching svg { animation: none; }
  /* keep a static "working" tint instead of the moving sweep/beam */
  .hero.is-probing::before, .hero.is-probing .hero-top-rule { animation: none; }
  .hero.is-probing::before { background-position: 50% 0; }
}

/* ===================== FUSED TABLE ===================== */
.tbl-wrap { margin-top: 26px; overflow-x: auto; }
.tbl-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.tbl-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.tbl-sortnote { font-size: 11.5px; color: var(--ghost); font-family: var(--mono); }

.ptable { width: 100%; border-collapse: collapse; }
.ptable thead th {
  text-align: left; font-family: var(--mono); font-weight: 500;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); padding: 0 12px 9px; border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.ptable thead th.num { text-align: right; }
.ptable td.num { text-align: right; }
.ptable thead th .arrow { color: var(--accent-text); margin-left: 4px; }
.ptable tbody tr.region-row { border-bottom: 1px solid var(--line-soft); transition: background .12s; cursor: pointer; }
.ptable tbody tr.region-row:hover { background: var(--bg-1); }
.ptable tbody tr.region-row.is-best { box-shadow: inset 3px 0 0 var(--accent); }
.ptable td { padding: 7px 12px; vertical-align: middle; }  /* compact density baked */

.r-region { display: flex; align-items: center; gap: 10px; }
.r-flag { font-size: 16px; line-height: 1; width: 20px; text-align: center; flex-shrink: 0; }
.r-name { font-weight: 500; font-size: 13px; white-space: nowrap; }
.r-sub { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.r-pop { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.r-end { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.r-chev { color: var(--ghost); display: inline-flex; transition: transform .18s; }
.r-chev svg { width: 14px; height: 14px; }
.region-row.open .r-chev { transform: rotate(90deg); color: var(--accent-text); }

.r-ping { text-align: right; font-family: var(--mono); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-ping .u { font-size: 10px; color: var(--faint); font-weight: 500; margin-left: 2px; }
.r-ping.pending { color: var(--ghost); font-weight: 500; }
.r-cmpdelta { margin-left: 6px; font-size: 10px; font-weight: 600; }

/* latency bar cell — gradient style baked */
.bar-cell { width: 130px; }
.bar { height: 8px; border-radius: 2px; background: var(--bg-3); overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: 2px; transform-origin: left; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar .cmp-tick { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .5; }

/* skeleton shimmer */
.sk { position: relative; overflow: hidden; background: var(--bg-2); border-radius: 3px; display: inline-block; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, oklch(0.32 0.01 264 / 0.6), transparent);
  transform: translateX(-100%); animation: shimmer 1.25s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-num { height: 14px; width: 42px; }
.sk-bar { height: 8px; width: 100%; display: block; }
/* stagger the shimmer per row so the fill reads as a wave */
.region-row:nth-child(odd) .sk::after { animation-delay: .12s; }
.region-row:nth-child(3n) .sk::after { animation-delay: .24s; }
.region-row:nth-child(4n) .sk::after { animation-delay: .36s; }

/* terminal "timed out" state — region settled with no reachable sample. Muted,
   non-animated (it's done, not pending) so it reads as a result, not a spinner. */
.r-timeout { text-align: right; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--faint); white-space: nowrap; text-transform: uppercase; }
.r-timeout-dash { display: block; text-align: center; color: var(--ghost); font-family: var(--mono); }
.pill-ping.is-timeout { color: var(--faint); background: transparent; text-transform: uppercase; font-size: 10px; letter-spacing: .02em; }

/* count-up reveal of a freshly-landed ping */
@keyframes popin { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.r-ping.fresh { animation: popin .25s ease; }

/* ===================== EXPANDED REGION DETAIL ===================== */
.region-detail > td { padding: 0 12px 12px; background: var(--bg-1); }
.rdetail { border-left: 2px solid var(--accent-line); padding: 10px 0 4px 14px; margin-top: 2px; }
.deep-row { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: 2px 0 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deep-row .deep-label { color: var(--accent-text); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; }
.pops { display: flex; flex-direction: column; gap: 8px; }
.pop {
  padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.pop + .pop { margin-top: 6px; }
/* Header line: flag · city · code on the left, via + ping pushed to the right. */
.pop-hd { display: flex; align-items: baseline; gap: 8px; }
.pop .leader { color: var(--ghost); display: inline-flex; align-self: center; }
.pop .leader svg { width: 14px; height: 14px; }
.pop-loc { font-size: 12.5px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop .pop-flag { margin-right: 4px; }
.pop .code { font-family: var(--mono); font-size: 11px; color: var(--faint); flex: none; }
.pop .code + .code { margin-left: -2px; }
.pop-multi { font-family: var(--mono); font-size: 10px; color: var(--ghost); flex: none; }
.pop .badge { font-family: var(--mono); font-size: 10px; color: var(--faint); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; flex: none; }
.pop-via { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; flex: none; }
.pop-via .proxy-far { color: var(--warn, #f59e0b); }
.pop-hd .pill-ping { flex: none; min-width: 52px; text-align: right; }
.pill-ping { font-family: var(--mono); font-weight: 700; font-size: 12.5px; }
.stats-line { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pop-subregions { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.stat-badge { font-family: var(--mono); font-size: 10px; padding: 1px 6px; border-radius: 100px; border: 1px solid var(--line); color: var(--muted); }
.stat-badge.warn { color: var(--q-rough); border-color: var(--q-rough); }
.stat-badge.bad { color: var(--q-bad); border-color: var(--q-bad); }
.spark { color: var(--accent-text); fill: currentColor; }
.spark .axis { stroke: var(--line); }

/* provider route comparison (multi mode) */
.prov-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.prov-tag { font-family: var(--mono); font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px 7px; display: inline-flex; gap: 5px; align-items: center; }
.prov-tag.win { border-color: var(--accent-line); color: var(--accent-text); }
.prov-tag .ct { color: var(--faint); }
.provider-routes { margin-top: 8px; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.route-title { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 10px; background: var(--bg-3); font-size: 11px; }
.route-title strong { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.route-title span { color: var(--faint); font-family: var(--mono); font-size: 10px; }
.provider-route { display: grid; grid-template-columns: 1.6fr repeat(4, 0.7fr) 1fr; gap: 8px; padding: 6px 10px; font-family: var(--mono); font-size: 11px; border-top: 1px solid var(--line-soft); align-items: center; }
.provider-route .name { display: inline-flex; gap: 6px; align-items: center; color: var(--text); }
.provider-route .route-icon { font-size: 9px; border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; color: var(--faint); }
.provider-route .metric { text-align: right; color: var(--muted); }
.provider-route .status { text-align: right; color: var(--faint); }
.provider-route.win .status { color: var(--accent-text); }
.provider-route.slow .status { color: var(--q-rough); }
.provider-route[aria-hidden="true"] { color: var(--faint); }

/* ===================== ADVANCED ===================== */
.advanced { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-1); }
.adv-summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 13px 16px; font-family: var(--mono); font-size: 12.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); user-select: none; list-style: none;
}
.adv-summary::-webkit-details-marker { display: none; }
.adv-summary .caret { transition: transform .18s; color: var(--faint); display: inline-flex; }
.adv-summary .caret svg { width: 13px; height: 13px; }
details[open] .adv-summary .caret { transform: rotate(90deg); }
.adv-summary .adv-tags { margin-left: auto; color: var(--ghost); font-size: 11px; letter-spacing: 0.02em; text-transform: none; }
.adv-body { padding: 4px 16px 18px; border-top: 1px solid var(--line-soft); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; padding-top: 16px; }
.field label { display: block; font-size: 11px; font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.field .hint { font-size: 11px; color: var(--ghost); margin-top: 6px; line-height: 1.4; }
.sel {
  width: 100%; appearance: none; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); font-family: var(--sans); font-size: 13px; padding: 8px 30px 8px 11px;
  border-radius: var(--radius); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.sel:focus { outline: none; border-color: var(--accent-line); }
.coltoggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-family: var(--mono);
  padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-2); color: var(--muted); cursor: pointer; user-select: none;
}
.toggle-chip[data-on="true"] { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.toggle-chip .box { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--faint); display: grid; place-items: center; }
.toggle-chip[data-on="true"] .box { background: var(--accent); border-color: var(--accent); }
.adv-deep { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.adv-deep .lock { font-family: var(--mono); font-size: 11px; color: var(--q-excellent); display: inline-flex; gap: 5px; align-items: center; }
.adv-deep .lock svg { width: 12px; height: 12px; }
.adv-deep .note { font-size: 11.5px; color: var(--ghost); font-family: var(--mono); }
.adv-status { width: 100%; margin-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.progress-wrap { height: 2px; background: var(--bg-3); border-radius: 2px; overflow: hidden; margin-top: 8px; width: 100%; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .25s; }

/* ===================== LEGEND ===================== */
.legend {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 16px; border: 1px solid var(--line-soft);
  border-radius: var(--radius); background: var(--bg-1);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}
.legend .it, .legend .li { display: inline-flex; align-items: center; gap: 7px; }
.legend .ct { color: var(--text); font-weight: 700; }

/* ===================== SHARE / COMPARE BANNER ===================== */
.compare-banner, .card.compare {
  margin-top: 18px; border: 1px solid var(--accent-line); border-radius: var(--radius-lg);
  background: var(--accent-soft); padding: 14px 16px;
}
.card.compare[hidden] { display: none; }
.cmp-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cmp-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.cmp-title { font-weight: 600; font-size: 14px; margin: 2px 0 0; }
.cmp-actions { margin-left: auto; display: flex; gap: 8px; }
.cmp-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; }
.cmp-stat .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.cmp-stat .val { font-family: var(--mono); font-weight: 700; font-size: 20px; }
.cmp-stat .val .unit { font-size: 11px; color: var(--faint); font-weight: 500; margin-left: 3px; }
.cmp-meet { margin-top: 12px; }
.meet-head { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.meet-head strong { color: var(--text); }
.meet-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.meet-tag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 100px; background: var(--bg-2); border: 1px solid var(--line-soft); font-size: 12px; }
.meet-name { color: var(--text); }
.meet-pings { font-family: var(--mono); font-size: 11px; }
.meet-pings .you { color: var(--accent-text); font-weight: 700; }
.meet-pings .them { color: var(--muted); }
.meet-pings .sep { color: var(--ghost); margin: 0 4px; }
.meet-pings .unit { color: var(--faint); margin-left: 2px; }
.meet-more, .meet-empty { font-size: 12px; color: var(--faint); margin-top: 8px; }
.r-cmpdelta.win, .delta.win { color: var(--q-excellent); } .r-cmpdelta.lose, .delta.lose { color: var(--q-rough); } .r-cmpdelta.tie, .delta.tie { color: var(--muted); }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-3); border: 1px solid var(--accent-line); color: var(--text);
  padding: 11px 18px; border-radius: 100px; font-size: 13px; font-family: var(--mono);
  box-shadow: 0 8px 30px oklch(0 0 0 / 0.5); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== SEO CONTENT (below the tool) ===================== */
.seo { margin-top: 56px; padding-top: 8px; }
.seo-sep { height: 1px; background: var(--line-soft); margin-bottom: 40px; }
.seo h2 { font-family: var(--sans); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; color: var(--text); }
.seo h1 { font-family: var(--sans); font-size: 22px; font-weight: 600; margin: 0 0 12px; }
.seo .eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.seo p, .seo-intro, .seo-thresh { color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 68ch; text-wrap: pretty; }
.seo-thresh b { color: var(--text); }
.seo-block { margin-bottom: 44px; }

/* server-rendered region reference table (crawlable) */
.seo-regions { width: 100%; border-collapse: collapse; margin: 16px 0 8px; font-size: 13px; }
.seo-regions caption { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-bottom: 8px; }
.seo-regions th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.seo-regions td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.seo-regions code { font-family: var(--mono); font-size: 11.5px; color: var(--accent-text); }

/* split stat card */
.split-card, .card.quality { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-1); padding: 18px 20px; margin-top: 16px; }
.split-card .tbl-title, .card.quality .title { display: block; margin-bottom: 2px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.split-bars, .stack { display: flex; height: 14px; border-radius: 3px; overflow: hidden; margin: 14px 0 12px; background: var(--bg-3); }
.split-bars > span, .stack .seg { height: 100%; }
.split-legend { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.split-legend .sl { display: inline-flex; align-items: center; gap: 7px; }
.split-legend b { color: var(--text); font-weight: 700; }

/* FAQ */
.faq details, .seo-faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary, .seo-faq summary {
  cursor: pointer; padding: 15px 2px; font-weight: 500; font-size: 14.5px; list-style: none;
  display: flex; align-items: center; gap: 12px; color: var(--text);
}
.faq summary::-webkit-details-marker, .seo-faq summary::-webkit-details-marker { display: none; }
.faq summary::after, .seo-faq summary::after { content: "+"; margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 18px; transition: transform .18s; }
.faq details[open] summary::after, .seo-faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a, .seo-faq p { padding: 0 2px 16px; color: var(--muted); font-size: 13.5px; line-height: 1.7; max-width: 70ch; margin: 0; }

/* cross-links */
.xlinks, .seo-cross { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.xlink, .seo-cross a {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-1);
  text-decoration: none; color: var(--text); transition: border-color .14s, background .14s;
}
.xlink:hover, .seo-cross a:hover { border-color: var(--accent-line); background: var(--bg-2); }
.xlink .xl-name { font-weight: 600; font-size: 14px; white-space: nowrap; }
.xlink .xl-sub { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.xlink .xl-arrow { margin-left: auto; color: var(--faint); }
.xlink .xl-arrow svg { width: 15px; height: 15px; }
.seo-cross { margin-top: 8px; }

/* home game-cards */
.gamecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; margin-top: 18px; }

/* footer */
.foot, .footer { margin-top: 56px; padding: 28px 0 60px; border-top: 1px solid var(--line-soft); color: var(--ghost); font-size: 12px; font-family: var(--mono); display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot .sep, .footer .sep { color: var(--line); }
.foot a, .footer a { color: var(--faint); text-decoration: none; }
.foot a:hover, .footer a:hover { color: var(--accent-text); }
.foot .foot-legal, .footer .foot-legal { flex-basis: 100%; margin-top: 4px; color: var(--ghost); font-size: 11px; line-height: 1.5; max-width: 78ch; }

/* the long explanatory notes from the original shell, kept below the tool */
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.note { border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--bg-1); padding: 16px 18px; }
.note h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.note h3 svg { width: 16px; height: 16px; color: var(--accent-text); }
.note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.note.warn h3 svg { color: var(--q-rough); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ===================== MOBILE ===================== */
@media (max-width: 760px) {
  .topbar-inner { height: auto; padding: 9px 14px 11px; flex-wrap: wrap; gap: 10px 12px; }
  .brand { order: 0; }
  .menu { order: 1; margin-left: auto; }
  .status { order: 2; }
  .tabs-wrap { order: 3; flex-basis: 100%; }
  .menu-panel { right: 0; }
  .notes { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .wrap, .container { padding: 0 14px; }
  .page-head { padding: 22px 0 10px; }
  .hero { padding: 18px 16px 16px; }
  .hero-main { gap: 14px; }
  .hero-region .rname { font-size: 19px; }
  .hero-help { margin-left: 0; flex-basis: 100%; margin-top: 6px; }
  .bignum { font-size: clamp(56px, 18vw, 88px); }
  .ptable td, .ptable thead th { padding-left: 8px; padding-right: 8px; }
  .bar-cell { width: 64px; }
  .r-flag { font-size: 15px; width: 18px; }
  /* On narrow screens let the header wrap so via/ping drop below city instead
     of overflowing; via aligns under the row, ping stays right. */
  .pop-hd { flex-wrap: wrap; }
  .pop-via { margin-left: 22px; }
  .pop-grid { grid-template-columns: 1fr; }
  .seo { margin-top: 40px; }
  .seo-sep { margin-bottom: 30px; }
  .legend { gap: 12px 14px; }
  .cmp-stats { gap: 16px; }
  .foot, .footer { gap: 10px 14px; }
}
@media (max-width: 520px) {
  html, body { overflow-x: hidden; }
  .col-pop { display: none; }
  .hero-main { flex-direction: column; align-items: flex-start; gap: 10px; }
  .bignum { font-size: clamp(52px, 16vw, 72px); }
  .hero-region .rname { font-size: 18px; }
  .hero-actions .btn { flex: 1; justify-content: center; }
  .adv-summary .adv-tags { display: none; }
  .provider-route { grid-template-columns: 1.4fr repeat(3, 0.8fr); }
  .provider-route .metric:nth-child(5), .provider-route .status { display: none; }
}
