/* ========== Loading Screen ========== */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #6a9fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* ========== Audio Control Button ========== */
.audio-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: rgba(20, 20, 30, 0.55);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.audio-btn:hover {
  background: rgba(30, 30, 45, 0.75);
  border-color: rgba(106, 159, 255, 0.4);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(106, 159, 255, 0.1);
}

.audio-btn:active {
  transform: scale(0.95);
  transition: transform 0.15s;
}

.audio-icon {
  position: absolute;
  transition: opacity 0.3s;
}

/* Muted state */
.audio-btn.muted .audio-on {
  opacity: 0;
}

.audio-btn.muted .audio-off {
  opacity: 1;
}

.audio-btn:not(.muted) .audio-off {
  opacity: 0;
}

.audio-btn:not(.muted) .audio-on {
  opacity: 1;
}

/* Double-click hint */
.audio-btn::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 15px;
  border: 1px solid transparent;
  transition: border-color 0.3s;
}

.audio-btn.song-switched::after {
  border-color: rgba(106, 159, 255, 0.5);
  animation: pulse-border 0.6s ease-out forwards;
}

@keyframes pulse-border {
  0% { border-color: rgba(106, 159, 255, 0.6); }
  100% { border-color: transparent; }
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .audio-btn {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
  }
}
