:root {
  color-scheme: dark;
  --ink: #06030d;
  --deep: #120023;
  --violet: #39106d;
  --purple: #7b1dff;
  --magenta: #ff2fb3;
  --hot: #ff6b58;
  --cyan: #31d8ff;
  --blue: #276bff;
  --lime: #d9ff5f;
  --text: #fff7ff;
  --muted: #bfaed5;
  --soft: #eadfff;
  --glass: rgba(24, 5, 46, 0.66);
  --glass-strong: rgba(18, 4, 36, 0.86);
  --line: rgba(255, 255, 255, 0.14);
  --glow: 0 28px 90px rgba(255, 47, 179, 0.28);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(49, 216, 255, 0.18), transparent 34%),
    radial-gradient(circle at 78% 20%, rgba(255, 47, 179, 0.24), transparent 30%),
    linear-gradient(135deg, #07020d 0%, #1b0635 48%, #08020e 100%);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

button,
select {
  cursor: pointer;
}

button {
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
}

button:hover,
.download-link:hover {
  border-color: rgba(255, 107, 88, 0.82);
  box-shadow: 0 0 26px rgba(255, 47, 179, 0.22);
}

button[aria-pressed="true"] {
  color: #19051f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--hot), var(--magenta));
}

input,
select {
  width: 100%;
  padding: 0 16px;
  color: var(--text);
  background: rgba(7, 2, 17, 0.72);
  outline: none;
}

input::placeholder {
  color: rgba(234, 223, 255, 0.52);
}

select {
  color: var(--soft);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(180deg, rgba(6, 3, 13, 0.25), rgba(6, 3, 13, 0.98) 84%),
    linear-gradient(90deg, rgba(6, 3, 13, 0.94), rgba(6, 3, 13, 0.34) 48%, rgba(6, 3, 13, 0.94)),
    url("assets/sonic-bg.webp") center / cover no-repeat;
  filter: saturate(1.35) contrast(1.08);
}

.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 20%, transparent 0 16%, rgba(6, 3, 13, 0.72) 42%, rgba(6, 3, 13, 0.95)),
    linear-gradient(180deg, transparent 0 42%, rgba(255, 47, 179, 0.08), transparent 72%);
}

.motion-grid {
  position: fixed;
  inset: -112px;
  z-index: -3;
  opacity: 0.4;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 70%, transparent);
}

.motion-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(49, 216, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 47, 179, 0.1) 1px, transparent 1px);
  background-size: 56px 56px;
  animation: grid-flow 18s linear infinite;
  will-change: transform;
}

@keyframes grid-flow {
  to { transform: translate3d(56px, 112px, 0); }
}

.site-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 calc(40px + env(safe-area-inset-bottom));
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.deck-card,
.control-panel,
.tracks-panel,
.queue-panel {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(26px);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 610px;
  padding: clamp(24px, 5vw, 62px);
  overflow: hidden;
  border-radius: 32px;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background:
    linear-gradient(130deg, rgba(255, 47, 179, 0.24), transparent 38%),
    radial-gradient(circle at 78% 74%, rgba(49, 216, 255, 0.22), transparent 32%);
  pointer-events: none;
}

.hero-copy::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10%;
  height: 170px;
  opacity: 0.62;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(255, 47, 179, 0.58) 9px 14px, transparent 14px 18px),
    linear-gradient(90deg, rgba(255, 47, 179, 0.1), rgba(217, 255, 95, 0.32), rgba(49, 216, 255, 0.28), rgba(255, 47, 179, 0.18));
  clip-path: polygon(0 74%, 6% 54%, 11% 70%, 16% 38%, 22% 60%, 27% 25%, 33% 72%, 39% 18%, 44% 60%, 50% 32%, 56% 72%, 62% 40%, 68% 62%, 74% 22%, 80% 66%, 86% 36%, 92% 54%, 100% 20%, 100% 100%, 0 100%);
  animation: spectrum-shift 3.2s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes spectrum-shift {
  from { transform: translateY(10px) scaleY(0.88); filter: hue-rotate(0deg); }
  to { transform: translateY(-8px) scaleY(1.06); filter: hue-rotate(24deg); }
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.hero-logo {
  position: absolute;
  z-index: 1;
  top: 18px;
  left: 50%;
  width: min(700px, 76%);
  max-height: 380px;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 18px rgba(134, 35, 255, 0.28));
  pointer-events: none;
}

.signal-label {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  color: var(--hot);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(52px, 10vw, 132px);
  line-height: 0.86;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(255, 47, 179, 0.34);
}

.hero-copy p {
  max-width: 680px;
  margin-top: 20px;
  color: var(--soft);
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.45;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-stats span {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.hero-stats strong {
  color: var(--text);
}

.deck-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 610px;
  padding: 18px;
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 47, 179, 0.32), transparent 38%),
    linear-gradient(180deg, rgba(6, 3, 13, 0.78), rgba(51, 6, 91, 0.88) 54%, rgba(8, 2, 15, 0.94));
}

