/* ==========================================================================
   Beat Play — design system
   Dark, glassy, mobile-first. Built for the Telegram Mini App viewport.
   ========================================================================== */

:root {
  /* canvas */
  --bg: #08090d;
  --bg-2: #0d0f16;

  /* type */
  --text: #f3f4f8;
  --sub: #8e94a8;
  --sub-dim: #676d80;

  /* accent */
  --accent: #7c6cff;
  --accent-2: #ff5f8f;
  --accent-soft: #a99bff;
  --grad: linear-gradient(135deg, #7c6cff 0%, #b45cff 55%, #ff5f8f 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,108,255,.22), rgba(255,95,143,.18));
  --danger: #ff5a6a;

  /* glass */
  --glass: rgba(255,255,255,.055);
  --glass-2: rgba(255,255,255,.09);
  --glass-3: rgba(255,255,255,.14);
  --line: rgba(255,255,255,.075);
  --line-2: rgba(255,255,255,.12);
  --blur: saturate(1.6) blur(22px);

  /* shape */
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 11px;
  --r-pill: 999px;
  --radius: var(--r-md);      /* legacy aliases */
  --radius-sm: var(--r-sm);
  --surface: var(--glass);
  --surface-2: rgba(255,255,255,.1);
  --card: var(--glass);

  /* depth */
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  --glow: 0 10px 30px rgba(124,108,255,.35);

  /* motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --spring: cubic-bezier(.34,1.32,.64,1);

  /* metrics */
  --header-h: 58px;
  --nav-h: 62px;
  --mini-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --max-width: 520px;
  --gutter: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.011em;
}

button, input, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; padding: 0; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { letter-spacing: -0.025em; }
::selection { background: rgba(124,108,255,.4); }

.hidden { display: none !important; }
.screen { position: fixed; inset: 0; overflow: hidden; z-index: 1; }

/* --------------------------------------------------------------------------
   Ambient background
   -------------------------------------------------------------------------- */
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--bg); }
.ambient .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.blob-a { width: 62vw; height: 62vw; top: -22vw; left: -18vw; background: radial-gradient(circle, rgba(124,108,255,.55), transparent 68%); animation: drift 26s var(--ease) infinite alternate; }
.blob-b { width: 55vw; height: 55vw; top: 12vh; right: -24vw; background: radial-gradient(circle, rgba(255,95,143,.4), transparent 68%); animation: drift 32s var(--ease) infinite alternate-reverse; }
.blob-c { width: 70vw; height: 70vw; bottom: -30vw; left: -10vw; background: radial-gradient(circle, rgba(56,189,248,.22), transparent 70%); animation: drift 38s var(--ease) infinite alternate; }
.ambient .grain {
  position: absolute; inset: 0; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(6vw,4vh,0) scale(1.15); }
}

/* --------------------------------------------------------------------------
   Onboarding
   -------------------------------------------------------------------------- */
.onboarding {
  z-index: 1000;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-t) + 54px) 20px 20px;
  text-align: center; overflow-y: auto;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(124,108,255,.28), transparent 60%),
    radial-gradient(90% 60% at 90% 10%, rgba(255,95,143,.16), transparent 60%),
    var(--bg);
}
.ob-step { width: 100%; max-width: var(--max-width); display: flex; flex-direction: column; align-items: center; animation: fadeUp .5s var(--ease) both; }
.ob-mark, .ob-pulse {
  width: 66px; height: 66px; border-radius: 22px; margin-bottom: 20px;
  display: grid; place-items: center; color: #fff;
  background: var(--grad); box-shadow: var(--glow);
}
.ob-mark svg, .ob-pulse svg { width: 34px; height: 34px; }
.ob-pulse { animation: breathe 2.4s var(--ease) infinite; }
@keyframes breathe { 0%,100% { transform: scale(1); box-shadow: 0 10px 30px rgba(124,108,255,.3); } 50% { transform: scale(1.08); box-shadow: 0 16px 44px rgba(124,108,255,.55); } }

.onboarding h1 { font-size: clamp(2rem, 9vw, 2.6rem); margin: 0 0 10px; font-weight: 800; }
.onboarding h2 { font-size: clamp(1.25rem, 5.4vw, 1.55rem); margin: 0 0 8px; font-weight: 750; line-height: 1.25; }
.onboarding p { color: var(--sub); margin: 0 0 26px; font-size: .95rem; line-height: 1.5; }
.ob-logo { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 850; }

.ob-steps { display: flex; gap: 7px; margin-bottom: 22px; }
.ob-steps i { width: 22px; height: 4px; border-radius: 99px; background: var(--glass-2); }
.ob-steps i.on { background: var(--grad); width: 34px; }

