@font-face {
  font-family: "Quicksand";
  src: url("/assets/fonts/quicksand-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #141414;
  --ink-2: #1f1f1f;
  --line: #303030;
  --text: #f2f2f2;
  --text-2: #d4d4d4;
  --muted: #8c8c8c;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 255, 255, 0.12);
  --sans: "Quicksand", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.muted { color: var(--muted); margin: 0; }
.eyebrow { margin: 0 0 6px; font: 600 0.72rem/1 var(--mono); letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }

.stage-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px clamp(16px, 3vw, 32px);
  background: rgba(16, 16, 18, 0.76);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.mark { width: 18px; height: 18px; }
.tag {
  font: 600 0.7rem/1 var(--mono);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  text-transform: uppercase;
}

.nav-pills {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  overflow-x: auto;
  max-width: 100%;
}
.nav-pill {
  border: 0;
  border-radius: 999px;
  padding: 7px 15px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
}
.nav-pill:hover { color: var(--text); }
.nav-pill.is-active { background: var(--text); color: var(--ink); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-weight: 600;
  font-size: 0.84rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease;
}
.chip-btn:hover { background: rgba(255, 255, 255, 0.12); }
.chip-btn--primary { background: var(--text); color: var(--ink); border-color: var(--text); }
.chip-btn--primary:hover { background: #fff; }
.chip-btn--owner { border-color: rgba(255, 255, 255, 0.4); }
.sync-dot { width: 7px; height: 7px; border-radius: 999px; background: #6f6f6f; }
.sync-dot.is-synced { background: #ffffff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.8); }
.sync-dot.is-syncing { background: #d4d4d4; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* Workspace */
.workspace {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 32px) 120px;
}

.toast {
  position: fixed;
  top: 74px;
  right: 22px;
  z-index: 35;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(24, 24, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.view-head h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.03em; }

/* Stage */
.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .stage-grid { grid-template-columns: 1fr; } }

.stage-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px;
  border-radius: 26px;
  background: rgba(20, 20, 22, 0.62);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
}
.art-frame {
  position: relative;
  width: min(260px, 65vw);
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 25%, #2d2d30, #121214);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}
.art-disc {
  width: 72%;
  height: 72%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  background: repeating-radial-gradient(circle, #18181a 0 6px, #1f1f22 6px 8px);
}
.art-cover { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.stage-meta h1 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -0.02em; }
.stage-artist { margin: 8px 0 18px; color: var(--text-2); font-size: 0.98rem; }
.stage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.stage-side { display: flex; flex-direction: column; gap: 18px; }
.glass-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(20, 20, 22, 0.68);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }

.mini-lyrics {
  min-height: 150px;
  max-height: 210px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.mini-lyrics p { margin: 0; font-size: 0.95rem; color: var(--muted); transition: color 180ms ease, transform 180ms ease; }
.mini-lyrics p.is-current { color: #ffffff; font-size: 1.12rem; font-weight: 700; }

.eq-sliders { display: flex; flex-direction: column; gap: 12px; }
.eq-row { display: grid; grid-template-columns: 58px 1fr 48px; align-items: center; gap: 12px; font-size: 0.88rem; color: var(--text-2); }
.eq-row input[type="range"], .dock input[type="range"] { accent-color: #f2f2f2; cursor: pointer; }

/* Buttons & segmented controls */
.pill-btn {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}
.pill-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.pill-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pill-btn--primary { background: var(--text); color: var(--ink); border-color: var(--text); }
.pill-btn--primary:hover:not(:disabled) { background: #fff; }
.pill-btn.is-liked { background: var(--text); color: var(--ink); border-color: var(--text); }

.mini-btn {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.mini-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.seg-btn {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn.is-active { background: var(--text); color: var(--ink); border-color: var(--text); }

/* Search */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.search-bar input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(22, 22, 24, 0.85);
  color: #fff;
  font-size: 0.96rem;
  outline: none;
}
.search-bar input:focus { border-color: rgba(255, 255, 255, 0.45); }

/* Shelves & Cards */
.shelves { display: flex; flex-direction: column; gap: 28px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.shelf-head h2 { margin: 0; font-size: 1.2rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}
.song-card {
  padding: 12px;
  border-radius: 18px;
  background: rgba(22, 22, 24, 0.72);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.song-card:hover { transform: translateY(-2px); background: rgba(34, 34, 38, 0.86); border-color: rgba(255, 255, 255, 0.25); }
.song-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #1e1e20; }
.song-card-title { margin: 0; font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card-artist { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Track list */
.track-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.track-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(22, 22, 24, 0.68);
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease;
}
.track-row:hover { background: rgba(34, 34, 38, 0.85); border-color: var(--glass-border); }
.track-row.is-current { border-color: rgba(255, 255, 255, 0.36); background: rgba(255, 255, 255, 0.08); }
.track-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #232326;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.track-info { min-width: 0; cursor: pointer; }
.track-name { margin: 0; font-weight: 700; font-size: 0.94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.src-pill {
  font: 600 0.66rem/1 var(--mono);
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-2);
}
.track-actions { display: flex; align-items: center; gap: 6px; }

/* Full Lyrics View */
.lyrics-stage {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px;
  border-radius: 26px;
  background: rgba(18, 18, 20, 0.7);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
}
.lyrics-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.lyrics-header h2 { margin: 0; font-size: 1.3rem; }
.offset-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
}
.offset-pill button { border: 0; background: transparent; color: var(--text); cursor: pointer; font-weight: 600; padding: 3px 6px; }
.lyrics-scroll {
  max-height: 54dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 20px 8px;
}
.lrc-line {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.5;
  color: rgba(242, 242, 242, 0.34);
  cursor: pointer;
  transition: color 200ms ease, transform 200ms ease, opacity 200ms ease;
}
.lrc-line:hover { color: rgba(242, 242, 242, 0.72); }
.lrc-line.is-active { color: #ffffff; font-size: 1.48rem; font-weight: 700; transform: scale(1.03); }

/* Library playlists */
.lib-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.playlist-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(22, 22, 24, 0.76);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.playlist-card h3 { margin: 0; font-size: 1.05rem; }
.playlist-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Queue Drawer */
.queue-drawer {
  position: fixed;
  top: 66px;
  right: 16px;
  bottom: 98px;
  width: min(380px, calc(100vw - 32px));
  z-index: 25;
  padding: 18px;
  border-radius: 22px;
  background: rgba(18, 18, 20, 0.92);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
}
.queue-drawer .track-list { overflow-y: auto; flex: 1; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head h2 { margin: 0; font-size: 1.05rem; }
.drawer-actions { display: flex; gap: 6px; }

/* Bottom Transport Dock */
.dock {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.5fr) minmax(140px, 0.8fr);
  align-items: center;
  gap: 16px;
  padding: 11px 18px;
  border-radius: 22px;
  background: rgba(18, 18, 20, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
@media (max-width: 820px) {
  .dock { grid-template-columns: 1fr auto; gap: 10px; }
  .dock-right { display: none; }
}
.dock-track { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dock-thumb {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: #232326;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.dock-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dock-meta { min-width: 0; flex: 1; }
.dock-title { margin: 0; font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-artist { margin: 2px 0 0; font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dock-center { display: flex; flex-direction: column; gap: 5px; }
.dock-controls { display: flex; align-items: center; justify-content: center; gap: 12px; }
.dock-timeline { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 8px; }
.dock-timeline .mono:last-child { text-align: right; }

.dock-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.dock-right input[type="range"] { width: 92px; }

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--text-2);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: background 140ms ease, color 140ms ease;
}
.icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: #fff; }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn.is-on { color: #ffffff; background: rgba(255, 255, 255, 0.16); }

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: var(--text);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.play-btn:hover:not(:disabled) { background: #fff; transform: scale(1.04); }
.play-btn:disabled { opacity: 0.4; cursor: not-allowed; }
