/*
  Music station mobile polish:
  - compact inline song comments
  - lyric auto-follow stays inside the lyric panel
  - dedicated reflections panel removed from the page
*/

:root {
  color-scheme: dark;
  --bg-url: url("music-grass-bg.jpg");
  --default-cover: url("music-heart-cover.jpg");
  --ink: #f9fff8;
  --muted: rgba(240, 251, 240, 0.75);
  --soft: rgba(230, 245, 230, 0.52);
  --line: rgba(235, 255, 236, 0.28);
  --line-green: rgba(146, 184, 135, 0.34);
  --accent: #d8ba71;
  --accent-soft: rgba(216, 186, 113, 0.18);
  --gold: #ead38c;
  --sage: #a9bea2;
  --grass: #7ea46e;
  --deep-green: #183225;
  --paper: rgba(232, 246, 229, 0.22);
  --paper-strong: rgba(230, 245, 226, 0.34);
  --glass-light: rgba(247, 255, 246, 0.42);
  --glass-mid: rgba(176, 211, 166, 0.22);
  --liquid-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(231, 250, 224, 0.18) 42%, rgba(139, 181, 125, 0.16));
  --liquid-edge: rgba(255, 255, 255, 0.62);
  --liquid-shadow: 0 26px 70px rgba(18, 48, 31, 0.28), 0 10px 28px rgba(126, 164, 110, 0.16);
  --liquid-flow-base:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(210, 238, 205, 0.12) 42%, rgba(70, 112, 70, 0.1));
  --shadow: 0 24px 58px rgba(24, 50, 37, 0.24);
  --glow: 0 0 30px rgba(226, 211, 147, 0.2);
  --blur: 24px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background-color: #dbe9d7;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--bg-url);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 8%, rgba(255, 255, 255, 0.28), transparent 32%),
    linear-gradient(180deg, rgba(230, 246, 232, 0.24) 0%, rgba(143, 175, 132, 0.16) 48%, rgba(22, 52, 37, 0.44) 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

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

a,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}

button {
  border: 1px solid var(--line);
  background: rgba(243, 255, 242, 0.18);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}

button:hover:not(:disabled) {
  background: rgba(216, 186, 113, 0.28);
  border-color: rgba(234, 211, 140, 0.58);
  box-shadow: 0 0 18px rgba(216, 186, 113, 0.22);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(18, 50, 35, 0.28);
  color: #fff;
  padding: 10px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 18px 80px;
  overflow-x: clip;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(235, 255, 236, 0.24);
  padding-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--soft);
}

.topbar h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 800;
  text-shadow: 0 4px 18px rgba(26, 57, 39, 0.34);
}

.token-box {
  display: grid;
  grid-template-columns: minmax(0, 220px) auto;
  gap: 10px;
  align-items: center;
}

.player {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 24px;
  align-items: center;
  background: var(--liquid-flow-base);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 34px;
  padding: 24px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    inset 0 -24px 42px rgba(44, 78, 52, 0.14),
    inset 0 0 32px rgba(255, 255, 255, 0.08),
    0 22px 56px rgba(16, 42, 24, 0.24),
    0 0 34px rgba(216, 186, 113, 0.12);
  backdrop-filter: blur(24px) saturate(1.65);
  -webkit-backdrop-filter: blur(24px) saturate(1.65);
  overflow: hidden;
  isolation: isolate;
}

.player::before,
.player::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.player::before {
  inset: -35%;
  border-radius: 999px;
  border: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.42), transparent 22%),
    radial-gradient(circle at 72% 30%, rgba(224, 245, 196, 0.28), transparent 26%),
    radial-gradient(circle at 42% 82%, rgba(180, 220, 170, 0.2), transparent 30%),
    linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.22) 42%, transparent 62%);
  filter: blur(18px);
  mix-blend-mode: screen;
  opacity: 0.82;
  transform: translate3d(-5%, -3%, 0) rotate(0deg) scale(1);
  animation: liquid-flow 16s ease-in-out infinite alternate;
}

