:root {
  --bg: #000000;
  --surface: #121212;
  --surface-hover: #1f1f1f;
  --border: rgba(255,255,255,0.08);
  --text: #ffffff;
  --text-sub: #b3b3b3;
  --text-muted: #727272;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 999px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; 
}
button, input { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; outline: none; }
.icon { width: 24px; height: 24px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }

@media (max-width: 899px) { #desktop-ui { display: none !important; } }
@media (min-width: 900px) { #mobile-ui { display: none !important; } }

/* DESKTOP UI */
#desktop-ui { display: grid; grid-template-columns: 280px 1fr 340px; grid-template-rows: 1fr 90px; grid-template-areas: "sidebar main right" "player player player"; height: 100vh; background: #050505; gap: 12px; padding: 12px; }
.sidebar { grid-area: sidebar; background: var(--surface); border-radius: var(--radius-md); display: flex; flex-direction: column; padding: 20px 12px; overflow: hidden; }
.logo { font-size: 20px; font-weight: 800; padding: 0 16px 20px; display: flex; align-items: center; gap: 12px; letter-spacing: -0.5px; }
.logo-mark { width: 34px; height: 34px; background: #fff; color: #000; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 16px; }
.nav-item { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: var(--radius-full); color: var(--text-sub); font-weight: 600; cursor: pointer; transition: all 0.2s; margin-bottom: 6px; }
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--surface-hover); }
.nav-item.active .icon { stroke-width: 2.5px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); font-weight: 700; margin: 24px 16px 12px; }

