:root {
  --bg: #0b0e14;
  --bg-secondary: #0f1319;
  --card: #151921;
  --border: #21262d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #d4a017;
  --accent-hover: #b8880f;
  --accent-glow: rgba(212, 160, 23, 0.15);
  --green: #27ae60;
  --red: #e74c3c;
  --yellow: #f1c40f;
  --radius: 12px;
  --shadow: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg: #f0f2f5;
  --bg-secondary: #ffffff;
  --card: #e8eaed;
  --border: #d0d4da;
  --text: #0d1117;
  --muted: #6b7280;
  --accent: #c4900e;
  --accent-hover: #a87a0c;
  --accent-glow: rgba(196, 144, 14, 0.12);
  --shadow: rgba(0, 0, 0, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: pageIn 0.35s ease;
  transition: background 0.2s, color 0.2s;
}

/* ── Top bar ── */
.top-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-bar .guild-icon { width: 32px; height: 32px; border-radius: 8px; }
.top-bar h1 { font-size: 1rem; font-weight: 600; flex: 1; }
.top-bar .badge {
  background: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.5rem;
  color: #fff;
}
.top-bar .user-area { display: flex; align-items: center; gap: 0.5rem; }
.top-bar .user-avatar { width: 28px; height: 28px; border-radius: 50%; }
.top-bar .user-name { font-size: 0.85rem; color: var(--muted); }
.top-bar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}
.top-bar a:hover { color: var(--text); }

/* Theme toggle */
.theme-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.theme-toggle .material-symbols-outlined { font-size: 20px; }

/* ── Login / Guild Select ── */
.login-card,
.container {
  width: min(720px, calc(100% - 2rem));
  margin: 3.5rem auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 48px var(--shadow);
}

.login-card {
  padding: 2rem;
  text-align: center;
}

.login-card h1,
.container h2 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.login-card p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
}

.login-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.container {
  padding: 1.5rem;
}

.top-bar .name {
  font-size: 0.92rem;
  font-weight: 600;
}

.guilds {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.2rem;
}

.guild-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.guild-card:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-1px);
}

.guild-card img,
.guild-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.guild-card-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
}

.guild-card-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.2rem;
  flex: 1;
}

