/* ═══════════════════════════════════════════════════════════
   real pp — DaBiGu / osu!mania
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jbmono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --bg: #07070c;
  --bg-2: #0b0b13;
  --panel: rgba(17, 17, 27, 0.66);
  --panel-solid: #111119;
  --text: #f4f5fb;
  --muted: #a3a8bc;
  --dim: #71768b;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --pink: #ff66aa;
  --pink-soft: #ffa1cb;
  --violet: #a78bfa;
  --cyan: #6fe7f5;
  --gold: #f4c65a;
  --green: #7ee2a8;
  --red: #ff7d93;
  --radius: 24px;
  --radius-sm: 14px;
  --max: 1320px;
  --font: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(255, 102, 170, 0.32); color: #fff; }

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
code, .mono { font-family: var(--mono); }

:focus-visible {
  outline: 2px solid rgba(255, 102, 170, 0.75);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── atmosphere ─────────────────────────────────────────── */

.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  will-change: transform;
}
.glow-pink {
  width: 54vw; height: 54vw;
  left: -16vw; top: -22vw;
  background: radial-gradient(circle, rgba(255, 102, 170, 0.5), transparent 66%);
  opacity: 0.55;
  animation: drift 22s ease-in-out infinite alternate;
}
.glow-cyan {
  width: 44vw; height: 44vw;
  right: -14vw; top: 4vw;
  background: radial-gradient(circle, rgba(111, 231, 245, 0.22), transparent 65%);
  opacity: 0.7;
  animation: drift 28s ease-in-out -8s infinite alternate-reverse;
}
.lanes {
  position: absolute;
  inset: 0 0 auto;
  height: 110vh;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0 1px,
    transparent 1px 12.5%
  );
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 52%, transparent 88%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 52%, transparent 88%);
  opacity: 0.55;
}
.grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.075) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  opacity: 0.16;
  mix-blend-mode: overlay;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, 2vw, 0) scale(1.08); }
}

/* ── top bar ────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
  padding-inline: max(clamp(18px, 3.4vw, 40px), calc((100vw - var(--max)) / 2 + clamp(18px, 3.4vw, 40px)));
  background: linear-gradient(180deg, rgba(7, 7, 12, 0.92), rgba(7, 7, 12, 0.55));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.mark {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  width: 34px;
  height: 34px;
  padding: 8px 7px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
.mark i {
  flex: 1;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--pink), var(--violet));
  height: 60%;
}
.mark i:nth-child(2) { height: 92%; background: linear-gradient(180deg, var(--violet), var(--cyan)); }
.mark i:nth-child(3) { height: 74%; background: linear-gradient(180deg, #d8b4fe, var(--violet)); }
.mark i:nth-child(4) { height: 100%; background: linear-gradient(180deg, var(--cyan), #38bdf8); }
.brand:hover .mark i { animation: keypulse 0.9s var(--ease); }
.brand:hover .mark i:nth-child(2) { animation-delay: 0.06s; }
.brand:hover .mark i:nth-child(3) { animation-delay: 0.12s; }
.brand:hover .mark i:nth-child(4) { animation-delay: 0.18s; }
@keyframes keypulse {
  0%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(0.68); }
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.12; }
.brand-copy b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.brand-copy small { font-size: 10px; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}
.nav a {
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.sync {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.sync-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(244, 198, 90, 0.1);
  transition: background 0.3s, box-shadow 0.3s;
}
.sync.is-ok .sync-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(126, 226, 168, 0.1); animation: breath 3s ease-in-out infinite; }
.sync.is-busy .sync-dot { background: var(--cyan); box-shadow: 0 0 0 4px rgba(111, 231, 245, 0.12); animation: breath 1s ease-in-out infinite; }
.sync.is-err .sync-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 125, 147, 0.12); }
@keyframes breath {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ── layout ─────────────────────────────────────────────── */

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: clamp(18px, 3.4vw, 40px);
}

main.container { padding-bottom: 20px; }

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ── hero ───────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.72fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  padding: clamp(52px, 8vw, 104px) 0 clamp(40px, 5vw, 64px);
}

.hero-left { position: relative; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--dim);
}
.eyebrow .slash { color: rgba(255, 255, 255, 0.18); }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 102, 170, 0.28);
  background: rgba(255, 102, 170, 0.09);
  color: var(--pink-soft);
  letter-spacing: 0.14em;
  font-size: 9.5px;
}
.live-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
  animation: breath 2.4s ease-in-out infinite;
}

