/* ─── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand palette */
  --rose-50:   #FDF5F3;
  --rose-100:  #FAE8E3;
  --rose-200:  #F4C9BE;
  --rose-300:  #ECA898;
  --rose-400:  #E08070;
  --rose-500:  #C9614E;
  --rose-600:  #A84A3A;
  --rose-700:  #7D3328;

  --cream-50:  #FFFCF9;
  --cream-100: #FAF5EF;
  --cream-200: #F0E6D8;
  --cream-300: #E2CDB8;
  --cream-400: #C9AD94;

  --text-primary:   #1C0F0B;
  --text-secondary: #6B4C42;
  --text-tertiary:  #A8887E;
  --text-inverse:   #FDF5F3;

  --surface-0: rgba(253, 245, 243, 0.75);
  --surface-1: rgba(250, 232, 227, 0.6);
  --surface-2: rgba(244, 201, 190, 0.4);

  --border:    rgba(200, 140, 120, 0.2);
  --border-md: rgba(200, 140, 120, 0.35);

  /* Layout */
  --sidebar-w: 240px;
  --np-h:      90px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  /* Spotify green for the connect button only */
  --spotify: #1DB954;
  --spotify-hover: #1AA34A;
}

html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream-100);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

/* ─── AMBIENT BACKGROUND ──────────────────────────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.ambient__blob--1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #F4C9BE 0%, transparent 70%);
  top: -200px; left: -150px;
  animation: blobDrift1 18s ease-in-out infinite alternate;
}
.ambient__blob--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #ECA898 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation: blobDrift2 22s ease-in-out infinite alternate;
}
.ambient__blob--3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #E2CDB8 0%, transparent 70%);
  top: 40%; left: 40%;
  animation: blobDrift3 26s ease-in-out infinite alternate;
}
.ambient__grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.04;
  mix-blend-mode: multiply;
}

@keyframes blobDrift1 {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(80px, 60px) scale(1.15); }
}
@keyframes blobDrift2 {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-60px, -40px) scale(1.1); }
}
@keyframes blobDrift3 {
  from { transform: translate(0,0) scale(0.9); }
  to   { transform: translate(-80px, 60px) scale(1.1); }
}

/* ─── SCREENS ─────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen.hidden { display: none; }

/* ─── AUTH SCREEN ─────────────────────────────────────────────── */
.screen--auth { background: transparent; }

.auth__inner {
  text-align: center;
  max-width: 420px;
  padding: 3rem 2.5rem;
  background: var(--surface-0);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(24px);
  animation: fadeUp 0.6s ease both;
}

.auth__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2.5rem;
}
.auth__logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  color: var(--rose-600);
  letter-spacing: 0.04em;
}

.auth__headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(36px, 8vw, 52px);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.auth__headline em { color: var(--rose-500); font-style: italic; }

.auth__sub {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.btn-spotify {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--spotify);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-bottom: 1rem;
}
.btn-spotify:hover { background: var(--spotify-hover); transform: translateY(-1px); }
.btn-spotify:active { transform: scale(0.98); }

.auth__note {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ─── CALLBACK SCREEN ─────────────────────────────────────────── */
.screen--callback { background: var(--cream-100); }

.callback__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.spinner {
  width: 40px; height: 40px;
  border: 2px solid var(--rose-200);
  border-top-color: var(--rose-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.callback__text {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 300;
}

/* ─── MAIN APP LAYOUT ─────────────────────────────────────────── */
.screen--app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--np-h);
  grid-template-areas:
    "sidebar main"
    "sidebar nowplaying";
  align-items: stretch;
  background: transparent;
  animation: fadeIn 0.4s ease both;
}

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  background: var(--surface-0);
  border-right: 0.5px solid var(--border);
  backdrop-filter: blur(20px);
  padding: 20px 0;
  overflow: hidden;
  z-index: 20;
}

.sidebar__top { padding: 0 16px; }

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 0 4px;
}
.sidebar__logo span {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  font-weight: 400;
  color: var(--rose-600);
  letter-spacing: 0.04em;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  user-select: none;
}
.sidebar__link:hover { background: var(--surface-1); color: var(--text-primary); }
.sidebar__link.active {
  background: var(--surface-2);
  color: var(--rose-600);
  font-weight: 500;
}
.sidebar__link svg { flex-shrink: 0; opacity: 0.8; }

