:root {
  --bg: #080808;
  --card: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --muted: #a0a0a0;
  --accent: #1db954;
  --danger: #ff5c6c;
  --nav-h: 66px;
  --mini-h: 66px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { color-scheme: dark; }
body {
  background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font);
  min-height: 100vh; overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* Latar: glow biru & ungu */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 38% at 12% 0%, rgba(59, 91, 255, 0.38), transparent 70%),
    radial-gradient(55% 40% at 100% 18%, rgba(139, 60, 255, 0.32), transparent 70%),
    radial-gradient(60% 40% at 50% 110%, rgba(59, 91, 255, 0.18), transparent 70%),
    var(--bg);
}
.glass {
  background: var(--card); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}

/* Layout */
.app { max-width: 720px; margin: 0 auto; }
.page { padding: 16px 18px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
body.has-mini .page { padding-bottom: calc(var(--nav-h) + var(--mini-h) + 32px + env(safe-area-inset-bottom)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.spacer { width: 40px; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }

/* Navigasi bawah */
.nav {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  height: var(--nav-h); border-radius: 22px; display: flex; justify-content: space-around; align-items: center;
  max-width: 700px; margin: 0 auto;
}
.nav-logo { display: none; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--muted); padding: 6px 14px; border-radius: 14px; }
.nav a.on { color: var(--accent); }

/* Header & judul */
.head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.logo { font-weight: 800; letter-spacing: 0.12em; font-size: 17px; }
.logo.big { font-size: 22px; text-align: center; margin-bottom: 28px; }
.head-av .avatar { width: 38px; height: 38px; font-size: 14px; }
.greet { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.ptitle { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }

.searchbox {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 16px;
  color: var(--muted); margin-bottom: 18px; width: 100%;
}
.searchbox input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; }
.searchbox:focus-within { border-color: var(--accent); }

/* Banner */
.banners { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px 6px; padding: 0 18px; scroll-padding: 0 18px; scrollbar-width: none; }
.banners::-webkit-scrollbar, .hscroll::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 86%; max-width: 420px; scroll-snap-align: start; min-height: 150px; border-radius: 22px;
  background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 18px;
  position: relative; overflow: hidden; border: 1px solid var(--line);
}
.banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.05) 70%); }
.banner div { position: relative; display: grid; gap: 2px; }
.banner b { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.banner span { color: rgba(255, 255, 255, 0.8); font-size: 13px; }

/* Section */
.sec { margin-top: 26px; }
.sec h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 12px; }
.hscroll { display: flex; gap: 14px; overflow-x: auto; margin: 0 -18px; padding: 0 18px 4px; scroll-padding: 0 18px; scrollbar-width: none; scroll-snap-type: x proximity; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
.card { flex: 0 0 140px; display: grid; gap: 2px; align-content: start; cursor: pointer; scroll-snap-align: start; }
.grid .card { flex: initial; }
.card b { font-size: 14px; font-weight: 700; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.artist { text-align: center; flex-basis: 116px; }

/* Cover */
.cover { aspect-ratio: 1; background-size: cover; background-position: center; display: grid; place-items: center; color: rgba(255, 255, 255, 0.75); flex: none; border-radius: 14px; overflow: hidden; }
.cover svg { width: 36%; height: 36%; }
.cover.sm { width: 52px; border-radius: 10px; }
.cover.fill { width: 100%; }
.cover.xl { width: min(240px, 66vw); border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.cover.round { border-radius: 50%; }
.avatar { width: 56px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.avatar.big { width: 64px; font-size: 20px; }

/* Baris lagu */
.list { display: grid; gap: 2px; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; cursor: pointer; }
.row:hover { background: rgba(255, 255, 255, 0.05); }
.row.playing .meta b { color: var(--accent); }
.meta { display: grid; min-width: 0; flex: 1; }
.meta b { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta > span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); flex: none; }
.icon:hover { color: var(--text); }
.icon.on { color: var(--accent); }

/* Tombol & form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 700; border: 1px solid var(--line); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; margin-bottom: 12px; }
.btn.primary { background: var(--accent); color: #04140a; border-color: transparent; }
.btn.ghost { background: var(--card); }
.btn.danger { background: rgba(255, 92, 108, 0.14); color: var(--danger); border-color: rgba(255, 92, 108, 0.3); }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.field {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35); color: var(--text); font: inherit; outline: 0;
}
textarea.field { height: 90px; padding: 12px 16px; resize: vertical; }
select.field option { background: #161616; }
.field:focus { border-color: var(--accent); }
.stack { display: grid; gap: 12px; }
.panel { border-radius: 20px; padding: 16px; }
.error { color: var(--danger); font-size: 13px; min-height: 0; }
.error:empty { display: none; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: rgba(29, 185, 84, 0.2); color: var(--accent); margin-top: 4px; }

/* Tab & chip */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tab, .chip { padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab.on { background: var(--accent); color: #04140a; border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Hero (album/artis/playlist) */
.hero { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 8px 0 18px; }
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 10px; }
.hero .bio { max-width: 46ch; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.hero a:hover { text-decoration: underline; }

/* Profil */
.profile { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; }
.profile > div:last-child { display: grid; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stats > * { border-radius: 18px; padding: 14px; display: grid; gap: 2px; text-align: center; }
.stats b { font-size: 22px; font-weight: 800; }
.stats span { font-size: 12px; color: var(--muted); }
.swatches { display: flex; gap: 12px; margin-top: 8px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6) inset; }
.panel + .panel, .panel + .btn, .sec .panel { margin-top: 12px; }

/* Kosong */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 16px; color: var(--muted); }
.empty > div { color: rgba(255, 255, 255, 0.25); }
.empty b { color: var(--text); font-size: 16px; }
.empty a { color: var(--accent); font-weight: 600; }

/* Sheet */
#sheet-root { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: rgba(24, 24, 30, 0.92); transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: grid; gap: 12px; max-height: 80vh; overflow-y: auto;
}
#sheet-root.open .sheet-back { opacity: 1; }
#sheet-root.open .sheet { transform: none; }
.sheet h3 { font-size: 18px; font-weight: 800; }
.picker { display: grid; gap: 4px; }
.pick { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); text-align: left; }
.tick { color: var(--accent); display: grid; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 90;
  background: rgba(30, 30, 36, 0.95); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: 0.25s; max-width: 90vw; text-align: center;
}
body.has-mini #toast { bottom: calc(var(--nav-h) + var(--mini-h) + 34px + env(safe-area-inset-bottom)); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Halaman login / daftar */
.auth-body { display: grid; place-items: center; padding: 24px 18px; }
.auth { width: 100%; max-width: 400px; display: grid; gap: 10px; }
.auth h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; text-align: center; }
.auth > .muted { text-align: center; }
.auth form { margin-top: 10px; }
.auth a { color: var(--accent); font-weight: 600; }
.demo-note { margin-top: 4px; }

/* ---------- Admin Panel ---------- */
.admin { max-width: 900px; margin: 0 auto; padding: 16px 18px 60px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.admin-head a.back { color: var(--muted); font-size: 14px; }
.admin-nav { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; scrollbar-width: none; }
.admin-nav a { padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px; white-space: nowrap; }
.admin-nav a.on { background: var(--accent); color: #04140a; border-color: transparent; }
.admin h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.toolbar { display: flex; gap: 10px; margin: 14px 0; }
.toolbar .field { flex: 1; }
.toolbar .btn { height: 48px; white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { border-radius: 18px; padding: 16px; display: grid; gap: 2px; }
.stat b { font-size: 26px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 13px; }
.arow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; margin-bottom: 8px; }
.arow .cover { width: 46px; border-radius: 10px; }
.arow .cover.round { border-radius: 50%; }
.arow .icon:hover { background: rgba(255, 255, 255, 0.08); }
.arow .icon.del:hover { color: var(--danger); }
.arow select.field { width: 120px; height: 38px; }
.form-grid { display: grid; gap: 12px; }
.form-grid label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.file-row { display: grid; gap: 6px; }
.bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }
.switch { display: flex; align-items: center; gap: 10px; color: var(--text) !important; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.admin .sec h2 { display: flex; justify-content: space-between; align-items: center; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