.big-pp {
  display: flex;
  align-items: baseline;
  margin: 18px 0 8px;
  font-size: clamp(78px, 11.4vw, 158px);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.058em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(104deg, #ffffff 4%, #ffd9e9 26%, #ff7db6 46%, #b79bff 72%, #7ceaf6 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 18px 46px rgba(255, 102, 170, 0.13));
}
.big-pp .pp-dec {
  margin-left: 0.02em;
  font-size: 0.36em;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--muted);
  background: none;
  -webkit-text-fill-color: var(--muted);
  transition: color 0.4s;
}
.big-pp.is-bumped { animation: ppBump 0.6s var(--ease); }
@keyframes ppBump {
  0% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-4px) scale(1.012); }
  100% { transform: translateY(0) scale(1); }
}

.hero-sub {
  margin: 20px 0 0;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.65;
  color: var(--muted);
  font-weight: 450;
}
.br-sm { display: none; }
.hero-sub em {
  font-style: normal;
  color: var(--text);
  font-weight: 700;
  background: linear-gradient(92deg, var(--pink-soft), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 32px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.split-item {
  flex: 1 1 130px;
  padding: 14px 22px 15px 0;
}
.split-item + .split-item { padding-left: 22px; border-left: 1px solid var(--line); }
.split-item span {
  display: block;
  margin-bottom: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.split-item b {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.split-delta b { color: var(--green); }
.split-delta b.is-neg { color: var(--red); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff7fb8, #b78cff);
  color: #14060d;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(255, 102, 170, 0.2);
  transition: transform 0.22s var(--ease), box-shadow 0.22s, filter 0.22s;
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(255, 102, 170, 0.3); filter: saturate(1.1); }
.btn:active { transform: translateY(0); }
.btn.is-busy { pointer-events: none; opacity: 0.72; }
.btn.is-busy svg { animation: spin 1s linear infinite; }

.btn.ghost {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-strong);
  color: var(--muted);
  box-shadow: none;
}
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

@keyframes spin { to { transform: rotate(360deg); } }

.updated {
  margin-left: 4px;
  font-size: 11px;
  color: var(--dim);
  font-family: var(--mono);
}

/* ── official card ──────────────────────────────────────── */

.official {
  position: relative;
  padding: 26px 26px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 102, 170, 0.11), transparent 58%),
    linear-gradient(170deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
.official::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  right: -60px; top: -70px;
  background: radial-gradient(circle, rgba(255, 102, 170, 0.22), transparent 68%);
  pointer-events: none;
}
.official-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
  color: var(--dim);
}
.frozen-pill {
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.16em;
  font-size: 8.5px;
}
.official-number {
  margin: 14px 0 2px;
  font-size: clamp(48px, 5.2vw, 64px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.9);
}
.official-note {
  margin: 0 0 22px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 30ch;
}

.meter { display: grid; gap: 12px; }
.meter-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--dim);
}
.meter-row b {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meter-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.meter-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.52));
  transition: width 1.1s var(--ease);
}
.meter-row.is-real b { color: var(--pink-soft); }
.meter-row.is-real .meter-track i {
  background: linear-gradient(90deg, var(--pink), var(--violet) 60%, var(--cyan));
  box-shadow: 0 0 12px rgba(255, 102, 170, 0.45);
}

.official-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, #2a1826, #151522);
}
.who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who b { font-size: 12.5px; font-weight: 700; }
.who span { font-size: 10px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-link {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--dim);
  transition: color 0.2s;
}
.mini-link:hover { color: var(--pink-soft); }

/* ── shared card / section head ─────────────────────────── */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.012));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}
.section-head h2 {
  margin: 7px 0 0;
  font-size: clamp(21px, 2.2vw, 27px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.section-head p {
  margin: 0;
  max-width: 460px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--dim);
  text-align: right;
}

/* ── chart ──────────────────────────────────────────────── */

.chart-card { padding: 26px 28px 20px; margin-top: 8px; }
.chart-head { margin-bottom: 14px; }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 290px;
  margin-top: 8px;
}
#chart { width: 100%; height: 100%; display: block; overflow: visible; }
#chart .grid-line { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; stroke-dasharray: 3 5; }
#chart .axis-text { fill: rgba(255, 255, 255, 0.34); font-size: 10px; font-family: var(--mono); }
#chart .area { fill: url(#areaGrad); }
#chart .line {
  fill: none;
  stroke: url(#lineGrad);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 4px 12px rgba(255, 102, 170, 0.22));
}
#chart .dot { fill: var(--gold); stroke: rgba(7, 7, 12, 0.9); stroke-width: 2; }
#chart .hover-line { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; stroke-dasharray: 2 4; }

