:root {
  --bg: #1f1a1d;
  --bg-2: #2a2226;
  --card: #2e262a;
  --card-2: #382f34;
  --line: #4a3f45;
  --text: #f1e9ed;
  --dim: #b3a6ad;
  --faint: #7d6f76;
  --pink: #ff66aa;
  --pink-2: #ff99cc;
  --blue: #66ccff;
  --green: #88da20;
  --yellow: #ffcc22;
  --red: #ff6666;
  --ss: #ffcc22;
  --s: #ffcc22;
  --ssh: #e6f0f5;
  --a: #88da20;
  --b: #66ccff;
  --c: #cc66ff;
  --d: #ff6666;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.45; }
a { color: var(--pink-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }

.cover {
  height: 220px;
  background:
    radial-gradient(1200px 300px at 20% 0%, rgba(255, 102, 170, .55), transparent 60%),
    radial-gradient(900px 260px at 85% 10%, rgba(102, 204, 255, .35), transparent 60%),
    linear-gradient(135deg, #3b1d2e, #1d2238);
  position: relative;
  overflow: hidden;
}
.cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 18px 18px;
}
.cover-glow { position: absolute; inset: auto 0 0 0; height: 80px; background: linear-gradient(transparent, var(--bg)); z-index: 1; }

.page { max-width: 1000px; margin: -120px auto 40px; padding: 0 16px; position: relative; z-index: 2; }
.card { background: var(--card); border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
h1, h2 { margin: 0; }
h2 { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
h2 .count { color: var(--dim); font-weight: 600; font-size: 15px; }

.head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.avatar { width: 110px; height: 110px; border-radius: 22px; background: var(--card-2); box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.who { flex: 1; min-width: 220px; }
.name-row { display: flex; align-items: center; gap: 10px; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: .3px; }
.badge-ai { background: var(--pink); color: #2a0d1b; font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.country { color: var(--dim); display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.flag { width: 24px; height: 12px; border-radius: 2px; }
.tagline { color: var(--dim); margin: 8px 0 0; max-width: 560px; }
.presence { display: flex; align-items: center; gap: 8px; background: var(--card-2); border-radius: 999px; padding: 6px 14px; font-weight: 700; color: var(--dim); }
.presence .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.presence.on { color: var(--text); }
.presence.on .dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.presence.busy .dot { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }

.label { color: var(--dim); font-size: 13px; font-weight: 700; }
.rank-row { display: flex; gap: 40px; align-items: flex-end; flex-wrap: wrap; }
.rank .value { font-size: 34px; font-weight: 800; }
.rank .value.small { font-size: 26px; }
.rank-note { color: var(--faint); font-size: 12px; flex: 1; text-align: right; min-width: 200px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--bg-2); border-radius: 10px; padding: 10px 14px; }
.stat .value { font-size: 20px; font-weight: 800; }
.stat.level { grid-column: span 2; }
.level-bar { height: 8px; background: var(--card-2); border-radius: 4px; margin-top: 10px; overflow: hidden; }
#level-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--pink-2)); }

.grades { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.grade-count { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.grade { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 22px; border-radius: 11px; font-weight: 800; font-size: 13px; color: #1f1a1d; padding: 0 8px; }
.g-SSH, .g-XH { background: var(--ssh); }
.g-SS, .g-X { background: var(--ss); }
.g-SH { background: #d0dce4; }
.g-S { background: var(--s); }
.g-A { background: var(--a); }
.g-B { background: var(--b); }
.g-C { background: var(--c); }
.g-D, .g-F { background: var(--d); }

.chart-wrap { margin-top: 18px; background: var(--bg-2); border-radius: 10px; padding: 10px 14px; }
.chart-head { display: flex; justify-content: space-between; color: var(--dim); font-weight: 700; font-size: 13px; }
.chart-tabs button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; margin-left: 6px; cursor: pointer; color: var(--dim); }
.chart-tabs button.active { background: var(--pink); color: #2a0d1b; border-color: var(--pink); }
#chart { width: 100%; height: 160px; display: block; margin-top: 6px; }

.live h2 { display: flex; align-items: center; gap: 10px; }
.live-status { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--card-2); color: var(--dim); text-transform: uppercase; letter-spacing: .5px; }
.live-status.playing { background: var(--green); color: #14240a; }
.live-status.busy { background: var(--yellow); color: #2a2200; }
.live-body { display: grid; grid-template-columns: minmax(0, 384px) 1fr; gap: 20px; }
@media (max-width: 760px) { .live-body { grid-template-columns: 1fr; } .stat.level { grid-column: auto; } }
.view { margin: 0; }
.view img, .view-empty { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: #000; display: block; image-rendering: auto; }
.view-empty { display: flex; align-items: center; justify-content: center; color: var(--faint); background: var(--bg-2); text-align: center; padding: 20px; }
.view figcaption { color: var(--faint); font-size: 12px; margin-top: 6px; }
.now-title { font-size: 18px; font-weight: 800; }
.now-sub { color: var(--dim); margin-top: 2px; }
.progress { height: 6px; background: var(--card-2); border-radius: 3px; margin: 12px 0; overflow: hidden; }
#now-progress { height: 100%; width: 0; background: var(--blue); transition: width .5s linear; }
.hits { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 800; font-size: 20px; }
.hits span small { font-size: 12px; color: var(--dim); font-weight: 700; margin-left: 3px; }
.h300 { color: var(--blue); } .h100 { color: var(--green); } .h50 { color: var(--yellow); } .hmiss { color: var(--red); }
.now-meta { color: var(--dim); margin-top: 8px; }
.keys { display: flex; gap: 10px; margin-top: 12px; }
.key { flex: 1; background: var(--bg-2); border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--dim); }
.key .bar { height: 5px; background: var(--card-2); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.key .bar div { height: 100%; background: var(--pink); }

.plays { list-style: none; margin: 0; padding: 0; }
.play { display: grid; grid-template-columns: 42px 76px 1fr auto auto; align-items: center; gap: 14px; background: var(--bg-2);
  border-radius: 10px; padding: 8px 14px 8px 10px; margin-bottom: 6px; }
.play .cover-thumb { width: 76px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--card-2); }
.play .title { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play .title small { color: var(--dim); font-weight: 600; }
.play .meta { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play .acc { color: var(--yellow); font-weight: 800; text-align: right; }
.play .mods { color: var(--dim); font-size: 12px; text-align: right; }
.play .pp { text-align: right; min-width: 92px; }
.play .pp b { font-size: 18px; color: var(--pink-2); }
.play .pp small { display: block; color: var(--faint); font-size: 12px; }
.play .main { min-width: 0; }
.unranked { color: var(--faint); }
@media (max-width: 640px) { .play { grid-template-columns: 42px 1fr auto; } .play .cover-thumb, .play .acc-col { display: none; } }
.more { display: block; margin: 10px auto 0; background: var(--card-2); border: 0; border-radius: 999px; padding: 6px 18px; cursor: pointer; font-weight: 700; }
.empty { color: var(--faint); padding: 10px 0; }

.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 24px; margin: 0; }
.totals div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
.totals dt { color: var(--dim); font-weight: 700; }
.totals dd { margin: 0; font-weight: 800; }

footer { color: var(--faint); font-size: 12px; text-align: center; margin: 24px 0; }