.guild-card-copy strong {
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-card-copy span {
  font-size: 0.84rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-card-arrow {
  color: var(--muted);
}

.guild-empty,
.footer {
  color: var(--muted);
}

.guild-empty {
  padding: 1rem 0.25rem 0.5rem;
}

.footer {
  margin-top: 1rem;
  font-size: 0.85rem;
  text-align: center;
}

/* ── Warning bar ── */
.warning-bar {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: #d4940020;
  border-bottom: 1px solid #d4940040;
  color: #d49400;
  font-size: 0.8rem;
}
.warning-bar .material-symbols-outlined { font-size: 16px; }

/* ── Layout ── */
.main-layout { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar controller ── */
.controller {
  width: 300px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  transition: background 0.2s;
}
.controller .artwork-container { position: relative; padding: 1.5rem; text-align: center; }
.controller .artwork {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px var(--shadow);
  transition: opacity 0.3s;
}
.controller .no-artwork {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  background: var(--card);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.controller .no-artwork .material-symbols-outlined { font-size: 64px; color: var(--muted); }
.controller .track-info { padding: 0 1.5rem; text-align: center; }
.controller .track-title {
  font-size: 1.05rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.controller .track-artist {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Position ── */
.position-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
}
.position-row span { font-size: 0.75rem; color: var(--muted); min-width: 36px; text-align: center; }
.position-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
  transition: height 0.15s;
}
.position-bar:hover { height: 6px; }
.position-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ── Controls ── */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.4rem 1rem;
}
.ctrl-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
.ctrl-btn:hover { color: var(--text); background: rgba(128, 128, 128, 0.1); }
.ctrl-btn.active { color: var(--accent); }
.ctrl-btn.primary { color: var(--text); }
.ctrl-btn .material-symbols-outlined { font-size: 24px; }
.ctrl-btn.primary .material-symbols-outlined { font-size: 38px; }

/* ── Volume ── */
.volume-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
}
.volume-row .material-symbols-outlined { font-size: 18px; color: var(--muted); }
.volume-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.volume-label { font-size: 0.75rem; color: var(--muted); min-width: 30px; text-align: right; }

/* ── EQ section ── */
.eq-section {
  padding: 0.6rem 1.5rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.eq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.eq-section .eq-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.eq-open-link {
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.eq-open-link:hover { color: var(--accent); background: var(--accent-glow); }
.eq-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.eq-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.eq-btn:hover { color: var(--text); border-color: var(--accent); }
.eq-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Right panel ── */
.right-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.search-container {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar .material-symbols-outlined { color: var(--muted); font-size: 20px; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}
.search-bar input::placeholder { color: var(--muted); opacity: 0.5; }
.search-play-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.2s;
  white-space: nowrap;
  min-height: 44px;
}
.search-play-btn:hover { background: var(--accent-hover); }
.search-play-btn .material-symbols-outlined { font-size: 18px; }

/* ── Queue ── */
.queue-section { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.queue-header h3 { font-size: 0.95rem; font-weight: 600; }
.queue-header .queue-count { color: var(--muted); font-size: 0.8rem; }
.queue-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.queue-empty .material-symbols-outlined { font-size: 48px; margin-bottom: 0.5rem; display: block; }

.q-track {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.5rem;
  border-radius: 8px;
  transition: background 0.15s;
  cursor: default;
  position: relative;
}
.q-track:hover { background: rgba(128, 128, 128, 0.07); }
.q-track .idx { color: var(--muted); font-size: 0.8rem; min-width: 22px; text-align: center; }
.q-track .thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--card);
}
.q-track .info { flex: 1; overflow: hidden; }
.q-track .info .title {
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-track .info .artist {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-track .duration { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }

/* ── Now playing banner ── */
.np-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  margin-bottom: 0.6rem;
  background: var(--accent-glow);
  border: 1px solid rgba(212, 160, 23, 0.3);
  border-radius: var(--radius);
}
.np-banner .thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.np-banner .info { flex: 1; overflow: hidden; }
.np-banner .info .label {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.np-banner .info .title {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-banner .info .artist { font-size: 0.8rem; color: var(--muted); }

/* ── Quick controls ── */
.np-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.np-ctrl {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s;
  font-family: inherit;
  min-height: 36px;
}
.np-ctrl:hover { color: var(--text); border-color: var(--accent); background: var(--accent-glow); }
.np-ctrl .material-symbols-outlined { font-size: 18px; }

/* ── Toasts ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}
.toast {
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
  max-width: 320px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(10px); } }

/* ── Not connected ── */
.not-connected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  flex: 1;
}
.not-connected .material-symbols-outlined { font-size: 64px; color: var(--muted); margin-bottom: 1rem; }
.not-connected h3 { margin-bottom: 0.5rem; }
.not-connected p { color: var(--muted); max-width: 360px; line-height: 1.5; }
.join-btn {
  margin-top: 1rem;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s;
  font-family: inherit;
  min-height: 44px;
}
.join-btn:hover { background: var(--accent-hover); }
.join-btn .material-symbols-outlined { font-size: 20px; }

/* ── Queue remove button ── */
.q-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 6px;
  opacity: 0;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0.3rem;
  min-width: 28px;
  min-height: 28px;
}
.q-remove .material-symbols-outlined { font-size: 18px; }
.q-track:hover .q-remove { opacity: 1; }
.q-remove:hover { color: var(--red); background: rgba(231, 76, 60, 0.1); }

/* ── Lyrics overlay ── */
.lyrics-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lyrics-overlay.active { display: flex; }
.lyrics-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.3) saturate(1.4);
  transform: scale(1.2);
  z-index: 0;
  animation: lyricsBgPulse 8s ease-in-out infinite alternate;
}
@keyframes lyricsBgPulse {
  0% { transform: scale(1.2); filter: blur(60px) brightness(0.3) saturate(1.4); }
  100% { transform: scale(1.3); filter: blur(70px) brightness(0.25) saturate(1.6); }
}
.lyrics-content {
  position: relative;
  z-index: 1;
  background: rgba(11, 14, 20, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
[data-theme="light"] .lyrics-content {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .lyrics-bg {
  filter: blur(60px) brightness(0.6) saturate(1.2);
}
.lyrics-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  min-width: 36px;
  min-height: 36px;
}
.lyrics-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.15); }
.lyrics-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .lyrics-header { border-bottom-color: rgba(0, 0, 0, 0.08); }
.lyrics-art { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.lyrics-meta { overflow: hidden; }
.lyrics-title {
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.lyrics-artist {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lyrics-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  line-height: 1.8;
  font-size: 0.95rem;
  color: rgba(230, 237, 243, 0.85);
  white-space: pre-wrap;
  word-break: break-word;
}
[data-theme="light"] .lyrics-body { color: rgba(13, 17, 23, 0.8); }
.lyrics-body::-webkit-scrollbar { width: 6px; }
.lyrics-body::-webkit-scrollbar-track { background: transparent; }
.lyrics-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
.lyrics-loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  color: var(--muted);
  padding: 2rem;
}
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page transition ── */
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Queue drag-and-drop ── */
.q-drag {
  color: var(--muted);
  cursor: grab;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.q-drag .material-symbols-outlined { font-size: 18px; }
.q-track:hover .q-drag { opacity: 0.6; }
.q-drag:hover { opacity: 1 !important; color: var(--accent); }
.q-track.q-dragging { opacity: 0.4; border: 1px dashed var(--accent); border-radius: 8px; }
.q-track.q-drag-over {
  background: var(--accent-glow);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ── Timed lyrics ── */
.lyrics-line {
  padding: 0.4rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(230, 237, 243, 0.3);
  transition: all 0.35s ease;
  cursor: pointer;
  border-radius: 6px;
  transform: scale(0.97);
  transform-origin: left center;
}
[data-theme="light"] .lyrics-line { color: rgba(13, 17, 23, 0.3); }
.lyrics-line:hover { color: rgba(230, 237, 243, 0.5); background: rgba(255, 255, 255, 0.03); }
[data-theme="light"] .lyrics-line:hover { color: rgba(13, 17, 23, 0.5); background: rgba(0, 0, 0, 0.03); }
.lyrics-line.active {
  color: #fff;
  font-weight: 600;
  font-size: 1.2rem;
  transform: scale(1);
  text-shadow: 0 0 20px rgba(212, 160, 23, 0.4);
}
[data-theme="light"] .lyrics-line.active { color: #0d1117; text-shadow: 0 0 20px rgba(196, 144, 14, 0.3); }
.lyrics-line.past { color: rgba(230, 237, 243, 0.45); }
[data-theme="light"] .lyrics-line.past { color: rgba(13, 17, 23, 0.45); }

/* ── Search results dropdown ── */
.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 12px 40px var(--shadow);
}
.sr-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(128, 128, 128, 0.08);
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: rgba(128, 128, 128, 0.07); }
.sr-art { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--bg); }
.sr-art-placeholder { display: flex; align-items: center; justify-content: center; }
.sr-info { flex: 1; overflow: hidden; }
.sr-title { font-size: 0.82rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-artist { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-dur { font-size: 0.72rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.sr-add {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
  flex-shrink: 0;
  min-width: 32px;
  min-height: 32px;
}
.sr-add:hover { color: var(--accent); background: var(--accent-glow); }
.sr-add .material-symbols-outlined { font-size: 20px; }
.sr-empty { padding: 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ── Channel Picker Overlay ── */
.channel-picker-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.channel-picker-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 32px var(--shadow);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.channel-picker-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.channel-picker-header h3 { margin: 0; font-size: 1.1rem; color: var(--text); }
.channel-picker-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  min-width: 32px;
  min-height: 32px;
}
.channel-picker-close:hover { color: var(--text); }
.channel-picker-desc { color: var(--muted); font-size: 0.85rem; margin: 0 0 1rem 0; line-height: 1.4; }
.channel-picker-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 300px; overflow-y: auto; }
.channel-pick-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: left;
  min-height: 52px;
}
.channel-pick-btn:hover { background: var(--border); border-color: var(--accent); }
.channel-pick-btn .material-symbols-outlined { font-size: 22px; color: var(--muted); flex-shrink: 0; }
.channel-pick-info { display: flex; flex-direction: column; min-width: 0; }
.channel-pick-name { font-size: 0.9rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-pick-members { font-size: 0.75rem; color: var(--muted); }

/* ══════════════════════════════════════════
   MOBILE
══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Stack layout vertically */
  .main-layout { flex-direction: column; }

  /* Compact top bar */
  .top-bar { padding: 0.6rem 1rem; gap: 0.5rem; }
  .top-bar h1 { font-size: 0.9rem; }
  .top-bar .user-name { display: none; }
  .top-bar a { font-size: 0.75rem; margin-left: 0.3rem; }

  /* Controller: horizontal strip at top */
  .controller {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    flex-shrink: 0;
    overflow-y: visible;
    overflow-x: hidden;
  }

  .controller .artwork-container {
    padding: 0;
    flex-shrink: 0;
  }
  .controller .artwork {
    max-width: 64px;
    width: 64px;
    height: 64px;
    aspect-ratio: 1;
    border-radius: 10px;
  }
  .controller .no-artwork {
    max-width: 64px;
    width: 64px;
    height: 64px;
    aspect-ratio: 1;
    border-radius: 10px;
  }
  .controller .no-artwork .material-symbols-outlined { font-size: 28px; }

  /* Center column: track info + controls */
  .controller-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: hidden;
  }

  .controller .track-info {
    padding: 0;
    text-align: left;
  }
  .controller .track-title { font-size: 0.9rem; }
  .controller .track-artist { font-size: 0.75rem; }

  /* Compact controls row */
  .controls-row {
    padding: 0;
    gap: 0;
    justify-content: flex-start;
  }
  .ctrl-btn { padding: 0.3rem; min-width: 36px; min-height: 36px; }
  .ctrl-btn .material-symbols-outlined { font-size: 20px; }
  .ctrl-btn.primary .material-symbols-outlined { font-size: 28px; }

  /* Hide position bar, volume, and EQ in mobile controller strip */
  .position-row { display: none; }
  .volume-row { display: none; }
  .eq-section { display: none; }

  /* Right panel takes remaining space */
  .right-panel { flex: 1; min-height: 0; overflow: hidden; }

  /* Search */
  .search-container { padding: 0.75rem 1rem; }
  .search-bar { padding: 0.5rem 0.7rem; }
  .search-bar input { font-size: 0.85rem; }
  .search-play-btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }

  /* Queue */
  .queue-section { padding: 0.75rem 1rem; }
  .q-remove { opacity: 1; }
  .q-drag { display: none; }

  /* Search dropdown */
  .search-dropdown { max-height: 280px; }

  /* Lyrics overlay: full-screen on mobile */
  .lyrics-overlay { padding: 0; align-items: flex-end; }
  .lyrics-content {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
  .lyrics-body { font-size: 0.9rem; }
  .lyrics-line { font-size: 1rem; }
  .lyrics-line.active { font-size: 1.1rem; }

  /* Toasts: centered on mobile */
  .toast-container { left: 1rem; right: 1rem; align-items: center; }
  .toast { max-width: 100%; text-align: center; }

  /* np quick controls wrap nicely */
  .np-controls { gap: 0.3rem; }
  .np-ctrl { padding: 0.35rem 0.6rem; font-size: 0.7rem; }
}

/* Very small phones */
@media (max-width: 380px) {
  .top-bar a { display: none; }
  .search-play-btn span:not(.material-symbols-outlined) { display: none; }
}
