/* BeatDesk DJ console — player UI */

.game-player {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dj-console {
  background: linear-gradient(165deg, #1f1238 0%, #130d25 55%, #0f0a1c 100%);
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 1.25rem;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  box-shadow:
    0 24px 60px rgba(7, 4, 15, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .dj-console {
    padding: 1.25rem 1.5rem;
    gap: 1.125rem;
  }
}

.dj-console-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dj-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.dj-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.dj-status-dot--live {
  background: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
  animation: dj-pulse 1.6s ease-in-out infinite;
}

.dj-status-dot--paused {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22);
  animation: none;
}

@keyframes dj-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.dj-status-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c4b5fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dj-count {
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(245, 243, 255, 0.65);
  flex-shrink: 0;
}

.dj-now-playing {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1rem 1.125rem;
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dj-song-meta {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.dj-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #fff;
  font-family: "Sora", "DM Sans", sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
}

.dj-song-text {
  min-width: 0;
  flex: 1;
}

.dj-song-title {
  margin: 0;
  font-family: "Sora", "DM Sans", sans-serif;
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: #faf5ff;
  word-break: break-word;
}

.dj-song-artist {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: rgba(196, 181, 253, 0.85);
  word-break: break-word;
}

.dj-equalizer {
  margin-top: 0.875rem;
  justify-content: center;
}

.dj-equalizer--paused .equalizer-bar {
  animation-play-state: paused;
  opacity: 0.45;
}

.dj-break-text {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e879f9;
}

.dj-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  min-height: 4rem;
}

.dj-complete p {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #faf5ff;
}

.dj-alert {
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e879f9;
}

.dj-alert--muted {
  color: rgba(245, 243, 255, 0.55);
}

.dj-transport {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  max-width: 22rem;
  margin: 0 auto;
  width: 100%;
}

.dj-transport .dj-btn--icon:first-child {
  justify-self: start;
}

.dj-transport .dj-btn--icon:last-child {
  justify-self: end;
}

.dj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: none;
  border-radius: 9999px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.dj-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dj-btn:not(:disabled):active {
  transform: scale(0.97);
}

.dj-btn--icon {
  flex-direction: column;
  gap: 0.2rem;
  min-width: 3.25rem;
  min-height: 3.25rem;
  padding: 0.5rem 0.625rem;
  color: #f5f3ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dj-btn--icon:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1);
}

.dj-btn-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(245, 243, 255, 0.7);
}

.dj-btn--play {
  width: 4rem;
  height: 4rem;
  color: #130d25;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.45);
}

.dj-btn--play:not(:disabled):hover {
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.55);
}

.dj-volume {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.875rem;
}

.dj-btn--volume {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.5rem;
}

.dj-volume-slider {
  flex: 1;
  min-width: 0;
  height: 0.35rem;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.dj-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: #7c3aed;
  border: 2px solid #faf5ff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.45);
}

.dj-volume-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: #7c3aed;
  border: 2px solid #faf5ff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.45);
}

.dj-volume-value {
  min-width: 2.25rem;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(245, 243, 255, 0.6);
}

.dj-clip-progress {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.dj-clip-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(245, 243, 255, 0.55);
}

.dj-live-note {
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(245, 243, 255, 0.65);
}

.dj-settings {
  display: grid;
  gap: 0.875rem;
  padding: 0.875rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.875rem;
}

@media (min-width: 768px) {
  .dj-settings {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .dj-settings-block--auto {
    grid-column: 1 / -1;
  }
}

.dj-settings-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dj-settings-block--auto {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.dj-settings-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 243, 255, 0.5);
}

.dj-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.dj-pill {
  padding: 0.45rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 243, 255, 0.75);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dj-pill:hover:not(:disabled) {
  border-color: rgba(167, 139, 250, 0.4);
  color: #faf5ff;
}

.dj-pill--active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.dj-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dj-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(19, 13, 37, 0.9);
  color: #faf5ff;
  font-size: 0.875rem;
  font-weight: 500;
}

.dj-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #faf5ff;
  cursor: pointer;
}

.dj-auto-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: #7c3aed;
}

.dj-btn--auto {
  padding: 0.55rem 1rem;
  color: #130d25;
  background: linear-gradient(135deg, #c4b5fd, #7c3aed);
}

.dj-btn--stop {
  padding: 0.55rem 1rem;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.dj-btn--secondary {
  padding: 0.625rem 1rem;
  color: #f5f3ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dj-btn--secondary:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1);
}

.dj-game-progress {
  padding-top: 0.25rem;
}

.dj-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dj-quick-actions .dj-btn--secondary {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 9rem;
}

.playlist-shuffle-btn {
  flex-shrink: 0;
}

.playlist-now-tag {
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.playlist-row--current {
  border-color: rgba(124, 58, 237, 0.55) !important;
  background: rgba(124, 58, 237, 0.12) !important;
}

.playlist-list {
  max-height: min(50vh, 28rem);
}

@media (max-width: 639px) {
  .dj-transport {
    max-width: none;
  }

  .dj-btn--play {
    width: 3.75rem;
    height: 3.75rem;
  }

  .dj-btn--icon {
    min-width: 3.5rem;
    min-height: 3.5rem;
  }

  .dj-volume-slider {
    height: 0.45rem;
  }

  .dj-volume-slider::-webkit-slider-thumb {
    width: 1.15rem;
    height: 1.15rem;
  }

  .dj-quick-actions .dj-btn--secondary {
    flex: 1 1 100%;
  }

  .playlist-panel-header {
    align-items: flex-start !important;
  }

  .game-hero .action-chip {
    flex: 1 1 calc(50% - 0.375rem);
    justify-content: center;
  }
}

/* Hide legacy now-stage if any remnants */
.now-stage {
  display: none !important;
}