.ob-list { width: 100%; display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
/* Source picker rows carry a description under the name, unlike the language
   rows where the native and English names sit side by side. */
.ob-list-item.stacked > span { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ob-list-item.stacked small { font-size: .79rem; font-weight: 500; color: var(--sub); line-height: 1.4; }
.ob-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 17px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .16s var(--ease);
}
.ob-list-item:active { transform: scale(.985); }
.ob-list-item span { font-weight: 620; }
.ob-list-item span small { color: var(--sub); font-weight: 450; margin-left: 7px; }
.ob-list-item.active { background: var(--grad-soft); border-color: rgba(124,108,255,.5); }
.ob-list-item .radio {
  width: 21px; height: 21px; border: 2px solid var(--line-2); border-radius: 50%;
  flex: 0 0 auto; transition: all .2s var(--ease);
}
.ob-list-item.active .radio { border-color: transparent; background: var(--grad); box-shadow: inset 0 0 0 4px var(--bg); }

.ob-grid { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; padding-bottom: 150px; }
.ob-grid-item, .music-lang-card {
  position: relative; display: flex; align-items: center; cursor: pointer;
  min-height: 104px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--glass); background-size: cover; border: 1px solid var(--line);
  filter: grayscale(85%) brightness(.62);
  transition: filter .3s var(--ease), transform .3s var(--spring), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.ob-grid-item.selected, .music-lang-card.selected {
  filter: none; transform: scale(1.035);
  border-color: rgba(255,255,255,.35); box-shadow: 0 12px 28px rgba(0,0,0,.5);
}
.ob-grid-item:active, .music-lang-card:active { transform: scale(.97); }
.ob-grid-item[data-side="left"], .music-lang-card[data-side="left"] { background-position: left center; padding-left: 46%; padding-right: 10px; }
.ob-grid-item[data-side="right"], .music-lang-card[data-side="right"] { background-position: right center; padding-left: 10px; padding-right: 46%; }
.ob-grid-item[data-side="left"] .mask, .music-lang-card[data-side="left"] .mask { background: linear-gradient(to right, rgba(6,7,11,.35), rgba(6,7,11,.85)); }
.ob-grid-item[data-side="right"] .mask, .music-lang-card[data-side="right"] .mask { background: linear-gradient(to left, rgba(6,7,11,.35), rgba(6,7,11,.85)); }
.ob-grid-item .mask, .music-lang-card .mask { position: absolute; inset: 0; }
.ob-grid-text, .music-lang-card .text { position: relative; z-index: 1; display: flex; flex-direction: column; width: 100%; text-align: center; }
.ob-grid-text .native, .music-lang-card .native { font-size: 1.14rem; font-weight: 750; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.ob-grid-text .name, .music-lang-card .name { font-size: .72rem; color: rgba(255,255,255,.72); margin-top: 3px; letter-spacing: .02em; }
.ob-grid-item .check, .music-lang-card .check {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 23px; height: 23px; border-radius: 50%; color: #fff; background: var(--grad);
  display: grid; place-items: center; font-size: .78rem; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,.45); animation: pop .3s var(--spring) both;
}

.ob-count { color: var(--sub); font-size: .88rem; margin: 0 0 12px; }
.ob-sticky { width: 100%; padding-bottom: 12px; }
.ob-music-footer {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: var(--max-width); margin: 0 auto;
  padding: 18px 20px calc(20px + var(--safe-b)); z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(to top, var(--bg) 40%, rgba(8,9,13,0));
}
.ob-btn {
  width: 100%; padding: 16px; border-radius: var(--r-md);
  background: var(--grad); color: #fff; font-weight: 700; font-size: 1rem;
  box-shadow: var(--glow); transition: transform .16s var(--ease), box-shadow .2s var(--ease), filter .2s;
}
.ob-btn:active { transform: scale(.975); box-shadow: 0 6px 18px rgba(124,108,255,.3); filter: brightness(1.06); }

.ob-bars { display: flex; align-items: flex-end; gap: 5px; height: 34px; margin-top: 26px; }
.ob-bars i { width: 5px; border-radius: 99px; background: var(--grad); animation: bars 1s ease-in-out infinite; }
.ob-bars i:nth-child(1) { height: 40%; animation-delay: 0s; }
.ob-bars i:nth-child(2) { height: 75%; animation-delay: .15s; }
.ob-bars i:nth-child(3) { height: 100%; animation-delay: .3s; }
.ob-bars i:nth-child(4) { height: 60%; animation-delay: .45s; }
.ob-bars i:nth-child(5) { height: 85%; animation-delay: .6s; }
@keyframes bars { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  height: calc(var(--header-h) + var(--safe-t)); padding: var(--safe-t) var(--gutter) 0;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(8,9,13,.9), rgba(8,9,13,.55) 70%, rgba(8,9,13,0));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 9px; user-select: none; }
/* Two-tone wordmark: "Beat" solid, "Play" carrying the accent gradient. Flat
   single-weight text read as a placeholder against the rest of the UI. */