.sidebar__section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-weight: 400;
  padding: 0 20px;
  margin-bottom: 8px;
}

.sidebar__playlists {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rose-200) transparent;
}
.sidebar__playlists::-webkit-scrollbar { width: 3px; }
.sidebar__playlists::-webkit-scrollbar-track { background: transparent; }
.sidebar__playlists::-webkit-scrollbar-thumb { background: var(--rose-200); border-radius: 2px; }

.sidebar__playlist-list { padding: 0 8px; }

.sidebar__pl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}
.sidebar__pl-item:hover { background: var(--surface-1); }
.sidebar__pl-item.active { background: var(--surface-2); }

.sidebar__pl-thumb {
  width: 32px; height: 32px;
  border-radius: 4px;
  background: var(--rose-200);
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar__pl-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sidebar__pl-name {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.sidebar__bottom {
  padding: 12px 16px 0;
  border-top: 0.5px solid var(--border);
  margin-top: 8px;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--rose-300);
  color: var(--text-inverse);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.user__avatar img { width: 100%; height: 100%; object-fit: cover; }

.user__info { flex: 1; min-width: 0; }
.user__name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user__plan {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ─── MAIN CONTENT ────────────────────────────────────────────── */
.main-content {
  grid-area: main;
  overflow-y: auto;
  padding: 32px 36px;
  scrollbar-width: thin;
  scrollbar-color: var(--rose-200) transparent;
}
.main-content::-webkit-scrollbar { width: 4px; }
.main-content::-webkit-scrollbar-track { background: transparent; }
.main-content::-webkit-scrollbar-thumb { background: var(--rose-200); border-radius: 2px; }

/* ─── VIEWS ───────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.3s ease both; }

.view__header { margin-bottom: 28px; }

.view__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 34px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.view__sub {
  font-size: 14px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ─── SECTIONS ────────────────────────────────────────────────── */
.section { margin-bottom: 36px; }

.section__title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ─── FEATURED GRID (Recently Played) ────────────────────────── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.featured-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-0);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  transition: all 0.18s;
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.featured-item:hover { background: var(--surface-1); transform: translateY(-1px); }

.featured-item__thumb {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  background: var(--rose-200);
  flex-shrink: 0;
  overflow: hidden;
}
.featured-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.featured-item__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-skeleton {
  height: 70px;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  animation: shimmer 1.5s ease infinite alternate;
}

/* ─── CARDS ROW (Playlists / Albums) ──────────────────────────── */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface-0);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  transition: all 0.18s;
  backdrop-filter: blur(12px);
}
.card:hover { background: var(--surface-1); transform: translateY(-2px); }

.card__thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--rose-200);
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.card__thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose-400);
}

.card__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__sub {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-skeleton {
  height: 200px;
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  animation: shimmer 1.5s ease infinite alternate;
}

/* ─── ARTISTS ROW ─────────────────────────────────────────────── */
.cards-row--artists {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.card--artist .card__thumb {
  border-radius: 50%;
}

.artist-skeleton {
  height: 160px;
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  animation: shimmer 1.5s ease infinite alternate;
}

/* ─── SEARCH ──────────────────────────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-0);
  border: 0.5px solid var(--border-md);
  border-radius: 100px;
  padding: 10px 20px;
  max-width: 520px;
  backdrop-filter: blur(12px);
}
.search-box svg { color: var(--text-tertiary); flex-shrink: 0; }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 300;
}
.search-box input::placeholder { color: var(--text-tertiary); }

.search-results {
  margin-bottom: 28px;
}

.search-track {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s;
}
.search-track:hover { background: var(--surface-1); }

.search-track__num {
  width: 24px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: right;
  flex-shrink: 0;
}

.search-track__thumb {
  width: 42px; height: 42px;
  border-radius: 4px;
  background: var(--rose-200);
  flex-shrink: 0;
  overflow: hidden;
}
.search-track__thumb img { width: 100%; height: 100%; object-fit: cover; }

.search-track__info { flex: 1; min-width: 0; }
.search-track__title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-track__artist {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
}

.search-track__dur {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
  flex-shrink: 0;
}

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

.browse-item {
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  position: relative;
  min-height: 80px;
  transition: transform 0.15s;
}
.browse-item:hover { transform: scale(1.02); }
.browse-item span { position: relative; z-index: 1; }

/* ─── LIBRARY ─────────────────────────────────────────────────── */
.library-filters {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 100px;
  border: 0.5px solid var(--border-md);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { background: var(--surface-1); }
.filter-btn.active {
  background: var(--rose-500);
  color: #fff;
  border-color: var(--rose-500);
  font-weight: 500;
}

.library-list { margin-top: 8px; }

.library-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s;
}
.library-item:hover { background: var(--surface-1); }

.library-item__thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--rose-200);
  flex-shrink: 0;
  overflow: hidden;
}
.library-item__thumb.round { border-radius: 50%; }
.library-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.library-item__info { flex: 1; min-width: 0; }
.library-item__name {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-item__sub {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* ─── PLAYLIST / ALBUM VIEW ───────────────────────────────────── */
.view--playlist {
  padding-bottom: 24px;
}

.playlist-hero {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  padding: 0 0 28px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 24px;
}

.playlist-hero__art {
  width: 200px; height: 200px;
  border-radius: var(--radius-lg);
  background: var(--rose-200);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(160, 74, 58, 0.2);
}
.playlist-hero__art img { width: 100%; height: 100%; object-fit: cover; }

.playlist-hero__type {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-bottom: 8px;
}

.playlist-hero__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 10px;
}

.playlist-hero__meta {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 300;
  margin-bottom: 20px;
}

.playlist-hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-play-hero {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--rose-500);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-play-hero:hover { background: var(--rose-600); transform: translateY(-1px); }
.btn-play-hero:active { transform: scale(0.97); }

/* ─── TRACK LIST ──────────────────────────────────────────────── */
.track-list { padding: 0; }

.track-list-header {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 60px;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}
.track-list-header span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-weight: 400;
}
.track-list-header .th-dur { text-align: right; }

