:root {
  --bg: #0f1115;
  --panel: rgba(23, 26, 33, 0.78);
  --panel-2: rgba(29, 34, 43, 0.85);
  --text: #f4f7fb;
  --muted: #98a2b3;
  --accent: #7c5cff;
  --accent-2: #2dd4bf;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.14), transparent 22%),
    linear-gradient(180deg, #0b0d11 0%, #11141b 100%);
}

button, input, a { font: inherit; }
button:disabled { opacity: .55; cursor: default; }
.app-shell { max-width: 1440px; margin: 0 auto; padding: 18px 18px 170px; }

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.glass-dark {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.topbar {
  display: flex; gap: 20px; justify-content: space-between; align-items: center;
  padding: 18px 20px; margin-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo {
  width: 52px; height: 52px; border-radius: 16px; object-fit: cover;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}
.brand h1 { margin: 0; font-size: 1.5rem; }
.brand p { margin: 4px 0 0; color: var(--muted); }

.search-area { flex: 1; max-width: 680px; }
.search-box { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; }
.search-box input {
  min-width: 0; border: 1px solid rgba(124, 92, 255, 0.35); outline: none;
  border-radius: 16px; padding: 14px 16px; background: rgba(14, 18, 24, 0.9); color: var(--text);
}
.status-text { margin-top: 8px; color: var(--muted); min-height: 20px; }

.layout { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(340px, 0.92fr); gap: 18px; align-items: start; }

.hero {
  position: relative; overflow: hidden; min-height: 540px; padding: 22px;
  display: flex; flex-direction: column; justify-content: space-between;
  background-size: cover; background-position: center;
  width: min(100%, 760px);
  justify-self: start;
}
.hero::before,
.hero::after {
  content: ""; position: absolute; border-radius: 999px; filter: blur(24px); opacity: 0.9;
}
.hero::before { width: 320px; height: 320px; left: -90px; top: 80px; background: rgba(124, 92, 255, 0.18); }
.hero::after { width: 280px; height: 280px; right: -70px; bottom: 60px; background: rgba(45, 212, 191, 0.14); }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.34), rgba(8, 10, 14, 0.84));
}
.cover-wrap, .song-meta, .mini-strip { position: relative; z-index: 1; }
.cover-wrap { display: flex; justify-content: center; padding-top: 6px; }
.cover-image {
  width: min(320px, 54%); aspect-ratio: 1 / 1; object-fit: cover; display: none;
  border-radius: 32px; box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.08);
}
.song-meta { text-align: center; padding: 10px 8% 0; }
.mode-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(124, 92, 255, 0.16); color: #d8ceff;
  border: 1px solid rgba(124, 92, 255, 0.22);
  border-radius: 999px; padding: 8px 14px; font-size: 0.9rem; margin-bottom: 16px;
}
.song-meta h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.meta-line { color: var(--muted); margin-bottom: 8px; font-size: 1rem; }
.mini-strip {
  display: flex; align-items: center; gap: 14px; padding: 18px 22px; justify-content: flex-start;
}
.mini-brand { margin-left: auto; color: var(--muted); font-weight: 700; }

.sidebar { display: flex; flex-direction: column; gap: 18px; }
.panel { padding: 18px; }
.btn {
  appearance: none; border: 1px solid var(--line); background: rgba(35, 41, 56, 0.95); color: var(--text);
  border-radius: 16px; padding: 13px 16px; cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(44, 52, 70, 0.98); }
