
:root {
  --bg: #0a0a0a;
  --text: #ffffff;
  --muted: rgba(255,255,255,0.7);
  --panel: rgba(255,255,255,0.08);
  --panel-border: rgba(255,255,255,0.12);
  --soft: rgba(255,255,255,0.10);
  --soft-hover: rgba(255,255,255,0.14);
  --pulse: 0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-base,
.bg-art,
.bg-art-next,
.bg-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-base {
  background: linear-gradient(180deg, #101010 0%, #090909 100%);
}

.bg-art,
.bg-art-next {
  background-image: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: center center;
  image-rendering: auto;
  filter:
    blur(82px)
    saturate(1.10)
    brightness(0.50)
    contrast(0.90);
  opacity: 0;
  will-change: transform, opacity;
}

.bg-art::before,
.bg-art-next::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: inherit;
  background-size: cover;
  background-position: center;
  filter: blur(40px);
  opacity: 0.72;
}

.bg-art::after,
.bg-art-next::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.04), transparent 28%),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,0.03), transparent 24%),
    linear-gradient(180deg, rgba(8,8,8,0.10), rgba(8,8,8,0.18));
}

.bg-art.is-visible,
.bg-art-next.is-visible {
  opacity: calc(0.72 + (var(--pulse) * 0.08));
}

.bg-art {
  animation: ambientFloatA 24s ease-in-out infinite alternate;
  transition: opacity 650ms ease, background-image 650ms ease;
}

.bg-art-next {
  animation: ambientFloatB 28s ease-in-out infinite alternate;
  transition: opacity 650ms ease, background-image 650ms ease;
}

.bg-overlay {
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.04), transparent 35%),
    linear-gradient(180deg, rgba(8,8,8,0.18) 0%, rgba(8,8,8,0.48) 42%, rgba(8,8,8,0.80) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

@keyframes ambientFloatA {
  0%   { transform: scale(calc(1.18 + (var(--pulse) * 0.015))) translate3d(-1.5%, -1%, 0); }
  50%  { transform: scale(calc(1.22 + (var(--pulse) * 0.02))) translate3d(1.5%, 1%, 0); }
  100% { transform: scale(calc(1.19 + (var(--pulse) * 0.018))) translate3d(-1%, 1.2%, 0); }
}

@keyframes ambientFloatB {
  0%   { transform: scale(calc(1.20 + (var(--pulse) * 0.015))) translate3d(1.2%, -1.2%, 0); }
  50%  { transform: scale(calc(1.24 + (var(--pulse) * 0.02))) translate3d(-1.2%, 1.4%, 0); }
  100% { transform: scale(calc(1.21 + (var(--pulse) * 0.018))) translate3d(1.4%, 0.8%, 0); }
}

.center {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.player {
  width: 100%;
  max-width: 860px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
}

.now {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.now img {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}

.meta {
  min-width: 0;
}

#nowTitle {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
}

#nowArtist {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 4px;
}

.wave-shell {
  position: relative;
  margin: 10px 0 8px;
  height: 64px;
}

.wave {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  pointer-events: none;
}

.wave div {
  flex: 1;
  min-width: 1px;
  border-radius: 999px;
  background: rgba(255,255,255,0.24);
  transition: background 0.12s ease;
}

.wave div.active {
  background: rgba(255,255,255,0.98);
}

.scrubber {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: pan-y;
}

.scrubber::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent;
}

.scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 64px;
  background: transparent;
  border: 0;
}

.scrubber::-moz-range-track {
  height: 100%;
  background: transparent;
}

.scrubber::-moz-range-thumb {
  width: 24px;
  height: 64px;
  background: transparent;
  border: 0;
}

.time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
  flex-wrap: wrap;
}

.controls button {
  border: none;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.controls button:hover {
  background: var(--soft-hover);
  transform: translateY(-1px);
}

.controls .play {
  padding-inline: 18px;
  font-weight: 600;
}

.volume {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  max-width: 240px;
  width: 100%;
}

.volume span {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #fff;
  border: none;
}

input[type="range"].scrubber::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent;
}

input[type="range"].scrubber::-webkit-slider-thumb {
  width: 24px;
  height: 64px;
  margin-top: 0;
  background: transparent;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: none;
}

input[type="range"].scrubber::-moz-range-track {
  height: 100%;
  background: transparent;
}

input[type="range"].scrubber::-moz-range-thumb {
  width: 24px;
  height: 64px;
  background: transparent;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.track:hover {
  background: rgba(255,255,255,0.10);
  transform: translateY(-1px);
}

.track.active {
  background: rgba(255,255,255,0.12);
}

.track img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}

.track-main {
  min-width: 0;
}

.track-title {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-duration {
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 680px) {
  .center {
    padding: 10px;
  }

  .player {
    padding: 14px;
    border-radius: 18px;
  }

  .now img {
    width: 52px;
    height: 52px;
  }

  #nowTitle {
    font-size: 0.98rem;
  }

  .wave-shell {
    height: 56px;
  }

  .wave {
    gap: 1px;
  }

  input[type="range"].scrubber::-webkit-slider-thumb {
    height: 56px;
  }

  input[type="range"].scrubber::-moz-range-thumb {
    height: 56px;
  }

  .controls {
    gap: 8px;
  }

  .controls button {
    padding: 10px 12px;
  }

  .volume {
    margin-left: 0;
    max-width: none;
    min-width: 100%;
  }

  .track {
    grid-template-columns: 38px 1fr auto;
    gap: 10px;
    padding: 9px;
  }

  .track img {
    width: 38px;
    height: 38px;
  }

  .track-title {
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-art,
  .bg-art-next {
    animation: none;
    transition: opacity 250ms ease, background-image 250ms ease;
  }
}