.chart-tip {
  position: absolute;
  z-index: 3;
  min-width: 178px;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(12, 12, 20, 0.94);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  font-size: 11px;
  line-height: 1.5;
}
.chart-tip .t-rank { color: var(--pink-soft); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; }
.chart-tip .t-title { margin: 3px 0 2px; font-weight: 700; color: var(--text); }
.chart-tip .t-sub { color: var(--dim); font-size: 10px; }
.chart-tip .t-pp { margin-top: 5px; font-family: var(--mono); color: var(--gold); font-size: 12px; }

.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.legend { display: flex; flex-wrap: wrap; gap: 16px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; color: var(--dim); }
.swatch { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.swatch.line { background: linear-gradient(90deg, var(--pink), var(--violet)); }
.swatch.gold { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.swatch.fill { height: 8px; border-radius: 2px; background: linear-gradient(180deg, rgba(255, 102, 170, 0.35), transparent); }
.chart-note { font-size: 10px; color: var(--dim); white-space: nowrap; }
.chart-note b { color: var(--muted); font-family: var(--mono); }

/* ── stats ──────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 36px;
}
.stat {
  position: relative;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.022);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}
.stat::before {
  content: "";
  position: absolute;
  left: 18px; top: 0;
  width: 30px; height: 1px;
  background: linear-gradient(90deg, var(--pink), transparent);
  opacity: 0.7;
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.035); }
.stat-label {
  display: block;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  color: var(--dim);
  white-space: nowrap;
}
.stat-value {
  display: block;
  margin: 8px 0 3px;
  font-family: var(--mono);
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-sub {
  display: block;
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── tabs ───────────────────────────────────────────────── */

.tabs-section { margin-top: 8px; }

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: background 0.22s, color 0.22s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab.is-active {
  background: linear-gradient(135deg, rgba(255, 102, 170, 0.18), rgba(167, 139, 250, 0.16));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 102, 170, 0.24);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
}
.tab.is-active .tab-count { color: var(--pink-soft); background: rgba(255, 102, 170, 0.12); }

.panel { display: none; padding-top: 20px; }
.panel.is-active { display: block; animation: panelIn 0.4s var(--ease); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── toolbar ────────────────────────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 14px;
}
.toolbar-copy {
  flex: 1 1 100%;
  margin: 0 0 2px;
  font-size: 11.5px;
  color: var(--dim);
}
.toolbar-copy code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10.5px;
  color: var(--muted);
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 650;
  transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active {
  color: var(--pink-soft);
  border-color: rgba(255, 102, 170, 0.35);
  background: rgba(255, 102, 170, 0.09);
}

.search {
  position: relative;
  margin-left: auto;
  width: min(280px, 100%);
}
.search svg {
  position: absolute;
  left: 11px; top: 50%;
  width: 14px; height: 14px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 33px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 11.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: rgba(255, 102, 170, 0.35); background: rgba(255, 255, 255, 0.04); }

.count {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── score list ─────────────────────────────────────────── */

.score-head {
  display: grid;
  grid-template-columns: 54px 56px minmax(0, 1fr) 64px 108px 76px 104px 88px;
  gap: 10px;
  align-items: center;
  padding: 0 12px 8px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--dim);
  text-transform: uppercase;
}
.score-head span:nth-child(5) { text-align: center; }

.score-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 54px 56px minmax(0, 1fr) 64px 108px 76px 104px 88px;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  transition: background 0.2s, border-color 0.2s;
}
.row:hover { background: rgba(255, 255, 255, 0.035); border-color: var(--line); }
.row.is-ds {
  background: linear-gradient(90deg, rgba(244, 198, 90, 0.075), rgba(244, 198, 90, 0.018) 34%, transparent 66%);
  box-shadow: inset 2px 0 0 rgba(244, 198, 90, 0.65);
}
.row.is-ds:hover { background: linear-gradient(90deg, rgba(244, 198, 90, 0.11), rgba(244, 198, 90, 0.03) 34%, transparent 70%); border-color: rgba(244, 198, 90, 0.18); }