.track-item {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 60px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}
.track-item:hover { background: var(--surface-1); }
.track-item.playing .track-item__title { color: var(--rose-500); }

.track-item__num {
  font-size: 14px;
  color: var(--text-tertiary);
  text-align: right;
  font-weight: 300;
}
.track-item.playing .track-item__num { color: var(--rose-500); }

.track-item__main { display: flex; align-items: center; gap: 12px; min-width: 0; }

.track-item__thumb {
  width: 40px; height: 40px;
  border-radius: 4px;
  background: var(--rose-200);
  flex-shrink: 0;
  overflow: hidden;
}
.track-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

.track-item__title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-item__album {
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 300;
}
.track-item__dur {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: right;
  font-weight: 300;
}

/* ─── NOW PLAYING BAR ─────────────────────────────────────────── */
.now-playing {
  grid-area: nowplaying;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface-0);
  border-top: 0.5px solid var(--border);
  backdrop-filter: blur(24px);
  z-index: 20;
  height: var(--np-h);
}

.np__track {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.np__art {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: var(--rose-100);
  flex-shrink: 0;
  overflow: hidden;
  border: 0.5px solid var(--border);
}
.np__art img { width: 100%; height: 100%; object-fit: cover; }
.np__art-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose-300);
}

.np__info { flex: 1; min-width: 0; }
.np__title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np__artist {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np__heart { color: var(--text-tertiary); }
.np__heart.liked { color: var(--rose-500); }

.np__controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.ctrl-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.np__controls {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
}

.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ctrl-btn:hover { color: var(--text-primary); }
.ctrl-btn.active { color: var(--rose-500); }

.ctrl-btn--play {
  width: 42px; height: 42px;
  background: var(--rose-500);
  color: #fff !important;
  border-radius: 50%;
  transition: all 0.15s;
}
.ctrl-btn--play:hover { background: var(--rose-600); transform: scale(1.05); }
.ctrl-btn--play:active { transform: scale(0.96); }

.np__extra {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding-left: 8px;
}

.np__progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.np__time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 300;
  min-width: 30px;
  flex-shrink: 0;
}
.np__time:last-child { text-align: right; }

.progress-track {
  flex: 1;
  height: 3px;
  background: var(--rose-200);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.progress-track:hover .progress-bar::after { opacity: 1; }

.progress-bar {
  height: 100%;
  background: var(--rose-500);
  border-radius: 2px;
  position: relative;
  transition: width 0.2s linear;
  pointer-events: none;
}
.progress-bar::after {
  content: '';
  position: absolute;
  right: -5px; top: -4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--rose-500);
  opacity: 0;
  transition: opacity 0.15s;
}