.btn-accent { background: linear-gradient(180deg, #8b6cff 0%, #6b4dff 100%); border-color: transparent; }
.icon-btn { padding-inline: 18px; }

.range-card, .button-stack { margin-top: 14px; padding: 16px; }
.range-card input[type="range"] { width: 100%; }
.small-row { display: flex; justify-content: space-between; color: var(--muted); margin-top: 8px; }
.toggle-card p { margin: 10px 0 0; color: var(--muted); }
.toggle-label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.button-stack { display: grid; gap: 10px; padding: 0; background: transparent; border: 0; }

.btn.is-disabled { opacity: .55; pointer-events: none; }
.attribution-note { margin: 12px 2px 0; color: var(--muted); font-size: 0.86rem; line-height: 1.4; }

.tabs { display: grid; gap: 10px; margin-bottom: 14px; }
.tabs-3 { grid-template-columns: repeat(3, 1fr); }
.tab-btn {
  border: 1px solid var(--line); background: rgba(29, 34, 43, 0.95); color: var(--muted);
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
}
.tab-btn.active { color: var(--text); background: rgba(23, 26, 33, 0.98); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.song-list {
  display: grid; gap: 10px; max-height: 360px; overflow: auto; padding-bottom: 120px;
}
.song-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: 16px; background: rgba(29, 34, 43, 0.85); border: 1px solid var(--line);
}
.song-item img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.song-item-title { font-weight: 600; }
.song-item-sub { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.song-load-btn { white-space: nowrap; }
.empty { color: var(--muted); padding: 6px; }

.genres-panel { display: grid; gap: 12px; }
.genres-help { color: var(--muted); font-size: 0.95rem; }
.genre-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  max-height: 360px; overflow: auto; padding-bottom: 120px;
}
.genre-chip {
  appearance: none;
  border: 1px solid rgba(124, 92, 255, 0.22);
  background: linear-gradient(180deg, rgba(32, 37, 49, 0.95), rgba(24, 28, 37, 0.98));
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.genre-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 92, 255, 0.48);
  background: linear-gradient(180deg, rgba(40, 46, 60, 0.98), rgba(29, 34, 43, 1));
}
.genre-chip strong { display: block; font-size: 0.98rem; }
.genre-chip span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.88rem; }