.row .rank {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 2px;
}
.row:nth-child(1) .rank,
.row:nth-child(2) .rank,
.row:nth-child(3) .rank { font-weight: 700; }
.row:nth-child(1) .rank { color: #ffd98a; }
.row:nth-child(2) .rank { color: #cfd6e6; }
.row:nth-child(3) .rank { color: #e5b08a; }

.cover {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #201527, #12121c);
  border: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), opacity 0.3s;
}
.row:hover .cover img { transform: scale(1.06); }
.cover .fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(145deg, rgba(255, 102, 170, 0.2), rgba(167, 139, 250, 0.12));
  opacity: 0;
  transition: opacity 0.25s;
}
.cover.is-empty img { display: none; }
.cover.is-empty .fallback { opacity: 1; }

.map { min-width: 0; }
.map-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.map-title .ds-star { color: var(--gold); margin-left: 5px; font-size: 11px; }
.map-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--dim);
}
.map-sub .version { color: rgba(255, 255, 255, 0.52); }
.map-sub .artist { color: var(--muted); }

.sr {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sr small { font-size: 8px; color: var(--dim); letter-spacing: 0.05em; }

.mods { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.mod {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}
.mod.ds { color: var(--gold); border-color: rgba(244, 198, 90, 0.3); background: rgba(244, 198, 90, 0.1); }
.mod.dc { color: var(--violet); border-color: rgba(167, 139, 250, 0.28); background: rgba(167, 139, 250, 0.09); }
.mod.mr { color: var(--cyan); border-color: rgba(111, 231, 245, 0.25); background: rgba(111, 231, 245, 0.08); }
.mod.nc { color: var(--pink-soft); border-color: rgba(255, 102, 170, 0.25); background: rgba(255, 102, 170, 0.08); }
.mod.ht, .mod.dt { color: #9ec5ff; border-color: rgba(158, 197, 255, 0.24); background: rgba(158, 197, 255, 0.07); }
.mod.nf, .mod.ez, .mod.hr { color: var(--green); border-color: rgba(126, 226, 168, 0.22); background: rgba(126, 226, 168, 0.07); }
.mod.none { color: var(--dim); }
.mods .mod-empty { font-family: var(--mono); font-size: 9px; color: var(--dim); }

.acc {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pp-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.pp-cell b {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
}
.pp-cell .gain {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pp-cell .gain.new { color: var(--gold); }

.weight-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.weight-val {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.wbar {
  width: 58px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.wbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  opacity: 0.75;
  transition: width 0.8s var(--ease);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--dim);
  text-align: center;
}
.empty b { color: var(--muted); font-size: 13px; }
.empty span { font-size: 11px; }

/* ── recent ─────────────────────────────────────────────── */

.recent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.recent-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.recent-card:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); transform: translateY(-1px); }
.recent-card.is-ds { border-color: rgba(244, 198, 90, 0.2); background: linear-gradient(100deg, rgba(244, 198, 90, 0.06), rgba(255, 255, 255, 0.015) 55%); }
.recent-card.is-ds:hover { border-color: rgba(244, 198, 90, 0.32); }

.recent-card .cover { width: 58px; height: 58px; }
.recent-body { min-width: 0; }
.recent-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--dim);
  letter-spacing: 0.02em;
}
.recent-title {
  margin: 3px 0 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 650;
}
.recent-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--dim);
}
.recent-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.recent-tags .mod-empty { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; color: var(--dim); }
.recent-pp {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}
.recent-pp b {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.recent-pp span { font-size: 8.5px; color: var(--dim); white-space: nowrap; }
.recent-pp .is-counted { color: var(--green); }
.recent-pp .is-ignored { color: var(--red); }
.recent-pp .is-new { color: var(--gold); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--dim);
  white-space: nowrap;
}
.pill.gold { color: var(--gold); border-color: rgba(244, 198, 90, 0.26); background: rgba(244, 198, 90, 0.08); }
.pill.green { color: var(--green); border-color: rgba(126, 226, 168, 0.24); background: rgba(126, 226, 168, 0.07); }
.pill.red { color: var(--red); border-color: rgba(255, 125, 147, 0.22); background: rgba(255, 125, 147, 0.06); }
.pill.dim { color: var(--dim); }
.pill.cyan { color: var(--cyan); border-color: rgba(111, 231, 245, 0.22); background: rgba(111, 231, 245, 0.06); }

/* ── dual stages ────────────────────────────────────────── */

