/* Cover pigments illuminate one continuous folded surface. */
/* The flyout unfolds from its speaker; closing releases it quickly. The rail
   follows input directly, without easing the user's volume or seek gesture. */
.volume-popover .volume-panel {
  transform: translate3d(0, 9px, 0) scale(.92, .78);
  transform-origin: 50% 100%;
  transition: opacity 130ms cubic-bezier(.4,0,.6,1),
    transform 170ms cubic-bezier(.4,0,.6,1), visibility 0s 170ms;
}
.volume-popover:not([data-dismissed]):is(:hover, :focus-within) .volume-panel {
  transform: none;
  transition: opacity 90ms cubic-bezier(.16,1,.3,1),
    transform 260ms cubic-bezier(.16,1.16,.3,1), visibility 0s;
}
.song-capsule .song-capsule-label,
.song-capsule .song-times {
  transition: opacity 140ms cubic-bezier(.22,1,.36,1),
    transform 220ms cubic-bezier(.16,1,.3,1);
}
.song-capsule .song-times { transform: translate3d(0, 5px, 0) scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .song-capsule:is(:hover, :focus-within) .song-capsule-label {
    opacity: 0;
    transform: translate3d(0, -5px, 0) scale(.98);
  }
  .song-capsule:is(:hover, :focus-within) .song-times {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .volume-popover .volume-panel,
  .volume-popover:not([data-dismissed]):is(:hover, :focus-within) .volume-panel,
  .song-capsule .song-capsule-label,
  .song-capsule .song-times { transition: none; transform: none; }
}
.scene-background {
  isolation: isolate;
  background: #080809;
}
.scene-background [data-scene-base],
.scene-background [data-scene-wash] {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--scene-ink, #080809);
}
.scene-background [data-scene-base] {
  z-index: 0;
}
.scene-background [data-scene-wash] {
  z-index: 1;
  transform-origin: 68% 48%;
}
.scene-background .scene-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 70% 35%,
    color-mix(in srgb, var(--scene-primary) 22%, transparent),
    transparent 76%
  );
}
.scene-background .scene-light + .scene-light {
  background: radial-gradient(
    ellipse at 30% 75%,
    color-mix(in srgb, var(--scene-secondary) 16%, transparent),
    transparent 72%
  );
}
.scene-background [data-ambient] {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: none;
}
.scene-background [data-ambient] + [data-ambient] {
  display: none;
}
.ambient-matter {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
}
.scene-cover-atmosphere {
  position: absolute;
  inset: -20%;
  background-position: center;
  background-size: cover;
  filter: blur(58px);
  transform: scale(1.12);
  opacity: 0.42;
}
.scene-background [data-artwork='real'] .scene-light {
  opacity: 0;
}
.scene-background[data-cover-art='real'] [data-light-field] {
  opacity: 1;
}
/* Unreadable remote pixels still own the hue through the original cover layer. */
.scene-background[data-palette-source='image'] .scene-cover-atmosphere {
  opacity: 1;
}
.scene-background[data-palette-source='image'] [data-light-field] {
  mix-blend-mode: luminosity;
}
.scene-background::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, #0808090a, #08080908 40%, #08080940 100%);
  pointer-events: none;
}
.hero-cover > .cover {
  transform-origin: 50% 64%;
  backface-visibility: hidden;
}
.motion-ghost {
  backface-visibility: hidden;
  contain: paint;
}