.player-dock-wrap {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 0 18px max(12px, env(safe-area-inset-bottom));
}
.player-dock {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(220px, 1.1fr) minmax(320px, 1.45fr) minmax(220px, 0.9fr);
  gap: 18px; align-items: center; padding: 16px 18px; min-height: 94px;
}
.player-track { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dock-artwork {
  width: 64px; height: 64px; border-radius: 18px; object-fit: cover;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04);
}
.dock-meta { min-width: 0; }
.dock-title {
  font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dock-sub {
  margin-top: 5px; color: var(--muted); font-size: 0.92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dock-fav-btn,
.dock-btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(27, 31, 41, 0.96);
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.dock-fav-btn:hover,
.dock-btn:hover {
  background: rgba(38, 44, 57, 0.98);
  border-color: rgba(124, 92, 255, 0.35);
}
.dock-fav-btn {
  margin-left: auto; width: 46px; height: 46px; border-radius: 50%;
  font-size: 1.45rem; color: #ff6b8d; flex: 0 0 auto;
}
.player-center { display: grid; gap: 10px; }
.dock-buttons { display: flex; gap: 14px; align-items: center; justify-content: center; }
.dock-btn {
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.12rem;
}
.dock-btn-primary {
  width: 58px; height: 58px; font-size: 1.45rem;
  background: linear-gradient(180deg, #8b6cff 0%, #6b4dff 100%);
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(107, 77, 255, 0.26);
}
.dock-btn-primary:hover {
  background: linear-gradient(180deg, #987dff 0%, #7356ff 100%);
  border-color: transparent;
}
.dock-progress-wrap { display: grid; gap: 8px; }
.dock-time { text-align: center; color: var(--muted); font-size: 0.92rem; }
.dock-progress, #dockVolumeBar { width: 100%; }
.player-side { display: grid; gap: 12px; justify-self: end; min-width: 0; width: 100%; max-width: 280px; }
.side-pill {
  justify-self: stretch; text-align: center;
  background: rgba(124, 92, 255, 0.16); color: #d8ceff;
  border: 1px solid rgba(124, 92, 255, 0.22); border-radius: 999px; padding: 8px 12px; font-size: 0.9rem;
}
.side-volume {
  display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center;
}
.side-volume span { display: none; }

.is-playing .dock-artwork,
.is-playing .brand-logo {
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.32), 0 0 24px rgba(124, 92, 255, 0.35);
}

@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .hero { min-height: 560px; width: 100%; }
  .player-dock { grid-template-columns: 1fr; gap: 14px; }
  .player-side, .side-pill { justify-self: stretch; }
}

@media (max-width: 760px) {
  .app-shell { padding: 12px 12px 220px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .search-area { max-width: none; }
  .search-box { grid-template-columns: 1fr auto; }
  .search-box .btn:last-child { grid-column: 1 / -1; }
  .cover-image { width: min(320px, 84%); }
  .tabs-3,
  .genre-grid { grid-template-columns: 1fr; }
  .song-list,
  .genre-grid { max-height: none; padding-bottom: 180px; }
  .player-dock-wrap { padding: 0 12px max(12px, env(safe-area-inset-bottom)); }
  .player-dock { padding: 14px; gap: 12px; }
  .dock-buttons { justify-content: space-between; }
  .player-track { gap: 12px; }
  .player-side { max-width: none; }
}


.ui-icons { pointer-events: none; }

.icon-svg {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-block;
  color: currentColor;
  fill: currentColor;
  flex: 0 0 auto;
}

.icon-inline {
  margin-right: 8px;
}

.btn-accent .icon-svg {
  width: 1rem;
  height: 1rem;
}

.eq-mini,
.eq-playing {
  display: inline-flex;
  align-items: end;
  gap: 3px;
}

.eq-mini span,
.eq-playing span {
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #bfa7ff 0%, #6b4dff 100%);
  opacity: .45;
  transform-origin: bottom center;
}

.eq-mini span:nth-child(1) { height: 11px; }
.eq-mini span:nth-child(2) { height: 17px; }
.eq-mini span:nth-child(3) { height: 13px; }

.eq-playing { margin-left: 10px; opacity: 0; transform: translateY(1px); transition: opacity .2s ease; }
.eq-playing span:nth-child(1) { height: 10px; }
.eq-playing span:nth-child(2) { height: 16px; }
.eq-playing span:nth-child(3) { height: 12px; }
.eq-playing span:nth-child(4) { height: 18px; }

.is-playing .eq-playing,
.is-playing .eq-mini {
  opacity: 1;
}

.is-playing .eq-mini span:nth-child(1),
.is-playing .eq-playing span:nth-child(1) { animation: equalize 0.9s ease-in-out infinite; }
.is-playing .eq-mini span:nth-child(2),
.is-playing .eq-playing span:nth-child(2) { animation: equalize 0.75s ease-in-out infinite .08s; }
.is-playing .eq-mini span:nth-child(3),
.is-playing .eq-playing span:nth-child(3) { animation: equalize 1.05s ease-in-out infinite .16s; }
.is-playing .eq-playing span:nth-child(4) { animation: equalize 0.82s ease-in-out infinite .24s; }

@keyframes equalize {
  0%, 100% { transform: scaleY(.45); opacity: .55; }
  50% { transform: scaleY(1); opacity: 1; }
}

.dock-title-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.dock-progress-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 16px;
}

.dock-progress {
  grid-column: 1 / -1;
}

.dock-total-time {
  text-align: right;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.volume-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  color: var(--muted);
}

.side-volume {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.dock-btn .icon-svg,
.dock-fav-btn .icon-svg {
  width: 1.15rem;
  height: 1.15rem;
}

.dock-btn-primary .icon-svg {
  width: 1.4rem;
  height: 1.4rem;
}

.is-playing .dock-btn-primary {
  box-shadow: 0 12px 24px rgba(107, 77, 255, 0.26), 0 0 0 8px rgba(107, 77, 255, 0.08);
}

@media (max-width: 760px) {
  .dock-progress-wrap {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dock-total-time {
    text-align: center;
  }
}


.hero-color-wash {
  position: absolute;
  inset: 0;
  opacity: .22;
  background:
    radial-gradient(circle at 20% 20%, rgba(124, 92, 255, .24), transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(45, 212, 191, .18), transparent 28%);
  transition: opacity .45s ease, filter .45s ease, transform .6s ease;
  z-index: 0;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(44px);
  opacity: .16;
  z-index: 0;
  pointer-events: none;
  transition: opacity .45s ease, transform .6s ease, background .45s ease;
}
.hero-glow-a { top: 10%; left: -8%; background: rgba(124, 92, 255, .45); }
.hero-glow-b { right: -10%; bottom: 6%; background: rgba(45, 212, 191, .35); }

.cover-frame {
  position: relative;
  display: inline-flex;
  padding: 10px;
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow:
    0 24px 60px rgba(0,0,0,.36),
    inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .45s ease, box-shadow .45s ease, background .45s ease, border-color .45s ease;
  border: 1px solid rgba(255,255,255,.06);
}

.cover-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(124,92,255,.16), rgba(45,212,191,.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: .65;
  pointer-events: none;
}

.cover-image {
  transition: transform .45s ease, opacity .35s ease, filter .45s ease;
}

.cover-image.is-changing,
.dock-artwork.is-changing {
  opacity: .55;
  transform: scale(.985);
  filter: saturate(.92);
}

.dock-artwork {
  transition: transform .45s ease, box-shadow .45s ease, opacity .35s ease, filter .45s ease;
}

.dock-title,
.dock-sub,
#songTitle,
#artistName,
#albumName,
#modeBadge,
#modePill {
  transition: opacity .22s ease, transform .3s ease, filter .3s ease;
}

.meta-changing .dock-title,
.meta-changing .dock-sub,
.meta-changing #songTitle,
.meta-changing #artistName,
.meta-changing #albumName,
.meta-changing #modeBadge,
.meta-changing #modePill {
  opacity: .65;
  transform: translateY(2px);
}

.is-playing .cover-frame {
  transform: translateY(-2px);
  box-shadow:
    0 30px 72px rgba(0,0,0,.42),
    0 0 0 1px rgba(124,92,255,.15),
    0 0 40px rgba(124,92,255,.14);
}

.is-playing .cover-image {
  animation: coverFloat 7.2s ease-in-out infinite;
}

.is-playing .dock-artwork {
  transform: scale(1.035);
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.32),
    0 0 24px rgba(124, 92, 255, 0.35);
}

.is-playing .hero-color-wash {
  opacity: .34;
  filter: saturate(1.12);
  animation: heroWashDrift 10s ease-in-out infinite;
}

.is-playing .hero-glow-a {
  opacity: .22;
  animation: floatGlowA 8s ease-in-out infinite;
}

.is-playing .hero-glow-b {
  opacity: .20;
  animation: floatGlowB 9s ease-in-out infinite;
}

.is-playing .dock-btn-primary {
  animation: pulsePlay 2.2s ease-in-out infinite;
}

@keyframes coverFloat {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.02) translateY(-4px); }
}

