:root {
  color-scheme: dark;
  --page-bg: #07080c;
  --panel: rgba(15, 17, 25, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --text: #fffaf4;
  --muted: #b9c0cc;
  --line: rgba(255, 255, 255, 0.15);
  --accent: #e9b765;
  --accent-two: #d8548e;
  --accent-three: #4bd4c3;
  --shadow: rgba(0, 0, 0, 0.48);
  --button-text: #100d11;
  --font-main: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(126deg, #07080c, #15111b 43%, #0a1b1c),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 16px
    );
  color: var(--text);
  font-family: var(--font-main);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 34px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
}

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-two) 55%, var(--accent-three));
  box-shadow: 0 14px 34px var(--shadow);
  color: var(--button-text);
  font-size: 0.86rem;
  font-weight: 950;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 850;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.live-status {
  min-width: 128px;
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 18px 50px var(--shadow);
  font-size: 0.9rem;
  backdrop-filter: blur(18px);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent), transparent 78%);
}

body.is-playing .status-dot {
  animation: pulse 1.1s ease-in-out infinite;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 20px;
  align-items: stretch;
}

.player-stage,
.controls {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.player-stage {
  min-height: 680px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(150deg, rgba(18, 10, 23, 0.96), rgba(21, 21, 33, 0.94) 52%, rgba(5, 35, 35, 0.92)),
    radial-gradient(circle at 80% 14%, rgba(75, 212, 195, 0.24), transparent 34%);
}

.player-stage::before,
.player-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.player-stage::before {
  background:
    linear-gradient(
      120deg,
      transparent 0,
      color-mix(in srgb, var(--accent-two), transparent 80%) 28%,
      transparent 60%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.07) 0,
      rgba(255, 255, 255, 0.07) 1px,
      transparent 1px,
      transparent 54px
    );
  mix-blend-mode: screen;
}

.player-stage::after {
  background:
    linear-gradient(to bottom, transparent 0 68%, rgba(0, 0, 0, 0.34)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 6px
    );
  opacity: 0.64;
}

.stage-lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.stage-lines span {
  position: absolute;
  width: 130%;
  height: 32%;
  left: -15%;
  border-top: 1px solid color-mix(in srgb, var(--accent), transparent 48%);
  border-bottom: 1px solid color-mix(in srgb, var(--accent-three), transparent 58%);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent-two), transparent 78%),
    color-mix(in srgb, var(--accent-three), transparent 84%),
    transparent
  );
  opacity: 0.72;
  animation: drift 10s ease-in-out infinite;
}

.stage-lines span:nth-child(1) {
  top: 12%;
  transform: rotate(-14deg);
}

.stage-lines span:nth-child(2) {
  top: 38%;
  animation-delay: -3.5s;
  transform: rotate(11deg);
}

.stage-lines span:nth-child(3) {
  top: 64%;
  animation-delay: -6s;
  transform: rotate(-7deg);
}

.cover-wrap {
  position: relative;
  z-index: 2;
  width: min(430px, 86%);
  aspect-ratio: 1;
  align-self: center;
  display: grid;
  place-items: center;
}

.cover-wrap::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 8px;
  background: conic-gradient(
    from 90deg,
    var(--accent),
    var(--accent-three),
    var(--accent-two),
    var(--accent)
  );
  filter: blur(10px);
  opacity: 0.48;
}

.cover-art,
.cover-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 1px solid color-mix(in srgb, var(--text), transparent 76%);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.44);
}

.cover-fallback {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(233, 183, 101, 0.92), rgba(216, 84, 142, 0.78)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14) 0,
      rgba(255, 255, 255, 0.14) 2px,
      transparent 2px,
      transparent 18px
    );
}

.cover-fallback span {
  color: var(--button-text);
  font-size: clamp(6rem, 20vw, 11rem);
  font-weight: 950;
}

.cover-art[src] {
  z-index: 2;
}

.song-copy {
  position: relative;
  z-index: 3;
  max-width: 640px;
}

.eyebrow,
.compact-now-playing p,
.section-heading p {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.song-copy h1 {
  margin: 10px 0 10px;
  font-size: 4.45rem;
  line-height: 0.96;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.song-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 700;
}

.visualizer {
  position: absolute;
  z-index: 1;
  right: -70px;
  bottom: 24px;
  width: 84%;
  height: 180px;
  opacity: 0.72;
}

.controls {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background:
    linear-gradient(160deg, var(--panel), rgba(12, 13, 20, 0.8)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.045) 0,
      rgba(255, 255, 255, 0.045) 1px,
      transparent 1px,
      transparent 12px
    );
}

.compact-now-playing {
  display: grid;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.compact-now-playing h2 {
  margin: 0;
  font-size: 2.05rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.compact-now-playing span {
  color: var(--muted);
}

.transport {
  display: grid;
  grid-template-columns: 54px 74px 54px;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.icon-button,
.play-button,
.playlist-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.icon-button {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.play-button {
  position: relative;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-three));
  color: var(--button-text);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--accent), transparent 72%);
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 21px solid currentColor;
  margin-left: 5px;
}

body.is-playing .play-icon {
  width: 22px;
  height: 27px;
  border: 0;
  margin-left: 0;
  background:
    linear-gradient(90deg, currentColor 0 8px, transparent 8px 14px, currentColor 14px 22px);
}

body.is-muted #muteButton::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 2px;
  background: currentColor;
  transform: rotate(-38deg);
}

.play-button::after,
.icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  pointer-events: none;
  opacity: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text), black 18%);
  color: var(--page-bg);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.play-button:hover::after,
.icon-button:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.timeline,
.volume-row {
  display: grid;
  gap: 10px;
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.volume-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

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

.playlist-section {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.playlist {
  display: grid;
  gap: 8px;
}

.playlist-button {
  width: 100%;
  min-height: 72px;
  padding: 10px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  text-align: left;
}

.playlist-button.is-active {
  border-color: color-mix(in srgb, var(--accent), white 18%);
  background: color-mix(in srgb, var(--accent), transparent 84%);
}

.playlist-thumb {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--accent-two));
}

.playlist-title,
.playlist-artist {
  display: block;
}

.playlist-title {
  font-weight: 850;
  overflow-wrap: anywhere;
}

.playlist-artist {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent), white 12%);
}

button:active {
  transform: translateY(0);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 48%);
  outline-offset: 2px;
}

@media (max-width: 920px) {
  .page-shell {
    width: min(100% - 24px, 720px);
    padding-top: 18px;
  }

  .player-layout {
    grid-template-columns: 1fr;
  }

  .player-stage {
    min-height: 590px;
  }

  .song-copy h1 {
    font-size: 3.35rem;
  }

  .cover-wrap {
    width: min(360px, 86%);
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 18px, 520px);
    gap: 14px;
  }

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

  .live-status {
    justify-content: flex-start;
  }

  .player-stage,
  .controls {
    padding: 18px;
  }

  .player-stage {
    min-height: 520px;
  }

  .cover-wrap {
    width: min(280px, 86%);
  }

  .song-copy h1 {
    font-size: 2.55rem;
  }

  .transport {
    grid-template-columns: 54px 68px 54px;
  }

  .play-button {
    width: 68px;
    height: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes drift {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 4% 8%;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent), transparent 72%);
  }

  50% {
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent), transparent 88%);
  }
}