/* Taste controls remain within reach without competing with the current song. */
.music-scene {
  position: relative;
}
.flow-toolbar {
  position: absolute;
  top: 12px;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
}
.flow-toolbar .flow-artist-entry,
.flow-toolbar .flow-settings-entry {
  min-height: 44px;
  color: #ffffffe0;
  background: #08080930;
  border: 1px solid #ffffff18;
}
.flow-toolbar .flow-artist-entry {
  padding-inline: 16px;
  border-radius: 24px;
  font-size: 13px;
}
.flow-toolbar .flow-settings-entry {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
@media (hover: hover) and (pointer: fine) {
  .flow-toolbar button:hover {
    color: var(--accent);
    background: #08080960;
  }
}

/* Phone home keeps next-track feedback beside playback and likes. */
.mobile-wave {
  --wave-control: 52px;
  --wave-height: max(360px, calc(var(--app-height) - var(--safe-top) - var(--safe-bottom) - 88px));
  min-height: var(--wave-height);
  display: block;
  color: #fff;
}
.mobile-wave .scene-group {
  position: relative;
  width: 100%;
  height: calc(var(--wave-height) - 64px);
  min-height: 360px;
  max-width: 680px;
  margin: 0 auto;
  padding: 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.mobile-wave .flow-toolbar {
  position: relative;
  top: auto;
  right: auto;
  justify-content: flex-end;
  min-height: 64px;
  padding-block: 8px 12px;
}
.wave-heading {
  position: absolute;
  inset: 8px 0 auto;
  height: 44%;
  text-align: center;
  pointer-events: none;
}
.wave-context {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.wave-heading h1 {
  position: absolute;
  top: 46%;
  left: 0;
  width: 100%;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--wave-name-size, 60px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-align: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.wave-deck {
  position: absolute;
  inset: 28% 0 auto;
  height: 36%;
  min-height: 180px;
}
.wave-stage {
  position: absolute;
  inset: 0 0 calc(var(--wave-control) + 12px);
  display: grid;
  place-items: end center;
}
.mobile-wave .wave-art {
  position: absolute;
  bottom: 0;
  width: 108px;
  height: 108px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
}
.mobile-wave .wave-art > .cover {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.mobile-wave .wave-launch {
  width: 88px;
  height: 88px;
  margin: 0;
  border: 0;
  background: var(--accent);
  color: #0b0b0d;
  box-shadow: none;
}
.mobile-wave .wave-launch .playback-symbol {
  width: 30px;
  height: 30px;
}
.wave-transport {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(100%, 380px);
  height: var(--wave-control);
}
.wave-transport[hidden] {
  display: none;
}
.mobile-wave .wave-pause,
.mobile-wave .wave-like,
.mobile-wave .wave-next {
  width: var(--wave-control);
  height: var(--wave-control);
  min-width: var(--wave-control);
  flex: 0 0 var(--wave-control);
  border: 0;
  border-radius: 50%;
  background: linear-gradient(155deg, #ffffff24, #ffffff0c);
  color: #fff;
  box-shadow: inset 0 1px 0 #ffffff0a;
}
.mobile-wave .wave-pause .playback-symbol {
  width: 20px;
  height: 20px;
}
.wave-track {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-width: 0;
  flex: 1;
  padding: 6px 14px;
  border: 0;
  border-radius: 32px;
  background: linear-gradient(165deg, #ffffff24, #ffffff0c);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  touch-action: pan-y;
}
[data-wave-caption] {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.mobile-wave[data-wave-state='playing'] .wave-launch {
  visibility: hidden;
}
.mobile-wave.has-track .wave-art {
  visibility: visible;
}
.mobile-wave:not([data-wave-state='playing']) .wave-heading h1 {
  top: 64%;
  font-size: 56px;
}
.mobile-wave:not([data-wave-state='playing']) .wave-context {
  visibility: hidden;
}
.mobile-wave:not([data-wave-state='playing']) .wave-deck {
  top: 34%;
  height: 30%;
}
.mobile-wave:not([data-wave-state='playing']) .wave-transport {
  height: 48px;
  border-radius: 28px;
  background: #ffffff12;
  gap: 0;
}
.mobile-wave:not([data-wave-state='playing']) .wave-track,
.mobile-wave:not([data-wave-state='playing']) .wave-like,
.mobile-wave:not([data-wave-state='playing']) .wave-next {
  background: transparent;
}
.mobile-wave:not([data-wave-state='playing']) .wave-like {
  height: 48px;
}
.mobile-wave .scene-feedback {
  position: absolute;
  top: 68%;
  left: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: center;
}
.mobile-wave
  .scene-feedback:has(.scene-status[hidden]):has(.flow-status:empty):not(:has(.coverage-note)) {
  display: none;
}
.wave-ghost-host {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  min-height: 0;
}
.wave-ghost-host .wave-track-ghost {
  max-width: none;
}
@media (max-width: 359px) {
  .mobile-wave {
    --wave-control: 48px;
  }
  .wave-heading h1 {
    top: 28%;
    font-size: min(var(--wave-name-size, 42px), 42px);
  }
  .mobile-wave:not([data-wave-state='playing']) .wave-heading h1 {
    font-size: 44px;
  }
  .mobile-wave .wave-art {
    width: 88px;
    height: 88px;
  }
  .mobile-wave .wave-launch {
    width: 76px;
    height: 76px;
  }
  .wave-track {
    font-size: 13px;
    padding-inline: 10px;
  }
}
@media (min-width: 640px) and (max-height: 620px) {
  .mobile-wave {
    --wave-height: max(
      240px,
      calc(var(--app-height) - var(--safe-top) - var(--safe-bottom) - 76px)
    );
  }
  .mobile-wave .scene-group {
    min-height: 240px;
    display: block;
  }
  .wave-heading {
    width: 48%;
    height: 100%;
  }
  .wave-heading h1 {
    top: 32%;
    font-size: 34px;
  }
  .wave-deck {
    inset: 12% 0 auto 52%;
    height: 74%;
    min-height: 180px;
  }
  .mobile-wave:not([data-wave-state='playing']) .wave-heading h1 {
    top: 38%;
  }
  .mobile-wave:not([data-wave-state='playing']) .wave-deck {
    top: 12%;
    height: 74%;
  }
  .mobile-wave .wave-art {
    width: 92px;
    height: 92px;
  }
  .mobile-wave .wave-launch {
    width: 76px;
    height: 76px;
  }
  .mobile-wave .scene-feedback {
    top: 88%;
  }
}
@media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
  .wave-track,
  .mobile-wave .wave-pause,
  .mobile-wave .wave-like,
  .mobile-wave .wave-next,
  .flow-toolbar .flow-artist-entry,
  .flow-toolbar .flow-settings-entry,
  .mobile-wave:not([data-wave-state='playing']) .wave-transport {
    background: #28282e;
  }
}
body[data-motion-active] .play-button.is-loading::after {
  animation-play-state: paused;
}

/* A visual snapshot never participates in input, accessibility or live state. */
.motion-page-ghost, .motion-page-ghost * {
  pointer-events: none !important;
  animation: none !important;
  transition: none !important;
}
.motion-page-ghost { overflow: clip; contain: paint; }

/* Small controls release slowly after an immediate, tactile compression. */
:root {
  --motion-touch: cubic-bezier(.2,.9,.25,1);
  --motion-release: cubic-bezier(.18,1,.32,1);
}
:is(.button, .icon-button, .chip, .nav-link, .track-main, .playlist-card, .artist-card, .liked-banner) {
  transition: transform 240ms var(--motion-release),
    background-color 180ms var(--motion-touch), color 180ms var(--motion-touch),
    opacity 180ms var(--motion-touch);
  transform-origin: 50% 60%;
}
:is(.button, .icon-button, .chip, .nav-link, .playlist-card, .liked-banner):active:not(:disabled) {
  transform: scale(.982);
  transition-duration: 130ms;
}
.nav-link svg {
  transition: transform 280ms var(--motion-release), opacity 180ms var(--motion-touch);
  transform-origin: center;
}
.nav-link.active svg { transform: translate3d(0,-1px,0) scale(1.055); }
@media (hover: hover) and (pointer: fine) {
  body:not([data-motion-active]) :is(.playlist-card, .liked-banner):hover {
    transform: translate3d(0,-2px,0);
  }
}
body[data-motion-active] .preference-emerge { animation: none; }
body[data-motion-active] :is(.nav-link, .nav-link svg, .playlist-card, .artist-card, .liked-banner) {
  transition: none;
}
body[data-motion-active] :is(.cover-queue, .desktop-cover-controls, .cover-menu, .cover-like) {
  transition: none;
}
body.keyboard-use :is(.button, .icon-button, .chip, .nav-link, .nav-link svg, .track-main, .playlist-card, .artist-card, .liked-banner) {
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .scene-background [data-ambient] {
    transform: none !important;
  }
  :is(.button, .icon-button, .chip, .nav-link, .nav-link svg, .track-main, .playlist-card, .artist-card, .liked-banner) {
    transition: none !important;
    transform: none !important;
  }
}

/* Keep two-line artist names above artwork on portrait Telegram viewports. */
@media (max-width: 639px) {
  .mobile-wave.has-track .wave-heading {
    height: auto;
  }
  .mobile-wave.has-track .wave-heading h1 {
    position: relative;
    top: auto;
    margin-top: 24px;
    font-size: min(var(--wave-name-size, 60px), 11vw);
    line-height: 1.04;
  }
  .mobile-wave.has-track .wave-deck {
    top: max(210px, 34%);
  }
}

/* Flow uses content rows instead of viewport percentages that collide on short phones. */
.mobile-wave {
  --wave-control: 48px;
  --wave-height: max(280px, calc(var(--app-height) - var(--safe-top) - var(--safe-bottom) - 88px));
}
.mobile-wave .scene-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: clamp(20px, 5vh, 40px);
  height: auto;
  min-height: max(216px, calc(var(--wave-height) - 64px));
  padding: 12px 0 28px;
}
.mobile-wave .wave-heading, .mobile-wave.has-track .wave-heading {
  position: relative;
  inset: auto;
  height: auto;
  flex: 0 0 auto;
}
.mobile-wave .wave-heading h1, .mobile-wave.has-track .wave-heading h1,
.mobile-wave:not([data-wave-state='playing']) .wave-heading h1 {
  position: relative;
  top: auto;
  margin: 12px 0 0;
  font-size: min(var(--wave-name-size, 52px), 52px);
  line-height: 1.06;
}
.mobile-wave .wave-context { font-size: 12px; }
.mobile-wave .wave-deck, .mobile-wave.has-track .wave-deck,
.mobile-wave:not([data-wave-state='playing']) .wave-deck {
  position: relative;
  inset: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: auto;
  min-height: 0;
}
.mobile-wave .wave-stage { position: relative; inset: auto; height: 124px; place-items: center; }
.mobile-wave .wave-art { position: relative; bottom: auto; width: 124px; height: 124px; grid-area: 1 / 1; }
.mobile-wave .wave-launch { grid-area: 1 / 1; }
.mobile-wave .wave-art, .mobile-wave .wave-launch { align-self: center; justify-self: center; }
.mobile-wave.has-track .wave-launch { display: none; }
.mobile-wave .wave-transport {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  align-self: center;
  flex: 0 0 auto;
}
.mobile-wave .scene-feedback { position: relative; top: auto; }
.mobile-wave .scene-feedback:empty { display: none; }
.mobile-wave .flow-toolbar .flow-settings-entry { width: 48px; height: 48px; }
.mobile-wave .flow-toolbar .flow-artist-entry { min-height: 48px; }
.mobile-wave .wave-heading h1 .artist-profile-link { min-height: 44px; }
@media (max-width: 359px) {
  .mobile-wave .wave-heading h1, .mobile-wave.has-track .wave-heading h1,
  .mobile-wave:not([data-wave-state='playing']) .wave-heading h1 { font-size: min(var(--wave-name-size, 42px), 42px); }
  .mobile-wave .wave-transport { gap: 2px; }
  .mobile-wave .wave-track { padding-inline: 6px; font-size: 12px; }
}
@media (max-height: 560px) and (min-width: 560px) {
  .mobile-wave .scene-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-content: center; align-items: center; column-gap: 24px; row-gap: 12px; }
  .mobile-wave .wave-heading { width: 100%; }
  .mobile-wave .wave-heading h1, .mobile-wave.has-track .wave-heading h1,
  .mobile-wave:not([data-wave-state='playing']) .wave-heading h1 { font-size: min(var(--wave-name-size, 36px), 36px); }
  .mobile-wave .wave-stage { height: 88px; }
  .mobile-wave .wave-art { width: 88px; height: 88px; }
  .mobile-wave .wave-deck { gap: 12px; }
  .mobile-wave .scene-feedback { grid-column: 1 / -1; }
}

/* Phone listening surface: pigment above, a quiet black floor below. */
@media (max-width: 639px) and (orientation: portrait) {
  .flow-page .scene-background::after {
    background: linear-gradient(180deg, #00000008 0%, #0000 29%, #00000014 45%, #000000b8 74%, #000 96%);
  }
  .flow-page .tabbar {
    background: linear-gradient(180deg, #0000, #000000e6 45%, #000);
    border-top: 0;
  }
  .flow-page .tabbar::before {
    content: '';
    position: absolute;
    inset: -56px 0 100%;
    background: linear-gradient(180deg, #0000, #000000d9);
    pointer-events: none;
  }
  .flow-page .tabbar .nav-link.active::before { display: none; }
  .mobile-wave .flow-toolbar { min-height: 56px; }
  .mobile-wave .flow-toolbar button {
    background: #00000018;
    border-color: transparent;
  }
  .mobile-wave .scene-group { justify-content: flex-start; padding-top: clamp(36px, 7vh, 64px); gap: 32px; }
  .mobile-wave .wave-heading { inset: auto; height: auto; }
  .mobile-wave .wave-context { font-size: 15px; text-shadow: 0 2px 16px #0005; }
  .mobile-wave .wave-heading h1 {
    top: auto;
    font-size: min(var(--wave-name-size, 60px), 60px);
    line-height: 1.04;
    text-shadow: 0 2px 24px #00000018;
  }
  .mobile-wave .wave-deck { top: auto; height: auto; min-height: 0; gap: 24px; }
  .mobile-wave .wave-art {
    width: 144px;
    height: 144px;
    border-radius: 12px;
    box-shadow: 0 16px 42px #0004, 0 1px 0 #ffffff24 inset;
  }
  .mobile-wave .wave-stage { inset: auto; height: 144px; }
  .mobile-wave .wave-transport { gap: 5px; }
  .mobile-wave .wave-track { padding-inline: 10px; }
  .mobile-wave .wave-next { background: transparent; flex-basis: 44px; min-width: 44px; width: 44px; }
  .mobile-wave:not([data-wave-state='playing']) .wave-heading h1 { top: auto; font-size: 48px; }
  .mobile-wave:not([data-wave-state='playing']) .wave-deck { top: auto; height: auto; }
  .mobile-wave.has-track:not([data-wave-state='playing']) .wave-art { visibility: visible; }
  .mobile-wave .scene-feedback { top: auto; }
}
@media (max-width: 359px) and (orientation: portrait) {
  .mobile-wave .wave-heading h1 { font-size: min(var(--wave-name-size, 42px), 42px); top: auto; }
  .mobile-wave .wave-art { width: 112px; height: 112px; }
  .mobile-wave .wave-stage { height: 112px; }
  .mobile-wave .scene-group { padding-top: 24px; gap: 24px; }
  .mobile-wave .wave-deck { top: auto; min-height: 0; gap: 18px; }
  .mobile-wave:not([data-wave-state='playing']) .wave-heading h1 { font-size: 40px; }
  .mobile-wave .wave-track { padding-inline: 8px; font-size: 13px; }
}
@media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
  .mobile-wave .wave-track,
  .mobile-wave .wave-pause,
  .mobile-wave .wave-like { background: #28282e; }
}

/* Playback controls have one transform owner: MusicMotion.press. CSS must not
   resume a second compression when the pointer or the spring is released. */
:is(.play-button, .flow-start, .broken-heart) {
  transition-property: background-color, color, opacity;
}
:is(.play-button, .flow-start, .broken-heart):active:not(:disabled) {
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  :is(.button, .icon-button, .chip, .nav-link, .track-main, .playlist-card, .artist-card, .liked-banner) {
    transition: none !important;
  }
  :is(.button, .icon-button, .chip, .nav-link, .playlist-card, .liked-banner):active:not(:disabled) {
    transform: none !important;
  }
}

/* Aura transport: warm central action and soft PNG silhouettes. */
.ui-icon[data-icon='previous'] { --icon: url('./icons/previous-flat-v2.png') !important; }
.ui-icon[data-icon='next'] { --icon: url('./icons/next-flat-v2.png') !important; }
.play-button,
.mobile-wave .wave-pause,
.mobile-wave .wave-launch {
  color: #231c09;
  background: #ffda57;
  border: 1px solid #ffe99b;
  box-shadow: inset 0 2px 2px #fff6c84d, 0 4px 14px #08080926;
}
.play-button .playback-symbol { width: 34px; height: 34px; }
.mini-player .play-button .playback-symbol { width: 24px; height: 24px; }
.mobile-wave .wave-transport {
  display: grid;
  grid-template-columns: 44px minmax(44px, 1fr) 64px minmax(44px, 1fr) 44px;
  grid-template-rows: auto 64px;
  align-items: center;
  justify-items: center;
  gap: 8px 2px;
  width: min(100%, 328px);
  max-width: 100%;
}
.mobile-wave .wave-track {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  background: transparent;
}
.mobile-wave .wave-previous,
.mobile-wave .wave-next {
  grid-row: 2;
  width: 48px;
  height: 48px;
  min-width: 44px;
  padding: 8px;
  border-radius: 50%;
  color: #fff9eb;
  background: transparent;
  box-shadow: none;
}
.mobile-wave .wave-previous { grid-column: 2; }
.mobile-wave .wave-next { grid-column: 4; }
.mobile-wave .wave-previous .ui-icon,
.mobile-wave .wave-next .ui-icon { width: 32px; height: 32px; }
.mobile-wave .wave-pause {
  grid-column: 3;
  grid-row: 2;
  width: 64px;
  height: 64px;
  min-width: 64px;
}
.mobile-wave .wave-pause .playback-symbol { width: 36px; height: 36px; }
.mobile-wave .wave-like {
  grid-column: 5;
  grid-row: 2;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: transparent;
  box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  .play-button:hover:not(:disabled) { background-color: #ffe477; }
}