@keyframes pulsePlay {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 24px rgba(107, 77, 255, 0.26), 0 0 0 0 rgba(107,77,255,.16); }
  50% { transform: scale(1.035); box-shadow: 0 16px 32px rgba(107, 77, 255, 0.30), 0 0 0 10px rgba(107,77,255,.07); }
}

@keyframes heroWashDrift {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(0,-8px,0) scale(1.02); }
}

@keyframes floatGlowA {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(12px,-10px,0) scale(1.06); }
}

@keyframes floatGlowB {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-10px,8px,0) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .is-playing .cover-image,
  .is-playing .hero-color-wash,
  .is-playing .hero-glow-a,
  .is-playing .hero-glow-b,
  .is-playing .dock-btn-primary,
  .is-playing .eq-mini span,
  .is-playing .eq-playing span {
    animation: none !important;
  }
}

@media (max-width: 760px) {
  .hero-glow {
    width: 240px;
    height: 240px;
    filter: blur(36px);
  }

  .cover-frame {
    padding: 8px;
    border-radius: 30px;
  }
}


.tabs-4 { grid-template-columns: repeat(4, 1fr); }

.history-tab-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.tab-icon-btn:hover {
  background: rgba(255,107,141,0.12);
  color: #ff6b8d;
  transform: translateY(-1px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.9rem;
  line-height: 1;
}

.smart-history {
  margin-top: 14px;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.smart-history-head h3,
.smart-columns h4 {
  margin: 0;
}

.smart-history-head span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.smart-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mini-ranking {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(29, 34, 43, 0.65);
  border: 1px solid var(--line);
}

.rank-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-count {
  color: var(--muted);
  font-size: 0.9rem;
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .tabs-4,
  .stats-grid,
  .smart-columns {
    grid-template-columns: 1fr;
  }
}


.hidden { display: none !important; }

.header-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.install-btn {
  padding: 10px 14px;
  border-radius: 14px;
  white-space: nowrap;
}

.hero {
  min-height: 520px;
}

.hero-placeholder {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 140px;
  padding-top: 6px;
}

.hero-compact-art {
  width: 132px;
  height: 132px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
}

.cover-image-compact {
  width: 100%;
  max-width: none;
  display: block;
  border-radius: 22px;
}

.tabs-panel,
#statsTab,
#historyTab,
#favoritesTab,
#genresTab {
  padding-bottom: 18px;
}

.song-list,
.genre-grid,
.stats-grid,
.smart-history {
  margin-bottom: 140px;
}

.dock-artwork-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 20px;
}

.dock-artwork-btn:hover .dock-artwork {
  transform: scale(1.03);
}

.artwork-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.artwork-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 14, 0.72);
  backdrop-filter: blur(12px);
}

