/* ============================================================
   AURORA MUSIC — design tokens
   Palette: near-black night sky + a flowing aurora gradient
   (teal → violet → pink) reserved for one signature accent.
   Type: Space Grotesk (display) + Inter (body/UI).
   ============================================================ */
:root {
  --bg-base: #0a0b0f;
  --bg-sidebar: #0d0f14;
  --bg-elevated: #14161d;
  --bg-elevated-2: #1b1e27;
  --bg-hover: #21242e;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-primary: #f3f4f8;
  --text-secondary: #9aa1b2;
  --text-tertiary: #676d7d;

  --aurora-teal: #3ce7c0;
  --aurora-violet: #8b6bff;
  --aurora-pink: #ef6fb5;
  --aurora-gradient: linear-gradient(100deg, var(--aurora-teal) 0%, var(--aurora-violet) 52%, var(--aurora-pink) 100%);

  --accent: #8b6bff;
  --danger: #ef6f6f;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  --shadow-elevated: 0 8px 30px rgba(0, 0, 0, 0.45);
  --player-height: 88px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
::selection { background: rgba(139, 107, 255, 0.35); }

.icon { display: block; flex-shrink: 0; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }

/* ============================================================
   App shell
   ============================================================ */
#app {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 1fr var(--player-height);
  height: 100vh;
  width: 100vw;
}

.sidebar {
  grid-row: 1 / 2;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.sidebar-aurora {
  position: absolute;
  top: -120px;
  left: -60px;
  width: 320px;
  height: 260px;
  background: radial-gradient(closest-side, rgba(60,231,192,0.16), transparent 70%),
              radial-gradient(closest-side, rgba(139,107,255,0.14), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 22px 18px;
  position: relative;
  z-index: 1;
}
.brand .icon { color: var(--aurora-violet); }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  position: relative;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14.5px;
  font-weight: 500;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-item.active { color: var(--text-primary); background: var(--bg-elevated-2); }
.nav-item.active .icon { color: var(--aurora-teal); }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 18px;
}

.sidebar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 10px 24px;
}
.sidebar-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.playlist-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.playlist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  width: 100%;
  text-align: left;
}
.playlist-row:hover, .playlist-row.active { background: var(--bg-hover); color: var(--text-primary); }
.playlist-row-cover {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  color: var(--text-tertiary);
}
.playlist-row-cover img { width: 100%; height: 100%; object-fit: cover; }
.playlist-row-meta { display: flex; flex-direction: column; overflow: hidden; }
.playlist-row-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-row-sub { font-size: 12px; color: var(--text-tertiary); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* ============================================================
   Main / topbar / views
   ============================================================ */
.main {
  grid-row: 1 / 2;
  overflow-y: auto;
  position: relative;
  background: linear-gradient(180deg, rgba(139,107,255,0.06), transparent 320px), var(--bg-base);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 32px;
  backdrop-filter: blur(14px);
  background: rgba(10, 11, 15, 0.72);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }

.topbar-nav { display: flex; gap: 6px; }
.round-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-elevated-2); border: none; color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
}
.round-btn:hover { background: var(--bg-hover); }

.search-box {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  color: var(--text-secondary);
}
.search-box:focus-within { border-color: var(--border-strong); }
.search-box input {
  border: none; background: transparent; outline: none; color: var(--text-primary);
  font-size: 14px; width: 100%;
}
.search-box .icon { color: var(--text-tertiary); }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elevated-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 4px 12px 4px 4px; color: var(--text-primary);
  font-size: 13.5px; font-weight: 500;
}
.user-menu-btn:hover { background: var(--bg-hover); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--aurora-gradient);
  display: flex; align-items: center; justify-content: center; color: #0a0b0f; font-weight: 700; font-size: 11px;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 34px; }

.btn {
  border: none; border-radius: var(--radius-pill); font-weight: 600; font-size: 13.5px;
  padding: 9px 20px; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--text-primary); color: #0a0b0f; }
