/* =============================================================
   SADEWA MUSIC — STYLE (look & feel ala Spotify)
   Palet: hitam pekat + abu gelap + aksen ungu
   ============================================================= */

:root {
  --bg: #121212;
  --bg-elev: #1A1A1A;
  --bg-elev-2: #232323;
  --bg-elev-3: #2d2d2d;
  --bg-top: #0d0d0d;
  --accent: #6C3FC5;
  --accent-d: #5a32a8;
  --accent-soft: rgba(108,63,197,.18);
  --text: #ffffff;
  --text-sub: #b3b3b3;
  --text-dim: #6a6a6a;
  --radius: 10px;
  --pb-h: 92px;          /* tinggi player bar desktop */
  --sidebar-w: 256px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; }
::selection { background: var(--accent); color: #fff; }

/* ---- scrollbar ---- */
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #5a5a5a; background-clip: content-box; }

/* ---- logo mark ---- */
.logo-mark {
  display: inline-block; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent);
  position: relative; flex: none;
}
.logo-mark::after {
  content: ''; position: absolute; inset: 7px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 40% 60%, #000 0 2px, transparent 2px 4px);
  opacity: .85;
}
.logo-mark.big { width: 64px; height: 64px; }

/* ---- splash boot ---- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 18px; background: var(--bg); color: var(--text-sub); z-index: 50;
}

/* =============================================================
   LAYOUT
   ============================================================= */
#app { height: 100%; display: flex; flex-direction: column; }

.layout {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 8px;
  padding: 8px 8px 0;
}

/* ---- SIDEBAR ---- */
.sidebar {
  background: var(--bg-elev);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 22px 14px; cursor: pointer;
}
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.3px; }

.side-nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px; border-radius: 6px;
  color: var(--text-sub); font-weight: 700; font-size: 15px;
  transition: color .15s;
}
.nav-item svg { width: 24px; height: 24px; flex: none; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); }

.side-collection { padding: 10px 10px 0; }
.side-collection-label {
  padding: 8px 14px 4px; color: var(--text-dim); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px;
}
.nav-sub-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 9px 14px; border-radius: 6px;
  color: var(--text-sub); font-weight: 600; font-size: 14px;
}
.nav-sub-item svg { width: 19px; height: 19px; flex: none; }
.nav-sub-item:hover { color: var(--text); background: var(--bg-elev-2); }
.nav-sub-item.active { color: var(--text); background: var(--bg-elev-2); }

.btn-artist {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin: 14px 12px 16px; padding: 12px 14px;
  border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent); font-weight: 700; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.btn-artist svg { width: 17px; height: 17px; }
