:root {
  --bg: #0d0f0e;
  --panel: #151917;
  --panel-2: #1c211e;
  --line: #2a312d;
  --text: #e9efe9;
  --muted: #8d9a91;
  --accent: #a6f43a;
  --accent-ink: #0d1404;
  --accent-2: #3be0c8;
  --danger: #ff6b6b;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: 18px; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.inline { display: inline; }
.flash { background: var(--panel-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 6px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(13,15,14,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { font-weight: 800; font-size: 19px; letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--accent), var(--accent-2), var(--accent)); box-shadow: 0 0 14px var(--accent); }
.search { flex: 1; }
.search input { width: 100%; }
.nav { display: flex; align-items: center; gap: 18px; white-space: nowrap; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select { width: auto; }
textarea { resize: vertical; }
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 999px;
}
.btn:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.link:hover { color: var(--accent); }

/* home */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: end; padding: 48px 0 32px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.hero h1 { font-size: clamp(30px, 5vw, 54px); max-width: 14ch; }
.hero p { color: var(--muted); max-width: 52ch; font-size: 17px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.genre-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--panel); }
.pill small { color: var(--muted); margin-left: 4px; }
section { margin-bottom: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head a { color: var(--muted); font-size: 14px; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.labels { list-style: none; margin: 0; padding: 0; }
.labels li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.labels small { color: var(--muted); }

/* covers + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.cover {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 60% 22%), hsl(calc(var(--h) + 70) 70% 12%));
  display: grid; place-items: center;
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover img.yt { transform: scale(1.34); } /* crop YouTube's letterbox bars */
.initials { font-weight: 800; font-size: 34px; text-transform: uppercase; color: hsl(var(--h) 80% 75% / .55); letter-spacing: -0.04em; }
.cover .play {
  position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.cover.tiny { width: 44px; border-radius: 4px; flex: none; }
.cover.tiny .initials { font-size: 14px; }
.cover.tiny .play { display: none; }
.cover.big { width: 100%; max-width: 300px; }
.card { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card .cover { margin-bottom: 8px; transition: transform .15s; }
.card:hover .cover { transform: translateY(-2px); }
.card:hover { color: inherit; }
.card-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-artist { color: var(--accent-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { color: var(--muted); font-size: 12px; display: flex; gap: 6px; white-space: nowrap; overflow: hidden; }
.card-meta .score { margin-left: auto; color: var(--accent); font-weight: 600; }

/* chart rows */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 28px 44px 1fr 1fr 110px 90px; gap: 14px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.row:hover { background: var(--panel); color: inherit; }
.rank { color: var(--muted); font-weight: 700; text-align: right; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main b, .row-main span, .row-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main span { color: var(--accent-2); font-size: 13px; }
.row-label, .row-genre { color: var(--muted); font-size: 13px; }
.row-score { color: var(--accent); font-weight: 600; text-align: right; font-size: 14px; }
.row-score small { color: var(--muted); font-weight: 400; }

/* browse */
.browse-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; padding: 32px 0 20px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[name=year] { width: 80px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.check input { width: auto; accent-color: var(--accent); }
.pager { display: flex; justify-content: center; gap: 24px; padding: 32px 0; color: var(--muted); }
.pager a { color: var(--accent); }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }

/* release */
.release-head { display: grid; grid-template-columns: 300px 1fr; gap: 36px; padding: 36px 0 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.release-info .artist { font-size: 20px; color: var(--accent-2); margin: 0 0 20px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 0 0 24px; }
.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.facts dd { margin: 0; }
.facts a { border-bottom: 1px dotted var(--muted); }
.rating { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; width: fit-content; }
.score-big { display: flex; align-items: baseline; gap: 8px; }
.score-big b { font-size: 30px; color: var(--accent); }
.score-big span { color: var(--muted); font-size: 13px; }
.stars { display: flex; align-items: center; gap: 2px; }
.stars button { background: none; border: 0; cursor: pointer; font-size: 26px; line-height: 1; color: var(--line); padding: 0 2px; }
.stars button.on, .stars:hover button { color: var(--accent); }
.stars button:hover ~ button { color: var(--line); }
.stars [data-mine] { margin-left: 10px; }
.release-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe, .player #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.no-audio { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; }
.no-audio p { color: var(--muted); }
.attach { display: grid; gap: 10px; margin-top: 18px; }
.attach .btn { justify-self: start; }
.tracklist ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.track { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; padding: 9px 6px; cursor: pointer; }
.track:hover, .track.now { background: var(--panel); }
.track.now .t { color: var(--accent); }
.track.static { cursor: default; }
.track.static:hover { background: none; }
.track .num { color: var(--muted); width: 22px; text-align: right; flex: none; }
.track .t { flex: 1; }
.track .time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.comments { max-width: 760px; margin-top: 40px; }
.comment { border-bottom: 1px solid var(--line); padding: 12px 0; }
.comment .who { margin: 0 0 4px; }
.comment .body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: grid; gap: 10px; margin-top: 16px; }
.comment-form .btn { justify-self: start; }

/* forms */
.narrow { max-width: 680px; margin: 0 auto; padding: 36px 0; }
.submit-form, .auth form { display: grid; gap: 16px; margin-top: 20px; }
.submit-form label, .auth label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.submit-form .btn, .auth .btn { justify-self: start; }
.url-row { display: flex; gap: 8px; }
.url-row .btn { white-space: nowrap; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lookup { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.lookup img { width: 120px; border-radius: 6px; flex: none; }
.lookup .warn { color: var(--danger); }
.lookup ul { margin: 6px 0 0; padding-left: 18px; }
.foot { color: var(--muted); font-size: 13px; padding-top: 30px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 40px; }

@media (max-width: 900px) {
  .hero, .split, .release-body { grid-template-columns: 1fr; }
  .genre-pills { justify-content: flex-start; }
  .release-head { grid-template-columns: 1fr; }
  .cover.big { max-width: 260px; }
  .row { grid-template-columns: 24px 44px 1fr 80px; }
  .row-label, .row-genre { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top-row { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .nav { gap: 12px; margin-left: auto; font-size: 14px; }
  .nav > a:first-child { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .fields { grid-template-columns: 1fr; }
  .url-row { flex-direction: column; }
  .lookup { flex-direction: column; align-items: flex-start; }
}

/* admin: match review */
.warn { color: #ffb44c; }
.bulk-bar { display: flex; gap: 12px; align-items: center; padding: 10px 0 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.match { display: grid; grid-template-columns: 22px minmax(0, 1fr) 20px minmax(0, 1.5fr) 44px auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); transition: opacity .25s, background .25s; }
.match > input { width: auto; accent-color: var(--accent); }
.match-release, .match-yt { display: flex; gap: 12px; align-items: center; min-width: 0; }
.match-release > span, .match-yt > span { display: flex; flex-direction: column; min-width: 0; }
.match-release b, .match-yt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-arrow { color: var(--muted); text-align: center; }
.reasons { color: var(--muted); font-style: italic; }
.thumb { flex: none; width: 96px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; border: 0; padding: 0; background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; font-size: 12px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.match-score { font-weight: 800; font-size: 18px; text-align: center; color: var(--muted); }
.match-score.s90, .match-score.s100 { color: var(--accent); }
.match-score.s80 { color: #d6f06a; }
.match-score.s70 { color: #ffb44c; }
.match-actions { display: flex; gap: 6px; }
.match.gone-ok { opacity: 0; background: rgba(166,244,58,.12); }
.match.gone-no { opacity: 0; background: rgba(255,107,107,.12); }
dialog#preview { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; width: min(860px, 92vw); color: var(--text); }
dialog#preview::backdrop { background: rgba(0,0,0,.7); }
dialog#preview form { margin-top: 10px; text-align: right; }
@media (max-width: 900px) {
  .match { grid-template-columns: 22px 1fr 44px; }
  .match-arrow { display: none; }
  .match-yt { grid-column: 2 / 3; }
  .match-actions { grid-column: 2 / -1; }
}