.btn-primary:hover { transform: scale(1.03); }
.btn-gradient { background: var(--aurora-gradient); color: #0a0b0f; }
.btn-gradient:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-text { background: transparent; color: var(--text-secondary); padding: 6px 8px; }
.btn-text:hover { color: var(--text-primary); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.view {
  padding: 8px 32px 48px;
}

.view-header {
  display: flex; align-items: flex-end; gap: 24px; margin: 12px 0 28px;
}
.view-header .cover-xl {
  width: 168px; height: 168px; border-radius: var(--radius-lg);
  background: var(--bg-elevated-2); box-shadow: var(--shadow-elevated);
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
  overflow: hidden; flex-shrink: 0;
}
.view-header .cover-xl img { width: 100%; height: 100%; object-fit: cover; }
.view-eyebrow { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.view-title {
  font-family: var(--font-display);
  font-size: 42px; font-weight: 600; line-height: 1.08; margin: 8px 0 10px;
  letter-spacing: -0.5px;
}
.view-sub { color: var(--text-secondary); font-size: 13.5px; display: flex; gap: 6px; align-items: center; }

.section-title {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600; margin: 0 0 16px;
  letter-spacing: -0.2px;
}
.section {
  margin-bottom: 38px;
}
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.link-more { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.link-more:hover { color: var(--text-primary); }

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

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  border: 1px solid transparent;
  transition: background .15s ease;
}
.card:hover { background: var(--bg-elevated-2); border-color: var(--border); }
.card-cover {
  position: relative;
  width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius-sm);
  background: var(--bg-elevated-2); margin-bottom: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
}
.card-cover.round { border-radius: 50%; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-play {
  position: absolute; right: 8px; bottom: 8px;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--aurora-gradient); color: #0a0b0f;
  display: flex; align-items: center; justify-content: center;
  border: none; opacity: 0; transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.card:hover .card-play { opacity: 1; transform: translateY(0); }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Track list (table-like rows) */
.track-list { display: flex; flex-direction: column; }
.track-list-head {
  display: grid; grid-template-columns: 32px 1fr 160px 90px 44px;
  gap: 14px; padding: 0 14px 8px; border-bottom: 1px solid var(--border);
  color: var(--text-tertiary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.track-row {
  display: grid; grid-template-columns: 32px 1fr 160px 90px 44px;
  gap: 14px; align-items: center; padding: 9px 14px; border-radius: var(--radius-sm);
}
.track-row:hover { background: var(--bg-elevated); }
.track-row.playing .track-index { color: var(--aurora-teal); }
.track-row.playing .track-title { color: var(--aurora-teal); }
.track-index { color: var(--text-tertiary); font-size: 13.5px; text-align: center; position: relative; }
.track-index .icon { display: none; }
.track-row:hover .track-index span { display: none; }
.track-row:hover .track-index .icon { display: block; margin: 0 auto; color: var(--text-primary); }
.track-index.show-icon span { display: none; }
.track-index.show-icon .icon { display: block; margin: 0 auto; }
.track-index button { background: none; border: none; color: inherit; width: 100%; display: flex; justify-content: center; padding: 0; }
.track-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.track-cover {
  width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg-elevated-2);
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
  overflow: hidden; flex-shrink: 0;
}
.track-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-meta { min-width: 0; }
.track-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-album { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-duration { font-size: 13px; color: var(--text-secondary); text-align: right; }
.track-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.track-actions .icon-btn { opacity: 0; }
.track-row:hover .track-actions .icon-btn, .track-actions .icon-btn.liked { opacity: 1; }
.icon-btn.liked { color: var(--aurora-pink); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px 20px; color: var(--text-secondary);
  gap: 14px;
}
.empty-state .icon { color: var(--text-tertiary); }
.empty-state-title { font-family: var(--font-display); font-size: 20px; color: var(--text-primary); font-weight: 600; }
.empty-state code {
  background: var(--bg-elevated-2); padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12.5px;
  border: 1px solid var(--border);
}

/* ============================================================
   Player bar
   ============================================================ */
.player {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  align-items: center;
  padding: 0 16px;
  position: relative;
}
.player::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--aurora-gradient);
  opacity: 0.9;
}

.player-track { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-cover {
  width: 54px; height: 54px; border-radius: var(--radius-sm); background: var(--bg-elevated-2);
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); overflow: hidden; flex-shrink: 0;
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-meta { min-width: 0; }
.player-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player-center { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 24px; }
.player-controls { display: flex; align-items: center; gap: 18px; }
.player-controls button { background: transparent; border: none; color: var(--text-secondary); display: flex; }
.player-controls button:hover { color: var(--text-primary); }
.player-controls .play-btn { color: var(--text-primary); }
.player-controls button.toggled { color: var(--aurora-teal); }

.player-seek { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; }
.player-time { font-size: 11.5px; color: var(--text-tertiary); min-width: 34px; text-align: center; }
.seek-track {
  flex: 1; height: 4px; border-radius: 4px; background: var(--bg-elevated-2);
  position: relative; cursor: pointer;
}
.seek-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--aurora-gradient); }
.seek-thumb {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-primary); transform: translate(-50%, -50%); opacity: 0; transition: opacity .1s;
}
.seek-track:hover .seek-thumb { opacity: 1; }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
#autoplay-toggle-btn { background: transparent; border: none; color: var(--text-secondary); display: flex; }
#autoplay-toggle-btn:hover { color: var(--text-primary); }
#autoplay-toggle-btn.toggled { color: var(--aurora-teal); }
#queue-toggle-btn { background: transparent; border: none; color: var(--text-secondary); display: flex; }
#queue-toggle-btn:hover { color: var(--text-primary); }
#queue-toggle-btn.toggled { color: var(--aurora-teal); }
#sleep-timer-btn { background: transparent; border: none; color: var(--text-secondary); display: flex; }
#sleep-timer-btn:hover { color: var(--text-primary); }
#sleep-timer-btn.toggled { color: var(--aurora-teal); }
.volume-group { display: flex; align-items: center; gap: 8px; width: 130px; }
.volume-group button { background: transparent; border: none; color: var(--text-secondary); display: flex; }
.volume-track { flex: 1; height: 4px; border-radius: 4px; background: var(--bg-elevated-2); position: relative; cursor: pointer; }
.volume-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--text-secondary); }

