:root {
  --bg: #0b0a12;
  --panel: rgba(22, 20, 34, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f0ea;
  --muted: #9a93a8;
  --accent: #e8b86d;
  --accent-2: #c4785a;
  --glow: rgba(232, 184, 109, 0.35);
  --fill: #2a2438;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", sans-serif;
}

body { overflow-x: hidden; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.orb-a { width: 420px; height: 420px; background: #5b2c6f; top: -80px; left: -60px; }
.orb-b { width: 380px; height: 380px; background: #1e3a5f; bottom: -40px; right: -40px; }
.orb-c { width: 260px; height: 260px; background: #8b3a2a; top: 40%; left: 50%; }

.app {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

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

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--glow);
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 13px;
}

.add-files {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

.add-files:hover { border-color: var(--accent); }

.stage {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 36px;
}

.vinyl-wrap {
  position: relative;
  width: 220px;
  height: 220px;
}

.vinyl {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #1a1a1a 0 28%, #111 29% 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), inset 0 0 0 1px #333;
  position: relative;
  margin: 10px auto 0;
}

.vinyl.spinning { animation: spin 4s linear infinite; }

.vinyl-grooves {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 6px, rgba(255,255,255,0.04) 6px 7px);
}

.vinyl-label {
  position: absolute;
  inset: 62px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.note-icon { font-size: 28px; color: #1a1010; }

.tonearm {
  position: absolute;
  top: 8px;
  right: 18px;
  width: 6px;
  height: 110px;
  background: linear-gradient(#d8d0c4, #8a8378);
  border-radius: 4px;
  transform-origin: top center;
  transform: rotate(-28deg);
  transition: transform 0.5s ease;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.4);
}

.tonearm.on { transform: rotate(12deg); }

.tonearm::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: -5px;
  width: 16px;
  height: 16px;
  background: #c9a227;
  border-radius: 3px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.now-playing { min-width: 0; }

.np-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

#trackTitle {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#trackArtist {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 22px;
}

#visualizer {
  width: 100%;
  height: 72px;
  display: block;
}

.controls {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 20px 24px 18px;
  margin-bottom: 24px;
}

.progress-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
}

.seek {
  position: relative;
  height: 6px;
  background: var(--fill);
  border-radius: 99px;
  cursor: pointer;
}

.seek-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 99px;
}

.seek-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: var(--text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px var(--glow);
  opacity: 0;
  transition: opacity 0.15s;
}

.seek:hover .seek-thumb { opacity: 1; }

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.icon-btn, .play-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.icon-btn.active { color: var(--accent); }

.play-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #1a1010;
  box-shadow: 0 10px 28px var(--glow);
}

.play-btn svg { width: 26px; height: 26px; }
.play-btn:hover { filter: brightness(1.08); }

.hidden { display: none !important; }

.repeat-badge {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
}

.volume-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.vol-icon { width: 16px; height: 16px; color: var(--muted); }

#volume {
  width: 140px;
  accent-color: var(--accent);
  cursor: pointer;
}

.playlist-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 18px 8px 12px;
  min-height: 180px;
}

.playlist-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 16px 12px;
}

.playlist-head h2 { font-size: 15px; font-weight: 500; }
#trackCount { font-size: 12px; color: var(--muted); }

.playlist { list-style: none; max-height: 280px; overflow-y: auto; }

.playlist li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.playlist li:hover { background: rgba(255,255,255,0.04); }
.playlist li.active { background: rgba(232, 184, 109, 0.1); }

.idx { font-size: 12px; color: var(--muted); }

.meta { min-width: 0; }
.meta .name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta .artist { font-size: 12px; color: var(--muted); }

.len { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.drop-hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 28px 16px;
}

.app.dragover .playlist-panel {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

@media (max-width: 700px) {
  .stage { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  #trackTitle { font-size: 24px; }
  .app { padding: 20px 16px 40px; }
}