.ds-intro {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 24px 26px;
  border: 1px solid rgba(244, 198, 90, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(244, 198, 90, 0.11), transparent 55%),
    rgba(255, 255, 255, 0.018);
}
.ds-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px; height: 70px;
  border-radius: 18px;
  border: 1px solid rgba(244, 198, 90, 0.35);
  background: linear-gradient(145deg, rgba(244, 198, 90, 0.2), rgba(244, 198, 90, 0.04));
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  box-shadow: 0 10px 34px rgba(244, 198, 90, 0.12);
}
.ds-intro h2 { margin: 2px 0 8px; font-size: clamp(20px, 2.3vw, 26px); font-weight: 750; letter-spacing: -0.035em; }
.ds-intro p { margin: 0; max-width: none; font-size: 12px; line-height: 1.75; color: var(--muted); }

.ds-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 22px;
}
.ds-kpi {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.02);
}
.ds-kpi b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ds-kpi span { display: block; margin-top: 5px; font-size: 10px; color: var(--dim); }
.ds-kpi.is-accent b { color: var(--gold); }

.ds-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
}
.ds-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.015);
  min-width: 0;
}
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.block-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -0.015em; }
.block-head span { font-size: 9.5px; color: var(--dim); white-space: nowrap; }

.replacement-list { display: grid; gap: 2px; }
.rep-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 74px 66px;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 11px;
}
.rep-row:hover { background: rgba(255, 255, 255, 0.03); }
.rep-map { min-width: 0; }
.rep-map b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 650; }
.rep-map span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; color: var(--dim); }
.rep-old, .rep-new {
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rep-old { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.22); }
.rep-new { color: var(--text); }
.rep-gain {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--green);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rep-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 74px 66px;
  gap: 8px;
  padding: 0 6px 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.rep-head span:not(:first-child) { text-align: right; }

.ds-list { display: grid; gap: 1px; max-height: 620px; overflow-y: auto; padding-right: 4px; }
.ds-list::-webkit-scrollbar { width: 4px; }
.ds-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }
.ds-list-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 7px 5px;
  border-radius: 7px;
  font-size: 10.5px;
}
.ds-list-row:hover { background: rgba(255, 255, 255, 0.03); }
.ds-date { font-family: var(--mono); font-size: 9px; color: var(--dim); white-space: nowrap; }
.ds-map { min-width: 0; }
.ds-map b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.ds-map span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; color: var(--dim); }
.ds-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ds-right b { font-family: var(--mono); font-size: 10.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.ds-right span { font-size: 8px; color: var(--dim); white-space: nowrap; }
.ds-right .in-top { color: var(--gold); }
.ds-right .below { color: var(--dim); }

/* ── about ──────────────────────────────────────────────── */

.about { padding: 32px 4px 10px; max-width: 1080px; margin: 0 auto; }
.about-lead { max-width: 760px; }
.about-lead h2 { margin: 8px 0 12px; font-size: clamp(24px, 3vw, 34px); font-weight: 750; letter-spacing: -0.04em; }
.about-lead p { margin: 0; font-size: 13px; line-height: 1.85; color: var(--muted); }
.about-lead b { color: var(--text); font-weight: 700; }
.about-lead code, .formula code, .flow-step code, .about-card code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--pink-soft);
  font-size: 0.88em;
}

.formula {
  display: grid;
  gap: 1px;
  margin: 26px 0 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  overflow: hidden;
}
.formula-line {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 13px 16px;
  background: rgba(12, 12, 19, 0.88);
}
.formula-line span { font-size: 9.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--dim); }
.formula-line code { font-family: var(--mono); font-size: 13px; font-weight: 500; line-height: 1.85; color: #d9ddec; }
.formula-line code sub, .formula-line code sup { font-size: 0.72em; }

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}
.flow-step {
  position: relative;
  padding: 17px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.018);
}
.flow-num { font-family: var(--mono); font-size: 9px; color: var(--pink-soft); letter-spacing: 0.1em; }
.flow-step h3 { margin: 7px 0 5px; font-size: 12.5px; font-weight: 700; }
.flow-step p { margin: 0; font-size: 10.5px; line-height: 1.7; color: var(--dim); }
.flow-step p code { font-size: 9.5px; }

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.about-card {
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.018);
}
.about-card h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; }
.about-card p { margin: 0; font-size: 11px; line-height: 1.75; color: var(--dim); }
.about-card b { color: var(--muted); }

.about-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 26px 0 10px;
}
.fine { font-size: 9.5px; color: var(--dim); }

/* ── footer ─────────────────────────────────────────────── */

.footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 24px;
  padding-block: 22px 30px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--dim);
}
.footer-left { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.footer-left .mark { width: 22px; height: 22px; padding: 5px 4px; border-radius: 6px; gap: 1.5px; }
.footer-left em { font-style: normal; color: var(--dim); }
.footer-mid { margin-left: auto; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.02em; }
.footer-right { font-family: var(--mono); font-size: 8.5px; }

/* ── toast ──────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(15, 15, 24, 0.95);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--text); }

/* ── responsive ─────────────────────────────────────────── */

@media (max-width: 1120px) {
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); gap: 40px; }
  .score-head, .row { grid-template-columns: 46px 52px minmax(0, 1fr) 58px 100px 70px 96px 76px; gap: 8px; }
  .cover { width: 46px; height: 46px; }
  .row { min-height: 60px; padding: 7px 10px; }
  .stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 46px; }
  .official { max-width: 520px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4), .stat:nth-child(5) { grid-column: span 1; }
  .score-head, .row { grid-template-columns: 42px 48px minmax(0, 1fr) 92px 66px 92px; }
  .score-head span:nth-child(4), .row > .sr { display: none; }
  .score-head span:nth-child(8), .row > .weight-cell { display: none; }
  .cover { width: 44px; height: 44px; }
  .ds-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head p { max-width: 34ch; }
  .chart-wrap { height: 260px; }
  .map-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
}

/* Tablet keeps SR, which otherwise leaves a dead column in the middle. */
@media (min-width: 761px) and (max-width: 980px) {
  .score-head, .row { grid-template-columns: 42px 48px minmax(0, 1fr) 58px 92px 66px 92px; }
  .score-head span:nth-child(4), .row > .sr { display: flex; }
}

@media (max-width: 760px) {
  .topbar { gap: 14px; height: 60px; }
  .nav { display: none; }
  .brand-copy small { display: none; }
  .sync { margin-left: auto; }
  .sync-text { font-size: 10px; }
  .hero { padding-top: 34px; }
  .big-pp { font-size: clamp(68px, 17vw, 108px); }
  .split { gap: 0; }
  .split-item { flex: 1 1 100%; padding: 12px 0; }
  .split-item + .split-item { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .official { max-width: none; }
  .card { border-radius: 18px; }
  .chart-card { padding: 18px 16px 14px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-head p { text-align: left; max-width: 100%; }
  .chart-wrap { height: 220px; }
  .chart-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 14px 14px 12px; }
  .stat-value { font-size: 21px; }
  .tabs { display: flex; width: 100%; }
  .tab { flex: 0 0 auto; }
  .search { width: 100%; margin-left: 0; order: 2; }
  .count { margin-left: auto; }
  .score-head, .row { grid-template-columns: 32px minmax(0, 1fr) 82px; gap: 7px; }
  .score-head span:nth-child(2), .row > .cover { display: none; }
  .score-head span:nth-child(5), .row > .mods { display: none; }
  .score-head span:nth-child(6), .row > .acc { display: none; }
  .score-head span:nth-child(7) { text-align: right; }
  .row { min-height: 54px; padding: 7px 8px; }
  .row .rank { font-size: 11px; }
  .map-title { font-size: 12.5px; }
  .map-sub { font-size: 9.5px; }
  .pp-cell b { font-size: 12.5px; }
  .recent-grid { grid-template-columns: 1fr; }
  .ds-intro { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .ds-badge { width: 54px; height: 54px; border-radius: 14px; font-size: 17px; }
  .ds-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rep-row, .rep-head { grid-template-columns: minmax(0, 1fr) 62px 62px 54px; gap: 5px; }
  .about { padding-top: 20px; }
  .formula-line { grid-template-columns: 1fr; gap: 4px; }
  .about-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .footer-mid { margin-left: 0; flex-basis: 100%; order: 3; }
  .footer-right { margin-left: auto; }
}

@media (max-width: 480px) {
  .container { padding-inline: 14px; }
  .topbar { padding-inline: 14px; }
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .tab { justify-content: center; }
  .sync { padding: 6px 9px; }
  .sync-text { display: inline; font-size: 9.5px; }
  .hero-sub { font-size: 15px; }
  .br-sm { display: inline; }
  .big-pp { font-size: 64px; }
  .btn { height: 38px; padding: 0 13px; font-size: 12px; }
  .updated { width: 100%; margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 19px; }
  .score-head, .row { grid-template-columns: 28px minmax(0, 1fr) 76px; }
  .map-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
  .map-sub .artist { display: none; }
  .pp-cell .gain { font-size: 8px; }
  .recent-card { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 9px; padding: 10px; }
  .recent-card .cover { width: 48px; height: 48px; }
  .ds-kpis { grid-template-columns: 1fr 1fr; }
  .ds-list-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .footer-right { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