.player::after {
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0.18) 16%, transparent 36%, transparent 70%, rgba(255, 255, 255, 0.2) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 18% 82%, rgba(255, 255, 255, 0.16));
  mix-blend-mode: screen;
  opacity: 0.62;
}

.player > * {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.disc {
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 9%, transparent 10% 100%),
    var(--disc-cover, var(--default-cover));
  background-size: cover;
  background-position: center;
  color: var(--gold);
  font-size: 54px;
  text-indent: -999px;
  overflow: hidden;
  border: 8px solid rgba(250, 255, 247, 0.46);
  box-shadow:
    0 0 0 1px rgba(234, 211, 140, 0.38),
    0 16px 38px rgba(22, 49, 35, 0.32),
    0 0 34px rgba(234, 211, 140, 0.24);
}

.disc.playing {
  animation: spin 28s linear infinite;
}

@keyframes eye-glow {
  from { box-shadow: 0 0 0 1px rgba(234, 211, 140, 0.32), 0 14px 32px rgba(22, 49, 35, 0.24), 0 0 16px rgba(216, 186, 113, 0.12); }
  to { box-shadow: 0 0 0 1px rgba(234, 211, 140, 0.48), 0 18px 42px rgba(22, 49, 35, 0.28), 0 0 36px rgba(216, 186, 113, 0.3); }
}

@keyframes liquid-flow {
  0% {
    transform: translate3d(-5%, -3%, 0) rotate(0deg) scale(1);
    opacity: 0.74;
  }

  50% {
    transform: translate3d(4%, 3%, 0) rotate(8deg) scale(1.04);
    opacity: 0.88;
  }

  100% {
    transform: translate3d(7%, -2%, 0) rotate(-6deg) scale(1.02);
    opacity: 0.78;
  }
}

@keyframes liquid-shimmer {
  from {
    transform: translateX(-28%) rotate(8deg);
    opacity: 0.36;
  }

  to {
    transform: translateX(20%) rotate(11deg);
    opacity: 0.68;
  }
}

.now {
  min-width: 0;
}

audio {
  display: block;
  width: 100%;
  max-width: 520px;
  min-width: 0;
}

.now h2 {
  font-size: 26px;
  margin: 7px 0 14px;
  line-height: 1.25;
  color: #fff;
}

.now small {
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.36), transparent 44%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(210, 238, 205, 0.08) 58%, rgba(70, 112, 70, 0.08));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.42),
    inset 0 -12px 24px rgba(44, 78, 52, 0.1),
    0 14px 32px rgba(20, 48, 31, 0.14);
  backdrop-filter: blur(20px) saturate(1.48);
  -webkit-backdrop-filter: blur(20px) saturate(1.48);
  overflow: hidden;
}

.controls::after {
  content: "";
  position: absolute;
  inset: -80% -30%;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 24%, rgba(255, 255, 255, 0.24) 44%, transparent 62%);
  transform: translateX(-22%) rotate(8deg);
  opacity: 0.62;
  animation: liquid-shimmer 12s ease-in-out infinite alternate;
}

.controls > * {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

.controls a {
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(243, 255, 242, 0.16);
  border-radius: 999px;
  padding: 8px 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.controls button,
.controls select,
.controls a {
  flex: 0 1 auto;
}

.controls select {
  width: auto;
  max-width: 180px;
}

.controls button,
.controls a,
#search,
#play-shared,
.mini-player-dock {
  position: relative;
  overflow: hidden;
}

.controls button::before,
.controls a::before,
#search::before,
#play-shared::before,
.mini-player-dock::before {
  content: "";
  position: absolute;
  inset: 1px 2px auto 2px;
  height: 44%;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.04));
}

.controls button,
#search,
#play-shared {
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.38);
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.42), transparent 46%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(209, 235, 198, 0.1) 52%, rgba(70, 112, 70, 0.08));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.46),
    inset 0 -9px 20px rgba(44, 78, 52, 0.08),
    0 10px 24px rgba(24, 50, 37, 0.13);
  backdrop-filter: blur(16px) saturate(1.42);
  -webkit-backdrop-filter: blur(16px) saturate(1.42);
}