.artwork-modal-card {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 28px));
  max-height: min(88vh, 900px);
  padding: 18px;
  overflow: auto;
}

.artwork-close-btn {
  appearance: none;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(25, 30, 39, 0.94);
  color: var(--text);
  cursor: pointer;
}

.artwork-modal-body {
  display: grid;
  gap: 18px;
  padding-top: 8px;
}

.artwork-modal-cover-wrap {
  display: flex;
  justify-content: center;
}

.artwork-modal-cover {
  width: min(420px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 22px 50px rgba(0,0,0,.35);
}

.artwork-modal-meta {
  text-align: center;
  display: grid;
  gap: 8px;
}

.artwork-modal-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
}

.artwork-modal-sub {
  color: var(--muted);
}

.artwork-modal-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  align-items: center;
}

.artwork-modal-progress {
  display: grid;
  gap: 10px;
}

.artwork-modal-times {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

#modalProgressBar {
  width: 100%;
}

@media (max-width: 760px) {
  .header-bottom-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero {
    min-height: 360px;
  }

  .hero-compact-art {
    width: 106px;
    height: 106px;
    border-radius: 22px;
  }

  .song-list,
  .genre-grid,
  .stats-grid,
  .smart-history {
    margin-bottom: 190px;
  }

  .artwork-modal-card {
    width: calc(100vw - 20px);
    padding: 14px;
  }

  .artwork-modal-cover {
    width: min(300px, 100%);
    border-radius: 22px;
  }

  .artwork-modal-times {
    flex-direction: column;
    align-items: center;
  }
}


.install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 150px;
}

.install-btn-icon {
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  line-height: 1;
  font-weight: 700;
}

.install-help-card {
  width: min(560px, calc(100vw - 28px));
}

.install-help-body {
  display: grid;
  gap: 14px;
  padding-top: 10px;
}

.install-help-body h3 {
  margin: 0;
  font-size: 1.4rem;
}

.install-help-body p {
  margin: 0;
  color: var(--muted);
}

.install-help-steps {
  display: grid;
  gap: 10px;
}

.install-step {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(29, 34, 43, 0.68);
  border: 1px solid var(--line);
  line-height: 1.4;
}

.install-step span {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 760px) {
  .install-btn {
    width: 100%;
  }
}


/* Simplified tabs after removing Stats */
.tabs-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 760px) {
  .tabs-3 { grid-template-columns: 1fr; }
}


.player-track-main {
  min-width: 0;
}

.player-toggle-btn {
  display: none;
  appearance: none;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(27, 31, 41, 0.96);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.player-toggle-btn:hover {
  background: rgba(38, 44, 57, 0.98);
  border-color: rgba(124, 92, 255, 0.35);
}

.dock-artwork {
  width: 64px;
  height: 64px;
}

.player-dock {
  transition: min-height .25s ease, padding .25s ease, gap .25s ease, transform .25s ease;
}

@media (max-width: 760px) {
  .player-dock-wrap {
    padding: 0 10px max(10px, env(safe-area-inset-bottom));
  }

  .player-dock {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 74px;
    padding: 10px 12px;
    align-items: center;
  }

  .player-center,
  .player-side {
    display: none;
  }

  .player-toggle-btn {
    display: inline-flex;
  }

  .player-track {
    gap: 10px;
  }

  .dock-artwork {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .dock-fav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .dock-title {
    font-size: 0.98rem;
  }

  .dock-sub {
    font-size: 0.86rem;
    margin-top: 2px;
  }

  .player-dock.is-expanded {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 14px;
    gap: 12px;
  }

  .player-dock.is-expanded .player-center,
  .player-dock.is-expanded .player-side {
    display: grid;
  }

  .player-dock.is-expanded .player-toggle-btn {
    justify-self: end;
  }

  .player-dock.is-expanded .player-side {
    max-width: none;
  }

  .player-dock.is-expanded .side-volume {
    display: none;
  }

  .player-dock.is-expanded .player-track {
    padding-right: 46px;
  }

  .player-dock.is-expanded .player-toggle-btn {
    position: absolute;
    right: 14px;
    top: 14px;
  }

  #playerDock {
    position: relative;
  }

  .song-list,
  .genre-grid,
  .stats-grid,
  .smart-history {
    margin-bottom: 120px;
  }

  .player-dock.is-expanded ~ * {
    pointer-events: none;
  }
}


.favorites-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 600;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding-bottom: 12px;
}

