:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: rgba(20, 22, 30, 0.82);
  --panel-solid: #151821;
  --text: #f5f7fb;
  --muted: #9ca7b8;
  --line: rgba(255, 255, 255, 0.12);
  --cyan: #30e5ff;
  --coral: #ff5f6f;
  --lime: #bef264;
  --gold: #ffd166;
  --violet: #a78bfa;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(135deg, rgba(48, 229, 255, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(255, 95, 111, 0.16), transparent 34%),
    linear-gradient(180deg, #08090d 0%, #101116 48%, #07080b 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  width: min(1680px, calc(100% - 32px));
  height: 100vh;
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
}

.stage {
  position: relative;
  width: 100%;
  height: calc(100vh - 36px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 42px
    ),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  overflow: hidden;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(48, 229, 255, 0.16), transparent 18%, transparent 82%, rgba(255, 209, 102, 0.13)),
    repeating-linear-gradient(0deg, transparent 0, transparent 12px, rgba(255, 255, 255, 0.025) 13px);
  mask-image: linear-gradient(180deg, black, transparent 68%);
}

.topbar,
.player-grid {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 3rem);
  line-height: 1;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  padding: 10px 14px;
  border: 1px solid rgba(48, 229, 255, 0.28);
  border-radius: 999px;
  background: rgba(48, 229, 255, 0.08);
  color: #c9f8ff;
  font-weight: 700;
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 18px var(--lime);
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(520px, 1fr) minmax(390px, 0.78fr);
  gap: 18px;
  height: calc(100% - 92px);
  min-height: 0;
}

.library,
.now-playing,
.lyrics-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 10, 15, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.library,
.lyrics-panel {
  padding: 18px;
  min-height: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.section-title strong {
  color: var(--text);
}

.track-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.track-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.track-card:hover {
  transform: translateY(-2px);
  border-color: rgba(48, 229, 255, 0.38);
  background: rgba(255, 255, 255, 0.075);
}

.track-card.active {
  border-color: rgba(255, 209, 102, 0.58);
  background: rgba(255, 209, 102, 0.12);
}

.track-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--thumb);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

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

.track-copy strong,
.track-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-copy strong {
  font-size: 0.95rem;
}

.track-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.track-time {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.now-playing {
  min-width: 0;
  min-height: 0;
  padding: 22px 28px;
  display: grid;
  grid-template-rows: auto auto 170px auto auto auto;
  align-content: start;
  gap: 14px;
  overflow: hidden;
}

.cover-wrap {
  display: grid;
  place-items: center;
}

.cover {
  position: relative;
  width: clamp(190px, 24vh, 250px);
  aspect-ratio: 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
    var(--cover-a);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  overflow: hidden;
  transition: background 300ms ease;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  transform: rotate(8deg);
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 15px, rgba(255, 255, 255, 0.08) 16px 17px),
    radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.28), transparent 22%);
  mix-blend-mode: screen;
}

.disc {
  position: absolute;
  inset: 17%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #08090d 0 13%, transparent 14%),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 1px, transparent 2px 12px),
    conic-gradient(from 40deg, rgba(0, 0, 0, 0.78), rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.78));
  box-shadow: 0 0 36px rgba(0, 0, 0, 0.5);
  animation: spin 18s linear infinite;
  animation-play-state: paused;
}

.is-playing .disc {
  animation-play-state: running;
}