#search,
#play-shared {
  color: #fffdf1;
  border-color: rgba(234, 211, 140, 0.42);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.46),
    inset 0 -10px 24px rgba(44, 78, 52, 0.1),
    0 12px 28px rgba(24, 50, 37, 0.16),
    0 0 24px rgba(216, 186, 113, 0.13);
}

#search:hover:not(:disabled),
#play-shared:hover:not(:disabled) {
  transform: translateY(-1px);
  background:
    radial-gradient(circle at 26% 15%, rgba(255, 255, 255, 0.48), transparent 48%),
    linear-gradient(135deg, rgba(234, 211, 140, 0.32), rgba(209, 235, 198, 0.16)),
    rgba(56, 104, 65, 0.28);
}

.lyrics {
  border-left: 1px solid rgba(235, 255, 236, 0.24);
  padding-left: 20px;
  max-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.lyrics p {
  margin: 0;
  color: var(--muted);
}

.lyric-line {
  display: block;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.lyric-line span,
.lyric-line em {
  display: block;
}

.lyric-line em {
  margin-top: 4px;
  font-style: normal;
  font-size: 13px;
  color: var(--soft);
}

.lyric-line.on {
  background: rgba(243, 255, 242, 0.14);
  color: #fff;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(234, 211, 140, 0.36);
}

.search-card,
.panel {
  margin-top: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(210, 235, 204, 0.1)),
    rgba(30, 72, 48, 0.2);
  border: 1px solid rgba(235, 255, 236, 0.28);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(24, 50, 37, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

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

.status {
  margin: 12px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.library-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.library-button {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 9px;
  padding: 20px;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(210, 235, 204, 0.1)),
    rgba(33, 76, 51, 0.2);
  border: 1px solid rgba(235, 255, 236, 0.3);
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(24, 50, 37, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.library-button::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 46%;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.32), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
}

.mini-player-dock {
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.42), transparent 48%),
    var(--liquid-flow-base);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -18px 34px rgba(44, 78, 52, 0.12),
    0 18px 42px rgba(16, 42, 24, 0.2);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
}

.library-button span {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
}

.library-button b {
  font-size: 15px;
  line-height: 1.3;
  color: var(--muted);
  font-weight: 600;
}

.panel header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.panel h2,
.panel h3 {
  margin: 0;
  color: #fff;
}

.panel h2 {
  font-size: 22px;
}

.panel h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.panel small {
  color: var(--soft);
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.song-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.song {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(239, 255, 238, 0.12);
  border: 1px solid rgba(235, 255, 236, 0.18);
  border-radius: 16px;
  padding: 12px;
  overflow: hidden;
}

.song:hover {
  border-color: rgba(234, 211, 140, 0.55);
  background: rgba(247, 255, 246, 0.18);
}

.song img,
.art {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 10px;
  object-fit: cover;
}

.art {
  display: grid;
  place-items: center;
  color: transparent;
  background-image: var(--default-cover);
  background-size: cover;
  background-position: center;
}

.song-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.song-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.song-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.song-copy b,
.song-copy em,
.song-copy small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-copy b {
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
}

.song-copy em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.song-copy small {
  color: var(--soft);
  font-size: 11px;
}

.song-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.song-actions button,
.song-actions a {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.song-actions a {
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(243, 255, 242, 0.14);
  border-radius: 10px;
}

.song-actions .heart.on {
  color: var(--gold);
  border-color: rgba(234, 211, 140, 0.58);
}

.song-comment {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(250, 255, 248, 0.9);
  background: rgba(15, 47, 30, 0.22);
  border: 1px solid rgba(235, 255, 236, 0.16);
  border-radius: 10px;
  padding: 8px 10px;
  word-break: break-word;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 38, 25, 0.38);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-card {
  width: min(92vw, 440px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(203, 230, 196, 0.12)),
    rgba(23, 54, 35, 0.56);
  border: 1px solid rgba(235, 255, 236, 0.3);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 28px 70px rgba(14, 36, 23, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.library-card {
  width: min(94vw, 760px);
  max-height: min(82dvh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.library-card h2 {
  margin: 0;
  font-size: 26px;
}

.library-card > .status {
  margin: 6px 0 14px;
}

.library-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.library-tabs button {
  flex: 1;
}

.library-tabs button.on {
  background: rgba(216, 186, 113, 0.3);
  border-color: rgba(234, 211, 140, 0.58);
}

.modal-song-list {
  overflow: auto;
  padding-right: 4px;
  margin-top: 0;
  overscroll-behavior: contain;
}

.modal-song-list.deck-list {
  display: grid;
  gap: 8px;
  padding: 12px 4px 22px;
}

.deck-list .deck-list-song {
  position: relative;
  min-height: 76px;
  margin-top: 0;
  padding: 13px;
  align-items: center;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 -8px 24px rgba(24, 50, 37, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(0) scale(0.985);
  animation: listCardIn 0.34s ease both;
  transition: transform 0.28s ease, opacity 0.28s ease, border-color 0.28s ease;
}

.deck-list .deck-list-song:not(.selected) {
  min-height: 72px;
  max-height: 72px;
  overflow: hidden;
  transform: translateY(-2px) scale(0.982);
  opacity: 0.86;
}

.deck-list .deck-list-song:not(.selected)::after {
  content: "";
  position: absolute;
  inset: auto 18px -5px 18px;
  height: 12px;
  border-radius: 0 0 18px 18px;
  background: rgba(239, 255, 238, 0.08);
  border: 1px solid rgba(235, 255, 236, 0.12);
  border-top: 0;
  pointer-events: none;
}

.deck-list .deck-list-song:not(.selected) .song-actions,
.deck-list .deck-list-song:not(.selected) .song-comment,
.deck-list .deck-list-song:not(.selected) .song-copy small {
  display: none;
}

.deck-list .deck-list-song:not(.selected) img,
.deck-list .deck-list-song:not(.selected) .art {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}

.deck-list .deck-list-song:not(.selected) .song-head {
  align-items: center;
  flex-direction: row;
}

.deck-list .deck-list-song:not(.selected) .song-copy b,
.deck-list .deck-list-song:not(.selected) .song-copy em {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-list .deck-list-song.selected {
  z-index: 5;
  min-height: 146px;
  margin: 2px 0 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(207, 231, 200, 0.12)),
    rgba(28, 65, 42, 0.46);
  border-color: rgba(234, 211, 140, 0.5);
  box-shadow: 0 18px 42px rgba(22, 49, 35, 0.3), 0 0 0 1px rgba(234, 211, 140, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-6px) scale(1);
}

.deck-list .deck-list-song.selected .song-head {
  gap: 12px;
}

.deck-list .deck-list-song.selected .song-actions {
  justify-content: flex-start;
}

.deck-list .deck-list-song:active {
  transform: translateY(-7px) scale(1.01);
}

@keyframes listCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
}

.song-deck {
  position: relative;
  min-height: 300px;
  margin: 8px 0 14px;
  padding: 28px 16px 18px 86px;
  overflow: visible;
  perspective: 900px;
  cursor: pointer;
  border-radius: 24px;
  background: rgba(239, 255, 238, 0.08);
  border: 1px solid rgba(235, 255, 236, 0.12);
}

.deck-card {
  position: absolute;
  left: calc(50% - 105px + var(--i) * 18px);
  top: calc(22px + var(--i) * 5px);
  width: 210px;
  height: 268px;
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr) 6px;
  gap: 12px;
  padding: 16px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(235, 255, 236, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(202, 228, 196, 0.08)),
    rgba(28, 65, 42, 0.42);
  box-shadow: -18px 0 36px rgba(24, 50, 37, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateX(calc(var(--i) * -18px)) rotateY(calc(var(--i) * -4deg)) rotateZ(calc(var(--i) * 1.2deg));
  transition: transform 0.35s ease, opacity 0.35s ease, border-color 0.35s ease;
  z-index: calc(20 - var(--i));
  overflow: hidden;
}

body.is-glass-animating .player::before,
body.is-glass-animating .controls::after {
  animation-play-state: paused;
  opacity: 0.32;
}

body.is-glass-animating .disc.playing,
body.is-glass-animating .deck-card,
body.is-glass-animating .deck-list .deck-list-song {
  animation: none !important;
}

body.is-glass-animating .deck-card,
body.is-glass-animating .deck-list .deck-list-song {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 8px 20px rgba(24, 50, 37, 0.16) !important;
}

.song-deck:hover .deck-card,
.song-deck:focus-within .deck-card {
  left: calc(50% - 145px + var(--i) * 38px);
  top: calc(16px + var(--i) * 3px);
  transform: translateY(calc(var(--i) * 2px - 10px)) rotateY(calc(var(--i) * 2deg)) rotateZ(calc(var(--i) * 0.8deg));
}

.song-deck:hover .deck-card:hover,
.deck-card:focus-visible {
  border-color: rgba(234, 211, 140, 0.72);
  transform: translateY(-22px) scale(1.02);
}

.deck-card img,
.deck-art {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
}

.deck-art {
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 28px;
  background-image: var(--default-cover);
  background-size: cover;
  background-position: center;
}

.deck-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}

.deck-copy b {
  color: #fff;
  font-size: 20px;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deck-copy em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-copy small {
  color: rgba(240, 251, 240, 0.72);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deck-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(239, 255, 238, 0.18);
}

.deck-bar i {
  display: block;
  height: 100%;
  width: 36%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(126, 164, 110, 0.48), rgba(234, 211, 140, 0.9));
  transition: width 0.35s ease;
}

.deck-card:hover .deck-bar i,
.deck-card:focus-visible .deck-bar i {
  width: 100%;
}

.deck-expand {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  background: rgba(239, 255, 238, 0.14);
  border-color: rgba(235, 255, 236, 0.2);
}

.close {
  margin-left: auto;
  display: block;
}

.qr img {
  width: 100%;
  max-width: 280px;
  margin: 14px auto 0;
  display: block;
  border-radius: 16px;
}

@media (max-width: 1180px) and (min-width: 861px) {
  .shell {
    max-width: 1040px;
    padding-inline: 22px;
  }

  .player {
    grid-template-columns: minmax(140px, 170px) minmax(0, 1fr);
  }

  .lyrics {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid rgba(235, 255, 236, 0.24);
    padding-left: 0;
    padding-top: 18px;
    max-height: 220px;
  }
}

@media (max-width: 860px) {
  :root {
    --blur: 14px;
    --shadow: 0 16px 36px rgba(24, 50, 37, 0.2);
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .shell {
    padding: 18px 14px 42px;
    max-width: 100%;
    overflow-x: clip;
  }

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

  .topbar h1 {
    font-size: 31px;
  }

  .token-box {
    grid-template-columns: 1fr;
  }

  .player {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 18px;
    max-width: 100%;
    border-radius: 28px;
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.42),
      inset 0 -16px 28px rgba(44, 78, 52, 0.12),
      0 14px 34px rgba(16, 42, 24, 0.18);
    backdrop-filter: blur(14px) saturate(1.34);
    -webkit-backdrop-filter: blur(14px) saturate(1.34);
  }

  .player::before {
    filter: blur(14px);
    opacity: 0.64;
    animation-duration: 22s;
  }

  .player::after {
    opacity: 0.42;
  }

  .controls {
    width: 100%;
    justify-content: center;
    border-radius: 24px;
    backdrop-filter: blur(10px) saturate(1.24);
    -webkit-backdrop-filter: blur(10px) saturate(1.24);
  }

  .controls::after {
    opacity: 0.34;
    animation-duration: 18s;
  }

  .disc {
    width: 140px;
    margin: 0 auto;
  }

  .lyrics {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 16px;
    max-height: 180px;
  }

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

  .library-actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .library-button {
    min-height: 82px;
    padding: 17px;
  }

  .library-button::before {
    opacity: 0.56;
  }

  .library-button span {
    font-size: 20px;
  }

  .library-card {
    width: min(100%, calc(100vw - 24px));
    max-height: 84dvh;
    padding: 18px;
  }

  .song-deck {
    min-height: 252px;
    padding: 20px 0 10px;
    overflow: hidden;
    backdrop-filter: blur(8px) saturate(1.16);
    -webkit-backdrop-filter: blur(8px) saturate(1.16);
  }

  .deck-card {
    left: calc(50% - 92px + var(--i) * 13px);
    top: calc(18px + var(--i) * 5px);
    width: 184px;
    height: 228px;
    grid-template-rows: 72px minmax(0, 1fr) 5px;
    padding: 14px;
    transform: translateX(calc(var(--i) * -13px)) rotateY(calc(var(--i) * -3deg)) rotateZ(calc(var(--i) * 1deg));
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: -10px 0 22px rgba(24, 50, 37, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  .song-deck:hover .deck-card,
  .song-deck:focus-within .deck-card {
    left: calc(50% - 92px + var(--i) * 13px);
    top: calc(18px + var(--i) * 5px);
    transform: translateX(calc(var(--i) * -13px)) translateY(-8px) rotateY(calc(var(--i) * -2deg)) rotateZ(calc(var(--i) * 1deg));
  }

  .deck-card img,
  .deck-art {
    width: 72px;
    height: 72px;
    border-radius: 12px;
  }

  .deck-copy b {
    font-size: 17px;
  }

  .deck-copy small {
    -webkit-line-clamp: 2;
  }

  .song {
    padding: 10px;
    gap: 10px;
  }

  .song img,
  .art {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .song-head {
    flex-direction: column;
    gap: 8px;
  }

  .song-copy b {
    font-size: 15px;
  }

  .song-copy em {
    font-size: 12px;
  }

  .song-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .song-actions a {
    display: none;
  }

  .song-comment {
    font-size: 12px;
    padding: 7px 9px;
  }

  .deck-list .deck-list-song {
    min-height: 70px;
    margin-top: 0;
    padding: 11px;
    box-shadow: 0 8px 18px rgba(24, 50, 37, 0.16);
  }

  .deck-list .deck-list-song:not(.selected) {
    min-height: 68px;
    max-height: 68px;
  }

  .deck-list .deck-list-song:not(.selected) .song-head {
    flex-direction: row;
    align-items: center;
  }

  .deck-list .deck-list-song.selected {
    min-height: 158px;
  }

  .deck-list .deck-list-song.selected .song-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .deck-list .deck-list-song.selected .song-actions {
    width: 100%;
  }
}

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

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .player,
  .search-card,
  .panel,
  .library-button,
  .modal-card,
  .deck-card {
    background: rgba(48, 86, 57, 0.78);
  }
}

/* vNext stability pass: quiet layout, static lists, custom player controls. */
audio#audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-player {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) auto minmax(80px, 120px);
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin: 16px 0 14px;
  padding: 10px 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(241, 255, 238, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px) saturate(1.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.16);
}

.transport-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fffdf2;
  background: rgba(234, 211, 140, 0.25);
}

.time {
  color: rgba(250, 255, 248, 0.82);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.seek,
.volume {
  width: 100%;
  min-width: 0;
  accent-color: #ead38c;
}

.seek {
  --progress: 0%;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(246, 238, 190, 0.82) 0 var(--progress), rgba(255, 255, 255, 0.2) var(--progress) 100%);
}

.volume {
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.seek::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(234, 211, 140, 0.52);
  background: rgba(255, 255, 250, 0.9);
  box-shadow: 0 4px 12px rgba(24, 50, 37, 0.18);
}

.seek::-moz-range-thumb,
.volume::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(234, 211, 140, 0.52);
  background: rgba(255, 255, 250, 0.9);
}

.controls {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.controls::after,
.player::before {
  animation: none !important;
  display: none;
}

.disc.playing {
  animation: none;
}

.controls button,
.controls select,
.controls a {
  max-width: 190px;
  min-width: 0;
}

#connect {
  order: 4;
  opacity: 0.78;
  max-width: 230px;
}

#play-shared,
#next-song {
  order: 1;
}

#play-mode,
#netease-link {
  order: 3;
}

.song-deck.static-preview {
  display: grid;
  gap: 10px;
  min-height: 0;
  margin: 0 0 12px;
  padding: 0;
  overflow: clip;
  perspective: none;
  cursor: default;
  background: transparent;
  border: 0;
}

.song-deck.static-preview .song {
  width: 100%;
  max-width: 100%;
}

.deck-card,
.deck-list .deck-list-song,
.song-deck:hover .deck-card,
.song-deck:focus-within .deck-card,
.song-deck:hover .deck-card:hover,
.deck-card:focus-visible {
  transform: none !important;
  left: auto !important;
  top: auto !important;
  animation: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease !important;
}

.lyrics,
.modal-song-list,
.library-card {
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 255, 240, 0.38) rgba(255, 255, 255, 0.06);
}

.lyrics::-webkit-scrollbar,
.modal-song-list::-webkit-scrollbar,
.library-card::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.lyrics::-webkit-scrollbar-track,
.modal-song-list::-webkit-scrollbar-track,
.library-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.lyrics::-webkit-scrollbar-thumb,
.modal-song-list::-webkit-scrollbar-thumb,
.library-card::-webkit-scrollbar-thumb {
  background: rgba(245, 255, 240, 0.34);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.lyrics::-webkit-scrollbar-thumb:hover,
.modal-song-list::-webkit-scrollbar-thumb:hover,
.library-card::-webkit-scrollbar-thumb:hover {
  background: rgba(246, 238, 190, 0.48);
}

@media (min-width: 960px) {
  .shell {
    max-width: 1180px;
    padding: clamp(28px, 3vw, 52px) clamp(24px, 3vw, 42px) 80px;
  }

  .player {
    grid-template-columns: 180px minmax(0, 1fr) 300px;
    align-items: start;
  }

  .now {
    padding-top: 4px;
  }

  .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, max-content)) minmax(120px, 160px) max-content;
    align-items: center;
    gap: 10px;
  }

  .controls button,
  .controls select,
  .controls a {
    width: auto;
  }
}

