:root {
  --bg: #0f0c0b;
  --bg-soft: #171313;
  --card: #1b1716;
  --card-hi: #221d1c;
  --line: #2b2422;
  --text: #f2ece9;
  --muted: #9c938e;
  --accent: #e0201a;
  --accent-soft: rgba(224, 32, 26, 0.14);
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, #2a1614 0%, var(--bg) 55%) no-repeat, var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; padding: 24px 0 40px; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 28px; letter-spacing: -0.02em; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
h2 .muted { text-transform: none; letter-spacing: 0; }

p { margin: 0 0 12px; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.center { text-align: center; }
.inline { display: inline; }

/* ------------------------------- header ------------------------------- */

.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(15, 12, 11, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo {
  font-size: 20px; font-weight: 800; letter-spacing: -0.03em; text-transform: lowercase;
  color: var(--text);
}
.logo span { color: var(--accent); }
.logo:hover { color: var(--text); }

.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active { color: var(--text); background: var(--card); }

.qsearch { margin-left: auto; }
.qsearch input {
  width: 210px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
  font: inherit; font-size: 14px;
}
.qsearch input:focus { outline: none; border-color: var(--accent); }

.acct { display: flex; align-items: center; gap: 10px; }
.me { display: flex; align-items: center; gap: 8px; }
.me-name { font-weight: 600; font-size: 14px; }

/* ------------------------------- buttons ------------------------------ */

.btn, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn { background: var(--accent); color: #fff; }
.btn:hover { background: #f0332c; color: #fff; }
.btn.alt { background: var(--accent-soft); color: #ff8a84; border-color: rgba(224, 32, 26, .35); }
.btn.alt:hover { background: rgba(224, 32, 26, .24); }
.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.ghost:hover { color: var(--text); border-color: #443a37; }
.btn.sm, .ghost.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; padding: 12px; }

/* -------------------------------- cards ------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card h2 { margin-bottom: 14px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.col-side > .card:last-child { margin-bottom: 0; }

/* -------------------------------- hero -------------------------------- */

.hero { padding: 44px 0 28px; max-width: 720px; }
.hero h1 { font-size: 44px; letter-spacing: -0.035em; margin-bottom: 14px; }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; gap: 12px; margin: 20px 0 14px; }
.stats-line { font-size: 13px; }

.page-head { padding: 10px 0 18px; }
.page-head h1 { font-size: 34px; letter-spacing: -0.03em; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--accent); font-weight: 700; margin-bottom: 6px; }

/* -------------------------------- forms ------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field.grow { flex: 1; }
.field label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.field label .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
input, textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; font: inherit; font-size: 14px;
  background: var(--bg-soft); color: var(--text); border: 1px solid var(--line);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="color"] { padding: 4px; height: 42px; }
textarea { resize: vertical; min-height: 44px; }
.hint { font-size: 12px; }

.scrobble-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.scrobble-form .field { margin-bottom: 0; }
.scrobble-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 4px; }
.scrobble .hint { margin: 12px 0 0; }

.edit-form { display: flex; gap: 12px; align-items: flex-end; }
.edit-form .field { margin-bottom: 0; }
.edit-form .field:not(.grow) { width: 110px; }

.shout-form { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.shout-form textarea { flex: 1; }

.search-form { display: flex; gap: 10px; max-width: 520px; }
.search-form input { flex: 1; }

.alert {
  background: var(--accent-soft); border: 1px solid rgba(224, 32, 26, .35);
  color: #ffb3af; padding: 10px 12px; border-radius: 10px; font-size: 14px;
}

/* -------------------------------- feed -------------------------------- */

.feed { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid rgba(43, 36, 34, .7);
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row-body { flex: 1; min-width: 0; }
.row-head { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-head .who { color: var(--text); font-weight: 600; font-size: 14px; }
.row-track { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; font-size: 14px; }
.row-track .track { color: var(--muted); }
.row-track .track:hover { color: var(--accent); }
.row-track .title { font-weight: 600; }
.row-track .album { font-size: 13px; color: var(--muted); }
.row-track .album::before { content: "· "; }
.row-track .dash { color: var(--muted); }

.love { display: flex; align-items: center; gap: 4px; }
.heart {
  background: none; border: 0; cursor: pointer; font-size: 16px; line-height: 1;
  color: #4a403d; padding: 4px; transition: color .15s, transform .15s;
}
.heart:hover { color: var(--accent); transform: scale(1.12); }
.heart.on { color: var(--accent); }
.love .muted { font-size: 12px; }

.empty { padding: 8px 0; }

/* ------------------------------- avatars ------------------------------ */

.ava {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 16px; flex: 0 0 auto;
  text-transform: uppercase;
}
.ava.sm { width: 30px; height: 30px; font-size: 13px; }
.ava.xs { width: 24px; height: 24px; font-size: 11px; }
.ava.xl { width: 96px; height: 96px; font-size: 40px; }

/* ------------------------------- toplists ----------------------------- */

.toplist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid rgba(43, 36, 34, .6); font-size: 14px;
}
.toplist .rank { padding-top: 2px; }
.toplist .num { padding-top: 1px; }
.toplist li:last-child { border-bottom: 0; }
.toplist .rank { width: 18px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; text-align: right; }
.toplist .stack { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.toplist a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist .stack a { flex: none; }
.num { font-variant-numeric: tabular-nums; font-size: 13px; }

.people li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 14px; }
.people a { display: flex; align-items: center; gap: 8px; }

.link-list li { padding: 6px 0; font-size: 14px; border-bottom: 1px solid rgba(43, 36, 34, .6); }
.link-list li:last-child { border-bottom: 0; }

.album-list li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid rgba(43, 36, 34, .6); }
.album-list li:last-child { border-bottom: 0; }

.kv li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 14px; border-bottom: 1px solid rgba(43, 36, 34, .6); }
.kv li:last-child { border-bottom: 0; }

/* ------------------------------- profile ------------------------------ */

.profile-head { display: flex; gap: 20px; align-items: flex-start; padding: 16px 0 20px; flex-wrap: wrap; }
.profile-meta { flex: 1; min-width: 240px; }
.profile-meta h1 { font-size: 32px; letter-spacing: -0.03em; margin-bottom: 4px; }
.tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  background: var(--accent-soft); color: #ff8a84; padding: 3px 8px; border-radius: 6px; vertical-align: middle;
}
.bio { margin-top: 8px; color: #d8d0cc; }
.counts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; }
.counts li { display: flex; flex-direction: column; }
.counts b { font-size: 18px; font-variant-numeric: tabular-nums; }
.counts span { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px; }
.tabs a {
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--muted); border: 1px solid var(--line);
}
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* -------------------------------- chart ------------------------------- */

.chart-wrap { margin-top: 6px; }
.chart {
  display: flex; align-items: flex-end; gap: 3px; height: 110px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.chart .bar { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.chart .bar i {
  display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #f0332c, #7c1410); opacity: .9;
}
.chart .bar:hover i { opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* -------------------------------- table ------------------------------- */

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600; padding: 0 8px 8px 0; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 9px 8px 9px 0; border-bottom: 1px solid rgba(43, 36, 34, .6); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .t-r { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------ artist grid --------------------------- */

.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.artist-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-soft); transition: border-color .15s, background .15s;
}
.artist-card:hover { border-color: #4a3634; background: var(--card-hi); }
.artist-name { font-weight: 600; }

/* -------------------------------- shouts ------------------------------ */

.shout-list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(43, 36, 34, .6); }
.shout-list li:last-child { border-bottom: 0; }
.shout-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* ---------------------------- now playing ----------------------------- */

.np-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.np-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px; font-size: 13px;
}
.np-item:hover { border-color: #4a3634; }
.np-text { display: flex; flex-direction: column; min-width: 0; }
.np-text b { font-size: 13px; }
.np-text span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np { color: var(--accent); font-weight: 600; font-size: 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: auto; animation: pulse 1.6s infinite; flex: 0 0 auto; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.now-banner {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  background: var(--accent-soft); border: 1px solid rgba(224,32,26,.3);
  padding: 10px 14px; border-radius: 12px; margin-bottom: 18px;
}
.now-banner .pulse { margin-left: 0; }

/* --------------------------------- auth ------------------------------- */

.auth { display: flex; justify-content: center; padding: 30px 0 50px; }
.auth-card { width: 100%; max-width: 400px; padding: 26px 26px 22px; }
.auth-card h1 { font-size: 24px; }
.auth-card form { margin-top: 16px; }

.notfound { text-align: center; padding: 80px 0; }

/* -------------------------------- footer ------------------------------ */

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 22px; padding-bottom: 28px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); flex: 0 0 auto;
}

/* ------------------------------- responsive --------------------------- */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .scrobble-form { grid-template-columns: 1fr; }
  .np-strip { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .top-inner { height: auto; flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .qsearch { order: 3; width: 100%; margin-left: 0; }
  .qsearch input { width: 100%; }
  .acct { margin-left: auto; }
  .nav a { padding: 7px 9px; font-size: 14px; }
  .me-name { display: none; }
  h1 { font-size: 24px; }
  .page-head h1 { font-size: 26px; }
  .profile-head { gap: 14px; }
  .ava.xl { width: 64px; height: 64px; font-size: 26px; }
  .counts { gap: 16px; }
  .row { align-items: flex-start; }
  .tbl .t-r:last-child, .tbl th:last-child { display: none; }
  .edit-form { flex-wrap: wrap; }
  .shout-form { flex-direction: column; }
  .shout-form .btn { align-self: flex-end; }
}
