:root {
  --bg: #121212;
  --panel: #1b1b1b;
  --panel-2: #242424;
  --line: #2e2e2e;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #ff5500;
  --accent-soft: #a8481b;
  --wave: #5c5c5c;
  --radius: 6px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body.has-player { padding-bottom: 64px; }
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
svg { width: 1em; height: 1em; fill: currentColor; stroke: currentColor; stroke-width: 0; }
.muted { color: var(--muted); }
h1 { font-size: 22px; margin: 8px 0 4px; }
h2 { font-size: 17px; margin: 24px 0 12px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; height: 52px; padding: 0 24px; background: #0b0b0b; border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .12em; font-size: 17px; }
.logo.big { font-size: 24px; justify-content: center; margin-bottom: 4px; }
.logo-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.logo-bars i { width: 3px; background: var(--accent); border-radius: 1px; }
.logo-bars i:nth-child(1) { height: 40%; } .logo-bars i:nth-child(2) { height: 75%; } .logo-bars i:nth-child(3) { height: 100%; }
.logo-bars i:nth-child(4) { height: 60%; } .logo-bars i:nth-child(5) { height: 85%; }
.topbar nav { display: flex; gap: 18px; color: var(--muted); font-weight: 600; font-size: 14px; }
.search { flex: 1; max-width: 520px; display: flex; background: var(--panel-2); border-radius: 4px; }
.search input { flex: 1; background: none; border: 0; color: var(--text); padding: 8px 12px; font: inherit; font-size: 14px; outline: none; }
.search button { background: none; border: 0; color: var(--muted); padding: 0 12px; cursor: pointer; }
.search svg { fill: none; stroke-width: 2; width: 18px; height: 18px; }
.top-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.user-chip { background: var(--panel-2); padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; }

/* ---------- buttons / forms ---------- */
.btn { background: var(--text); color: #111; border: 0; border-radius: 4px; padding: 9px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { background: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-ghost:hover { border-color: #555; }
.btn-ghost.danger:hover { border-color: #c33; color: #f66; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; color: #ddd; }
input:not([type=checkbox]):not([type=range]):not([type=file]), textarea { display: block; width: 100%; margin-top: 6px; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 4px; padding: 9px 11px; font: inherit; font-size: 14px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=file] { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
label.check { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.flash { padding: 10px 14px; border-radius: 4px; margin: 0 0 16px; font-size: 14px; }
.flash.ok { background: #16351f; border: 1px solid #22693a; }
.flash.error { background: #3a1616; border: 1px solid #7a2626; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; margin-bottom: 24px; }
.card h2:first-child { margin-top: 0; }

/* ---------- layout ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 24px; }
.narrow { max-width: 460px; }
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.side { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 150px); overflow: auto; }
.side h3:first-child { margin-top: 4px; }
.side-link { display: flex; justify-content: space-between; padding: 6px 12px; border-radius: 4px; font-size: 14px; font-weight: 600; color: #ddd; }
.side-link small { color: var(--muted); font-weight: 500; }
.side-link.active { background: var(--text); color: #111; }
.side-link.active small { color: #555; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a, .tag-pill { background: var(--panel-2); border-radius: 99px; padding: 4px 10px; font-size: 12px; color: #ccc; white-space: nowrap; }
.tag-cloud a:hover, .tag-pill:hover { background: #333; color: #fff; }
.feed-title { margin-top: 0; }
.feed > .muted { margin: 0 0 20px; font-size: 14px; }
.feed > .muted a { color: var(--accent); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }
.empty a { color: var(--accent); }

/* ---------- mix row ---------- */
.mix { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid #1f1f1f; }
.cover img, .cover-ph { width: 160px; height: 160px; object-fit: cover; border-radius: 3px; display: block; background: var(--panel-2); }
.cover-ph { display: grid; place-items: center; font-size: 48px; color: #444; }
.mix-body { min-width: 0; display: flex; flex-direction: column; }
.mix-head { display: flex; align-items: flex-start; gap: 12px; }
.play-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--text); color: #111; display: grid; place-items: center; cursor: pointer; font-size: 18px; transition: transform .1s; }
.play-btn:hover { transform: scale(1.06); }
.play-btn.big { width: 60px; height: 60px; font-size: 24px; background: var(--accent); color: #fff; }
.mix.current .play-btn { background: var(--accent); color: #fff; }
.play-btn .i-pause, .pb-play .i-pause { display: none; }
.play-btn.playing .i-play, .pb-play.playing .i-play { display: none; }
.play-btn.playing .i-pause, .pb-play.playing .i-pause { display: block; }
.mix-names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.artist { color: var(--muted); font-size: 14px; font-weight: 600; }
.title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; color: var(--muted); }
.wave { position: relative; height: 64px; margin: 14px 0 12px; }
.wave.big { height: 110px; }
.wave canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
.wave-time { position: absolute; right: 0; top: 68%; transform: translateY(-100%); font-size: 11px; background: rgba(0,0,0,.75); padding: 1px 4px; color: #ccc; pointer-events: none; }
.mix-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.like-btn, .icon-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 4px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.like-btn:hover, .icon-btn:hover { border-color: #555; }
.like-btn.on { color: var(--accent); border-color: var(--accent-soft); }
.icon-btn svg { fill: none; stroke-width: 2; }
.icon-btn.done { color: #4c4; border-color: #4c4; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; min-width: 0; }
.tags a, .tags span { color: var(--muted); }
.tags a:hover { color: var(--accent); }
.tags.big { margin: 16px 0; font-size: 14px; gap: 10px; }
.plays { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.plays svg { width: 10px; }

/* ---------- mix page hero ---------- */
.hero { position: relative; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #3a2a20, #15151c); }
.hero::before { content: ""; position: absolute; inset: -40px; background: var(--cover, none) center/cover; filter: blur(40px) brightness(.45); }
.hero-inner { position: relative; display: flex; gap: 30px; padding: 30px; align-items: stretch; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.hero-cover { width: 300px; height: 300px; object-fit: cover; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.hl { background: rgba(0,0,0,.8); padding: 4px 8px; align-self: flex-start; display: inline-block; }
.hero h1.hl { font-size: 24px; margin: 4px 0 0; }
.mix-detail { padding: 18px 4px; max-width: 900px; }
.description { white-space: pre-wrap; line-height: 1.6; color: #ccc; font-size: 14px; }

/* ---------- bottom player ---------- */
.playerbar { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: #1a1a1a; border-top: 1px solid var(--line); }
.playerbar[hidden] { display: none; }
.pb-controls { display: flex; align-items: center; gap: 6px; }
.pb-controls button { background: none; border: 0; color: var(--text); cursor: pointer; font-size: 18px; padding: 6px; display: grid; place-items: center; }
.pb-controls .pb-play { font-size: 22px; }
.pb-controls button.small { font-size: 11px; font-weight: 700; color: var(--muted); }
.pb-controls button:hover { color: var(--accent); }
.pb-time { font-size: 12px; color: var(--accent); width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
#pb-dur { color: var(--text); }
#pb-seek { flex: 1; accent-color: var(--accent); }
.pb-vol { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.pb-vol svg path:last-child { fill: none; stroke-width: 2; }
.pb-vol input { width: 80px; accent-color: var(--accent); }
.pb-now { display: flex; align-items: center; gap: 10px; width: 260px; min-width: 0; }
.pb-now img { width: 36px; height: 36px; object-fit: cover; }
.pb-now span { display: flex; flex-direction: column; min-width: 0; }
.pb-now small, .pb-now b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-now small { color: var(--muted); font-size: 12px; }
.pb-now b { font-size: 13px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, #2a1608, var(--bg) 60%); }
.login { width: 100%; max-width: 360px; text-align: center; }
.login label { text-align: left; }
.login .btn { width: 100%; margin-top: 6px; background: var(--accent); color: #fff; }

/* ---------- admin ---------- */
.admin-tabs { display: flex; gap: 10px; margin: 6px 0 20px; }
.admin-tabs a { background: var(--panel-2); padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.cover-drop { position: relative; width: 220px; height: 220px; border: 2px dashed #444; border-radius: 6px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; overflow: hidden; }
.cover-drop:hover { border-color: var(--accent); }
.cover-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.analyse { font-size: 13px; margin: -6px 0 12px; min-height: 1em; }
.progress { position: relative; height: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid #222; vertical-align: middle; }
.table .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 3px; font-size: 18px; }
.table .tags span { white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.actions form { display: inline; margin-left: 4px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input:not([type=checkbox]):not([type=range]):not([type=file]) { display: inline-block; width: 200px; margin: 0; padding: 6px 10px; }
.table .inline-form input:not([type=checkbox]):not([type=range]):not([type=file]) { width: 150px; }
.table .inline-form { flex-wrap: nowrap; }
.badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

@media (max-width: 860px) {
  .topbar { gap: 12px; padding: 0 12px; } .topbar nav { display: none; }
  .layout { grid-template-columns: 1fr; } .side { position: static; max-height: none; }
  .mix { grid-template-columns: 90px 1fr; gap: 14px; } .cover img, .cover-ph { width: 90px; height: 90px; }
  .hero-inner { flex-direction: column-reverse; } .hero-cover { width: 100%; height: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .pb-vol, .pb-now, .pb-controls .small { display: none; }
}