.deck-card::before {
  content: "Music Player";
  display: block;
  height: 34px;
  padding-left: 26px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 900;
  line-height: 34px;
  background:
    radial-gradient(circle at 7px 50%, transparent 0 4px, var(--soft) 4px 5px, transparent 5px),
    linear-gradient(135deg, transparent 0 50%, var(--soft) 51% 55%, transparent 56%) left 3px center / 14px 14px no-repeat;
  opacity: 0.95;
}

.deck-orbit {
  display: grid;
  place-items: center;
  min-height: 238px;
}

.disc {
  position: relative;
  display: grid;
  place-items: center;
  width: min(264px, 68vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 107, 88, 0.95), rgba(255, 47, 179, 0.38), rgba(49, 216, 255, 0.78)),
    url("assets/sonic-bg.webp") center / cover;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.045), 0 0 0 2px rgba(255, 107, 88, 0.78), 0 24px 70px rgba(255, 47, 179, 0.34);
  transform: translateY(0);
}

.disc::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%);
  pointer-events: none;
}

.disc-face {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.18) contrast(1.08);
  transform-origin: 50% 50%;
}

.disc::after {
  content: "";
  position: absolute;
  left: -5px;
  top: 31px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 18px rgba(255, 107, 88, 0.9);
}

.disc-core {
  position: relative;
  z-index: 1;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 3, 13, 0.38);
}

.disc.is-spinning .disc-face {
  animation: disc-spin 7s linear infinite;
}

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

.wave-field {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 172px;
  height: 116px;
  padding: 0 22px;
  opacity: 0.72;
  pointer-events: none;
  overflow: hidden;
}

.wave-field::before {
  content: "";
  position: absolute;
  left: -18%;
  right: -18%;
  top: 2px;
  height: 86px;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 10px, rgba(255, 255, 255, 0.1) 11px 12px, transparent 13px 20px);
  transform: scaleX(1.6);
  opacity: 0.32;
}

.wave-field span {
  position: absolute;
  left: -12%;
  right: -12%;
  height: 72px;
  border-radius: 50%;
  border-top: 2px solid rgba(255, 47, 179, 0.72);
  filter: drop-shadow(0 0 12px rgba(255, 47, 179, 0.42));
  transform: translateY(34px) scaleX(1.12);
}

.wave-field span:nth-child(2) {
  border-color: rgba(49, 216, 255, 0.64);
  transform: translateY(48px) scaleX(1.36);
}

.wave-field span:nth-child(3) {
  border-color: rgba(217, 255, 95, 0.42);
  transform: translateY(63px) scaleX(1.62);
}

.is-playing .wave-field span {
  animation: wave-drift 4.6s ease-in-out infinite alternate;
}

.is-playing .wave-field span:nth-child(2) {
  animation-delay: 0.7s;
}

.is-playing .wave-field span:nth-child(3) {
  animation-delay: 1.3s;
}

@keyframes wave-drift {
  from { margin-left: -18px; opacity: 0.48; }
  to { margin-left: 18px; opacity: 0.86; }
}

.now-card {
  margin-top: 6px;
  padding: 10px 4px;
}

.now-card h2 {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(22px, 4vw, 30px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-card p,
.panel-title p,
.track-main span,
.track-artist,
.genre-name,
.queue-row span,
.mobile-player span {
  color: var(--muted);
}

.transport {
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: auto;
}

.transport button:nth-child(4),
.transport button:nth-child(5) {
  min-height: 36px;
  font-size: 12px;
}

.primary-play {
  width: 76px;
  min-height: 76px;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7b4c, #ff3ea5);
  box-shadow: 0 14px 38px rgba(255, 83, 126, 0.44);
  font-weight: 900;
}

.progress-wrap,
.volume-wrap {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  color: var(--soft);
  font-size: 12px;
}

.volume-wrap {
  grid-template-columns: 62px minmax(0, 1fr);
}

input[type="range"] {
  min-height: 30px;
  padding: 0;
  border: 0;
  accent-color: var(--hot);
  background: transparent;
}

.control-panel {
  display: block;
  margin-top: 22px;
  padding: 18px;
  border-radius: 26px;
}

.collapse-head,
.panel-title,
.panel-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.collapse-head,
.panel-title {
  justify-content: space-between;
}

.collapse-head h2 {
  font-size: 28px;
}

.panel-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.collapse-toggle {
  min-width: 96px;
}

.control-body {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(360px, 1.2fr) auto;
  gap: 16px;
  align-items: end;
  margin-top: 14px;
}

.collapsible-section.is-collapsed .collapsible-body {
  display: none;
}

.search-zone label,
.filter-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.tracks-panel,
.queue-panel {
  overflow: hidden;
  border-radius: 28px;
}

.panel-title {
  align-items: end;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 {
  font-size: 28px;
}

.panel-title.compact {
  align-items: center;
}

.track-head,
.track-row {
  display: grid;
  grid-template-columns: 70px minmax(270px, 1.4fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) 190px;
  gap: 12px;
  align-items: center;
}

.track-head {
  height: 40px;
  padding: 0 16px 0 98px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.track-list {
  position: relative;
  height: min(690px, calc(100vh - 140px));
  min-height: 440px;
  overflow: auto;
  overscroll-behavior: contain;
}

.track-spacer {
  position: relative;
  min-height: 100%;
}

.track-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 76px;
  min-height: 76px;
  padding: 0 16px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(7, 2, 17, 0.34);
}

.track-row:hover,
.track-row.is-current {
  background: linear-gradient(90deg, rgba(255, 47, 179, 0.16), rgba(49, 216, 255, 0.08));
}

.row-play {
  min-width: 58px;
  padding: 0 10px;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--hot), var(--magenta));
  font-weight: 900;
}

.track-main,
.track-pack,
.track-artist {
  min-width: 0;
}

.track-main strong,
.track-main span,
.track-artist,
.genre-name,
.queue-row strong,
.queue-row span,
.mobile-player strong,
.mobile-player span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-main strong {
  margin-bottom: 5px;
}

.pack-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid rgba(49, 216, 255, 0.38);
  border-radius: 999px;
  color: #bdf4ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.genre-name {
  margin-top: 4px;
}

