* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2b0a4e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #1a0a2e;
}
.scene-bg-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(70px) brightness(0.55) saturate(1.15);
  transform: scale(1.2);
}
.scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}
.scene-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,2,20,0.35) 0%, rgba(10,2,20,0) 22%, rgba(10,2,20,0) 55%, rgba(10,2,20,0.75) 100%);
  pointer-events: none;
}

/* --- twinkle overlay: soft glowing points layered on top of the illustration --- */
.confetti-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.twinkle-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,230,160,0.95) 0%, rgba(255,200,110,0.4) 45%, rgba(255,200,110,0) 75%);
  animation-name: twinkle-pulse;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes twinkle-pulse {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: 0.95; transform: scale(1.3); }
}

/* --- playlist panel --- */
.playlist-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--bar-h, 92px);
  width: min(320px, 85vw);
  background: rgba(15, 3, 30, 0.92);
  backdrop-filter: blur(6px);
  z-index: 15;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  border-left: 2px solid rgba(255, 184, 77, 0.3);
}
.playlist-panel.open { transform: translateX(0); }
.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  color: #ffd42f;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.playlist-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
}
.playlist-header button:hover { opacity: 1; }
.playlist-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  flex: 1;
}
.playlist-list li {
  display: flex;
  gap: 10px;
  padding: 10px 18px;
  cursor: pointer;
  color: #e8dcff;
  font-size: 13.5px;
  border-left: 3px solid transparent;
}
.playlist-list li:hover { background: rgba(255,255,255,0.06); }
.playlist-list li.active {
  background: rgba(255, 184, 77, 0.12);
  border-left-color: #ffb84d;
  color: #ffd42f;
}
.playlist-list .track-num { opacity: 0.5; width: 18px; flex-shrink: 0; }
.playlist-list .track-thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}
.playlist-list .track-meta { display: flex; flex-direction: column; min-width: 0; }
.playlist-list .track-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-list .track-artist { font-size: 11.5px; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- player bar: floating centered pill --- */
.player-bar {
  position: fixed;
  left: 50%;
  bottom: 7vh;
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: min(800px, 94vw);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px 14px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(70, 16, 20, 0.78), rgba(24, 6, 20, 0.82));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 184, 77, 0.2);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  color: #fff;
}
.player-art {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff2fb0, #ffb84d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(255, 47, 176, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.15);
  animation: spin-art 6s linear infinite;
  animation-play-state: paused;
}
.player-art.spinning {
  animation-play-state: running;
}
@keyframes spin-art {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.player-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.player-art-img.loaded { opacity: 1; }
.player-art-img.loaded + .dhol-emoji { display: none; }
.player-info {
  flex: 1;
  min-width: 190px;
}
.player-title {
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  font-size: 13.5px;
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.time { font-size: 12px; opacity: 0.6; width: 36px; flex-shrink: 0; }
#time-duration { text-align: right; }
.seek {
  flex: 1;
  height: 4px;
  accent-color: #ffb84d;
  cursor: pointer;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.player-controls button {
  background: none;
  border: none;
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  padding: 8px;
  opacity: 0.85;
}
.player-controls button:hover { opacity: 1; }
#btn-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: #2b0a4e;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 3px;
}
.player-extra {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.volume { width: 64px; accent-color: #2fd0ff; }
#btn-list {
  background: none;
  border: none;
  color: #fff;
  font-size: 19px;
  cursor: pointer;
  opacity: 0.75;
}

.yt-player-hidden {
  position: fixed;
  bottom: -1000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .player-bar {
    bottom: 4vh;
    max-width: 96vw;
    padding: 10px 16px 10px 10px;
    gap: 12px;
  }
  .player-art { width: 48px; height: 48px; font-size: 21px; }
  .player-info { min-width: 0; }
  .volume { display: none; }
}