.brand-name {
  font-weight: 800; font-size: 1.16rem; line-height: 1;
  letter-spacing: -.025em; color: var(--text);
}
.brand-name > span {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.logo-icon {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--grad); color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  /* outer accent glow + inner top highlight, so the tile reads as lit glass
     rather than a flat swatch */
  box-shadow: 0 6px 18px rgba(124,108,255,.42), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .3s var(--spring);
}
.brand:active .logo-icon { transform: scale(.93); }
.logo-icon svg { width: 18px; height: 18px; }
.header-actions { display: flex; align-items: center; gap: 9px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; color: var(--text);
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: transform .16s var(--ease), background .2s var(--ease);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn:active { transform: scale(.9); background: var(--glass-2); }

.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border-radius: var(--r-pill); font-size: .82rem; font-weight: 600;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: transform .16s var(--ease);
}
.user-chip:active { transform: scale(.95); }
.user-chip img { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; background: var(--glass-2); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
#app { display: flex; flex-direction: column; }
main {
  position: fixed; left: 0; right: 0;
  top: calc(var(--header-h) + var(--safe-t));
  bottom: calc(var(--nav-h) + var(--safe-b));
  overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
}
#app.has-player main { bottom: calc(var(--nav-h) + var(--safe-b) + var(--mini-h) + 10px); }
.view { display: none; padding: 4px var(--gutter) 28px; }
.view.active { display: block; animation: viewIn .34s var(--ease) both; }
.view-title { font-size: 1.55rem; margin: 6px 0 16px; font-weight: 800; }

@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */
.home-top { padding-top: 6px; }
.home-tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-pill);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.home-tabs button {
  padding: 8px 20px; border-radius: var(--r-pill); font-size: .84rem; font-weight: 650; color: var(--sub);
  transition: color .2s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.home-tabs button.active { color: #fff; background: var(--grad); box-shadow: 0 4px 14px rgba(124,108,255,.4); }
/* Podcasts are JioSaavn-only. Dimmed rather than hidden: a lone "Music" pill
   would be a pointless control, and the disabled state is what tells a YouTube
   listener podcasts exist at all. */
.home-tabs button.disabled { opacity: .38; cursor: not-allowed; }
.home-tab-hint {
  margin: -12px 0 16px; font-size: .78rem; line-height: 1.45; color: var(--sub);
  animation: fadeUp .3s var(--ease) both;
}
.home-greeting h2 { font-size: clamp(1.5rem, 6.6vw, 1.85rem); margin: 0 0 18px; font-weight: 800; }

.home-section { margin-bottom: 26px; animation: fadeUp .5s var(--ease) both; }
.home-section:nth-child(1) { animation-delay: .02s; }
.home-section:nth-child(2) { animation-delay: .08s; }
.home-section:nth-child(3) { animation-delay: .14s; }
.home-section:nth-child(4) { animation-delay: .2s; }
.home-section:nth-child(5) { animation-delay: .26s; }
.home-section:nth-child(n+6) { animation-delay: .32s; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 13px; }
.section-title h3 { font-size: 1.08rem; margin: 0; font-weight: 750; }
.section-title .view-all {
  color: var(--sub); font-size: .78rem; font-weight: 650; cursor: pointer;
  padding: 5px 11px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--line);
  white-space: nowrap; transition: color .2s, background .2s, transform .16s var(--ease);
}
.section-title .view-all:active { transform: scale(.94); color: var(--text); background: var(--glass-2); }
.text-btn { color: var(--accent-soft); font-size: .8rem; font-weight: 650; padding: 4px 2px; }
.text-btn:active { opacity: .6; }

.h-scroll {
  display: flex; gap: 13px; overflow-x: auto; padding: 2px 0 8px;
  scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-padding-left: var(--gutter);
}
.h-scroll::-webkit-scrollbar { display: none; }

/* While drag-panning: kill snap (it fights the drag) and text selection. */
.h-scroll.dragging, .search-tabs.dragging, .library-menu.dragging {
  scroll-snap-type: none; cursor: grabbing; user-select: none; -webkit-user-select: none;
}
.h-scroll.dragging * { pointer-events: none; }

/* cards ---------------------------------------------------------------- */
.card, .card-song, .chart-card {
  flex: 0 0 auto; scroll-snap-align: start; cursor: pointer;
  transition: transform .26s var(--spring);
}
.card:active, .card-song:active, .chart-card:active { transform: scale(.955); }

.card { width: 146px; }
.card-cover, .card-song .cover, .chart-card .cover {
  position: relative; width: 100%; aspect-ratio: 1; margin-bottom: 10px;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--grad-soft);
  box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.07);
}
.card-cover img, .card-song .cover img, .chart-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover.round { border-radius: 50%; }
.card-cover.round + .card-title { text-align: center; }

.card-song { width: 140px; }
.chart-card { width: 172px; }