.main { grid-area: main; background: var(--surface); border-radius: var(--radius-md); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.topbar { padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; background: rgba(18,18,18,0.8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.search-wrap { display: flex; align-items: center; gap: 12px; background: #000; border-radius: var(--radius-full); padding: 12px 20px; width: 100%; max-width: 400px; border: 1px solid var(--border); transition: 0.2s; }
.search-wrap:focus-within { border-color: #555; background: var(--surface-hover); }
.search-wrap input { flex: 1; font-size: 14px; font-weight: 500; }
.user-chip { display: flex; align-items: center; gap: 10px; background: #000; padding: 4px 12px 4px 4px; border-radius: var(--radius-full); border: 1px solid var(--border); cursor: pointer; transition: 0.2s; }
.user-chip:hover { border-color: #555; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #333; }

.content-scroll { flex: 1; overflow-y: auto; padding: 10px 24px 40px; }
.content-scroll::-webkit-scrollbar { width: 8px; }
.content-scroll::-webkit-scrollbar-thumb { background: #333; border-radius: var(--radius-full); }
h1 { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin-bottom: 24px; }

.loader-line { height: 2px; background: #333; overflow: hidden; display: none; margin-bottom: 16px; border-radius: 2px; }
.loader-line.active { display: block; }
.loader-line::after { content: ''; display: block; width: 50%; height: 100%; background: #fff; animation: slide 1s infinite linear; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(200%); } }

.track-list { display: flex; flex-direction: column; gap: 4px; }
.track-row { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.2s; }
.track-row:hover { background: var(--surface-hover); }
.track-num { width: 24px; text-align: right; color: var(--text-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.track-row:hover .track-num { display: none; }
.track-play-icon { width: 24px; display: none; justify-content: center; }
.track-row:hover .track-play-icon { display: flex; }
.track-cover { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; background: #222; }
.track-info { flex: 1; min-width: 0; }
.track-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.track-artist { font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-dur { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-right: 16px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text-sub); transition: 0.2s; }
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.1); }
.icon-btn.active { color: #fff; }
.icon-btn.active svg { fill: #fff; stroke: #fff; }

.right-panel { grid-area: right; background: var(--surface); border-radius: var(--radius-md); padding: 24px; display: flex; flex-direction: column; overflow: hidden; }
.right-panel h3 { font-size: 16px; font-weight: 700; margin-bottom: 24px; }
.np-cover { width: 100%; aspect-ratio: 1; border-radius: var(--radius-md); object-fit: cover; margin-bottom: 20px; background: #222; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.np-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.np-artist { font-size: 15px; color: var(--text-sub); margin-bottom: 24px; }
.np-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: auto; }

.player-desktop { grid-area: player; background: var(--surface); border-radius: var(--radius-md); display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; padding: 0 24px; gap: 16px; }
.player-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.player-left img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; background: #222; flex-shrink: 0; }
.player-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.player-controls { display: flex; align-items: center; gap: 24px; }
.btn-play { width: 48px; height: 48px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; transition: transform 0.1s; }
.btn-play:hover { transform: scale(1.05); }
.btn-play:active { transform: scale(0.95); }
.btn-play svg { fill: #000; stroke: none; }
.progress-row { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 500px; }
.time { font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; width: 36px; text-align: center; }
.progress-bar { flex: 1; height: 4px; background: #333; border-radius: var(--radius-full); cursor: pointer; position: relative; overflow: hidden; }
.progress-fill { height: 100%; background: #fff; border-radius: var(--radius-full); width: 0%; }
.progress-bar:hover .progress-fill { background: #1ed760; }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.volume-wrap { display: flex; align-items: center; gap: 8px; }
.volume-slider { width: 100px; height: 4px; -webkit-appearance: none; appearance: none; background: #333; border-radius: var(--radius-full); outline: none; cursor: pointer; }
.volume-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; background: #fff; border-radius: 50%; cursor: pointer; transition: transform 0.15s; }
.volume-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.volume-slider::-moz-range-thumb { width: 12px; height: 12px; background: #fff; border-radius: 50%; cursor: pointer; border: none; }

/* MOBILE UI */
#mobile-ui { width: 100%; height: 100vh; height: 100dvh; background: var(--bg); display: flex; flex-direction: column; position: relative; }
.m-header { padding: 20px 20px 12px; display: flex; align-items: center; justify-content: space-between; }
.m-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.m-scroll { flex: 1; overflow-y: auto; padding: 0 20px 120px; }
.m-search { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius-full); padding: 14px 20px; margin-bottom: 20px; }
.m-search input { flex: 1; font-size: 15px; }

.m-track-list { display: flex; flex-direction: column; gap: 4px; }
.m-track-row { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: var(--radius-md); transition: background 0.2s; cursor: pointer; }
.m-track-row:active { background: var(--surface-hover); }
.m-track-row img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; background: #222; }
.m-track-info { flex: 1; min-width: 0; }
.m-track-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.m-track-artist { font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.m-mini-player { position: absolute; bottom: 70px; left: 12px; right: 12px; background: var(--surface-hover); border-radius: var(--radius-md); display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; cursor: pointer; transition: transform 0.3s; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,0.6); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.05); }
.m-mini-player img { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; }
.m-mini-info { flex: 1; min-width: 0; }
.m-mini-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-mini-artist { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-mini-play { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,0.1); border-radius: 50%; }
.m-mini-play svg { fill: currentColor; stroke: none; }

.m-tabbar { position: absolute; bottom: 0; left: 0; right: 0; height: 64px; background: #000; border-top: 1px solid var(--border); display: flex; padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 40; }
.m-tabbar-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); font-size: 10px; font-weight: 600; transition: color 0.2s; }
.m-tabbar-btn.active { color: var(--text); }

.m-full-player { position: absolute; inset: 0; background: #080808; z-index: 100; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; padding: 24px 20px; border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.m-full-player.open { transform: translateY(0); }
.m-fp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.m-fp-artwork { width: 100%; aspect-ratio: 1; border-radius: var(--radius-lg); object-fit: cover; margin-bottom: 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.6); background: #222; }
.m-fp-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.m-fp-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.m-fp-artist { font-size: 16px; color: var(--text-sub); }
.m-fp-progress { height: 6px; background: #333; border-radius: var(--radius-full); margin-bottom: 10px; cursor: pointer; overflow: hidden; }
.m-fp-progress-fill { height: 100%; background: #fff; border-radius: var(--radius-full); width: 0%; }
.m-fp-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; margin-bottom: 30px; }
.m-fp-controls { display: flex; justify-content: space-between; align-items: center; }
.m-fp-controls .btn-play { width: 72px; height: 72px; }
.m-fp-controls .btn-play svg { width: 32px; height: 32px; }