:root{
  --green:#1db954;
  --bg:#121212;
  --panel:#181818;
  --panel2:#202020;
  --hover:#282828;
  --text:#ffffff;
  --sub:#b3b3b3;
  --border:#2a2a2a;
  --shadow: 0 12px 28px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  overflow:hidden;
}

a{color:inherit; text-decoration:none}
button{font-family:inherit}

.app{
  height:100vh;
  display:flex;
}

/* Sidebar (Spotify-like) */
.sidebar{
  width:260px;
  background:#000;
  padding:16px 14px;
  display:flex;
  flex-direction:column;
  gap:14px;
  border-right:1px solid #0a0a0a;
  transition: width .18s ease, transform .18s ease;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:10px;
}
.brand-badge{
  width:30px;height:30px;border-radius:50%;
  background:var(--green);
  display:grid;place-items:center;
  color:#000;font-weight:900;
}
.brand-name{
  font-weight:900;
  letter-spacing:.2px;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:10px;
  color:var(--sub);
  user-select:none;
}
.nav a:hover{background:#121212; color:#fff}
.nav a.active{background:#121212; color:#fff}

.sidebar-footer{
  margin-top:auto;
  padding:10px 12px;
  color:var(--sub);
  font-size:12px;
  line-height:1.35;
  opacity:.9;
}

/* Collapsed sidebar */
body.sidebar-collapsed .sidebar{
  width:86px;
}
body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .nav span,
body.sidebar-collapsed .sidebar-footer{
  display:none;
}
body.sidebar-collapsed .nav a{
  justify-content:center;
}

/* Main */
.main{
  flex:1;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

/* Topbar (sticky) */
.topbar{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background: linear-gradient(180deg, #1b1b1b, #121212);
  border-bottom:1px solid #1a1a1a;
}

.icon-btn{
  width:38px;height:38px;
  border-radius:50%;
  border:none;
  background:#0b0b0b;
  color:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.icon-btn:hover{background:#161616}
.icon-btn:disabled{
  opacity:.35; cursor:not-allowed;
}

.searchbox{
  flex:1;
  display:flex;
  align-items:center;
  gap:10px;
  max-width:720px;
  background:#fff;
  border-radius:999px;
  padding:10px 12px;
  color:#000;
}
.searchbox input{
  border:none; outline:none;
  flex:1;
  font-size:14px;
  background:transparent;
}
.chip{
  color:#000;
  background:#eaeaea;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
}

/* Content */
.content{
  overflow:auto;
  padding:16px 16px 120px;
}
.h1{
  font-size:26px;
  font-weight:900;
  margin:12px 0 10px;
}
.h2{
  font-size:18px;
  font-weight:900;
  margin:18px 0 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.subtle{color:var(--sub)}

.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap:16px;
}

.row{
  display:flex;
  gap:14px;
  overflow:auto;
  padding-bottom:4px;
  scroll-snap-type: x proximity;
}
.row::-webkit-scrollbar{height:10px}
.row::-webkit-scrollbar-thumb{background:#2a2a2a; border-radius:999px}
.row::-webkit-scrollbar-track{background:transparent}

.card{
  background:var(--panel);
  padding:14px;
  border-radius:12px;
  cursor:pointer;
  position:relative;
  transition: background .14s ease, transform .14s ease;
  min-width: 170px;
  max-width: 220px;
  scroll-snap-align: start;
}
.card:hover{background:var(--hover); transform: translateY(-2px)}
.card img{
  width:100%;
  aspect-ratio:1/1;
  border-radius:10px;
  object-fit:cover;
  display:block;
  box-shadow: var(--shadow);
}
.card .title{
  margin-top:10px;
  font-weight:800;
  font-size:14px;
  line-height:1.2;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.card .meta{
  margin-top:6px;
  font-size:13px;
  color:var(--sub);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.play-fab{
  position:absolute;
  right:16px;
  top:128px;
  width:46px;height:46px;
  border-radius:50%;
  background:var(--green);
  color:#000;
  display:grid;
  place-items:center;
  font-weight:900;
  opacity:0;
  transform: translateY(10px);
  transition: opacity .14s ease, transform .14s ease;
  box-shadow: 0 12px 26px rgba(0,0,0,.45);
}
.card:hover .play-fab{
  opacity:1;
  transform: translateY(0);
}

/* Track page */
.track-hero{
  display:flex;
  gap:18px;
  align-items:flex-end;
  padding:18px;
  border-radius:16px;
  background: linear-gradient(135deg, #2b2b2b, #141414);
  border:1px solid #1f1f1f;
}
.track-hero img{
  width:180px;
  height:180px;
  border-radius:14px;
  object-fit:cover;
  box-shadow: var(--shadow);
}
.track-hero .kicker{
  color:var(--sub);
  font-size:12px;
  letter-spacing:.12em;
}
.track-hero .name{
  font-size:34px;
  font-weight:1000;
  margin:6px 0 6px;
  line-height:1.05;
}
.track-hero .by{
  color:var(--sub);
  font-size:14px;
}
.hero-actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.btn{
  border:none;
  cursor:pointer;
  border-radius:999px;
  padding:10px 16px;
  font-weight:900;
}
.btn.primary{background:var(--green); color:#000}
.btn.secondary{background:#2a2a2a; color:#fff}
.btn.secondary:hover{background:#343434}

.panel{
  margin-top:14px;
  background:var(--panel);
  border:1px solid #202020;
  border-radius:14px;
  padding:14px;
}
.panel-title{
  font-weight:900;
  margin:0 0 10px;
}
.lyrics{
  white-space:pre-wrap;
  line-height:1.45;
  color:#e9e9e9;
}
.empty{
  color:var(--sub);
  padding:10px 0;
}

/* Player */
.player{
  position:fixed;
  left:0; right:0; bottom:0;
  height:92px;
  background:#181818;
  border-top:1px solid var(--border);
  display:none;
  align-items:center;
  justify-content:space-between;
  padding:0 16px;
  gap:14px;
}
.player-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 240px;
}
.player-cover{
  width:56px;height:56px;
  border-radius:10px;
  object-fit:cover;
}
.player-meta{
  display:flex;
  flex-direction:column;
  gap:2px;
  max-width: 320px;
}
.player-song{
  font-weight:900;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.player-artist{
  font-size:12px;
  color:var(--sub);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.player-center{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  flex:1;
}
.player-controls{
  display:flex;
  align-items:center;
  gap:10px;
}
.pbtn{
  width:38px;height:38px;
  border-radius:50%;
  border:none;
  background:none;
  color:#fff;
  cursor:pointer;
}
.pbtn:hover{background:#232323}
.pbtn.play{
  background:#fff;
  color:#000;
}
.pbtn.play:hover{background:#eaeaea}

.progress{
  width:min(520px, 52vw);
  height:4px;
  background:#2a2a2a;
  border-radius:999px;
  overflow:hidden;
  cursor:pointer;
}
.progress > div{
  height:100%;
  width:0%;
  background:#fff;
}
.player-right{
  min-width: 220px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  color:var(--sub);
  font-size:12px;
}

/* Mobile */
.mobile-only{display:none}
.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:none;
}

@media (max-width: 860px){
  body{overflow:hidden}
  .sidebar{
    position:fixed;
    left:0; top:0; bottom:0;
    transform: translateX(-102%);
    z-index:50;
    width:280px;
  }
  body.sidebar-open .sidebar{
    transform: translateX(0);
  }
  .overlay{display:none; z-index:40}
  body.sidebar-open .overlay{display:block}
  .mobile-only{display:inline-grid}
}