.card-title { font-size: .855rem; font-weight: 650; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { font-size: .755rem; color: var(--sub); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.card-song .play {
  position: absolute; right: 9px; bottom: 9px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(8px) scale(.85);
  transition: opacity .25s var(--ease), transform .3s var(--spring);
}
.card-song .play svg { width: 17px; height: 17px; fill: currentColor; margin-left: 2px; }
.card-song:hover .play, .card-song:active .play, .card-song.playing .play { opacity: 1; transform: none; }
/* touch devices never get :hover — keep the affordance visible */
@media (hover: none) { .card-song .play { opacity: 1; transform: none; } }

/* images fade in as they decode */
img.bp-img { opacity: 0; transition: opacity .45s var(--ease); }
img.bp-img.loaded { opacity: 1; }

/* track rows ----------------------------------------------------------- */
.track-list { display: flex; flex-direction: column; gap: 2px; }
.track-row {
  display: flex; align-items: center; gap: 13px; padding: 8px; cursor: pointer;
  border-radius: var(--r-md); position: relative;
  transition: background .2s var(--ease), transform .16s var(--ease);
}
.track-row:active { transform: scale(.985); background: var(--glass); }
.track-row + .track-row::before {
  content: ''; position: absolute; top: 0; left: 69px; right: 8px; height: 1px; background: var(--line);
}
.track-row img {
  width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; flex: 0 0 auto;
  background: var(--grad-soft); box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.track-row .info { flex: 1; min-width: 0; }
.track-row .title { font-size: .9rem; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-row .artist { font-size: .775rem; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.track-row .actions { display: flex; gap: 2px; flex: 0 0 auto; }
.track-row .actions button {
  width: 34px; height: 34px; border-radius: 50%; color: var(--sub-dim);
  display: grid; place-items: center; transition: color .2s, background .2s, transform .16s var(--ease);
}
.track-row .actions button svg { width: 17px; height: 17px; }
.track-row .actions button:active { transform: scale(.86); background: var(--glass); }
.track-row .actions button.active, .track-row .actions .row-fav[data-on="1"] { color: var(--accent-2); }

/* currently playing row */
.track-row.playing, .track-row.active { background: var(--grad-soft); }
.track-row.playing .title, .track-row.active .title { color: var(--accent-soft); }
.track-row.playing + .track-row::before, .track-row.active + .track-row::before { opacity: 0; }
.track-row .eq { display: none; align-items: flex-end; gap: 2.5px; height: 15px; width: 17px; flex: 0 0 auto; }
.track-row.playing .eq { display: flex; }
.track-row .eq i { width: 2.5px; height: 100%; border-radius: 99px; background: var(--accent-soft); transform-origin: bottom; animation: bars .9s ease-in-out infinite; }
.track-row .eq i:nth-child(2) { animation-delay: .18s; }
.track-row .eq i:nth-child(3) { animation-delay: .36s; }
/* freeze the equaliser while playback is paused */
body:not(.is-playing) .track-row .eq i { animation-play-state: paused; }

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */
.search-header {
  position: sticky; top: 0; z-index: 20; margin: 0 calc(var(--gutter) * -1); padding: 8px var(--gutter) 4px;
  background: linear-gradient(to bottom, var(--bg) 55%, rgba(8,9,13,.75) 85%, rgba(8,9,13,0));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.search-input-box {
  display: flex; align-items: center; gap: 11px; padding: 0 15px;
  border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.search-input-box:focus-within { border-color: rgba(124,108,255,.55); box-shadow: 0 0 0 4px rgba(124,108,255,.13); }
.search-input-box .search-ico { width: 18px; height: 18px; color: var(--sub); flex: 0 0 auto; }
.search-input-box input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  padding: 13px 0; color: var(--text); font-size: .93rem;
}
.search-input-box input::placeholder { color: var(--sub-dim); }
.search-input-box input::-webkit-search-cancel-button { display: none; }
.clear-btn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-2); color: var(--sub); flex: 0 0 auto; }
.clear-btn svg { width: 12px; height: 12px; }
.clear-btn:active { transform: scale(.88); }

.search-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 12px 0 6px; scrollbar-width: none; }
.search-tabs::-webkit-scrollbar { display: none; }
.search-tabs button, .library-menu button {
  padding: 8px 15px; border-radius: var(--r-pill); white-space: nowrap;
  font-size: .805rem; font-weight: 650; color: var(--sub);
  background: var(--glass); border: 1px solid var(--line);
  transition: color .2s, background .3s var(--ease), border-color .2s, transform .16s var(--ease);
}
.search-tabs button:active, .library-menu button:active { transform: scale(.94); }
.search-tabs button.active, .library-menu button.active {
  color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 4px 14px rgba(124,108,255,.38);
}

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 7px; padding: 9px 14px;
  border-radius: var(--r-pill); font-size: .8rem; font-weight: 550; color: var(--text);
  background: var(--glass); border: 1px solid var(--line); cursor: pointer;
  transition: transform .16s var(--ease), background .2s, border-color .2s;
  animation: pop .3s var(--ease) both;
}
.chip:active { transform: scale(.94); background: var(--glass-2); }
.chip .remove-history { color: var(--sub-dim); font-size: 1rem; line-height: 1; background: none; border: none; }
.search-section { margin-bottom: 24px; }

/* --------------------------------------------------------------------------
   Library
   -------------------------------------------------------------------------- */
.library-menu { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 16px; scrollbar-width: none; }
.library-menu::-webkit-scrollbar { display: none; }

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */
.settings-header { padding-top: 2px; }
.settings-group { margin-bottom: 22px; }
.settings-group h4 {
  font-size: .705rem; text-transform: uppercase; color: var(--sub-dim);
  margin: 0 0 9px 4px; letter-spacing: .09em; font-weight: 700;
}
.settings-group .settings-row:first-of-type { border-top-left-radius: var(--r-md); border-top-right-radius: var(--r-md); }
.settings-group .settings-row:last-of-type { border-bottom-left-radius: var(--r-md); border-bottom-right-radius: var(--r-md); border-bottom: none; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 16px; cursor: pointer;
  background: var(--glass); border-bottom: 1px solid var(--line);
  transition: background .2s var(--ease);
}
.settings-row:active { background: var(--glass-2); }
.settings-row .label { font-size: .92rem; font-weight: 550; }
.settings-row .value, .settings-row .music-lang-value { color: var(--sub); font-size: .84rem; }
.settings-row .music-lang-value { max-width: 165px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-row .chevron { color: var(--sub-dim); font-size: 1.15rem; line-height: 1; }
.settings-row select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--glass-2) no-repeat right 10px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e94a8' stroke-width='3' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 30px 8px 12px; color: var(--text); font-size: .84rem; max-width: 62%;
}
.settings-row select option { background: var(--bg-2); color: var(--text); }

.settings-toggle {
  width: 48px; height: 28px; border-radius: var(--r-pill); flex: 0 0 auto; position: relative;
  background: var(--glass-3); transition: background .28s var(--ease);
}
.settings-toggle.active { background: var(--grad); box-shadow: 0 3px 12px rgba(124,108,255,.4); }
.settings-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .28s var(--spring);
}
.settings-toggle.active::after { transform: translateX(20px); }
.settings-toggle:active::after { width: 25px; }