.page-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(29, 34, 43, 0.95);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.page-info {
  color: var(--muted);
  font-size: 0.92rem;
}

.genre-chip.is-active { border-color: rgba(124, 92, 255, 0.58); box-shadow: 0 0 0 1px rgba(124,92,255,.2), 0 14px 28px rgba(0,0,0,.18); }
.genre-chip.is-active .genre-copy strong { color: #ffffff; }
@media (max-width: 760px) {
  .accordion-toggle { padding: 14px 15px; gap: 10px; }
  .accordion-title { font-size: .98rem; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .genre-chip { grid-template-columns: 60px minmax(0, 1fr); min-height: 82px; gap: 12px; padding: 12px; }
  .genre-badge { width: 60px; height: 60px; border-radius: 18px; }
  .genre-icon { width: 30px; height: 30px; }
  .genre-copy strong { font-size: .94rem; }
  .genre-copy span { font-size: .82rem; }
}


.site-footer {
  margin-top: 18px;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
}

.site-footer-copy {
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-footer-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: #d8ceff;
  cursor: pointer;
  padding: 0;
}

.site-footer-link:hover {
  text-decoration: underline;
}

.site-footer-sep {
  color: var(--muted);
}

.legal-modal-card {
  width: min(760px, calc(100vw - 28px));
}

.legal-modal-body {
  display: grid;
  gap: 18px;
  padding-top: 10px;
}

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

.legal-tab-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(29, 34, 43, 0.95);
  color: var(--muted);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.legal-tab-btn.active {
  color: var(--text);
  background: rgba(23, 26, 33, 0.98);
}

.legal-panel {
  display: none;
  color: var(--text);
  line-height: 1.6;
}

.legal-panel.active {
  display: block;
}

.legal-panel h3 {
  margin: 0 0 12px;
}

.legal-panel p {
  margin: 0 0 12px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer-links {
    justify-content: flex-start;
  }

  .legal-tabs {
    grid-template-columns: 1fr;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.92rem;
}

.lang-picker select {
  background: rgba(14, 18, 24, 0.9);
  color: var(--text);
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
}

@media (max-width: 760px) {
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .lang-picker {
    justify-content: space-between;
  }
}


/* Accordion sections */
.accordion-panel-wrap { padding-top: 14px; }
.accordion-stack { display: grid; gap: 12px; }
.accordion-section {
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(18, 22, 31, 0.92), rgba(14, 17, 25, 0.96));
  border-radius: 20px;
  overflow: hidden;
}
.accordion-header-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
}
.accordion-header-row.with-action { grid-template-columns: 1fr auto; }
.accordion-toggle {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(32, 38, 50, 0.95);
  color: var(--text);
  border-radius: 16px;
  min-height: 58px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.accordion-title {
  justify-self: center;
  font-size: 1.08rem;
  font-weight: 700;
}
.accordion-chevron {
  color: var(--muted);
  font-size: 1.05rem;
  transition: transform .2s ease;
}
.accordion-section.is-open .accordion-chevron { transform: rotate(180deg); }
.section-action-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(32, 38, 50, 0.95);
  border-radius: 14px;
  flex: 0 0 auto;
}
.accordion-panel {
  display: none;
  padding: 0 12px 14px;
}
.accordion-panel.is-open { display: block; }
.accordion-panel .song-list,
.accordion-panel .genre-grid { margin-bottom: 0 !important; padding-bottom: 0 !important; }
.accordion-panel .list-pagination { padding-bottom: 0 !important; }
.genres-panel { gap: 14px; }
.genre-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding-bottom: 10px;
}
.genre-chip {
  appearance: none;
  border: 1px solid rgba(124, 92, 255, 0.20);
  background: linear-gradient(180deg, rgba(32, 37, 49, 0.96), rgba(24, 28, 37, 0.99));
  color: var(--text);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  text-align: left;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 92px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.genre-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 92, 255, 0.44);
  background: linear-gradient(180deg, rgba(40, 46, 60, 0.98), rgba(29, 34, 43, 1));
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.genre-badge {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.18), rgba(255,255,255,0.02) 58%), linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.genre-icon { width: 34px; height: 34px; }
.genre-copy { display: block; min-width: 0; }
.genre-copy strong { display: block; font-size: 1rem; line-height: 1.15; }
.genre-copy span { display: block; margin-top: 6px; color: var(--muted); font-size: 0.88rem; line-height: 1.25; }
.tone-random .genre-badge, .genre-badge.tone-random { color: #dfd6ff; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(124,92,255,.42), rgba(124,92,255,.14)); }
.tone-pop .genre-badge, .genre-badge.tone-pop { color: #ffd6e7; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(255,99,146,.40), rgba(255,179,71,.16)); }
.tone-rock .genre-badge, .genre-badge.tone-rock { color: #ffd8c8; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(255,115,72,.42), rgba(255,206,84,.14)); }
.tone-hiphop .genre-badge, .genre-badge.tone-hiphop { color: #ffe4ba; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(255,170,52,.42), rgba(255,219,112,.14)); }
.tone-latin .genre-badge, .genre-badge.tone-latin { color: #ffd9cf; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(255,91,91,.42), rgba(255,159,67,.14)); }
.tone-dance .genre-badge, .genre-badge.tone-dance { color: #d3fff4; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(45,212,191,.42), rgba(87,221,255,.14)); }
.tone-electro .genre-badge, .genre-badge.tone-electro { color: #d9ecff; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(56,189,248,.42), rgba(124,92,255,.14)); }
.tone-indie .genre-badge, .genre-badge.tone-indie { color: #dff6d5; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(132,204,22,.42), rgba(45,212,191,.14)); }
.tone-rnb .genre-badge, .genre-badge.tone-rnb { color: #ffd8f7; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(217,70,239,.42), rgba(236,72,153,.14)); }
.tone-kpop .genre-badge, .genre-badge.tone-kpop { color: #ffe1fb; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(244,114,182,.42), rgba(129,140,248,.14)); }
.tone-jazz .genre-badge, .genre-badge.tone-jazz { color: #ffe9bf; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(245,158,11,.42), rgba(120,53,15,.18)); }
.tone-classical .genre-badge, .genre-badge.tone-classical { color: #f4e7d8; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(196,181,253,.30), rgba(180,83,9,.16)); }
.tone-metal .genre-badge, .genre-badge.tone-metal { color: #eef2f7; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(148,163,184,.34), rgba(71,85,105,.22)); }
.tone-country .genre-badge, .genre-badge.tone-country { color: #ffe8c5; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(234,179,8,.34), rgba(217,119,6,.16)); }
.tone-flamenco .genre-badge, .genre-badge.tone-flamenco { color: #ffd8d8; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(239,68,68,.40), rgba(234,88,12,.16)); }
.tone-anime .genre-badge, .genre-badge.tone-anime { color: #f7ddff; background-image: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 58%), linear-gradient(135deg, rgba(168,85,247,.40), rgba(99,102,241,.16)); }
@media (max-width: 760px) {
  .accordion-toggle { min-height: 54px; padding: 12px 14px; }
  .accordion-title { font-size: 1rem; }
  .accordion-header-row { padding: 10px; }
  .accordion-panel { padding: 0 10px 12px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .genre-chip {
    grid-template-columns: 1fr;
    min-height: 132px;
    padding: 10px;
    gap: 10px;
  }
  .genre-chip-icon { min-height: 72px; }
  .genre-chip-copy { align-content: start; text-align: left; }
  .section-action-btn { width: 40px; height: 40px; }
}


/* Final polish for collapsible genre cards */
.genre-grid {
  align-items: stretch;
}

.genre-chip {
  width: 100%;
  min-width: 0;
  align-items: start;
  align-content: start;
}

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

.genre-copy strong,
.genre-copy span {
  overflow: hidden;
  word-break: break-word;
}

.genre-copy strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.genre-copy span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  min-height: calc(1.25em * 2);
}

@media (min-width: 761px) {
  .genre-chip {
    min-height: 118px;
  }
}

@media (max-width: 760px) {
  .genre-grid {
    align-items: stretch;
  }

  .genre-chip {
    min-height: 168px;
    align-content: start;
  }

  .genre-badge {
    width: 68px;
    height: 68px;
    border-radius: 20px;
  }

  .genre-icon {
    width: 32px;
    height: 32px;
  }

  .genre-copy {
    gap: 4px;
  }

  .genre-copy strong {
    font-size: 0.96rem;
    line-height: 1.15;
  }

  .genre-copy span {
    font-size: 0.82rem;
    line-height: 1.22;
    min-height: calc(1.22em * 2);
  }
}
