:root {
  --bg: #16121f;
  --surface: #201a30;
  --surface-2: #2a2240;
  --gold: #e8a33d;
  --pink: #ff3e7f;
  --text: #f5f0e6;
  --text-muted: #948da8;
  --border: #362c4d;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 4rem;
  position: relative;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.glow {
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 60vh;
  background: radial-gradient(ellipse at center, rgba(255, 62, 127, 0.18), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.marquee {
  padding: 2.5rem 1rem 1.5rem;
  text-align: center;
  z-index: 1;
}

.marquee h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  letter-spacing: 0.12em;
  margin: 0;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(232, 163, 61, 0.45);
}
.marquee h1 span { color: var(--pink); text-shadow: 0 0 24px rgba(255, 62, 127, 0.5); }

main {
  width: 100%;
  max-width: 560px;
  padding: 0 1.1rem;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ---- Now playing ---- */

.now-playing {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.8rem 1.4rem;
  text-align: center;
}

.np-art-wrap {
  width: min(58vw, 220px);
  aspect-ratio: 1 / 1;
  margin: 0 auto 1.1rem;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, var(--surface-2), #0c0a13);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

.np-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.np-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
  margin: 0 0 0.35rem;
}

#np-title {
  font-size: 1.2rem;
  margin: 0 0 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-artist {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-progress-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0 0.3rem;
}

.np-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 2.4rem;
}
.np-time:last-child { text-align: right; }

.np-progress-track {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
}

.np-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--pink));
  transition: width 0.25s linear;
}

.playlist-link {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--gold);
  font-size: 0.78rem;
  text-decoration: none;
  border-bottom: 1px dotted var(--gold);
}
.playlist-link:hover { color: #ffc773; }

.locked-notice {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-align: center;
}
.locked-notice p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.queue-note {
  margin: -0.2rem 0 0.7rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.up-next-playlist {
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
}

.ghost-btn {
  margin-top: 0.7rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ghost-btn:hover, .ghost-btn:focus-visible { border-color: var(--pink); color: var(--pink); }

/* ---- Search ---- */

.context-playlist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}

.cp-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cp-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cp-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-name:hover { color: #ffc773; }

.cp-upcoming-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cp-upcoming-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-upcoming-list li .num {
  color: var(--pink);
  font-family: 'JetBrains Mono', monospace;
  margin-right: 0.4rem;
}

.search-box input {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.2);
}

.results {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
}

.result-item img {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.result-meta { flex: 1; min-width: 0; }
.result-meta .t { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-meta .a { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.add-btn {
  flex-shrink: 0;
  background: var(--pink);
  color: #1b0b16;
  border: none;
  font-weight: 700;
  font-size: 1.2rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.add-btn:hover, .add-btn:focus-visible { transform: scale(1.08); background: #ff5c92; }
.add-btn:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ---- Queue ---- */

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.7rem;
}
.queue-header h3 { margin: 0; font-size: 1.05rem; }
.queue-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-list .empty-state {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1.2rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
}

.queue-item .pos {
  font-family: 'JetBrains Mono', monospace;
  color: var(--gold);
  font-size: 0.85rem;
  width: 1.4rem;
  flex-shrink: 0;
}

.queue-item .meta { flex: 1; min-width: 0; }
.queue-item .t { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .a { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: 100px;
  font-size: 0.88rem;
  z-index: 5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

footer {
  margin-top: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.7;
  z-index: 1;
}