@media (max-width: 860px) {
  .custom-player {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    max-width: 100%;
    gap: 8px;
  }

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

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .controls button,
  .controls select,
  .controls a {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  #connect,
  #netease-link {
    grid-column: 1 / -1;
  }

  .song-deck.static-preview {
    overflow: clip;
  }
}

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

  .disc.playing,
  .player::before,
  .controls::after {
    animation: none !important;
  }
}

@media (max-width: 860px) {
  body {
    overflow-x: clip;
  }

  .player,
  .custom-player,
  .library-card,
  .search-card,
  .modal-card,
  .library-button {
    backdrop-filter: blur(6px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(6px) saturate(1.08) !important;
    box-shadow: 0 10px 24px rgba(20, 48, 32, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  }

  .player::before,
  .player::after,
  .custom-player::before,
  .controls::after,
  .library-button::before,
  .liquid-glass-flow::before,
  .liquid-glass-flow::after {
    animation: none !important;
    filter: none !important;
  }

  .song-deck,
  .deck-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

@media (max-width: 860px), (prefers-reduced-motion: reduce) {
  .is-glass-animating .player::before,
  .is-glass-animating .player::after,
  .is-glass-animating .library-button::before,
  .is-glass-animating .deck-card {
    animation: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

.media-debug-panel {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 9999;
  max-height: min(58dvh, 520px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(15, 32, 21, 0.82);
  color: #f3fff4;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.media-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-debug-head button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: #14321f;
  background: rgba(236, 255, 222, 0.92);
  font: inherit;
  font-weight: 700;
}

.media-debug-panel pre {
  min-height: 0;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.45;
}