.btn-artist:hover { background: var(--accent); color: #fff; }

.side-section {
  margin: 14px 8px 0; padding: 8px 4px;
  background: var(--bg-elev); border-radius: var(--radius);
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.side-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px 10px; color: var(--text-sub); font-weight: 700; font-size: 14px;
}
.side-playlists { overflow-y: auto; padding: 0 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-pl {
  text-align: left; padding: 8px 10px; border-radius: 6px;
  color: var(--text-sub); font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-pl:hover { color: var(--text); background: var(--bg-elev-2); }
.side-hint { padding: 8px 12px; color: var(--text-dim); font-size: 13px; line-height: 1.5; }

/* ---- MAIN ---- */
.main {
  background: linear-gradient(180deg, #1f1f1f 0%, var(--bg-elev) 220px);
  border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px; flex: none;
  position: sticky; top: 0; z-index: 30;
}
.top-nav-btns { display: flex; gap: 8px; flex: none; }
.icon-btn { display: inline-grid; place-content: center; color: var(--text-sub); border-radius: 50%; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { color: var(--text); }
.icon-btn.circle { width: 32px; height: 32px; background: rgba(0,0,0,.5); color: #fff; }
.icon-btn.circle:hover { background: rgba(0,0,0,.7); }

.top-right { display: flex; align-items: center; gap: 8px; position: relative; }

/* ---- TOP SEARCH ---- */
.topsearch { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.topsearch-ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-sub); pointer-events: none; }
.topsearch-ic svg { width: 20px; height: 20px; }
.topsearch-input {
  width: 100%; background: var(--bg-elev-2); color: #fff; border: 1px solid transparent;
  border-radius: 999px; padding: 11px 16px 11px 46px; font-size: 14px; font-weight: 500;
  transition: background .15s, border-color .15s;
}
.topsearch-input::placeholder { color: var(--text-sub); }
.topsearch-input:focus { outline: none; background: var(--bg-elev-3); border-color: var(--accent); }
.topsearch.open .topsearch-dropdown { display: block; }
.topsearch-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-elev-3); border-radius: 10px; padding: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); max-height: 420px; overflow-y: auto; z-index: 40;
}
.topsearch-label { padding: 8px 10px 6px; color: var(--text-sub); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.topsearch-empty { padding: 14px 10px; color: var(--text-sub); font-size: 13.5px; }
.topsearch-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.topsearch-item:hover { background: var(--bg-elev-2); }
.topsearch-item-ic { color: var(--text-sub); flex: none; }
.topsearch-item-ic svg { width: 16px; height: 16px; }
.topsearch-item-cover { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; flex: none; background: var(--bg-elev-2); }
.topsearch-item-cover.round { border-radius: 50%; }
.topsearch-item-text { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topsearch-item-tag { color: var(--text-dim); font-size: 11px; font-weight: 700; text-transform: uppercase; flex: none; }
.topsearch-item-x { color: var(--text-dim); flex: none; }
.topsearch-item-x svg { width: 14px; height: 14px; }
.topsearch-item-x:hover { color: #fff; }
.topsearch-seeall { color: var(--accent); font-weight: 700; justify-content: center; }

/* ---- TOMBOL TOPBAR KANAN: APK + Artis ---- */
.btn-apk, .btn-artist-top {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px;
  white-space: nowrap; transition: filter .15s, transform .12s;
}
.btn-apk { background: var(--accent); color: #fff; }
.btn-apk:hover { filter: brightness(1.15); transform: scale(1.03); }
.btn-apk svg { width: 15px; height: 15px; }

.btn-artist-top {
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
}
.btn-artist-top:hover { background: var(--accent); color: #fff; transform: scale(1.03); }
.btn-artist-top svg { width: 15px; height: 15px; }

@media (max-width: 600px) {
  .btn-apk span, .btn-artist-top span { display: none; }
  .btn-apk, .btn-artist-top { padding: 8px; border-radius: 50%; }
}
.profile-menu-wrap { display: flex; align-items: center; gap: 8px; position: relative; flex: none; }
.chev { display: inline-grid; place-content: center; }
.chev svg { width: 16px; height: 16px; }
.user-menu button { display: flex; align-items: center; gap: 10px; }
.user-menu button svg { width: 17px; height: 17px; }
.user-menu-sep { border: none; border-top: 1px solid #3a3a3a; margin: 4px 6px; }
.top-link { color: var(--text-sub); font-weight: 700; padding: 8px 16px; }
.top-link:hover { color: var(--text); }
.btn-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--text);
  border: 1px solid #7a7a7a; border-radius: 999px;
  padding: 9px 18px; font-weight: 700; font-size: 14px;
}
.btn-pill svg { width: 18px; height: 18px; }
.btn-pill:hover { border-color: #fff; transform: scale(1.03); }
.btn-pill.solid { background: #fff; color: #000; border: none; }
.btn-pill.solid:hover { background: #f0f0f0; transform: scale(1.04); }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.6); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer;
}
.user-chip:hover { background: rgba(0,0,0,.8); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-d); color: #fff;
  display: grid; place-content: center; font-weight: 800; font-size: 14px; }
.user-name { font-weight: 700; font-size: 14px; }
.user-menu {
  position: absolute; top: 48px; right: 0; min-width: 160px;
  background: var(--bg-elev-3); border-radius: 6px; padding: 4px; display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.user-menu.open { display: block; }
.user-menu button { width: 100%; text-align: left; padding: 10px 12px; border-radius: 4px; font-size: 14px; }
.user-menu button:hover { background: var(--bg-elev-2); }

/* ---- VIEW (scroll area) ---- */
.view { flex: 1; overflow-y: auto; padding: 0 24px calc(var(--pb-h) + 32px); }
.page { max-width: 1400px; }
.home-hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 8px 0 22px; }

.block-h, .block-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin: 26px 0 14px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; }

/* ---- CARD ROW ---- */
.card-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 180px; justify-content: start;
  gap: 20px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.card-row::-webkit-scrollbar { height: 0; }

.card {
  background: var(--bg-elev); border-radius: var(--radius);
  padding: 14px; transition: background .25s; cursor: pointer;
  scroll-snap-align: start; outline: none;
}
.card:hover { background: var(--bg-elev-3); }
.card:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.card-cover { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); background: var(--bg-elev-3); }
.card-cover.round { border-radius: 50%; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--text-sub); font-size: 13px; margin-top: 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-artist { text-align: center; }
.cover-mosaic {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  width: 100%; height: 100%; gap: 1px; background: var(--bg-elev-3);
}
.cover-mosaic img { width: 100%; height: 100%; object-fit: cover; }

.card-play {
  position: absolute; right: 8px; bottom: 8px; width: 48px; height: 48px;
  border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-content: center;
  opacity: 0; transform: translateY(8px); transition: .25s;
  box-shadow: 0 8px 16px rgba(0,0,0,.5);
}
.card-play svg { width: 26px; height: 26px; }
.card:hover .card-play { opacity: 1; transform: translateY(0); }
.card-play:hover { transform: scale(1.06); background: var(--accent); }

/* ---- TRACK LIST ---- */
.track-list { margin-top: 8px; }
.track-row {
  display: grid; grid-template-columns: 28px 44px 1fr auto auto;
  align-items: center; gap: 14px;
  padding: 8px 12px; border-radius: 6px; cursor: pointer;
}
.track-row:hover { background: var(--bg-elev-2); }
.track-row.playing .track-name { color: var(--accent); }
.track-index { color: var(--text-sub); font-size: 15px; text-align: center; }
.track-cover { width: 44px; height: 44px; border-radius: 4px; overflow: hidden; background: var(--bg-elev-3); }
.track-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-meta { min-width: 0; }
.track-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { color: var(--text-sub); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.track-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.track-row:hover .track-actions { opacity: 1; }
.track-actions .icon-btn svg { width: 18px; height: 18px; }
.row-like.active { color: var(--accent); opacity: 1; }
.row-dl.active { color: var(--accent); opacity: 1; }
.track-row:hover .row-like.active, .track-row:hover .row-dl.active { opacity: 1; }
.track-actions .active { opacity: 1; }
.track-time { color: var(--text-sub); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---- DETAIL HEADER ---- */
.detail-head {
  display: flex; gap: 24px; align-items: flex-end;
  padding: 32px 0 24px; margin-bottom: 8px;
}
.detail-cover { width: 200px; height: 200px; border-radius: 6px; overflow: hidden; flex: none;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); background: var(--bg-elev-3); }
.detail-cover.round { border-radius: 50%; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.detail-kind { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.detail-title { font-size: clamp(32px, 6vw, 72px); font-weight: 900; letter-spacing: -2px; line-height: 1; }
.detail-sub { color: var(--text-sub); font-size: 14px; max-width: 60ch; }
.btn-play-lg {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-content: center; margin-top: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,.4); transition: transform .15s;
}
.btn-play-lg svg { width: 28px; height: 28px; }
.btn-play-lg:hover { transform: scale(1.06); }

/* ---- SEARCH ---- */
.search-bar { position: relative; max-width: 420px; margin: 8px 0 18px; }
.search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #000; }
.search-ic svg { width: 22px; height: 22px; }
.search-input {
  width: 100%; background: #fff; color: #000; border: none;
  border-radius: 999px; padding: 13px 16px 13px 46px; font-size: 15px; font-weight: 500;
}
.search-input:focus { outline: 2px solid var(--accent); }

/* ---- AUTH PAGES ---- */
.auth-page { min-height: 100%; display: grid; place-items: center; padding: 40px 16px; }
.auth-card {
  width: 100%; max-width: 420px; background: rgba(0,0,0,.4);
  border-radius: 12px; padding: 40px 32px; text-align: center;
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 18px; margin-bottom: 24px; }
.auth-title { font-size: 26px; font-weight: 800; margin-bottom: 28px; letter-spacing: -.4px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.field {
  background: #121212; border: 1px solid #3a3a3a; color: #fff;
  border-radius: 6px; padding: 13px 14px; font-size: 15px;
}
.field:focus { outline: none; border-color: #fff; }
.btn-green {
  background: var(--accent); color: #fff; font-weight: 800; font-size: 16px;
  border-radius: 999px; padding: 14px; margin-top: 6px; transition: transform .12s, filter .12s;
}
.btn-green:hover { transform: scale(1.02); filter: brightness(1.05); }
.btn-green:disabled { opacity: .6; cursor: default; transform: none; }
.form-err { color: #f15e6c; font-size: 13px; min-height: 16px; }
.auth-alt { text-align: center; color: var(--text-sub); font-size: 14px; margin-top: 10px; }
.auth-alt a { color: #fff; text-decoration: underline; }

/* checkbox setuju syarat (register) */
.auth-terms {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim); cursor: pointer; margin: 4px 0;
}
.auth-terms input { width: 16px; height: 16px; cursor: pointer; }
.auth-terms a { color: var(--accent); text-decoration: none; }

/* ---- GENRE ---- */
.genre-row { display: flex; flex-wrap: wrap; gap: 10px; }
.genre-chip {
  padding: 10px 20px; border-radius: 999px; background: var(--bg-elev-2);
  color: var(--text); font-weight: 700; font-size: 14px; transition: background .15s, transform .15s;
}
.genre-chip:hover { background: var(--accent); transform: scale(1.04); }

.search-q { font-size: 22px; font-weight: 800; margin: 8px 0 18px; letter-spacing: -.3px; }

/* ---- PROFIL ---- */
.profile-page { padding: 48px 12px; max-width: 460px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%; background: var(--accent-d); color: #fff;
  display: grid; place-content: center; font-size: 36px; font-weight: 800; margin-bottom: 14px;
}
.profile-page h1 { font-size: 26px; font-weight: 800; }
.profile-email { color: var(--text-sub); font-size: 14px; margin-bottom: 18px; }
.empty { padding: 48px 12px; text-align: center; color: var(--text-sub); }
.empty .btn-pill { margin-top: 16px; }
.premium { padding: 60px 12px; max-width: 600px; }
.premium h1 { font-size: 40px; font-weight: 900; letter-spacing: -1px; margin-bottom: 16px; }
.premium p { color: var(--text-sub); font-size: 16px; line-height: 1.6; margin-bottom: 24px; }

.lib-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 18px; }
.lib-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }

.lib-quicklinks { display: flex; gap: 10px; margin-bottom: 24px; }
.lib-qlink {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--bg-elev-2); border-radius: 999px; font-weight: 700; font-size: 13.5px;
}
.lib-qlink svg { width: 16px; height: 16px; }
.lib-qlink:hover { background: var(--bg-elev-3); }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 8px 0 18px; }

/* ---- SKELETON ---- */
.skeleton { pointer-events: none; }
.sk, .sk-line { background: linear-gradient(90deg, #1f1f1f 25%, #2a2a2a 37%, #1f1f1f 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 4px; }
.card-cover.sk { aspect-ratio: 1; margin-bottom: 14px; }
.sk-line { height: 12px; margin-top: 8px; }
.sk-line.short { width: 60%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* =============================================================
   PLAYER BAR (persisten)
   ============================================================= */
.player-bar {
  height: var(--pb-h); flex: none;
  background: var(--bg-elev); border-top: 1px solid #282828;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 16px; gap: 16px;
  cursor: pointer;
}
.pb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pb-tap-area { display: flex; align-items: center; gap: 14px; min-width: 0; cursor: pointer; }
.pb-cover { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; background: var(--bg-elev-3); flex: none; }
.pb-info { min-width: 0; }
.pb-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist { color: var(--text-sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pb-like { flex: none; }
.pb-like svg { width: 18px; height: 18px; }
.pb-like.active { color: var(--accent); }

.pb-center { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(40vw, 540px); }
.pb-controls { display: flex; align-items: center; gap: 18px; }
.pb-controls .icon-btn svg { width: 18px; height: 18px; }
.pb-controls .icon-btn.active { color: var(--accent); }
.pb-controls .icon-btn.repeat-one,
.np-controls .icon-btn.repeat-one { position: relative; }
.pb-controls .icon-btn.repeat-one::after,
.np-controls .icon-btn.repeat-one::after {
  content: '1'; position: absolute; top: -4px; right: -6px;
  width: 13px; height: 13px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 800; line-height: 13px; text-align: center;
}
.pb-play {
  width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #000;
  display: grid; place-content: center; transition: transform .12s;
}
.pb-play svg { width: 20px; height: 20px; }
.pb-play:hover { transform: scale(1.07); }

.pb-progress { display: flex; align-items: center; gap: 10px; width: 100%; }
.pb-time { color: var(--text-sub); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 36px; text-align: center; }

input[type=range].pb-seek, input[type=range].pb-vol {
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #fff var(--p, 0%), #4d4d4d var(--p, 0%));
  cursor: pointer; flex: 1;
}
input[type=range].pb-seek { width: 100%; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff;
  opacity: 0; transition: opacity .15s;
}
.pb-progress:hover input[type=range]::-webkit-slider-thumb,
.pb-right:hover input[type=range]::-webkit-slider-thumb { opacity: 1; }
.pb-progress:hover input[type=range].pb-seek,
.pb-right:hover input[type=range].pb-vol {
  background: linear-gradient(90deg, var(--accent) var(--p, 0%), #4d4d4d var(--p, 0%));
}
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: #fff; }

.pb-right { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.pb-right .icon-btn svg { width: 19px; height: 19px; }
.pb-vol-wrap { position: relative; display: flex; align-items: center; }
.pb-vol-icon { color: var(--text-sub); }
.pb-vol-icon svg { width: 20px; height: 20px; }
.pb-vol {
  width: 0; opacity: 0; margin-left: 0; overflow: hidden;
  transition: width .18s ease, opacity .18s ease, margin-left .18s ease;
}
.pb-vol-wrap.open .pb-vol { width: 84px; opacity: 1; margin-left: 8px; }

.pb-mini-play { display: none; width: 36px; height: 36px; color: #fff; place-content: center; }
.pb-mini-play svg { width: 26px; height: 26px; }

/* =============================================================
   MOBILE NAV
   ============================================================= */
.mobile-nav { display: none; }

/* ---- TOAST ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--pb-h) + 16px); transform: translate(-50%, 20px);
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #e53e3e; color: #fff; }
.toast.info { background: var(--bg-elev-3); color: #fff; }

/* =============================================================
   RESPONSIVE — MOBILE
   ============================================================= */
@media (max-width: 860px) {
  :root { --pb-h: 64px; }
  .layout { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .sidebar { display: none; }
  .main { border-radius: 0; background: linear-gradient(180deg, #1f1f1f 0%, var(--bg-elev) 180px); }
  .topbar { padding: 12px 16px; }
  .top-nav-btns { display: none; }
  .topsearch { max-width: none; }
  .topsearch-input { padding: 9px 14px 9px 40px; font-size: 13px; }
  .user-chip .user-name { display: none; }
  .user-menu { right: -8px; }
  .view { padding: 0 16px calc(var(--pb-h) + 76px); }
  .home-hero h1 { font-size: 24px; }
  .card-row { grid-auto-columns: minmax(140px, 42vw); gap: 14px; }
  .detail-head { flex-direction: column; align-items: center; text-align: center; padding-top: 16px; }
  .detail-cover { width: 160px; height: 160px; }
  .detail-title { letter-spacing: -1px; }
  .btn-play-lg { align-self: center; }

  .player-bar {
    position: fixed; left: 8px; right: 8px; bottom: 64px; height: var(--pb-h);
    border-radius: 8px; border: none; grid-template-columns: 1fr auto; gap: 10px;
    padding: 0 12px; background: #2a2118;
    background: linear-gradient(90deg, #3a2d20, #2a2118);
  }
  .pb-center, .pb-right { display: none; }
  .pb-left { gap: 10px; }
  .pb-cover { width: 44px; height: 44px; }
  .player-bar::after { content: ''; }
  .player-bar .pb-mini-play { display: grid; }

  .mobile-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 20;
    background: #101010; border-top: 1px solid #222;
  }
  .mnav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--text-sub); font-size: 11px; font-weight: 600;
  }
  .mnav-item svg { width: 24px; height: 24px; }
  .mnav-item.active { color: #fff; }

  .toast { bottom: calc(64px + var(--pb-h) + 12px); }

  /* ---- NOW PLAYING di HP: pastikan semua tombol muat ---- */
  /* Overlay bisa di-scroll penuh, artwork dibatasi supaya kontrol
     + tombol aksi (Simpan/Bagikan/Timer) tetap terlihat. */
  .np-overlay { -webkit-overflow-scrolling: touch; }
  .np-body { padding: 16px 20px 40px; }
  .np-art-wrap {
    max-width: min(70vw, 320px);
    max-height: 44vh;
    margin: 0 auto 18px;
  }
  .np-meta-row { margin-bottom: 12px; }
  .np-progress { margin-bottom: 12px; }
  .np-controls { margin-bottom: 18px; }
  .np-actions { gap: 8px; }
  .np-action { padding: 12px 4px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =============================================================
   SIDE PANEL — Antrean / Lirik (overlay kanan)
   ============================================================= */
.side-panel {
  position: fixed; top: 8px; right: 8px; bottom: calc(var(--pb-h) + 16px); width: 360px;
  background: var(--bg-elev); border-radius: var(--radius);
  transform: translateX(calc(100% + 16px)); transition: transform .25s ease;
  z-index: 25; display: flex; flex-direction: column; overflow: hidden;
}
.side-panel.open { transform: translateX(0); }
.sp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; flex: none; }
.sp-tabs { display: flex; gap: 4px; }
.sp-tab { padding: 7px 14px; border-radius: 999px; color: var(--text-sub); font-weight: 700; font-size: 13.5px; }
.sp-tab.active { background: var(--bg-elev-3); color: #fff; }
.sp-body { flex: 1; overflow-y: auto; padding: 4px 10px 14px; }

.sp-track { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; cursor: pointer; }
.sp-track:hover { background: var(--bg-elev-2); }
.sp-track.active { background: var(--accent-soft); }
.sp-track img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; flex: none; background: var(--bg-elev-3); }
.sp-track-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-track.active .sp-track-title { color: var(--accent); }
.sp-track-artist { color: var(--text-sub); font-size: 12.5px; margin-top: 2px; }

.sp-lyrics-head { padding: 6px 6px 16px; }
.lyrics-loading, .lyrics-text { padding: 0 6px; color: var(--text-sub); font-size: 14px; line-height: 1.9; }
.lyrics-text { font-family: inherit; white-space: pre-wrap; color: #e8e8e8; }

@media (max-width: 1100px) { .side-panel { width: min(360px, calc(100vw - 16px)); } }
@media (max-width: 860px) { .side-panel { display: none; } }

/* ---- Lirik sinkron di SIDE PANEL (berjalan) ---- */
.lrc-container {
  padding: 8px 6px 40vh;
}
.lrc-line {
  margin: 0;
  padding: 10px 4px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: color .25s ease, transform .25s ease, opacity .25s ease;
  opacity: 0.55;
  transform-origin: left center;
}
.lrc-line:hover { color: var(--text); opacity: 0.85; }
.lrc-line.active {
  color: var(--accent);
  opacity: 1;
  transform: scale(1.04);
  font-weight: 800;
}

/* baris lirik besar (lirik penuh yang menggantikan artwork) */
.lrc-line.big {
  font-size: 17px;
  line-height: 1.5;
  padding: 9px 0;
  color: rgba(255,255,255,0.45);
  font-weight: 700;
  text-align: center;
  opacity: 1;
  /* PENTING: origin di tengah, kalau warisan 'left center' teks
     bergeser ke kanan saat membesar -> terlihat miring */
  transform-origin: center center;
}
.lrc-line.big:hover { color: rgba(255,255,255,0.75); opacity: 1; }
.lrc-line.big.active {
  color: #fff;
  transform: scale(1.06);
  text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}
.lrc-loading, .lrc-empty {
  text-align: center; color: rgba(255,255,255,0.6); padding: 40px 20px;
}
.np-lyrics-plain {
  color: rgba(255,255,255,0.85); white-space: pre-wrap;
  text-align: center; line-height: 1.8; font-size: 16px;
}

/* =============================================================
   NOW PLAYING — layar penuh, gradient mengikuti warna cover
   ============================================================= */
.np-overlay {
  --np-color: var(--accent-d);
  position: fixed; inset: 0; z-index: 60;
  background: linear-gradient(180deg, var(--np-color) 0%, #121212 78%);
  transform: translateY(100%); transition: transform .3s ease;
  display: flex; flex-direction: column; overflow-y: auto;
}
.np-overlay.open { transform: translateY(0); }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 6px; flex: none; }
.np-head .icon-btn svg { width: 24px; height: 24px; }
.np-head-label { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; color: rgba(255,255,255,.85); }
/* Dua tombol toggle di pojok kanan atas: Gambar | Lirik */
.np-view-toggle { display: flex; gap: 2px; }
.np-view-btn {
  width: 38px; height: 38px; border-radius: 50%;
  color: rgba(255,255,255,.55);
  transition: background .2s, color .2s;
}
.np-view-btn svg { width: 21px; height: 21px; }
.np-view-btn:hover { color: rgba(255,255,255,.9); }
.np-view-btn.active { background: rgba(255,255,255,.18); color: #fff; }

.np-body { flex: 1; display: flex; flex-direction: column; padding: 24px 28px 36px; max-width: 480px; margin: 0 auto; width: 100%; }

/* ---- Artwork jadi wadah untuk lirik overlay ---- */
.np-art-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  margin-bottom: 28px;
}
.np-art-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* Scrim gelap di bawah artwork supaya lirik terbaca */
.np-art-scrim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 45%;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.45) 55%,
    rgba(0,0,0,0.82) 100%);
  opacity: 0;
  transition: opacity .3s ease;
}
.np-art-wrap:has(.np-lyric-strip.show) .np-art-scrim { opacity: 1; }

/* Strip lirik 2 baris di depan artwork (bagian bawah) */
.np-lyric-strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 18px 18px;
  text-align: center;
  cursor: pointer;
  display: none;
}
.np-lyric-strip.show { display: block; }
.np-strip-cur {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.np-strip-next {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Overlay lirik PENUH (saat strip di-tap) ---- */
/* Lirik penuh MENGGANTIKAN artwork (berada di dalam .np-art-wrap) */
.np-full-lyrics {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(180deg,
    var(--np-color, #1a1a2e) 0%, rgba(8,8,16,0.97) 60%);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 10;
}
.np-full-lyrics.open { opacity: 1; visibility: visible; }
.np-full-scroll {
  flex: 1; overflow-y: auto;
  padding: 40% 16px;      /* ruang atas-bawah supaya baris aktif bisa ke tengah */
  text-align: center;
  scrollbar-width: none;
}
.np-full-scroll::-webkit-scrollbar { width: 0; }

.np-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.np-meta { min-width: 0; }
.np-title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { color: rgba(255,255,255,.75); font-size: 14px; margin-top: 4px; }
.np-like { flex: none; }
.np-like svg { width: 24px; height: 24px; }
.np-like.active { color: #fff; }

.np-progress { margin-bottom: 18px; }
.np-seek {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #fff var(--p,0%), rgba(255,255,255,.25) var(--p,0%));
  cursor: pointer;
}
.np-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.np-times { display: flex; justify-content: space-between; margin-top: 6px; color: rgba(255,255,255,.7); font-size: 12px; font-variant-numeric: tabular-nums; }

.np-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.np-controls .icon-btn svg { width: 24px; height: 24px; color: rgba(255,255,255,.85); }
.np-controls .icon-btn.active { color: var(--accent); }
.np-controls .icon-btn.active svg { color: var(--accent); }
.np-play {
  width: 70px; height: 70px; border-radius: 50%; background: #fff; color: #121212;
  display: grid; place-content: center; box-shadow: 0 10px 24px rgba(0,0,0,.4);
}
.np-play svg { width: 32px; height: 32px; }

.np-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.np-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px; border-radius: 12px; background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85); font-size: 12px; font-weight: 600;
}
.np-action svg { width: 20px; height: 20px; }
.np-action:hover { background: rgba(255,255,255,.16); }

@media (min-width: 861px) {
  .np-overlay { background: linear-gradient(135deg, var(--np-color) 0%, #121212 65%); }
  .np-body { padding: 48px 28px 56px; max-width: 460px; }
  .np-art-wrap { max-width: 360px; margin: 0 auto 28px; }
}

/* =============================================================
   TEMA TERANG (opsional, lewat dropdown profil)
   ============================================================= */
:root[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --bg-elev-2: #ececec;
  --bg-elev-3: #e0e0e0;
  --text: #121212;
  --text-sub: #5a5a5a;
  --text-dim: #8a8a8a;
}
:root[data-theme="light"] .main { background: linear-gradient(180deg, #eee 0%, var(--bg-elev) 220px); }
:root[data-theme="light"] .topsearch-input { color: #121212; }
:root[data-theme="light"] .btn-pill.solid { background: #121212; color: #fff; }
:root[data-theme="light"] .btn-pill.solid:hover { background: #2a2a2a; }
:root[data-theme="light"] ::selection { color: #fff; }
:root[data-theme="light"] .lrc-line { color: #9a9aa8; }
:root[data-theme="light"] .lrc-line.active { color: var(--accent); }