/* ============================================================
   Modals
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5, 6, 9, 0.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 420px; padding: 28px; box-shadow: var(--shadow-elevated);
  max-height: 86vh; overflow-y: auto;
}
.modal-wide { max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; background: var(--bg-elevated-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; color: var(--text-primary); font-size: 14px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 70px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }
.form-error-banner {
  background: rgba(239, 111, 111, 0.12); border: 1px solid rgba(239, 111, 111, 0.3); color: #ff9a9a;
  border-radius: var(--radius-sm); padding: 10px 13px; font-size: 13px; margin-bottom: 16px;
}
.form-toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.switch { position: relative; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; background: var(--bg-elevated-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); transition: background .15s;
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-secondary); transition: transform .15s, background .15s;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: #0a0b0f; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.auth-screen {
  height: 100vh; width: 100vw; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(60,231,192,0.10), transparent 45%),
              radial-gradient(circle at 80% 30%, rgba(139,107,255,0.12), transparent 45%),
              radial-gradient(circle at 50% 90%, rgba(239,111,181,0.08), transparent 40%),
              var(--bg-base);
  position: relative;
  overflow: hidden;
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-elevated); position: relative; z-index: 1;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand .icon { color: var(--aurora-violet); }
.auth-brand span { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.auth-title { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-bottom: 6px; }
.auth-sub { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-secondary); }
.auth-switch button { background: none; border: none; color: var(--aurora-violet); font-weight: 600; font-size: inherit; }

.picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; margin: -4px -8px 0; padding: 4px 8px; }
.picker-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--text-primary); text-align: left; width: 100%; }
.picker-row:hover { background: var(--bg-hover); }
.picker-row-cover { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--bg-elevated-2); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }
.picker-row-cover img { width: 100%; height: 100%; object-fit: cover; }
.picker-row-name { font-size: 13.5px; font-weight: 500; }
.picker-row-sub { font-size: 12px; color: var(--text-secondary); }
.picker-row .icon { margin-left: auto; color: var(--aurora-teal); }

.toast-stack { position: fixed; bottom: calc(var(--player-height) + 20px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--bg-elevated-2); border: 1px solid var(--border-strong); color: var(--text-primary);
  padding: 10px 18px; border-radius: var(--radius-pill); font-size: 13.5px; box-shadow: var(--shadow-elevated);
  animation: toast-in .18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.hidden { display: none !important; }

.avatar-upload { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.avatar-upload-btn { position: relative; cursor: pointer; }
.avatar-upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.avatar-upload-hint { color: var(--text-secondary); font-size: 12.5px; }

.cover-upload {
  width: 168px; height: 168px; border-radius: var(--radius-lg); background: var(--bg-elevated-2);
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
  cursor: pointer; position: relative; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border);
}
.cover-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cover-upload img { width: 100%; height: 100%; object-fit: cover; }
.cover-upload-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35); opacity: 0; transition: opacity .15s;
}
.cover-upload:hover .cover-upload-overlay { opacity: 1; }

@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .player { grid-column: 1 / 2; grid-template-columns: 1fr; }
  .player-right, .player-track { display: none; }
}

/* ============================================================
   Queue panel
   ============================================================ */