/* --------------------------------------------------------------------------
   Bottom nav
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(10,11,16,.72); border-top: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7);
}
.bottom-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--sub-dim); font-size: .655rem; font-weight: 600; flex: 1;
  transition: color .25s var(--ease), transform .18s var(--ease);
}
.bottom-nav button:active { transform: scale(.9); }
.nav-ico { display: grid; place-items: center; width: 26px; height: 26px; transition: transform .3s var(--spring); }
.bottom-nav button svg { width: 22px; height: 22px; }
.bottom-nav button.active { color: var(--accent-soft); }
.bottom-nav button.active .nav-ico { transform: translateY(-2px); filter: drop-shadow(0 4px 10px rgba(124,108,255,.55)); }

/* --------------------------------------------------------------------------
   Mini player
   -------------------------------------------------------------------------- */
.mini-player {
  position: fixed; left: 10px; right: 10px; z-index: 70;
  bottom: calc(var(--nav-h) + var(--safe-b) + 9px); height: var(--mini-h);
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer;
  border-radius: var(--r-lg); overflow: hidden;
  background: rgba(22,24,34,.82); border: 1px solid var(--line-2);
  backdrop-filter: blur(26px) saturate(1.8); -webkit-backdrop-filter: blur(26px) saturate(1.8);
  box-shadow: var(--shadow);
  animation: miniIn .4s var(--spring) both;
}
@keyframes miniIn { from { opacity: 0; transform: translateY(70px) scale(.94); } to { opacity: 1; transform: none; } }
.mini-progress { position: absolute; top: 0; left: 0; right: 0; height: 2.5px; background: rgba(255,255,255,.08); }
.mini-progress i { display: block; height: 100%; width: 0%; background: var(--grad); border-radius: 0 99px 99px 0; transition: width .25s linear; }
.mini-art { width: 44px; height: 44px; border-radius: var(--r-sm); overflow: hidden; flex: 0 0 auto; background: var(--grad-soft); box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.mini-art img { width: 100%; height: 100%; object-fit: cover; }
.mini-meta { flex: 1; min-width: 0; }
.mini-title { font-size: .865rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-size: .755rem; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.mini-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ghost-btn {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--sub);
  transition: color .2s, background .2s, transform .16s var(--ease);
}
.ghost-btn svg { width: 19px; height: 19px; }
.ghost-btn:active { transform: scale(.88); background: var(--glass); }
.ghost-btn.active { color: var(--accent-2); }
.mini-play {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(124,108,255,.42);
  transition: transform .18s var(--spring);
}
.mini-play svg { width: 20px; height: 20px; }
.mini-play:active { transform: scale(.9); }

/* --------------------------------------------------------------------------
   Now playing
   -------------------------------------------------------------------------- */
.now-playing { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: var(--bg); }
.now-playing:not(.hidden) { animation: npIn .42s var(--ease) both; }
.now-playing.closing { animation: npOut .3s var(--ease) both; }
@keyframes npIn { from { opacity: .4; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@keyframes npOut { from { opacity: 1; transform: none; } to { opacity: .3; transform: translateY(100%); } }

.np-bg { position: absolute; inset: -25%; background-size: cover; background-position: center; filter: blur(64px) saturate(1.7); opacity: .8; transform: scale(1.1); transition: background-image .5s var(--ease); }
.np-veil { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(8,9,13,.3), rgba(8,9,13,.62) 48%, rgba(8,9,13,.88) 78%, rgba(8,9,13,.96)); }
.np-content {
  position: relative; flex: 1; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 12px) 22px calc(var(--safe-b) + 20px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.np-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4vh; flex: 0 0 auto; }
.np-eyebrow { font-weight: 700; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sub); }

.np-art { margin: 0 auto 5vh; width: min(320px, 74vw); flex: 0 0 auto; }
#np-cover {
  width: 100%; aspect-ratio: 1; border-radius: 26px; object-fit: cover;
  background: var(--grad-soft);
  box-shadow: 0 30px 70px rgba(0,0,0,.65), inset 0 0 0 1px rgba(255,255,255,.1);
  animation: artIn .5s var(--spring) both;
}
@keyframes artIn { from { opacity: 0; transform: scale(.88) translateY(16px); } to { opacity: 1; transform: none; } }