.track-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.07);
}

.queue-panel {
  position: sticky;
  top: 18px;
}

.queue-list {
  max-height: 690px;
  overflow: auto;
  padding: 10px;
}

.queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 8px;
  align-items: center;
  min-height: 66px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
}

.queue-row.is-current {
  border-color: rgba(255, 107, 88, 0.5);
  background: rgba(255, 47, 179, 0.13);
}

.queue-row button {
  min-width: 50px;
  padding: 0;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

.mobile-player {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
  display: none;
  grid-template-columns: minmax(0, 1fr) 72px 72px;
  gap: 8px;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(255, 107, 88, 0.55);
  border-radius: 24px;
  background: rgba(18, 4, 36, 0.88);
  box-shadow: 0 16px 56px rgba(255, 47, 179, 0.26);
  backdrop-filter: blur(24px);
}

.mobile-player button {
  background: linear-gradient(135deg, var(--hot), var(--magenta));
  border-color: transparent;
  font-weight: 900;
}

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

.disc.is-spinning .disc-face {
  animation: disc-spin 7s linear infinite !important;
}

@media (max-width: 1180px) {
  .hero-panel,
  .content-grid,
  .control-body {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 420px;
  }

  .hero-logo {
    width: min(620px, 82%);
    max-height: 300px;
  }

  .deck-card {
    width: min(430px, 100%);
    min-height: 650px;
    margin: 0 auto;
  }

  .queue-panel {
    position: static;
  }

  .queue-list {
    max-height: 280px;
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 18px, 440px);
    padding-top: 8px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .hero-panel {
    gap: 14px;
  }

  .hero-copy {
    min-height: auto;
    padding: 18px;
    border-radius: 26px;
    padding-top: 180px;
  }

  .hero-copy::after {
    height: 92px;
    bottom: 0;
    opacity: 0.38;
  }

  h1 {
    font-size: clamp(44px, 15vw, 72px);
  }

  .hero-logo {
    top: 10px;
    width: 92%;
    max-height: 190px;
  }

  .hero-copy p {
    font-size: 15px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .deck-card {
    min-height: 640px;
    padding: 14px;
    border-radius: 34px;
  }

  .deck-orbit {
    min-height: 246px;
  }

  .disc {
    width: min(254px, 72vw);
  }

  .wave-field {
    bottom: 158px;
    height: 106px;
    padding: 0 14px;
  }

  .transport {
    grid-template-columns: 1fr 76px 1fr;
  }

  .transport button:nth-child(4),
  .transport button:nth-child(5) {
    grid-column: span 1;
  }

  .control-panel {
    padding: 14px;
    border-radius: 24px;
  }

  .filter-grid,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    display: grid;
  }

  .quick-actions {
    display: grid;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .collapse-head {
    align-items: flex-start;
  }

  .panel-actions {
    width: 100%;
    justify-content: space-between;
  }

  .track-head {
    display: none;
  }

  .track-list {
    height: 62vh;
    min-height: 440px;
  }

  .track-row {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas:
      "play main"
      "artist artist"
      "pack pack"
      "actions actions";
    gap: 7px 10px;
    height: 172px;
    min-height: 172px;
    padding: 12px;
  }

  .row-play {
    grid-area: play;
  }

  .track-main {
    grid-area: main;
  }

  .track-artist {
    grid-area: artist;
  }

  .track-pack {
    grid-area: pack;
  }

  .track-actions {
    grid-area: actions;
    justify-content: stretch;
  }

  .track-actions > * {
    flex: 1;
  }

  .queue-panel {
    display: none;
  }

  .mobile-player {
    display: grid;
  }
}

@media (max-width: 420px) {
  .site-shell {
    width: min(100% - 12px, 420px);
  }

  .hero-copy {
    padding-top: 154px;
  }

  .hero-logo {
    max-height: 158px;
  }

  .search-input-row,
  .progress-wrap {
    grid-template-columns: 1fr;
  }

  .progress-wrap span {
    display: none;
  }

  .deck-card {
    min-height: 612px;
  }

  .track-row {
    height: 188px;
    min-height: 188px;
  }
}
