* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: transparent;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow: hidden;
}

/* Full-bleed artwork background when a SoundCloud track (with thumbnail) is playing */
.now-playing-artwork {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0a0a0a;
}

.now-playing-artwork::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.now-playing-artwork[aria-hidden="true"] {
  display: none !important;
}

/* SoundCloud embed over the artwork when full-screen (centered, below the bar area) */
.now-playing-player {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90%, 900px);
  height: 166px;
  z-index: 100;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  background: #111;
  pointer-events: none;
}

.now-playing-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.now-playing-player[aria-hidden="true"] {
  display: none !important;
}

#now-playing-container {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 500px;
  min-height: 140px;
  pointer-events: none;
  z-index: 1000;
  transition: top 0.3s ease, bottom 0.3s ease;
}

#now-playing-container.position-bottom-left {
  top: auto;
  bottom: 4rem;
}

#now-playing-container.hidden {
  opacity: 0;
  visibility: hidden;
}

.view {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  max-width: 500px;
  width: 100%;
  min-height: 140px;
  height: 140px;
  z-index: 1000;
}

.view.active {
  display: block;
  opacity: 1;
}

.view-current.active {
  display: flex;
}

.view-next.active,
.view-instruction.active {
  display: flex;
}

/* Current Song View */
.view-current {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.now-playing-thumb {
  width: 120px;
  min-width: 120px;
  height: 68px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.now-playing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-playing-info {
  flex: 1;
  min-width: 0;
}

.now-playing-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-requested {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 0.75rem 0;
}

.progress-wrap {
  margin-top: 0.5rem;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-fill {
  display: block;
  height: 100%;
  min-width: 4px;
  width: 0%;
  border-radius: 4px;
  transition: width 0.25s ease-out;
  /* Multi-color gradient: as the bar fills, more of the gradient is revealed */
  background: linear-gradient(
    90deg,
    #06b6d4 0%,
    #8b5cf6 35%,
    #d946ef 65%,
    #f97316 100%
  );
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.progress-times {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  display: block;
}

/* Next Song Preview View - same layout as Now Playing (thumb left, info right) */
.view-next {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-next .view-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 0.35rem 0;
}

.next-song-thumb {
  width: 120px;
  min-width: 120px;
  height: 68px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.next-song-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.next-song-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.next-song-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.35rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-song-requested {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Instruction Message View */
.view-instruction {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.instruction-text {
  font-size: 1.1rem;
  color: #fff;
  margin: 0;
  font-weight: 500;
}

/* Wheel Panel - slides out from bottom of panel (top-left) or top of panel (bottom-left) */
.wheel-panel {
  position: absolute;
  left: 0;
  width: 100%;
  max-width: 500px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  visibility: hidden;
  z-index: 1000;
  pointer-events: none;
}

/* Default and top-left: wheel slides down from just below the now-playing panel */
#now-playing-container .wheel-panel,
#now-playing-container.position-top-left .wheel-panel {
  top: 100%;
  margin-top: 0.5rem;
  transform: translateY(-100%);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.45s;
}

#now-playing-container .wheel-panel.wheel-visible,
#now-playing-container.position-top-left .wheel-panel.wheel-visible {
  visibility: visible;
  transform: translateY(0);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s;
}

/* Bottom-left: wheel slides up from just above the now-playing panel */
#now-playing-container.position-bottom-left .wheel-panel {
  bottom: 100%;
  margin-bottom: 0.5rem;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.45s;
}

#now-playing-container.position-bottom-left .wheel-panel.wheel-visible {
  visibility: visible;
  transform: translateY(0);
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s;
}

.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  aspect-ratio: 1;
}

.wheel-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid #a855f7;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  z-index: 1001;
}
