:root {
  --bg: #111418;
  --bg2: #171b21;
  --panel: #1d222a;
  --line: #2a3038;
  --line2: #38404b;
  --text: #d8dee6;
  --muted: #8b96a5;
  --dim: #5f6a78;
  --white: #f4f6f8;
  --amber: #f2a43a;
  --heart: #ff5d6c;
  --green: #48d597;
  --blue: #63b3ff;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font: 15px/1.5 var(--sans); background: radial-gradient(1200px 500px at 50% -200px, #1e2530 0%, transparent 70%), var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--white); }
button, input, textarea, select { font: inherit; color: inherit; }
.wrap { width: min(1080px, 100% - 40px); margin: 0 auto; }
main { flex: 1; padding: 28px 0 60px; }
h1, h2, h3 { font-family: var(--serif); color: var(--white); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 40px; line-height: 1.1; }
h2 { font-size: 22px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin: 36px 0 16px; }
.section-title h2 { font: 600 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.section-title a, .section-title button { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(17, 20, 24, 0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font: italic 600 26px/1 var(--serif); color: var(--white); display: flex; align-items: center; gap: 10px; }
.disc { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, var(--bg) 0 2px, var(--amber) 2.5px 6px, #222831 6.5px 8px, #2d343e 8.5px 9px, #222831 9.5px); box-shadow: 0 0 0 1px #2d343e; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.nav { display: flex; align-items: center; gap: 22px; font: 600 12px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.nav a { color: var(--muted); }
.nav a.on, .nav a:hover { color: var(--white); }
.avatar { --h: 200; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, hsl(var(--h) 55% 45%), hsl(calc(var(--h) + 40) 60% 30%)); display: inline-grid; place-items: center; font: 600 13px/1 var(--sans); color: #fff; letter-spacing: 0; text-transform: uppercase; flex: none; }
.avatar.lg { width: 96px; height: 96px; font-size: 36px; font-family: var(--serif); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); border-radius: var(--r); padding: 8px 14px; font-weight: 500; font-size: 13px; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.05s; }
.btn:hover { background: #252b34; border-color: #4a5360; color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #1a1206; font-weight: 600; }
.btn.primary:hover { background: #ffb954; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #6b2e36; color: #ff9aa4; background: transparent; }
.btn.danger:hover { background: #2a1519; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.tangle { background: #f4f6f8; color: #111418; border-color: #f4f6f8; font-weight: 600; }
.btn.tangle:hover { background: #fff; }
.tangle-mark { width: 16px; height: 16px; }
.log-btn { background: var(--amber); color: #1a1206 !important; padding: 8px 14px; border-radius: var(--r); letter-spacing: 0.08em; }
.log-btn:hover { background: #ffb954; }

/* banner */
.banner { border-bottom: 1px solid var(--line); background: #241a10; color: #ffd8a8; }
.banner.err { background: #2a1519; color: #ffc2c8; }
.banner .wrap { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 0; font-size: 14px; }

/* covers */
.cover { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--panel); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 18px rgba(0, 0, 0, 0.35); display: block; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.gen { --a: 20; --b: 200; background: radial-gradient(120% 90% at 15% 10%, hsl(var(--a) 70% 58%) 0%, transparent 60%), radial-gradient(100% 100% at 100% 100%, hsl(var(--b) 60% 35%) 0%, transparent 70%), linear-gradient(160deg, hsl(var(--a) 35% 22%), hsl(var(--b) 40% 12%)); }
.cover.gen::after { content: ""; position: absolute; width: 74%; aspect-ratio: 1; right: -24%; bottom: -24%; border-radius: 50%; background: repeating-radial-gradient(circle, rgba(0, 0, 0, 0.55) 0 1px, rgba(0, 0, 0, 0.42) 1px 3px), #0c0e11; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
.cover.gen.p1::after { right: auto; left: -26%; bottom: -30%; }
.cover.gen.p2::after { display: none; }
.cover.gen.p2 { background: radial-gradient(circle at 70% 62%, transparent 0 18%, hsla(var(--a), 70%, 60%, 0.9) 18.5% 19.5%, transparent 20% 27%, hsla(var(--a), 70%, 60%, 0.5) 27.5% 28.2%, transparent 28.7% 36%, hsla(var(--a), 70%, 60%, 0.3) 36.5% 37%, transparent 37.5%), linear-gradient(200deg, hsl(var(--b) 45% 30%), hsl(var(--b) 50% 10%)); }
.cover .ct { position: absolute; inset: 9% 9% auto 9%; font: italic 600 clamp(11px, 1.35vw, 17px)/1.12 var(--serif); color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); z-index: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cover .ca { position: absolute; left: 9%; bottom: 8%; right: 30%; font: 600 clamp(8px, 0.8vw, 10px)/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.82); z-index: 1; }
.cover.xl .ct { font-size: 28px; }
.cover.xl .ca { font-size: 12px; }
.cover.mini .ct, .cover.mini .ca { display: none; }
a.cover:hover { box-shadow: inset 0 0 0 2px var(--amber), 0 6px 18px rgba(0, 0, 0, 0.35); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.grid.six { grid-template-columns: repeat(6, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); gap: 22px; }
.poster .meta { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-height: 18px; }
.poster .meta .who { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.poster .t { font-size: 13px; color: var(--text); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster .a { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stars { color: var(--amber); letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.stars.lg { font-size: 18px; }
.heart { color: var(--heart); }
.icon { color: var(--dim); font-size: 13px; }

/* hero */
.hero { padding: 54px 0 20px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 54px; font-weight: 600; }
.hero h1 em { color: var(--amber); font-style: italic; }
.hero p { font-size: 18px; color: var(--muted); max-width: 30em; margin: 18px 0 26px; }
.hero-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; transform: rotate(-4deg); opacity: 0.95; }
.hero-wall .cover:nth-child(odd) { transform: translateY(14px); }
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.pill { border: 1px solid var(--line2); border-radius: 999px; padding: 4px 12px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 30px 0 18px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); font: 600 12px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; }
.tabs button.on { color: var(--white); border-color: var(--amber); }

/* activity */
.activity { display: flex; flex-direction: column; }
.act { display: grid; grid-template-columns: 70px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); animation: in 0.35s ease; }
.act:first-child { padding-top: 4px; }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } }
.act .line { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.act .line b { color: var(--white); font-weight: 600; }
.act .title { font: 600 19px/1.25 var(--serif); color: var(--white); margin: 2px 0 2px; display: block; }
.act .title .yr { font: 400 14px var(--sans); color: var(--muted); }
.act .review { margin-top: 8px; color: var(--text); font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.act .actions { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); border: 1px solid var(--line2); border-radius: 999px; padding: 3px 10px; background: none; cursor: pointer; }
.chip:hover { color: var(--white); border-color: #556070; }
.chip.ok { color: var(--green); border-color: #275c46; cursor: default; }
.chip.busy { opacity: 0.6; cursor: progress; }

/* two column layouts */
.cols { display: grid; grid-template-columns: 1fr 300px; gap: 48px; }
.side .box { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--bg2); margin-bottom: 18px; }
.side h3 { font: 600 11px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.person .n { flex: 1; min-width: 0; }
.person .n b { display: block; color: var(--white); font-weight: 600; font-size: 14px; }
.person .n span { font-size: 12px; color: var(--muted); }

/* profile */
.profile-head { display: flex; gap: 24px; align-items: center; padding: 10px 0 24px; border-bottom: 1px solid var(--line); }
.profile-head .who { flex: 1; }
.profile-head h1 { font-size: 34px; }
.profile-head .handle { color: var(--muted); margin-top: 4px; }
.profile-head .bio { margin-top: 8px; color: var(--text); max-width: 40em; }
.nums { display: flex; gap: 0; }
.nums div { text-align: center; padding: 0 18px; border-left: 1px solid var(--line); }
.nums div:first-child { border-left: 0; }
.nums b { display: block; font: 600 26px/1.1 var(--serif); color: var(--white); }
.nums span { font: 600 10px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.subnav { display: flex; gap: 22px; padding: 14px 0; border-bottom: 1px solid var(--line); font: 600 12px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.subnav a { color: var(--muted); }
.subnav a.on { color: var(--white); }
.fav-empty { aspect-ratio: 1; border: 1px dashed var(--line2); border-radius: 4px; display: grid; place-items: center; color: var(--dim); font-size: 13px; text-align: center; padding: 10px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; }
.bars div { flex: 1; background: #3a434f; border-radius: 1px 1px 0 0; min-height: 2px; transition: background 0.15s; position: relative; }
.bars div:hover { background: var(--amber); }
.bars-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--amber); margin-top: 4px; }
.artist-row { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 5px 0; }
.artist-row .bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.artist-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), #ffcf7d); }
.artist-row .nm { width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* diary */
.month { margin-top: 28px; }
.month h2 { font: italic 600 26px/1 var(--serif); margin-bottom: 8px; }
.diary-row { display: grid; grid-template-columns: 44px 44px 1fr 110px 26px 26px 26px 60px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); animation: in 0.3s ease; }
.diary-row .day { font: 600 22px/1 var(--serif); color: var(--muted); text-align: center; }
.diary-row .tt b { color: var(--white); font-weight: 600; }
.diary-row .tt span { color: var(--muted); font-size: 13px; }
.diary-row .tools { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity 0.15s; }
.diary-row:hover .tools { opacity: 1; }
.iconbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; font-size: 13px; }
.iconbtn:hover { color: var(--white); background: var(--panel); }
.pending { opacity: 0.55; }

/* track page */
.song-head { display: grid; grid-template-columns: 260px 1fr 260px; gap: 40px; padding-top: 10px; }
.song-head h1 { font-size: 44px; }
.song-head .by { font-size: 18px; color: var(--muted); margin-top: 8px; }
.song-head .by a { color: var(--text); border-bottom: 1px solid var(--line2); }
.sources { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.src { font: 600 10px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid var(--line2); border-radius: 3px; padding: 5px 7px; color: var(--muted); }
a.src:hover { color: var(--white); border-color: var(--amber); }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.panel + .panel { margin-top: 14px; }
.avg { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.avg b { font: 600 34px/1 var(--serif); color: var(--white); }
.actions-col { display: flex; flex-direction: column; gap: 10px; }
.actions-col .btn { justify-content: center; }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.note.ok { color: var(--green); }

/* forms + modal */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 7, 9, 0.72); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 50; animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(680px, 100%); background: var(--bg2); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: pop 0.18s ease; max-height: 84vh; display: flex; flex-direction: column; }
@keyframes pop { from { transform: translateY(8px) scale(0.99); opacity: 0; } }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 20px; }
.modal-b { padding: 18px 20px; overflow: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.input { width: 100%; background: #0d1014; border: 1px solid var(--line2); border-radius: var(--r); padding: 11px 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(242, 164, 58, 0.15); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.55; }
label.f { display: block; font: 600 11px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.search-wrap { position: relative; }
.search-wrap .spin { position: absolute; right: 12px; top: 12px; width: 18px; height: 18px; border: 2px solid var(--line2); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.7s linear infinite; display: none; }
.search-wrap.busy .spin { display: block; }
.results { margin-top: 12px; }
.result { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 6px; cursor: pointer; width: 100%; text-align: left; background: none; border: 0; }
.result:hover, .result.kb { background: var(--panel); }
.result b { color: var(--white); font-weight: 600; display: block; }
.result span { color: var(--muted); font-size: 13px; }
.result .tag { font-size: 11px; color: var(--amber); }
.new-badge { font: 600 9px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: #0c2a1d; background: var(--green); padding: 3px 5px; border-radius: 3px; }
.recent-box { border: 1px solid #274a3b; background: linear-gradient(180deg, #13221c, transparent); border-radius: 8px; padding: 12px; margin-top: 14px; }
.recent-box h3 { font: 600 11px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(72, 213, 151, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(72, 213, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(72, 213, 151, 0); } }
.picked { display: grid; grid-template-columns: 120px 1fr; gap: 20px; }
.picked h3 { font-size: 24px; }
.rate-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 4px; }
.rater { display: inline-flex; gap: 2px; cursor: pointer; user-select: none; }
.rater .s { position: relative; width: 30px; height: 30px; font-size: 30px; line-height: 30px; color: #3a434f; }
.rater .s::before { content: "★"; position: absolute; inset: 0; }
.rater .s .fill { position: absolute; inset: 0; overflow: hidden; color: var(--amber); width: 0; }
.rater .s .fill::before { content: "★"; }
.toggle-heart { background: none; border: 0; font-size: 28px; color: #3a434f; cursor: pointer; padding: 0; line-height: 1; transition: transform 0.12s; }
.toggle-heart.on { color: var(--heart); transform: scale(1.08); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { accent-color: var(--amber); width: 16px; height: 16px; }
.row2 { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: end; }

/* settings */
.settings { max-width: 720px; }
.card { border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 22px; margin-top: 20px; }
.card h2 { font-size: 20px; margin-bottom: 6px; }
.card p { color: var(--muted); margin: 6px 0; }
.card ul { color: var(--muted); padding-left: 18px; margin: 8px 0; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 14px; margin: 12px 0; }
.kv span:nth-child(odd) { color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.status-dot.off { background: var(--heart); }
.switch { display: flex; gap: 14px; align-items: flex-start; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 11px; background: var(--line2); position: relative; cursor: pointer; flex: none; margin-top: 2px; transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked { background: var(--amber); }
.switch input:checked::after { transform: translateX(18px); }
.danger-zone { border-color: #4a2329; }

/* welcome */
.welcome { max-width: 520px; margin: 40px auto; }
.welcome h1 { font-size: 42px; }
.handle-input { position: relative; }
.handle-input span { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.handle-input .input { padding-left: 28px; }
.err-text { color: #ff9aa4; font-size: 13px; margin-top: 8px; min-height: 18px; }

/* states */
.empty { border: 1px dashed var(--line2); border-radius: 10px; padding: 34px; text-align: center; color: var(--muted); }
.empty h3 { font-size: 20px; margin-bottom: 6px; }
.skel { background: linear-gradient(90deg, var(--panel) 0%, #262c35 50%, var(--panel) 100%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 4px; }
@keyframes sh { to { background-position: -200% 0; } }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; }
.toast { background: #f4f6f8; color: #111418; border-radius: 8px; padding: 11px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-width: 560px; animation: pop 0.2s ease; display: flex; gap: 12px; align-items: center; }
.toast.err { background: #ff9aa4; }
.toast.tangle::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }

.foot { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 30px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.foot a { color: var(--muted); }

@media (max-width: 860px) {
  .hero, .cols, .song-head { grid-template-columns: 1fr; }
  .grid.six { grid-template-columns: repeat(3, 1fr); }
  .diary-row { grid-template-columns: 36px 40px 1fr 90px 20px 20px; }
  .diary-row .tools, .diary-row .rv { display: none; }
  .nav { gap: 14px; }
}
