@import url("/strela-sound/v2.css");

:root {
  --bg: #000;
  --surface: #121212;
  --muted: #8d8d8d;
  --text: #fff;
  --accent: #ff0;
  --nav: clamp(186px, 18.5vw, 244px);
  --line: #ffffff19;
  --pad: clamp(16px, 3vw, 40px);
}
.sidebar {
  padding: clamp(23px,3vw,42px) 25px 24px;
  background: #000;
  border: 0;
  gap: 27px;
}
.wordmark { color: #ff0; font-size: clamp(28px, 4vw, 42px); }
.wordmark i { margin-right: 10px; }
.sidebar nav { gap: 4px; }
.sidebar nav button { padding: 11px 6px; min-height: 48px; font-size: 15px; border-radius: 0; gap: 13px; }
.sidebar nav button[aria-current=page] { background: transparent; color: #fff; }
.sidebar nav button:hover { background: transparent; color: #fff; }
.sidebar nav svg { width: 23px; height: 23px; }
.side-footer { padding: 0 6px; font-size: 15px; }
.side-footer small { display: block; font-size: 12px; }
.side-footer strong { color: #eee; }
main { padding-top: 40px; }
body[data-view=home] main { max-width: none; padding: 0 18px 0 0; }
body[data-view=home] .top, body[data-view=home] .player { display: none; }
body:not([data-view=search]) .top { display: none; }
#query { background: #1a1a1a; border-radius: 999px; padding-block: 14px; }
.search-icon { top: 16px; }
.wave-layout {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(185px, .7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: clamp(7px, 3vw, 44px);
  overflow: hidden;
}
.wave-rail {
  display: grid;
  align-content: center;
  gap: clamp(9px, 2.2vh, 23px);
  padding: 21px 0 21px 11px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(transparent, #000 7%, #000 92%, transparent);
}
.rail-item {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.35vw, 22px);
  min-width: 0;
  padding: 0 4px 0 0;
  text-align: left;
  border-radius: 10px;
}
.rail-item:nth-child(1), .rail-item:nth-child(7n) { margin-left: 35px; }
.rail-item:nth-child(2), .rail-item:nth-child(6n) { margin-left: 19px; }
.rail-item:nth-child(3), .rail-item:nth-child(5n) { margin-left: 8px; }
.rail-item .art, .rail-icon { width: clamp(44px, 6.7vw, 84px); flex: 0 0 auto; border-radius: 16px; }
.rail-item .track-meta { overflow: hidden; }
.rail-item b { font-size: clamp(12px, 1.35vw, 19px); line-height: 1.17; display: block; overflow-wrap: anywhere; }
.rail-item small { color: #777; font-weight: 650; }
.rail-item:hover { transform: translateX(4px); transition: transform .18s ease; }
.rail-icon {
  display: grid; place-items: center; aspect-ratio: 1;
  color: #ff8e38; background: radial-gradient(circle,#ff7d4455,transparent 70%);
}
.rail-icon svg { width: 77%; height: 77%; fill: currentColor; stroke: none; filter: drop-shadow(0 0 5px currentColor); }
.rail-item:nth-child(even) .rail-icon { color: #5b7dff; background: radial-gradient(circle,#5979ff55,transparent 70%); }
.wave {
  min-height: min(91dvh, 940px);
  justify-content: center;
  align-items: center;
  position: relative; overflow: visible;
  padding: 28px 0 38px;
  background: #000; border-radius: 0;
  isolation: isolate;
}
.wave-art {
  inset: 3% -3% 6%;
  mask-image: radial-gradient(ellipse at 50% 49%, #000 38%, transparent 76%);
  filter: blur(clamp(20px,3.8vw,52px));
}
.wave-art i {
  border: 0; box-shadow: none; width: auto; height: auto; background: none;
  position: absolute; inset: auto; translate: 0 0; transform: none;
  animation: ambient-morph 14s ease-in-out infinite alternate;
  will-change: transform;
}
.wave-art i:first-child {
  left: 20%; top: 11%; width: 60%; height: 67%; border-radius: 49% 51% 33% 67% / 59% 43% 57% 41%;
  background: #ad21b2; opacity: .73;
}
.wave-art i:nth-child(2) {
  left: 26%; top: 26%; width: 52%; height: 51%; border-radius: 31% 69% 52% 48% / 55% 37% 63% 45%;
  background: #f21b8f; animation-delay: -7s;
}
.wave-art i:nth-child(3) {
  left: 28%; top: 25%; width: 42%; height: 48%; border-radius: 61% 39% 28% 72% / 52% 61% 39% 48%;
  background: #ffdf09; animation-delay: -2s; opacity: .89;
}
@keyframes ambient-morph {
  from { transform: translate(-2%,3%) rotate(-12deg) scale(.93); }
  to { transform: translate(10%,-5%) rotate(23deg) scale(1.09); }
}
.wave-content { width: 100%; text-align: center; }
.wave h1 { font-size: clamp(49px,7.3vw,113px); font-weight: 850; letter-spacing: -.055em; white-space: nowrap; margin: 0 0 clamp(20px,7vh,110px); }
.wave-deck { display: grid; justify-items: center; gap: 14px; }
.wave-cover { width: clamp(78px,8.5vw,110px); height: clamp(78px,8.5vw,110px); padding: 0; }
.wave-cover .art { border-radius: 9px; }
.art { place-items: center; place-content: normal; background: #242424; }
.art:has(img[hidden]) { display: grid; }
.art svg { color: #c1c1c1; }
.wave-info { display: flex; justify-content: center; align-items: center; gap: 5px; width: min(96%,510px); }
.wave-tool {
  display: grid; place-items: center; border-radius: 50%; width: clamp(31px,3.8vw,46px);
  height: clamp(31px,3.8vw,46px); flex: 0 0 auto; padding: 0;
  color: #eee; background: #252525ae;
}
.wave-tool:hover { background: #333; }
.wave-tool.active-like, .wave-tool[aria-pressed=true] { color: #ff0; }
.wave-progress {
  position: relative; overflow: hidden; flex: 1; background: #232323b9;
  border-radius: 999px; min-width: 0; height: clamp(39px,5.1vw,60px); display: grid;
}
.wave-progress::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--position,0%);
  background: #ffffff22; pointer-events: none;
}
#wave-track {
  position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: clamp(12px,1.55vw,19px); font-weight: 750; padding: 0 12px;
}
#wave-progress {
  position: absolute; z-index: 2; inset: auto 9px 5px; width: calc(100% - 18px);
  margin: 0; height: 9px; opacity: 0; cursor: pointer;
}
.wave-progress:hover #wave-progress,#wave-progress:focus-visible { opacity: 1; }
.wave-controls { display: flex; align-items: center; justify-content: center; gap: clamp(17px,2.7vw,33px); margin: 5px 0; }
.wave-controls button { display: grid; place-items: center; padding: 0; width: 35px; height: 35px; }
.wave-controls svg { width: 23px; height: 23px; fill: currentColor; }
.wave-controls button.wave-play { background: #ff0; color: #000; border-radius: 50%; width: clamp(55px,6vw,72px); height: clamp(55px,6vw,72px); }
.wave-play:hover { scale: 1.045; }
.wave-controls .wave-play svg { width: 28px; height: 28px; }
.wave-settings { color: #b6b6b6; background: #181818c9; border-radius: 999px; padding: 9px 15px; font-weight: 650; }
.wave-settings:hover { color: #fff; }
.primary,.controls button:nth-child(2) { color: #000; }
.player, .sidebar nav button[aria-current=page].active { background: #141414; }
dialog,.empty,.sheet-buttons button,.sheet-buttons a,.mix { background: #191919; }
.mix:nth-child(n) { background: #202020; }
.sheet-buttons button:hover,.sheet-buttons a:hover { background: #252525; }
.chip.active { background: #252525; }
@media (max-width: 760px) {
  :root { --nav: 0px; --pad: 17px; }
  .sidebar { padding: 5px 8px max(5px,env(safe-area-inset-bottom)); gap: 0; background: #121212; border-top: 1px solid var(--line); }
  .sidebar nav { grid-template-columns: repeat(4,1fr); gap: 0; }
  .sidebar nav button { gap: 2px; min-height: 46px; padding: 3px 1px; font-size: 10px; white-space: nowrap; }
  .sidebar nav svg { width: 19px; height: 19px; }
  main { padding-top: max(24px,env(safe-area-inset-top)); }
  body[data-view=home] main { padding: 0 13px 75px; }
  .wave-layout { grid-template-columns: 1fr; min-height: auto; gap: 6px; }
  .wave { grid-row: 1; min-height: max(465px,68dvh); padding: max(22px,env(safe-area-inset-top)) 0 8px; }
  .wave-art { inset: -10% -16% 2%; }
  .wave h1 { margin-bottom: clamp(27px,6vh,60px); font-size: clamp(43px,11vw,76px); }
  .wave-deck { gap: 11px; }
  .wave-rail { display: flex; max-height: none; overflow: auto; mask-image: none; padding: 8px 0 4px; scrollbar-width: none; }
  .rail-item:nth-child(n) { flex: 0 0 116px; margin-left: 0; gap: 4px; flex-direction: column; padding: 0; text-align: center; }
  .rail-item .art,.rail-icon { width: 67px; }
  .rail-item small { font-size: 10px; }
  .rail-item b { font-size: 12px; }
  body[data-view=search] .top .wordmark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wave-art i { animation: none; will-change: auto; }
}

/* The desktop keeps its vertical rail. Small touch screens use a snap wheel. */
.wheel { min-width: 0; }
.wheel-label, .wheel-controls { display: none; }
.wave-art {
  --outer: #b718a9;
  --middle: #ef1686;
  --core: #ffde0d;
  filter: blur(clamp(16px, 3.2vw, 42px));
}
body[data-palette=blue] .wave-art {
  --outer: #500dbe;
  --middle: #0462ff;
  --core: #40f4de;
}
body[data-palette=sunset] .wave-art {
  --outer: #c00b67;
  --middle: #f2343a;
  --core: #ffad30;
}
.wave-art i:first-child { background: var(--outer); }
.wave-art i:nth-child(2) { background: var(--middle); }
.wave-art i:nth-child(3) { background: var(--core); }
.wave-art i { animation: color-flow 9s ease-in-out infinite alternate; }
.wave-art i:nth-child(2) { animation-duration: 13s; animation-delay: -7s; }
.wave-art i:nth-child(3) { animation-duration: 11s; animation-delay: -3s; }
@keyframes color-flow {
  0% { transform: translate(-12%, 8%) rotate(-24deg) scale(.83, .96); }
  45% { transform: translate(3%, -6%) rotate(16deg) scale(1.10, .94); }
  100% { transform: translate(10%, 3%) rotate(37deg) scale(.94, 1.12); }
}
body:not([data-view=home]) .wave-art i,
body[data-motion=off] .wave-art i { animation: none; will-change: auto; }
.rail-icon { position: relative; overflow: hidden; }
.rail-icon .art { position: absolute; inset: 0; width: 100%; }
.rail-icon .art:has(img[hidden]), .rail-icon .art:not(:has(img)) { opacity: 0; }
.rail-icon .art img { display: block; }
.wave-tool { min-width: 34px; min-height: 34px; }

@media (max-width: 760px) {
  body[data-view=home] main { padding-inline: 0; }
  .wave-layout { gap: 0; }
  .wave { min-height: max(360px, 58dvh); padding-inline: 12px; }
  .wave h1 { margin-bottom: clamp(18px, 4vh, 37px); font-size: clamp(40px, 11vw, 74px); }
  .wave-art { inset: -4% -13% 0; }
  .wave-deck { gap: 10px; }
  .wave-controls { grid-row: 2; margin-block: 0; }
  .wave-info { grid-row: 3; }
  .wave-cover { width: 73px; height: 73px; }
  .wave-settings { font-size: 13px; }
  .wheel-label {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 3px 20px; color: #aaa;
  }
  .wheel-label h2 { font-size: 17px; color: #eee; }
  .wheel-label span { font-size: 11px; font-variant-numeric: tabular-nums; }
  .wave-rail {
    --card: clamp(132px, 40vw, 208px);
    display: flex;
    gap: 9px;
    padding: 12px calc((100% - var(--card))/2) 12px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }
  .wave-rail::-webkit-scrollbar { display: none; }
  .rail-item:nth-child(n) {
    flex: 0 0 var(--card); scroll-snap-align: center; margin: 0;
    min-height: 144px; justify-content: center; gap: 6px;
    isolation: isolate; position: relative; overflow: hidden;
    border-radius: 21px; background: radial-gradient(ellipse at 68% 0%, #4650a0a6, transparent 75%),#18181d;
    opacity: var(--fade,1);
  }
  .rail-item:nth-child(3n+1) { background: radial-gradient(ellipse at 54% 0%,#97466ca6,transparent 75%),#1d151b; }
  .rail-item:nth-child(3n+2) { background: radial-gradient(ellipse at 54% 0%,#248674a6,transparent 75%),#13201e; }
  .rail-item :is(.rail-icon, .art, .track-meta) {
    transform: perspective(350px) translateY(var(--depth,0px)) rotateY(var(--turn,0deg)) scale(var(--scale,1));
  }
  .rail-item .rail-icon .art { transform: none; }
  .rail-item:hover, .rail-item:focus { translate: none; transform: none; }
  .rail-item .rail-icon, .rail-item > .art { width: 72px; border-radius: 12px; }
  .rail-item .track-meta { max-width: 100%; padding-inline: 7px; }
  .rail-item small { color: #ccc; }
  .wheel-controls {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; width: 100%; min-height: 28px;
  }
  .wheel-controls button { font-size: 27px; color: #ddd; width: 38px; line-height: 1; }
  .wheel-dots { display: flex; gap: 4px; align-items: center; }
  .wheel-dots span { width: 5px; height: 5px; border-radius: 8px; background: #666; }
  .wheel-dots .selected { width: 14px; background: #ff0; }
}
@media (prefers-reduced-motion: reduce) {
  .wave-art i { animation: none; }
}