.queue-panel {
  position: fixed;
  right: 16px;
  bottom: calc(var(--player-height) + 12px);
  width: 340px;
  max-height: 60vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.queue-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.queue-panel-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.queue-panel-list { overflow-y: auto; padding: 6px; }
.queue-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px;
  border-radius: var(--radius-sm); cursor: grab;
}
.queue-row:hover { background: var(--bg-hover); }
.queue-row.current { background: var(--bg-elevated-2); }
.queue-row.current .queue-row-title { color: var(--aurora-teal); }
.queue-row.drag-over { box-shadow: inset 0 2px 0 var(--aurora-violet); }
.queue-row-cover {
  width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--bg-elevated-2);
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); overflow: hidden; flex-shrink: 0;
}
.queue-row-cover img { width: 100%; height: 100%; object-fit: cover; }
.queue-row-meta { flex: 1; min-width: 0; }
.queue-row-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-row-artist { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-row-remove { opacity: 0; background: none; border: none; color: var(--text-secondary); display: flex; }
.queue-row:hover .queue-row-remove { opacity: 1; }
.queue-row-remove:hover { color: var(--text-primary); }
.queue-empty { padding: 24px 16px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.queue-section-label { padding: 10px 12px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }

/* ============================================================
   Context menu (right-click-style popover for track rows)
   ============================================================ */
.context-menu {
  position: fixed;
  min-width: 190px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 6px;
  z-index: 150;
}
.context-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: var(--radius-sm); border: none; background: transparent;
  color: var(--text-primary); font-size: 13.5px; text-align: left;
}
.context-menu-item:hover { background: var(--bg-hover); }
.context-menu-divider { height: 1px; background: var(--border); margin: 5px 4px; }

/* Drag-and-drop reordering within a playlist */
.track-row[draggable="true"] { cursor: grab; }
.track-row.drag-over { box-shadow: inset 0 2px 0 var(--aurora-violet); }
.track-row.dragging { opacity: 0.4; }

/* ============================================================
   Genre browse tiles
   ============================================================ */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.genre-tile {
  position: relative; height: 100px; border-radius: var(--radius-md); overflow: hidden;
  display: flex; align-items: flex-end; padding: 14px; font-family: var(--font-display);
  font-size: 16px; font-weight: 600; color: #0a0b0f;
}
.genre-tile span { position: relative; z-index: 1; }
.genre-tile::after {
  content: ''; position: absolute; right: -10px; bottom: -14px; width: 64px; height: 64px;
  border-radius: 50%; background: rgba(10,11,15,0.16); transform: rotate(18deg);
}

/* ============================================================
   Now Playing / lyrics modal
   ============================================================ */
.now-playing-modal { display: flex; gap: 28px; max-width: 640px; width: 100%; }
.now-playing-cover {
  width: 220px; height: 220px; border-radius: var(--radius-lg); background: var(--bg-elevated-2);
  box-shadow: var(--shadow-elevated); flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
}
.now-playing-cover img { width: 100%; height: 100%; object-fit: cover; }
.now-playing-info { min-width: 0; flex: 1; }
.now-playing-lyrics {
  white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; color: var(--text-secondary);
  max-height: 260px; overflow-y: auto; margin-top: 14px; padding-right: 8px;
}