.np-info { text-align: center; margin-bottom: 26px; }
.np-info .title { font-size: 1.4rem; font-weight: 780; line-height: 1.25; margin-bottom: 6px; }
.np-info .artist { color: var(--sub); font-size: .95rem; font-weight: 550; }
.np-source {
  display: inline-block; margin-top: 11px; padding: 4px 11px; border-radius: var(--r-pill);
  font-size: .63rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--accent-soft); background: rgba(124,108,255,.14); border: 1px solid rgba(124,108,255,.28);
}
.np-source:empty { display: none; }

.np-progress { margin-bottom: 14px; }
.np-times { display: flex; justify-content: space-between; margin-top: -2px; }
.np-times span { font-size: .7rem; color: var(--sub); font-variant-numeric: tabular-nums; }

.np-controls { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 26px; }
.np-controls .ctrl {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--sub);
  transition: color .2s var(--ease), background .2s, transform .18s var(--ease);
}
.np-controls .ctrl svg { width: 21px; height: 21px; }
.np-controls .ctrl.lg { width: 54px; height: 54px; color: var(--text); }
.np-controls .ctrl.lg svg { width: 29px; height: 29px; }
.np-controls .ctrl:active { transform: scale(.86); background: var(--glass); }
.np-controls .ctrl.active { color: var(--accent-soft); background: rgba(124,108,255,.14); }
.np-controls .play {
  width: 70px; height: 70px; border-radius: 50%; margin: 0 6px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 12px 32px rgba(124,108,255,.5);
  transition: transform .2s var(--spring), box-shadow .25s var(--ease);
}
.np-controls .play svg { width: 30px; height: 30px; }
.np-controls .play:active { transform: scale(.92); box-shadow: 0 6px 18px rgba(124,108,255,.35); }

.np-extra { display: flex; justify-content: space-around; align-items: center; margin-top: auto; padding-top: 10px; }
.np-extra button {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--sub);
  transition: color .2s, background .2s, transform .18s var(--ease);
}
.np-extra button svg { width: 21px; height: 21px; }
.np-extra button:active { transform: scale(.88); background: var(--glass); }
.np-extra button.active { color: var(--accent-2); }
#np-fav.active svg { filter: drop-shadow(0 3px 10px rgba(255,95,143,.5)); }

/* Lyrics come in two pieces: a peek card that sits in the now-playing flow and
   the full-height sheet it opens. The card used to be the only surface, which
   meant reading a whole song four lines at a time at the bottom of a scroll. */
.np-lyrics {
  margin-top: 14px; padding: 14px 18px 0; cursor: pointer;
  border-radius: var(--r-lg); background: rgba(255,255,255,.05); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: fadeUp .35s var(--ease) both;
  transition: background .2s var(--ease), transform .2s var(--spring);
}
.np-lyrics:active { transform: scale(.985); background: rgba(255,255,255,.08); }
.np-lyrics-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sub);
}
.np-lyrics-expand { color: var(--accent-soft); letter-spacing: .04em; }
.np-lyrics-text {
  /* Clipped to a teaser and faded out, so it reads as "there is more" rather
     than as a broken scroll box. */
  max-height: 132px; overflow: hidden; margin-top: 10px; padding-bottom: 18px;
  text-align: center; white-space: pre-wrap; line-height: 1.75;
  color: rgba(255,255,255,.82); font-size: .95rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}
/* Empty / "no lyrics" states have nothing to expand into. */
.np-lyrics.flat { cursor: default; }
.np-lyrics.flat .np-lyrics-expand { display: none; }
.np-lyrics.flat .np-lyrics-text { max-height: none; -webkit-mask-image: none; mask-image: none; padding-bottom: 16px; }

/* About sheet ---------------------------------------------------------- */
.about-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 20px calc(var(--safe-b) + 24px);
}
.about-body::-webkit-scrollbar { width: 0; }
.about-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 0 22px; }
.about-hero .logo-icon { width: 62px; height: 62px; border-radius: 20px; margin-bottom: 14px; }
.about-hero .logo-icon svg { width: 32px; height: 32px; }
.about-hero .brand-name { font-size: 1.5rem; }
.about-version {
  margin-top: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .1em;
  color: var(--sub); padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--glass); border: 1px solid var(--line);
}
.about-desc { margin: 14px 0 0; max-width: 30ch; font-size: .93rem; line-height: 1.6; color: var(--sub); }

.about-group { margin-top: 22px; }
.about-group h4 {
  margin: 0 0 11px; font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--sub-dim);
}
.about-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.about-chip {
  padding: 7px 13px; border-radius: var(--r-pill); font-size: .85rem; font-weight: 600;
  background: var(--glass); border: 1px solid var(--line); color: rgba(255,255,255,.86);
}

.about-link {
  display: flex; align-items: center; gap: 13px; width: 100%; margin-bottom: 9px;
  padding: 13px 14px; text-align: left; color: var(--text);
  border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--line);
  transition: transform .18s var(--spring), background .2s var(--ease);
}
.about-link:active { transform: scale(.98); background: var(--glass-2); }
.about-link-ico {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px;
  display: grid; place-items: center; color: #fff; background: var(--grad);
  box-shadow: 0 5px 14px rgba(124,108,255,.35);
}
.about-link-ico svg { width: 19px; height: 19px; }
.about-link-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.about-link-text .t { font-weight: 650; font-size: .95rem; }
.about-link-text .s { font-size: .8rem; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.about-legal {
  margin: 22px 0 0; text-align: center; font-size: .76rem;
  line-height: 1.6; color: var(--sub-dim);
}

.lyrics-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 22px 24px calc(var(--safe-b) + 32px);
  text-align: center; white-space: pre-wrap;
  font-size: 1.06rem; line-height: 2; color: rgba(255,255,255,.9);
}
.lyrics-body::-webkit-scrollbar { width: 0; }

