
:root {
  --bg: #17141c;
  --bg-2: #211c28;
  --bg-3: #2b2534;
  --line: #3a3245;
  --text: #ece8f1;
  --muted: #9a90a8;
  --accent: #ff66aa;
  --accent-2: #66ccff;
  --fail: #ff5c6c;
  --quit: #ffb347;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.muted { color: var(--muted); }
h1, h2 { margin: 0; font-weight: 600; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: var(--bg-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 18px; font-weight: 700; color: var(--accent); }
.profile-select { display: flex; align-items: center; gap: 8px; }
select {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font: inherit; min-width: 180px;
}

.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.footer { text-align: center; padding: 24px; font-size: 12px; }

.header-card {
  background: linear-gradient(135deg, #2d2038, var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  display: grid; gap: 20px;
}
.identity { display: flex; align-items: center; gap: 16px; }
.identity h1 { font-size: 28px; }
.avatar {
  width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center;
  background: var(--bg-3); color: var(--accent); font-size: 32px; font-weight: 700;
  border: 2px solid var(--line);
}
.ranks { display: flex; flex-wrap: wrap; gap: 32px; }
.rank-box { display: flex; flex-direction: column; }
.rank-value { font-size: 26px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: rgba(0,0,0,.18); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 18px; font-weight: 600; }
.grades { display: flex; gap: 18px; flex-wrap: wrap; }
.grade-count { display: flex; align-items: center; gap: 6px; font-weight: 600; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0 4px; }
.tabs a { background: var(--bg-2); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }

.section { margin-top: 28px; }
.section h2 { font-size: 18px; margin-bottom: 10px; scroll-margin-top: 70px; }
.empty { color: var(--muted); background: var(--bg-2); padding: 16px; border-radius: var(--radius); margin: 0; }
.rows { display: flex; flex-direction: column; gap: 4px; }

.score {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: 80px 44px minmax(0, 1fr) auto 120px 110px 56px;
  background: var(--bg-2); border-radius: 8px; padding: 6px 12px 6px 6px; min-height: 58px;
}
.score:hover { background: var(--bg-3); }
.score-failed { opacity: .78; }
.most-played { grid-template-columns: 80px minmax(0, 1fr) 90px; }
.cover { width: 80px; height: 46px; object-fit: cover; border-radius: 6px; background: var(--bg-3); display: block; }
.score-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.map { display: flex; flex-direction: column; min-width: 0; }
.map-title, .map-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-title { font-weight: 600; }
.map-title .diff { color: var(--accent-2); font-weight: 500; }
.map-sub { font-size: 12px; }
.score-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.stars { color: #ffd966; }
.length { color: var(--text); opacity: .75; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.icon { width: 11px; height: 11px; }
.tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.tag-fail { background: rgba(255,92,108,.15); color: var(--fail); }
.tag-quit { background: rgba(255,179,71,.15); color: var(--quit); }

.mods { display: flex; gap: 3px; justify-content: flex-end; }
.mod {
  font-size: 11px; font-weight: 700; padding: 2px 5px; border-radius: 4px;
  background: #4a3e5c; color: #fff; letter-spacing: .02em;
}
.mod-hd, .mod-fi { background: #b38f00; }
.mod-hr { background: #c0392b; }
.mod-dt, .mod-nc { background: #7d3cbd; }
.mod-fl { background: #222; border: 1px solid #555; }
.mod-ez { background: #27ae60; }
.mod-ht { background: #607d8b; }
.mod-nf { background: #3f6fb5; }
.mod-sd, .mod-pf { background: #b85c00; }
.mod-rx, .mod-ap, .mod-at, .mod-cn { background: #2c7873; }

.score-numbers { display: flex; flex-direction: column; text-align: right; font-size: 13px; }
.acc { color: #ffcc22; font-weight: 600; }
.misses { color: var(--fail); }
.score-pp { display: flex; flex-direction: column; text-align: right; }
.pp { color: var(--accent); font-weight: 700; font-size: 16px; }
.weight { font-size: 12px; }

.replay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 8px; padding: 4px; color: var(--accent-2); font-size: 11px;
}
a.replay:hover { background: rgba(102,204,255,.12); color: var(--accent-2); }
.replay-icon { font-size: 18px; line-height: 1; }

.playcount { display: flex; flex-direction: column; align-items: flex-end; }
.playcount-n { font-size: 20px; font-weight: 700; color: var(--accent-2); }

.grade { font-weight: 800; font-size: 20px; text-align: center; letter-spacing: -.03em; }
.grade-xh, .grade-sh { color: #d6e0eb; text-shadow: 0 0 8px rgba(214,224,235,.45); }
.grade-x, .grade-s { color: #ffcc22; text-shadow: 0 0 8px rgba(255,204,34,.35); }
.grade-a { color: #88da20; }
.grade-b { color: #e9b941; }
.grade-c { color: #fa8a59; }
.grade-d { color: #f55757; }
.grade-f { color: var(--fail); opacity: .9; }

.more {
  display: block; margin: 10px auto 0; padding: 8px 22px; border-radius: 999px;
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line); font: inherit; cursor: pointer;
}
.more:hover { border-color: var(--accent); }
.more[disabled] { opacity: .5; cursor: wait; }
.message { text-align: center; padding: 80px 0; }

@media (max-width: 760px) {
  .score { grid-template-columns: 60px 34px minmax(0, 1fr) 80px; row-gap: 4px; }
  .cover { width: 60px; height: 40px; }
  .score .mods { grid-column: 3; justify-content: flex-start; }
  .score .score-numbers { display: none; }
  .score .score-pp { grid-column: 4; grid-row: 1; }
  .score .replay { grid-column: 4; grid-row: 2; }
  .most-played { grid-template-columns: 60px minmax(0, 1fr) 60px; }
  .ranks { gap: 18px; }
  .rank-value { font-size: 20px; }
}