.disc span {
  width: 21%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0b0d12;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.level-bars {
  position: absolute;
  right: 24px;
  bottom: 22px;
  display: flex;
  align-items: end;
  gap: 6px;
  z-index: 2;
}

.level-bars i {
  display: block;
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  transform-origin: bottom;
  animation: bounce 900ms ease-in-out infinite alternate;
  animation-play-state: paused;
}

.is-playing .level-bars i {
  animation-play-state: running;
}

.level-bars i:nth-child(2) { animation-delay: 120ms; }
.level-bars i:nth-child(3) { animation-delay: 220ms; }
.level-bars i:nth-child(4) { animation-delay: 320ms; }
.level-bars i:nth-child(5) { animation-delay: 420ms; }

.meta {
  text-align: center;
}

.meta p {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.meta h2 {
  margin-top: 6px;
  font-size: clamp(2rem, 3.1vw, 3.25rem);
  line-height: 1.02;
}

.meta span {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #101116;
  background: var(--lime);
  font-size: 0.78rem;
  font-weight: 900;
}

#visualizer {
  width: 100%;
  height: 170px;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.timeline {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.seekbar {
  --seek-fill: 0%;
  position: relative;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.seekbar-track {
  position: relative;
  width: 100%;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.seekbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--seek-fill);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
}

.seekbar-thumb {
  position: absolute;
  top: 50%;
  left: var(--seek-fill);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow:
    0 0 0 7px rgba(48, 229, 255, 0.15),
    0 9px 24px rgba(48, 229, 255, 0.34);
  transform: translate(-50%, -50%);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.seekbar:hover .seekbar-thumb,
.seekbar.dragging .seekbar-thumb,
.seekbar:focus-visible .seekbar-thumb {
  box-shadow:
    0 0 0 10px rgba(48, 229, 255, 0.18),
    0 12px 30px rgba(48, 229, 255, 0.42);
  transform: translate(-50%, -50%) scale(1.06);
}

.seekbar:focus-visible {
  outline: 2px solid rgba(48, 229, 255, 0.75);
  outline-offset: 4px;
  border-radius: 999px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.volume input[type="range"] {
  --range-fill: 0%;
  height: 34px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.volume input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--cyan) 0 var(--range-fill), rgba(255, 255, 255, 0.2) var(--range-fill) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.volume input[type="range"]::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--cyan);
  box-shadow:
    0 0 0 6px rgba(48, 229, 255, 0.14),
    0 8px 22px rgba(48, 229, 255, 0.3);
}

.volume input[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.volume input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--cyan);
}

.volume input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow:
    0 0 0 6px rgba(48, 229, 255, 0.14),
    0 8px 22px rgba(48, 229, 255, 0.3);
}

.volume input[type="range"]:focus-visible {
  outline: 2px solid rgba(48, 229, 255, 0.75);
  outline-offset: 4px;
  border-radius: 999px;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.icon-btn,
.play-btn,
.pill-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.icon-btn:hover,
.play-btn:hover,
.pill-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(48, 229, 255, 0.48);
  background: rgba(48, 229, 255, 0.11);
}

.icon-btn {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.play-btn {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0b0d12;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  box-shadow: 0 14px 34px rgba(48, 229, 255, 0.28);
}

.icon-btn svg,
.play-btn svg,
.volume svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.play-btn svg {
  width: 30px;
  height: 30px;
}

.mix-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
}

.volume {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
}

.pill-btn {
  min-width: 70px;
  min-height: 40px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

.pill-btn.active {
  color: #101116;
  border-color: transparent;
  background: var(--gold);
}

.lyrics-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.lyrics-panel::before,
.lyrics-panel::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  z-index: 2;
  pointer-events: none;
}

.lyrics-panel::before {
  top: 48px;
  height: 90px;
  background: linear-gradient(180deg, rgba(9, 10, 15, 0.96), rgba(9, 10, 15, 0));
}

.lyrics-panel::after {
  bottom: 0;
  height: 130px;
  background: linear-gradient(0deg, rgba(9, 10, 15, 0.98), rgba(9, 10, 15, 0));
}

.lyrics {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  padding: max(110px, calc((100vh - 300px) / 2)) 12px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  mask-image: linear-gradient(180deg, transparent 0, black 14%, black 86%, transparent 100%);
}

.lyrics::-webkit-scrollbar {
  display: none;
}

.lyrics-line {
  margin: 0 0 14px;
  padding: 10px 18px;
  border-left: 4px solid transparent;
  border-radius: 8px;
  color: rgba(245, 247, 251, 0.24);
  font-size: clamp(1.05rem, 1.15vw, 1.32rem);
  font-weight: 800;
  line-height: 1.5;
  transform-origin: left center;
  transition:
    color 200ms ease,
    background 200ms ease,
    opacity 200ms ease,
    transform 200ms ease,
    text-shadow 200ms ease,
    border-color 200ms ease;
}

.lyrics-line.active {
  color: var(--text);
  border-color: var(--cyan);
  background:
    linear-gradient(90deg, rgba(48, 229, 255, 0.2), rgba(255, 95, 111, 0.11) 62%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  opacity: 1;
  transform: translateX(8px) scale(1.045);
  text-shadow: 0 0 22px rgba(48, 229, 255, 0.22);
}

.lyrics-line.passed {
  color: rgba(245, 247, 251, 0.18);
}

.lyrics-line.near {
  color: rgba(245, 247, 251, 0.52);
  opacity: 0.9;
}

.lyrics-line.far {
  opacity: 0.34;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  from {
    transform: scaleY(0.32);
  }
  to {
    transform: scaleY(1);
  }
}

@media (min-width: 1101px) and (max-height: 840px) {
  .shell {
    padding: 12px 0;
  }

  .stage {
    height: calc(100vh - 24px);
    padding: 18px;
  }

  .topbar {
    margin-bottom: 12px;
  }

  h1 {
    font-size: clamp(1.45rem, 2.6vw, 2.35rem);
  }

  .player-grid {
    height: calc(100% - 74px);
  }

  .now-playing {
    grid-template-rows: auto auto 130px auto auto auto;
    gap: 10px;
    padding: 18px 24px;
  }

  .cover {
    width: 165px;
  }

  .meta h2 {
    font-size: clamp(1.85rem, 2.8vw, 2.7rem);
  }

  .meta span {
    margin-top: 8px;
  }

  #visualizer {
    height: 130px;
  }

  .play-btn {
    width: 62px;
    height: 62px;
  }

  .icon-btn {
    width: 46px;
    height: 46px;
  }

  .lyrics {
    padding: 120px 12px;
  }
}

@media (max-width: 1100px) {
  .shell {
    height: auto;
    min-height: 100vh;
  }

  .stage {
    height: auto;
    min-height: calc(100vh - 48px);
  }

  .player-grid {
    grid-template-columns: 1fr 1fr;
    height: auto;
    min-height: calc(100vh - 142px);
  }

  .now-playing {
    grid-column: 1 / -1;
    order: -1;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 18px, 1480px);
    height: auto;
    min-height: 100vh;
    padding: 9px 0;
    align-items: start;
  }

  .stage {
    padding: 16px;
    min-height: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .now-playing {
    padding: 16px;
  }

  .cover {
    width: min(300px, 78vw);
  }

  .mix-row {
    grid-template-columns: 1fr 1fr;
  }

  .volume {
    grid-column: 1 / -1;
  }

  .lyrics {
    max-height: 420px;
    padding: 150px 2px;
  }
}