/* range input ---------------------------------------------------------- */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0 var(--pct, 0%), rgba(255,255,255,.14) var(--pct, 0%) 100%);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(124,108,255,.22), 0 2px 6px rgba(0,0,0,.4);
  transition: transform .16s var(--spring);
}
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.3); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.14); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: none; border-radius: 50%; background: #fff; }

/* --------------------------------------------------------------------------
   Sheets: queue + modals
   -------------------------------------------------------------------------- */
.queue-panel { position: fixed; inset: 0; z-index: 250; }
.modal { position: fixed; inset: 0; z-index: 300; }
.queue-backdrop, .modal-backdrop {
  position: absolute; inset: 0; background: rgba(4,5,8,.66);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn .3s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.queue-sheet, .modal-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: rgba(16,18,26,.92); border: 1px solid var(--line-2); border-bottom: none;
  backdrop-filter: blur(30px) saturate(1.7); -webkit-backdrop-filter: blur(30px) saturate(1.7);
  box-shadow: var(--shadow-lg);
  animation: sheetUp .42s var(--ease) both;
}
.queue-sheet { max-height: 72vh; }
.modal-sheet { top: 7vh; }
.modal-sheet.compact { top: auto; max-height: 82vh; }
.queue-panel.closing .queue-sheet, .modal.closing .modal-sheet { animation: sheetDown .28s var(--ease) both; }
.queue-panel.closing .queue-backdrop, .modal.closing .modal-backdrop { animation: fadeIn .28s var(--ease) reverse both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { from { transform: none; } to { transform: translateY(100%); } }

.grabber { width: 38px; height: 4px; border-radius: 99px; background: var(--glass-3); margin: 9px auto 0; flex: 0 0 auto; }
.queue-header, .modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px 13px; flex: 0 0 auto; border-bottom: 1px solid var(--line);
}
.queue-header h3, .modal-header h3 {
  margin: 0; font-size: 1.08rem; font-weight: 750;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal-close {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; color: var(--text);
  display: grid; place-items: center; background: var(--glass); border: 1px solid var(--line);
  transition: transform .16s var(--ease), background .2s;
}
.modal-close svg { width: 15px; height: 15px; }
.modal-close:active { transform: scale(.9); background: var(--glass-2); }

.queue-list, .modal-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px calc(28px + var(--safe-b)); }
.queue-list { padding-bottom: calc(20px + var(--safe-b)); }

.artist-hero {
  position: relative; width: 100%; height: 210px; margin-bottom: 18px;
  border-radius: var(--r-lg); overflow: hidden; background: var(--grad-soft);
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
}
.artist-hero img { width: 100%; height: 100%; object-fit: cover; }
.artist-hero .overlay {
  position: absolute; inset: 0; padding: 18px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(6,7,11,.92) 5%, rgba(6,7,11,.25) 60%, transparent);
}
.artist-hero h2 { margin: 0 0 3px; font-size: 1.55rem; font-weight: 800; text-shadow: 0 3px 14px rgba(0,0,0,.6); }
.artist-hero p { margin: 0; color: var(--sub); font-size: .82rem; }

/* profile -------------------------------------------------------------- */
.profile-card { text-align: center; padding: 12px 8px 20px; }
.profile-ring {
  width: 104px; height: 104px; margin: 0 auto 16px; padding: 3px; border-radius: 50%;
  background: var(--grad); box-shadow: var(--glow);
}
.profile-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--bg-2); border: 3px solid var(--bg); }
.profile-name { font-size: 1.3rem; font-weight: 780; }
.profile-username { color: var(--sub); font-size: .875rem; margin-top: 3px; }
.profile-stats {
  display: flex; align-items: center; justify-content: center; gap: 26px; margin: 22px 0;
  padding: 16px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--line);
}
.profile-stats .stat-num { font-size: 1.5rem; font-weight: 800; }
.profile-stats .stat-label { font-size: .715rem; color: var(--sub); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.profile-stats .stat-div { width: 1px; height: 34px; background: var(--line-2); }

/* music languages ------------------------------------------------------ */
.music-lang-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 6px 0 16px; }
.music-lang-card { min-height: 112px; }
.music-lang-footer {
  position: sticky; bottom: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 11px;
  padding: 14px 0 calc(14px + var(--safe-b));
  background: linear-gradient(to top, rgba(16,18,26,.98) 45%, rgba(16,18,26,0));
}
.music-lang-footer span { color: var(--sub); font-size: .88rem; }

/* --------------------------------------------------------------------------
   Notification toast
   -------------------------------------------------------------------------- */
.notification-toast {
  position: fixed; z-index: 500; left: 12px; right: 12px; top: calc(var(--safe-t) + 12px);
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 15px; cursor: pointer;
  border-radius: var(--r-md); background: rgba(22,24,34,.9); border: 1px solid var(--line-2);
  backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: var(--shadow);
  animation: toastIn .45s var(--spring) both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-26px) scale(.96); } to { opacity: 1; transform: none; } }
