:root {
  --bg: #0a0a0b;
  --bg-elevated: #141416;
  --bg-track: #1c1c1f;
  --fg: #f2f2f3;
  --fg-muted: #8b8b93;
  --accent: #ff2d8a;
  --accent-soft: #ff5aa3;
  --accent-dim: rgba(255, 45, 138, 0.18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 100% 70% at 50% -10%, rgba(255, 45, 138, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(80, 10, 40, 0.35) 0%, transparent 50%),
    var(--bg);
  min-height: 100dvh;
}

.site {
  max-width: 440px;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 16px calc(28px + var(--safe-bottom));
}

.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.site-brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-decoration: none;
  line-height: 1;
}

.site-brand span { color: var(--accent); }

.site-link {
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  padding: 6px 0;
}

.site-link:hover { color: var(--fg); }

.site-main { width: 100%; }

.card {
  background: rgba(20, 20, 22, 0.72);
  border: 1px solid rgba(255, 45, 138, 0.22);
  border-radius: 10px;
  padding: 22px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  font-weight: 400;
  line-height: 1;
}

.lead {
  margin-top: 8px;
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.role {
  margin-top: 6px;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 8px;
  border-radius: 2px;
}

.form {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  padding: 11px 12px;
  outline: none;
}

.field input:focus {
  border-color: rgba(255, 45, 138, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.error {
  color: #ff7aae;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 500;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.check input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.cta:hover { background: var(--accent-soft); }
.cta:active { transform: scale(0.98); }

.cta-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cta-ghost:hover {
  background: var(--bg-track);
  color: var(--fg);
}

.foot {
  margin-top: 18px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.foot a {
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 600;
}

.foot a:hover { text-decoration: underline; }

.flash {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent-soft);
  font-size: 0.85rem;
}

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(255, 45, 138, 0.35);
}

.dash-links {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hint {
  color: var(--fg-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.hint strong { color: var(--fg); font-weight: 600; }

.logout-form { margin-top: 14px; }

/* Top songs */
.top-wrap { width: 100%; }

.top-head {
  margin-bottom: 18px;
}

.top-head h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  font-weight: 400;
  line-height: 1;
}

.top-empty {
  color: var(--fg-muted);
  text-align: center;
  padding: 32px 0;
  font-size: 0.9rem;
}

.top-list {
  list-style: none;
  border: 1px solid rgba(255, 45, 138, 0.18);
  border-radius: 10px;
  background: rgba(20, 20, 22, 0.72);
  overflow: hidden;
  margin-bottom: 16px;
}

.top-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.top-row:last-child { border-bottom: none; }

.top-rank {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
}

.top-title {
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.top-score svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
}

.top-score--5 { color: #22c55e; }
.top-score--4 { color: #86efac; }
.top-score--3 { color: #facc15; }
.top-score--2 { color: #fb923c; }
.top-score--1 { color: #ef4444; }
.top-score--none { color: var(--fg-muted); font-weight: 500; }

.top-plays {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-soft);
}

.top-back { margin-top: 4px; }

