:root {
  --bg1: #121212;
  --bg2: #1a1a1a;
  --ink: #fff;
  --muted: #b3b3b3;
  --accent: #1db954;
  --panel: #000000b3;
  --bar: #535353;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.player-shell {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* ART */
.art-wrap {
  position: relative;
}
.art {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  filter: saturate(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.7));
}
.title-wrap {
  position: absolute;
  left: 16px;
  bottom: 14px;
}
.title {
  margin: 0 0 2px 0;
  font-size: 22px;
  font-weight: 700;
}
.artist {
  margin: 0;
  color: #ddd;
  font-size: 14px;
}
.menu-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #00000080;
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

/* CONTROLS */
.controls {
  padding: 18px 16px 8px;
}
.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aaa;
  margin-bottom: 6px;
}
.bar {
  height: 6px;
  background: var(--bar);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
}
.bar-fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
}
.bar:hover .bar-fill::after {
  opacity: 1;
}
.main-ctrls {
  margin: 16px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.icon-btn {
  background: transparent;
  border: 0;
  color: #cfcfcf;
  cursor: pointer;
  font-size: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.icon-btn:hover {
  color: #fff;
  background: #ffffff14;
}
.icon-btn.active {
  color: #111;
  background: var(--accent);
}
.play-btn {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: grid;
  place-items: center;
}
.play-btn:hover {
  transform: scale(1.03);
}
.utils-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 40%;
}
.vol-ico {
  color: #cfcfcf;
}

/* NOW PLAYING */
.now-playing {
  background: linear-gradient(90deg, #14a44d, #20c35a);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.np-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.np-art {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.np-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.np-artist {
  margin: 0;
  font-size: 11px;
  color: #111;
}
.pulse {
  animation: heartbeat 1.5s ease-in-out infinite;
}
.spin {
  animation: spin 20s linear infinite;
  animation-play-state: paused;
}
@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.08);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* PLAYLIST */
.playlist {
  padding: 12px 12px 16px;
  background: #0d0d0db3;
  border-top: 1px solid #ffffff14;
}
.add-row {
  display: flex;
  gap: 8px;
}
.add-row input {
  flex: 1;
  padding: 10px 12px;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  color: #fff;
  border-radius: 8px;
  outline: none;
}
.add-row button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  cursor: pointer;
}
.add-row button:hover {
  filter: brightness(1.05);
}
.queue {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  max-height: 180px;
  overflow: auto;
}
.queue li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.queue li:hover {
  background: #ffffff12;
}
.queue li.active {
  background: #ffffff1e;
}
.badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #2a2a2a;
  color: #ccc;
  font-size: 10px;
}
.q-title {
  font-size: 12px;
  margin: 0;
  color: #f0f0f0;
}
.q-sub {
  font-size: 11px;
  margin: 0;
  color: #bdbdbd;
}

/* Autoplay gate */
.autoplay-gate {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.gate-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  border: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

/* small */
@media (max-width: 380px) {
  .volume-wrap {
    width: 48%;
  }
}

/* --- Compact desktop fit overrides --- */
@media (min-width: 992px) {
  .player-shell {
    max-width: 360px;
  }

  /* Header / artwork */
  .art {
    height: 240px;
  }
  .title {
    font-size: 20px;
  }
  .artist {
    font-size: 13px;
  }

  /* Controls area */
  .controls {
    padding: 14px 14px 6px;
  }
  .main-ctrls {
    margin: 12px 0 8px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .play-btn {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  /* Bars */
  .bar {
    height: 5px;
  }
  .bar-fill::after {
    width: 10px;
    height: 10px;
    right: -5px;
  }

  /* Now playing strip */
  .np-art {
    width: 32px;
    height: 32px;
  }
  .np-title {
    font-size: 12px;
  }
  .np-artist {
    font-size: 10px;
  }

  /* Playlist section */
  .add-row input {
    padding: 8px 10px;
  }
  .add-row button {
    padding: 8px 12px;
  }
  .queue {
    max-height: 140px;
  }
  .q-title {
    font-size: 11.5px;
  }
  .q-sub {
    font-size: 10.5px;
  }
}