.notification-toast::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 99px; background: var(--grad); }
.toast-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent-soft); background: rgba(124,108,255,.15); }
.toast-ico svg { width: 17px; height: 17px; }
.toast-body { flex: 1; min-width: 0; }
.notification-toast strong { display: block; font-size: .875rem; margin-bottom: 3px; text-transform: capitalize; }
.notification-toast #notification-message { font-size: .82rem; color: var(--sub); line-height: 1.45; }
.toast-x { width: 18px; height: 18px; color: var(--sub-dim); flex: 0 0 auto; margin-top: 2px; }
.toast-x svg { width: 100%; height: 100%; }
.notification-toast.warning::before, .notification-toast.warning .toast-ico { background: linear-gradient(135deg, #ffb020, #ff7a45); }
.notification-toast.warning .toast-ico { color: #fff; }
.notification-toast.error::before, .notification-toast.error .toast-ico { background: linear-gradient(135deg, #ff5a6a, #ff2d55); }
.notification-toast.error .toast-ico { color: #fff; }

/* --------------------------------------------------------------------------
   States: loading / empty / skeletons
   -------------------------------------------------------------------------- */
.loading { color: var(--sub); padding: 30px 0; text-align: center; font-size: .88rem; }
/* compact variant for empty states that sit inline in a row of chips */
.inline-empty { color: var(--sub-dim); font-size: .82rem; padding: 4px 2px; }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--sub); text-align: center; padding: 46px 20px; font-size: .89rem; line-height: 1.5;
  animation: fadeUp .4s var(--ease) both;
}
.empty-ico {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  color: var(--accent-soft); background: var(--grad-soft); border: 1px solid var(--line);
}
.empty-ico svg { width: 26px; height: 26px; }
.empty-detail { color: var(--sub-dim); font-size: .74rem; max-width: 260px; word-break: break-word; }
.retry-btn {
  margin-top: 2px; padding: 10px 22px; border-radius: var(--r-pill);
  font-size: .82rem; font-weight: 650; color: var(--text);
  background: var(--glass-2); border: 1px solid var(--line-2);
  transition: transform .16s var(--ease), background .2s;
}
.retry-btn:active { transform: scale(.94); background: var(--glass-3); }

.sk { position: relative; overflow: hidden; background: rgba(255,255,255,.055); border-radius: var(--r-sm); }
.sk::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08) 45%, rgba(255,255,255,.13) 50%, rgba(255,255,255,.08) 55%, transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.sk-section { margin-bottom: 26px; }
.sk-title { width: 40%; height: 17px; margin-bottom: 15px; border-radius: 8px; }
.sk-strip { display: flex; gap: 13px; overflow: hidden; }
.sk-card { flex: 0 0 auto; width: 140px; }
.sk-card .sk-art { width: 140px; height: 140px; border-radius: var(--r-lg); margin-bottom: 10px; }
.sk-card .sk-l1 { width: 85%; height: 11px; border-radius: 6px; margin-bottom: 7px; }
.sk-card .sk-l2 { width: 55%; height: 9px; border-radius: 6px; }
.sk-rows { display: flex; flex-direction: column; gap: 10px; }
.sk-row { display: flex; align-items: center; gap: 13px; padding: 8px; }
.sk-row .sk-art { width: 52px; height: 52px; border-radius: var(--r-sm); flex: 0 0 auto; }
.sk-row .sk-lines { flex: 1; }
.sk-row .sk-l1 { width: 62%; height: 11px; border-radius: 6px; margin-bottom: 8px; }
.sk-row .sk-l2 { width: 38%; height: 9px; border-radius: 6px; }

/* --------------------------------------------------------------------------
   Scrollbars, reduced motion, desktop framing
   -------------------------------------------------------------------------- */
main::-webkit-scrollbar, .modal-body::-webkit-scrollbar, .queue-list::-webkit-scrollbar,
.np-content::-webkit-scrollbar, .np-lyrics::-webkit-scrollbar, .onboarding::-webkit-scrollbar { width: 0; height: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ambient .blob { animation: none; }
}

/* Desktop / wide viewport: frame the app as a centred phone-width column.
   Centring uses `left:0; right:0; margin-inline:auto` rather than
   translateX(-50%) so the transform-based entry animations (miniIn, toastIn,
   npIn) don't knock these elements off centre when their fill mode lands on
   `transform: none`. */
@media (min-width: 600px) {
  body { background: #05060a; }
  body::before {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(70% 50% at 50% 0%, rgba(124,108,255,.14), transparent 70%);
  }
  .screen, .app-header, .bottom-nav, .now-playing, .modal, .queue-panel, main {
    left: 0; right: 0; margin-inline: auto; max-width: var(--max-width);
  }
  .screen, .now-playing { box-shadow: 0 0 0 1px var(--line), 0 30px 90px rgba(0,0,0,.7); }
  .mini-player { left: 0; right: 0; margin-inline: auto; width: calc(var(--max-width) - 20px); }
  .notification-toast { left: 0; right: 0; margin-inline: auto; width: calc(var(--max-width) - 24px); }
}
