:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --card: #16161f;
  --text: #f4f4f8;
  --muted: #9a9aad;
  --red: #e11d2e;
  --red-dim: #b40e1c;
  --border: #2a2a38;
  --green: #22c55e;
  --max: 920px;
  --header-h: 64px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: #ffb4b8; }
a:hover { color: #fff; }

/* Sticky header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
}
.brand sup { color: var(--red); font-size: 0.55em; }
.header-nav { display: flex; gap: 0.35rem; }
.nav-link {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  cursor: pointer;
}
.nav-link:hover { color: var(--text); background: var(--bg-elevated); }
.nav-link.active {
  color: #fff;
  background: var(--red);
}

.main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.panel { display: none; }
.panel.active { display: block; }

.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}
.hero-logo { margin-bottom: 0.75rem; }
.hero h1, .activity-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
}
.lead {
  color: var(--muted);
  max-width: 36rem;
  margin: 0 auto 1.35rem;
}
.lead.muted { color: var(--muted); }
.cta-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.version { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  font: inherit;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dim); color: #fff; }
.btn.ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}
.btn.ghost:hover { background: var(--card); }

.features {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 1.5rem 0 2rem;
}
.features article, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 1.25rem 1.4rem;
}
.features h2 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.features p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.downloads h2 { margin-top: 0; }
.download-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.download-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.download-list li:last-child { border-bottom: 0; }
.fine { color: var(--muted); font-size: 0.9rem; }

.activity-head { text-align: center; margin-bottom: 1.25rem; }
.subtabs {
  display: inline-flex;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border-radius: 0.65rem;
  border: 1px solid var(--border);
}
.subtab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
}
.subtab:hover { color: var(--text); }
.subtab.active { background: var(--red); color: #fff; }

.chart-status {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  min-height: 1.25rem;
}
.chart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}
.chart-list li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.chart-list li:last-child { border-bottom: 0; }
.chart-list li::before {
  content: counter(rank);
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--red);
  background: rgba(225, 29, 46, 0.12);
  border-radius: 0.4rem;
}
.chart-meta { flex: 1; min-width: 0; }
.chart-meta .t {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-meta .s {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-plays {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--green);
  font-size: 0.9rem;
}

.site-footer {
  text-align: center;
  padding: 1.75rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer a, .linkish {
  color: var(--muted);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer a:hover, .linkish:hover { color: var(--text); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }
.modal-body { padding: 1.15rem; color: var(--muted); }
.modal-body p { margin: 0 0 0.75rem; }
.modal-body ul { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.modal-body li { margin: 0.35rem 0; }
.modal-foot {
  padding: 0 1.15rem 1.15rem;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 560px) {
  .header-nav .nav-link { padding: 0.45rem 0.65rem; font-size: 0.85rem; }
  .brand span { font-size: 1.05rem; }
}
