:root {
  --bg: #121212;
  --sidebar-bg: #000000;
  --card-bg: #181818;
  --card-bg-hover: #282828;
  --text: #ffffff;
  --text-dim: #b3b3b3;
  --accent: #1db954;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
}

.spotify-shell {
  display: flex;
  height: calc(100vh - 90px);
}

.sidebar {
  width: 230px;
  flex: 0 0 auto;
  background: var(--sidebar-bg);
  padding: 1.5rem 1rem;
}

.sidebar-brand {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 2rem;
}

.sidebar-nav { display: flex; flex-direction: column; gap: .3rem; }

.sidebar-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  padding: .5rem .6rem;
  border-radius: 4px;
}

.sidebar-link:hover { color: var(--text); }
.sidebar-link.active { color: var(--text); background: var(--card-bg); }

.main-panel {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem 3rem;
}

.page-title { font-size: 1.8rem; margin: 0 0 1.5rem; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.3rem;
}

.album-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: background .2s ease;
  position: relative;
}

.album-card:hover { background: var(--card-bg-hover); }

.album-card .art-wrap { position: relative; margin-bottom: .8rem; }

.album-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.play-fab {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 8px 16px rgba(0,0,0,.4);
}

.album-card:hover .play-fab { opacity: 1; transform: translateY(0); }

.album-card .title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card .subtitle {
  color: var(--text-dim);
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-btn {
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: .9rem;
  cursor: pointer;
  padding: 0 0 1.2rem;
}

.back-btn:hover { color: var(--text); }

.album-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.album-header img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,.6);
}

.eyebrow {
  text-transform: uppercase;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: .05em;
}

.album-header h1 { font-size: 2.4rem; margin: .3rem 0; }
.album-header p { color: var(--text-dim); margin: 0; }

.album-description {
  color: var(--text-dim);
  font-size: .9rem;
  line-height: 1.5;
  max-width: 640px;
  margin: 0 0 1.5rem;
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.track-row:hover { background: rgba(255,255,255,.08); }
.track-row.playing { color: var(--accent); }

.track-row .idx { color: var(--text-dim); width: 1.6rem; text-align: right; }
.track-row.playing .idx { color: var(--accent); }
.track-row .dur { margin-left: auto; color: var(--text-dim); font-size: .85rem; }

.now-playing-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 90px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  background: #181818;
  border-top: 1px solid #282828;
}

.np-track { display: flex; align-items: center; gap: .8rem; width: 260px; flex: 0 0 auto; }

.np-track img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  background: #282828;
}

.np-title { font-size: .9rem; font-weight: 600; }
.np-artist { font-size: .8rem; color: var(--text-dim); }

.now-playing-bar audio { flex: 1; }

@media (max-width: 700px) {
  .spotify-shell { flex-direction: column; height: auto; min-height: calc(100vh - 130px); }

  .sidebar {
    width: 100%;
    padding: .8rem 1rem;
  }
  .sidebar-brand { margin-bottom: .6rem; font-size: 1.1rem; }
  .sidebar-nav { flex-direction: row; gap: 1.2rem; overflow-x: auto; }
  .sidebar-link { padding: .3rem 0; white-space: nowrap; }
  .sidebar-link.active { background: none; text-decoration: underline; }

  .main-panel { padding: 1.2rem 1rem calc(130px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 1.3rem; }

  .album-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .8rem; }

  .play-fab { opacity: 1; transform: none; width: 36px; height: 36px; font-size: .9rem; }

  .album-header {
    flex-direction: column;
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: 1.2rem;
  }
  .album-header img { width: 140px; height: 140px; }
  .album-header h1 { font-size: 1.5rem; }

  .track-row { padding: .5rem .4rem; gap: .6rem; }

  .now-playing-bar {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: .4rem;
    padding: .5rem .8rem calc(.6rem + env(safe-area-inset-bottom));
  }
  .np-track { width: auto; flex: 0 0 auto; min-width: 0; }
  .np-track img { width: 40px; height: 40px; }
  .np-title, .np-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .now-playing-bar audio { width: 100%; max-width: none; flex: none; }
}