.np__volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-track {
  flex: 1;
  height: 3px;
  background: var(--rose-200);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.volume-bar {
  height: 100%;
  background: var(--rose-400);
  border-radius: 2px;
  pointer-events: none;
}

/* ─── BUTTONS ─────────────────────────────────────────────────── */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-icon:hover { color: var(--text-primary); background: var(--surface-1); }

.btn-icon--lg { padding: 10px; }

/* ─── PLACEHOLDERS ────────────────────────────────────────────── */
.placeholder-list { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }
.placeholder-item {
  height: 46px;
  background: var(--surface-1);
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s ease infinite alternate;
}

@keyframes shimmer {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* ─── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  gap: 12px;
}
.empty-state svg { opacity: 0.4; }
.empty-state p { font-size: 15px; font-weight: 300; }

/* ─── TOAST ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--np-h) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text-primary);
  color: var(--cream-50);
  font-size: 13px;
  font-weight: 400;
  padding: 10px 22px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── HOME DECO HEADER ────────────────────────────────────────── */
.view__header--home {
  position: relative;
  background: var(--surface-0);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  margin-bottom: 32px;
  overflow: hidden;
  min-height: 120px;
  backdrop-filter: blur(12px);
}

.home-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.home-deco__svg {
  position: absolute;
  right: -20px;
  top: -20px;
  width: 600px;
  height: 320px;
  max-width: 70%;
}

.home-deco__text {
  position: relative;
  z-index: 1;
}

.home-deco__text .view__title {
  font-size: 42px;
}


* { scrollbar-width: thin; scrollbar-color: var(--rose-200) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rose-200); border-radius: 2px; }

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 24px 20px; }
}

@media (max-width: 680px) {
  .screen--app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr var(--np-h);
    grid-template-areas: "main" "nowplaying";
  }
  .sidebar { display: none; }
  .np__track { display: none; }
  .now-playing { grid-template-columns: 1fr 1fr; }
}

/* ─── EXPANDED NOW PLAYING ────────────────────────────────────── */
.exp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 15, 11, 0.5);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.exp-overlay.open { opacity: 1; pointer-events: all; }

.exp-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: min(480px, 100vw);
  max-height: 92vh;
  background: var(--cream-50);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 16px 32px 40px;
  z-index: 101;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
}
.exp-panel.open {
  transform: translateX(-50%) translateY(0);
}

.exp-close {
  display: flex;
  margin: 0 auto 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 6px;
  border-radius: 50%;
  transition: color 0.15s;
}
.exp-close:hover { color: var(--text-primary); }

.exp-art-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.exp-art {
  width: 280px;
  height: 280px;
  border-radius: var(--radius-lg);
  background: var(--rose-200);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(160, 74, 58, 0.25);
  transition: transform 0.3s ease;
}
.exp-art.playing {
  animation: artPulse 3s ease-in-out infinite alternate;
}
.exp-art img { width: 100%; height: 100%; object-fit: cover; }

@keyframes artPulse {
  from { transform: scale(1);    box-shadow: 0 20px 60px rgba(160,74,58,0.25); }
  to   { transform: scale(1.02); box-shadow: 0 28px 72px rgba(160,74,58,0.35); }
}

.exp-info { display: flex; flex-direction: column; gap: 20px; }

.exp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exp-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
}
.exp-artist {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 300;
  margin-top: 3px;
}

.exp-heart { color: var(--text-tertiary); }
.exp-heart.liked { color: var(--rose-500); }

.exp-progress { display: flex; flex-direction: column; gap: 6px; }

.exp-track {
  width: 100%;
  height: 4px;
  background: var(--rose-200);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.exp-track:hover .exp-fill::after { opacity: 1; }

.exp-fill {
  height: 100%;
  background: var(--rose-500);
  border-radius: 2px;
  position: relative;
  pointer-events: none;
  transition: width 0.2s linear;
}
.exp-fill::after {
  content: '';
  position: absolute;
  right: -6px; top: -5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--rose-500);
  opacity: 0;
  transition: opacity 0.15s;
}

.exp-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
}

.exp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ctrl-btn--play-lg {
  width: 58px !important;
  height: 58px !important;
}

.exp-volume {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exp-vol-track {
  flex: 1;
  height: 3px;
  background: var(--rose-200);
  border-radius: 2px;
  cursor: pointer;
}
.exp-vol-fill {
  height: 100%;
  background: var(--rose-400);
  border-radius: 2px;
  pointer-events: none;
}
