/* =========================================
   CHILLSOUND — Main Stylesheet
   ========================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Global perf: GPU layers for animated elements ── */
.page, .mob-player-expanded, .music-player, .tracklist-overlay,
.auth-modal-overlay, .nav-dropdown {
  transform: translateZ(0);
}

/* Touch device improvements */
@media (hover: none) {
  .ctrl-btn:hover      { background: none; transform: none; }
  .play-btn:hover      { transform: none !important; }
  .playlist-card:hover { transform: none; }
  .nav-item:hover      { background: none; }
  .auth-header-btn:hover { transform: none; }
  .lib-nav:hover       { transform: none; }
  .tl-row:hover        { background: none; }
  .mob-tab:hover       { color: #999; }
}

/* Active press states for touch */
@media (hover: none) {
  .mob-tab:active          { background: rgba(26,42,108,0.07); border-radius: 12px; }
  .playlist-card:active    { opacity: 0.85; transform: scale(0.97); }
  .track-row:active        { background: rgba(255,255,255,0.1); }
  .tl-row:active           { background: rgba(255,255,255,0.07); }
  .auth-submit-btn:active  { transform: scale(0.98); opacity: 0.9; }
  .plan-btn:active         { opacity: 0.85; }
  .cat-card:active         { transform: scale(0.96); opacity: 0.9; }
  .add-to-pl-row:active    { background: rgba(255,255,255,0.1); }
}

:root {
  --bg-top: #a8d8ea;
  --bg-mid: #6baed6;
  --bg-bot: #3b6fca;
  --accent-yellow: #ffe066;
  --accent-green: #8fcb9b;
  --accent-dark: #1a2a6c;
  --white: #ffffff;
  --player-h: 80px;
  --header-h: 64px;
  --radius: 20px;
  --font: 'Inter', sans-serif;
  --anim: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: linear-gradient(160deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bot) 100%);
}

/* ---- HEADER ---- */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 28px;
  z-index: 1000;
  pointer-events: none;
}

.logo {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-dark);
  pointer-events: all;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .2s;
}
.logo:hover { opacity: .75; }

/* Hamburger pill */
.nav-pill {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 54px;
  height: 36px;
  background: var(--accent-yellow);
  border-radius: 0 0 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  pointer-events: all;
  transition: height var(--anim), border-radius var(--anim), box-shadow .2s;
  box-shadow: 0 4px 18px rgba(0,0,0,.15);
  z-index: 1010;
}
.nav-pill:hover { box-shadow: 0 6px 24px rgba(0,0,0,.22); }
.nav-pill.open { height: 44px; border-radius: 0 0 22px 22px; }

.hamburger-line {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--accent-dark);
  border-radius: 2px;
  transition: transform var(--anim), opacity var(--anim);
}
.nav-pill.open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-pill.open .hamburger-line:nth-child(2) { opacity: 0; }
.nav-pill.open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdown nav */
.nav-dropdown {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-radius: 0 0 24px 24px;
  padding: 48px 16px 16px;
  display: flex;
  gap: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  z-index: 1005;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--anim), transform var(--anim);
  white-space: nowrap;
}
.nav-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: background var(--anim), color var(--anim), transform .2s;
}
.nav-item i { font-size: 18px; }
.nav-item:hover { background: #f0f4ff; color: var(--accent-dark); transform: translateY(-2px); }
.nav-item.active { background: var(--accent-yellow); color: var(--accent-dark); }

/* Header right buttons */
.header-btns {
  margin-left: auto;
  display: flex;
  gap: 12px;
  pointer-events: all;
  transition: opacity var(--anim);
}
.header-btns.hidden { opacity: 0; pointer-events: none; }

.pill-btn {
  border: 2px solid var(--accent-dark);
  background: transparent;
  border-radius: 100px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
  transition: background var(--anim), color var(--anim), transform .15s;
}
.pill-btn:hover { background: var(--accent-dark); color: #fff; transform: scale(1.04); }

.premium-badge {
  margin-left: auto;
  background: var(--accent-green);
  border-radius: 100px;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #1a5c2a;
  pointer-events: all;
  transition: opacity var(--anim);
}
.premium-badge.hidden { opacity: 0; pointer-events: none; }

/* ---- MAIN ---- */
.app-main {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  bottom: var(--player-h);
  overflow: hidden;
}

/* ---- PAGES ---- */
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity var(--anim), transform var(--anim);
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.page::-webkit-scrollbar { width: 5px; }
.page::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 10px; }

.page.active {
  opacity: 1;
  transform: none;
  pointer-events: all;
}
.page.exit {
  opacity: 0;
  transform: translateY(-20px) scale(1.01);
}

.hidden { display: none !important; }

/* ===== SOUNDWAVES ===== */
.soundwave {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.soundwave-left {
  left: -10px;
  bottom: 160px;
  width: 280px;
  opacity: 0.8;
  animation: waveDrift 6s ease-in-out infinite alternate;
}
.soundwave-right {
  right: -10px;
  top: 40px;
  width: 280px;
  opacity: 0.8;
  animation: waveDrift 8s ease-in-out infinite alternate-reverse;
}
.soundwave.small { width: 200px; opacity: 0.5; }
@keyframes waveDrift {
  from { transform: translateX(0) scaleY(1); }
  to   { transform: translateX(8px) scaleY(1.15); }
}

/* ===== HOME PAGE ===== */
#page-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

.hero-bg-text {
  font-size: clamp(80px, 14vw, 180px);
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  letter-spacing: -2px;
  line-height: 0.9;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  user-select: none;
  z-index: 1;
  animation: heroTextPulse 4s ease-in-out infinite;
}
/* letter-spacing causes layout reflow — use opacity pulse instead */
@keyframes heroTextPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .85; }
}

/* Headphone mascot */
.headphone-mascot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  z-index: 2;
  animation: float 3.5s ease-in-out infinite;
  will-change: transform;
  cursor: pointer;
}
@keyframes float {
  0%,100% { transform: translate3d(-50%, -55%, 0); }
  50%      { transform: translate3d(-50%, calc(-55% - 18px), 0); }
}
.headphone-mascot:hover .headphone-body { transform: scale(1.08) rotate(-3deg); }

.headphone-body {
  position: relative;
  width: 200px;
  height: 170px;
  transition: transform .3s;
}

.headphone-band {
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 70px;
  border: 18px solid #6ea8d8;
  border-bottom: none;
  border-radius: 80px 80px 0 0;
  background: transparent;
  box-shadow: inset 0 -4px 8px rgba(0,0,0,.12), 0 4px 16px rgba(100,160,220,.4);
}

.headphone-left-cup,
.headphone-right-cup {
  position: absolute;
  bottom: 10px;
  width: 58px;
  height: 80px;
  background: linear-gradient(135deg, #7bc0f0 0%, #4a90d9 60%, #2c6fbe 100%);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(60,120,200,.35), inset 0 2px 8px rgba(255,255,255,.3);
}
.headphone-left-cup  { left: 0; }
.headphone-right-cup { right: 0; }

.sound-ring {
  position: absolute;
  border: 2px solid rgba(100,170,230,.5);
  border-radius: 50%;
  animation: ringPulse 1.8s ease-out infinite;
  will-change: transform, opacity;
}
.r1 { width: 20px; height: 20px; top: 30px; left: -26px; animation-delay: 0s; }
.r2 { width: 32px; height: 32px; top: 24px; left: -38px; animation-delay: .4s; }
.r1.right { left: auto; right: -26px; }
.r2.right { left: auto; right: -38px; }
@keyframes ringPulse {
  0%   { opacity: 0.6; transform: scale3d(1,1,1); }
  100% { opacity: 0;   transform: scale3d(1.7,1.7,1); }
}

.headphone-face {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 40px;
}
.face-eye {
  position: absolute;
  width: 8px;
  height: 4px;
  background: #2c4a8c;
  border-radius: 4px 4px 0 0;
  top: 4px;
  animation: blink 4s infinite;
}
.face-eye.left-eye  { left: 16px; }
.face-eye.right-eye { right: 16px; }
@keyframes blink {
  0%,94%,98%,100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}
.face-smile {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 14px;
  border: 3px solid #2c4a8c;
  border-top: none;
  border-radius: 0 0 20px 20px;
}

.chill-badge {
  position: absolute;
  bottom: 160px;
  right: 8%;
  width: 76px;
  height: 76px;
  background: var(--accent-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #1a5c2a;
  box-shadow: 0 0 0 6px rgba(143,203,155,.25), 0 0 0 12px rgba(143,203,155,.1);
  animation: badgePop 2s ease-in-out infinite;
  z-index: 3;
}
@keyframes badgePop {
  0%,100% { transform: scale(1) rotate(-8deg); }
  50%      { transform: scale(1.06) rotate(-10deg); }
}

.hero-subtitle {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 500;
  color: rgba(255,255,255,0.95);
  z-index: 3;
  line-height: 1.6;
  white-space: nowrap;
  animation: fadeUp 1s ease .2s both;
}
.hero-subtitle em {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== PAGE COMMON ===== */
.page-content {
  position: relative;
  z-index: 1;
  padding: 20px 32px 20px;
  min-height: 100%;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-size: clamp(48px, 8vw, 110px);
  font-weight: 900;
  color: #fff;
  letter-spacing: -2px;
  line-height: 0.9;
  text-transform: uppercase;
  flex: 1;
}

.count-badge {
  background: var(--accent-green);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #1a5c2a;
  line-height: 1.3;
  padding: 6px;
  flex-shrink: 0;
  animation: badgePop 3s ease-in-out infinite;
  margin-top: 4px;
}
.count-badge.green { background: var(--accent-green); }

/* ===== SEARCH PAGE ===== */
.search-content { padding-top: 16px; }

.search-bar-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 100px;
  padding: 12px 20px;
  margin-bottom: 16px; /* уменьшили — история/результаты сразу под */
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  gap: 12px;
  position: relative;
}
.search-icon-left { color: #999; font-size: 18px; flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: var(--font);
  background: transparent;
  color: #333;
}
.search-clear-btn {
  background: rgba(0,0,0,.08);
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.search-clear-btn:hover { background: rgba(0,0,0,.15); color: #333; }
.search-clear-btn.hidden { display: none; }
.mic-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 18px;
  flex-shrink: 0;
  transition: color .2s;
}
.mic-btn:hover { color: var(--accent-dark); }

/* История поиска — прямо под строкой */
.search-inline-top {
  margin-bottom: 20px;
  transition: opacity .2s;
}
.search-inline-top.hidden { display: none; }

/* Результаты — прямо под строкой */
.search-results {
  margin-bottom: 8px;
}
.search-results.hidden { display: none; }

/* Категории — всегда внизу */
.search-browse-section {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.section-label {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.cat-card {
  border-radius: 16px;
  padding: 20px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .2s;
  border-radius: inherit;
}
.cat-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.cat-card:hover::after { background: rgba(0,0,0,.05); }

.cat-name { font-size: 18px; font-weight: 800; color: #fff; line-height: 1.2; }
.cat-icon { font-size: 32px; }

.cat-chill    { background: linear-gradient(135deg, #5dc9b0, #3daf96); }
.cat-lofi     { background: linear-gradient(135deg, #ff8c7a, #e85e4d); }
.cat-ambient  { background: linear-gradient(135deg, #b09be8, #8a6dcc); }
.cat-jazz     { background: linear-gradient(135deg, #ffb366, #f09040); }
.cat-electronic { background: linear-gradient(135deg, #f0b3d8, #d87ab0); }
.cat-indie    { background: linear-gradient(135deg, #ffd96e, #f0b830); }
.cat-hiphop   { background: linear-gradient(135deg, #e8734a, #c0392b); grid-column: span 3; }

.section-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.clear-all-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  text-decoration: underline;
  transition: color .2s;
}
.clear-all-btn:hover { color: #fff; }

.recent-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.search-tag {
  background: rgba(255,255,255,.22);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
  animation: tagSlide .3s ease;
}
@keyframes tagSlide {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.search-tag button {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  line-height: 1;
  transition: color .15s;
}
.search-tag button:hover { color: #fff; }

.results-list { display: flex; flex-direction: column; gap: 0; }

/* ── Search sections ── */
.search-loading {
  padding: 20px;
  color: rgba(255,255,255,.5);
  text-align: center;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.search-empty {
  padding: 32px 20px;
  text-align: center;
  color: rgba(255,255,255,.5);
}
.search-empty p  { font-size: 15px; margin-bottom: 6px; color: rgba(255,255,255,.7); }
.search-empty span { font-size: 13px; }

.search-section { margin-bottom: 8px; }
.search-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 4px;
}
.search-section-icon  { font-size: 16px; }
.search-section-label { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .06em; flex: 1; }
.search-section-count { font-size: 11px; color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 100px; }

.search-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
}
.search-result-row:hover { background: rgba(255,255,255,.07); }
.search-result-row:active { background: rgba(255,255,255,.11); }

.sr-thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.sr-thumb-user {
  border-radius: 50%;
  font-size: 22px;
}
.sr-info { flex: 1; min-width: 0; }
.sr-name { font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-sub  { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sr-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sr-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sr-duration { font-size: 12px; color: rgba(255,255,255,.4); min-width: 32px; text-align: right; }
.sr-add-btn {
  background: rgba(255,255,255,.08);
  border: none;
  color: rgba(255,255,255,.5);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.sr-add-btn:hover { background: rgba(93,201,176,.25); color: #5dc9b0; }

/* ── User profile modal ── */
.user-profile-card { padding: 28px 24px 24px !important; }
.up-avatar  { font-size: 56px; margin-bottom: 10px; }
.up-name    { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.up-handle  { font-size: 14px; color: rgba(255,255,255,.5); margin-bottom: 10px; }
.up-plan-badge {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.6);
  margin-bottom: 20px;
}
.up-plan-badge.premium { background: rgba(255,224,102,.15); color: #ffe066; }
.up-stats { display: flex; gap: 0; margin-bottom: 20px; justify-content: center; }
.up-stat  { flex: 1; border-right: 1px solid rgba(255,255,255,.1); padding: 8px 0; }
.up-stat:last-child { border-right: none; }
.up-stat-num   { display: block; font-size: 22px; font-weight: 800; color: #fff; }
.up-stat-label { display: block; font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }
.up-playlists-label { font-size: 12px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.up-playlists { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.up-pl-chip {
  font-size: 12px; font-weight: 600; color: #fff;
  padding: 5px 12px; border-radius: 100px;
  white-space: nowrap; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── Profile member since ── */
.profile-member-since {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  margin-bottom: 10px;
  min-height: 16px;
}
.stats-chart-labels {
  display: flex;
  justify-content: space-around;
  margin-top: 6px;
  gap: 4px;
  overflow: hidden;
}

/* ===== LIBRARY PAGE ===== */
.library-content { padding-top: 16px; }
.library-layout { display: flex; gap: 0; min-height: calc(100vh - 220px); }

/* На десктопе lib-nav-wrap — просто прозрачный враппер */
.lib-nav-wrap {
  display: contents; /* не влияет на layout десктопа */
}
.lib-nav-fade-left,
.lib-nav-fade-right { display: none; } /* fade только на мобиле */

.library-sidebar {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 20px;
  border-right: 1px solid rgba(255,255,255,.2);
}
.lib-nav {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.lib-nav:hover { background: rgba(255,255,255,.1); color: #fff; transform: translateX(4px); }
.lib-nav.active { color: var(--accent-yellow); background: rgba(255,230,102,.1); }

.library-main {
  flex: 1;
  padding-left: 24px;
  overflow: hidden;
}

.lib-view { width: 100%; animation: fadeView .25s ease; }
@keyframes fadeView {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Playlist Grid */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.playlist-grid.mini { grid-template-columns: repeat(4, 1fr); }

.playlist-card {
  border-radius: 16px;
  padding: 16px 14px 14px;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}
.playlist-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 12px 32px rgba(0,0,0,.25); }

.playlist-wave {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.35;
  overflow: hidden;
}
.playlist-wave svg { width: 100%; height: 100%; }

.playlist-card-name {
  position: relative;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  z-index: 1;
}
.playlist-card-count {
  position: relative;
  font-size: 12px;
  color: rgba(255,255,255,.75);
  margin-top: 4px;
  z-index: 1;
}

/* Tracks List */
.tracks-list { display: flex; flex-direction: column; gap: 8px; }
.track-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  cursor: pointer;
  transition: background .15s;
  animation: trackSlide .25s ease;
}
@keyframes trackSlide {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.track-row:hover { background: rgba(255,255,255,.2); }
.track-row.playing { background: rgba(255,255,255,.28); }

.track-num-cell {
  width: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.track-num-text {
  font-size: 12px;
  color: rgba(255,255,255,.45);
}
.track-info { flex: 1; min-width: 0; }
.track-name {
  font-size: 14px; font-weight: 700;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-artist {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.track-duration {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.track-heart {
  background: none; border: none;
  color: rgba(255,255,255,.45);
  font-size: 16px; cursor: pointer;
  padding: 6px; flex-shrink: 0;
  transition: color .15s, transform .15s;
}
.track-heart:hover  { color: #ff6b8a; transform: scale(1.15); }
.track-heart.liked  { color: #ff6b8a; }

/* ── Now Playing state in track-row (Liked Songs, etc.) ── */
.track-row--playing {
  background: rgba(255,255,255,.22) !important;
  box-shadow: inset 3px 0 0 #5dc9b0;
}
.track-row--playing .track-name {
  color: #fff !important;
  font-weight: 700;
}
.track-row--playing.track-row--paused {
  background: rgba(255,255,255,.15) !important;
  box-shadow: inset 3px 0 0 rgba(93,201,176,.5);
}
.track-row--playing.track-row--paused .track-name {
  color: rgba(255,255,255,.75) !important;
}

/* Number cell (holds track index or equalizer) */
.track-num-cell {
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.track-num-text {
  font-size: 12px;
  color: rgba(255,255,255,.35);
}

/* Small equalizer variant for track-row */
.tl-equalizer.sm-eq {
  width: 16px;
  height: 14px;
  gap: 2px;
}
.tl-equalizer.sm-eq .tl-eq-bar {
  width: 3px;
}

.track-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}
.track-info { flex: 1; min-width: 0; }
.track-name { font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 12px; color: rgba(255,255,255,.65); }
.track-duration { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.7); flex-shrink: 0; }
.track-heart {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  transition: transform .2s, color .2s;
  flex-shrink: 0;
}
.track-heart.liked { color: #ff6b8a; animation: heartPop .3s ease; }
.track-heart:not(.liked) { color: rgba(255,255,255,.4); }
@keyframes heartPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Albums grid (stacked cards look) */
.album-card {
  border-radius: 16px;
  padding: 14px 12px 12px;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: visible;
}
.album-card:hover { transform: translateY(-8px) scale(1.05); box-shadow: 0 18px 44px rgba(0,0,0,.3); }
.album-stack {
  position: absolute;
  inset: 8px 8px -4px;
  border-radius: 14px;
  opacity: .5;
  z-index: -1;
}
.album-stack2 {
  position: absolute;
  inset: 4px 4px -8px;
  border-radius: 14px;
  opacity: .3;
  z-index: -2;
}
.album-name { font-size: 13px; font-weight: 800; color: #fff; line-height: 1.2; position: relative; z-index: 1; }
.album-artist { font-size: 11px; color: rgba(255,255,255,.7); position: relative; z-index: 1; }
.album-year { font-size: 11px; color: rgba(255,255,255,.5); position: relative; z-index: 1; text-align: right; }

/* Artists grid */
.artists-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.artist-card {
  border-radius: 16px;
  padding: 16px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
}
.artist-card:hover { transform: translateY(-6px) scale(1.04); box-shadow: 0 14px 36px rgba(0,0,0,.25); }
.artist-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  overflow: hidden;
}
.artist-avatar img { width: 100%; height: 100%; object-fit: cover; }
.artist-name { font-size: 13px; font-weight: 800; color: #fff; }
.artist-genre { font-size: 11px; color: rgba(255,255,255,.65); }
.artist-followers { font-size: 11px; color: rgba(255,255,255,.5); }

/* Recent page */
.recent-playlists {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.recent-playlists::-webkit-scrollbar { height: 3px; }
.recent-playlists::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 10px; }
.recent-playlist-card {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  cursor: pointer;
  transition: transform .2s;
  position: relative;
  overflow: hidden;
}
.recent-playlist-card:hover { transform: scale(1.06); }
.recent-playlist-card .rp-name { font-size: 12px; font-weight: 700; color: #fff; }
.recent-playlist-card .rp-count { font-size: 10px; color: rgba(255,255,255,.7); }

.track-time-hint { font-size: 12px; color: rgba(255,255,255,.6); flex-shrink: 0; }

/* ===== PROFILE PAGE ===== */
.profile-content { padding-top: 10px; position: relative; }

.profile-bg-title {
  font-size: clamp(60px, 11vw, 140px);
  font-weight: 900;
  color: rgba(255,255,255,.85);
  letter-spacing: -2px;
  line-height: 0.9;
  position: absolute;
  top: 10px; left: 32px; right: 32px;
  pointer-events: none;
  z-index: 0;
}

.profile-card {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 240px;
  position: relative;
  z-index: 1;
  margin: 60px auto 0;
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
  animation: cardDrop .5s ease both;
}
@keyframes cardDrop {
  from { opacity: 0; transform: translateY(-30px) scale(.95); }
  to   { opacity: 1; transform: none; }
}

.profile-avatar-wrap {
  position: relative;
  display: inline-block;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd97d, #ff6bcb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Camera button on avatar */
.avatar-upload-btn {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-dark, #3daf96);
  border: 2px solid #fff;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s;
  z-index: 2;
}
.avatar-upload-btn:hover { transform: scale(1.12); background: #2d9a83; }

.profile-name { font-size: 20px; font-weight: 800; color: #fff; }
.profile-handle { font-size: 13px; color: rgba(255,255,255,.7); }

.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 20px; font-weight: 800; color: #fff; }
.stat-label { font-size: 11px; color: rgba(255,255,255,.65); }

.profile-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
  position: relative;
  z-index: 1;
}
.ptab {
  border: 2px solid rgba(255,255,255,.4);
  background: transparent;
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: all .2s;
}
.ptab:hover { border-color: #fff; color: #fff; }
.ptab.active { background: var(--accent-yellow); border-color: var(--accent-yellow); color: var(--accent-dark); }

.profile-panel { position: relative; z-index: 1; animation: fadeView .3s ease; }

.overview-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.overview-heading { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.overview-col { min-width: 0; }

.recent-played-row { display: flex; gap: 10px; flex-wrap: wrap; }
.recent-played-item {
  width: 80px;
  text-align: center;
  cursor: pointer;
  transition: transform .2s;
}
.recent-played-item:hover { transform: scale(1.08); }
.rp-thumb {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.rp-label { font-size: 11px; font-weight: 600; color: #fff; }
.rp-sub { font-size: 10px; color: rgba(255,255,255,.6); }

.top-artists-row { display: flex; gap: 10px; }
.ta-item { text-align: center; cursor: pointer; transition: transform .2s; }
.ta-item:hover { transform: scale(1.08); }
.ta-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd97d, #ff6bcb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 6px;
  overflow: hidden;
}
.ta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ta-name { font-size: 10px; font-weight: 600; color: #fff; }

/* Stats chart (mini bars) */
.stats-chart { display: flex; align-items: flex-end; gap: 8px; height: 90px; }
.mini-bar { flex: 1; border-radius: 6px 6px 0 0; display: flex; align-items: flex-end; justify-content: center; transition: height .6s ease; position: relative; cursor: pointer; }
.mini-bar:hover { filter: brightness(1.2); }
.mini-bar span { font-size: 9px; font-weight: 700; color: #fff; position: absolute; bottom: 3px; }

/* Stats panel bars */
.stats-panel { display: flex; flex-direction: column; gap: 16px; padding: 0 20px; }
.stat-bar-item { display: flex; align-items: center; gap: 14px; }
.stat-bar-item > span:first-child { width: 100px; font-size: 14px; font-weight: 600; color: #fff; }
.stat-bar-item > span:last-child  { width: 60px; font-size: 13px; color: rgba(255,255,255,.7); text-align: right; }
.bar-track { flex: 1; height: 12px; background: rgba(255,255,255,.2); border-radius: 100px; overflow: hidden; }
.bar-fill { height: 100%; width: var(--pct); background: linear-gradient(90deg, var(--accent-green), #4ecdc4); border-radius: 100px; animation: barGrow .8s ease; }
@keyframes barGrow { from { width: 0; } }

/* ===== SETTINGS PAGE ===== */
.settings-content { padding-top: 16px; }
.settings-layout { display: flex; gap: 0; }

.settings-sidebar {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 20px;
  border-right: 1px solid rgba(255,255,255,.2);
}
.set-nav {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.set-nav:hover { background: rgba(255,255,255,.1); color: #fff; transform: translateX(4px); }
.set-nav.active { background: var(--accent-yellow); color: var(--accent-dark); }

.settings-main { flex: 1; padding-left: 28px; }
.set-panel { animation: fadeView .3s ease; }

.account-form { display: flex; gap: 24px; align-items: flex-start; }
.avatar-upload { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: rgba(255,255,255,.7);
}
.yellow-btn {
  background: var(--accent-yellow);
  border: none;
  border-radius: 100px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.yellow-btn:hover { transform: scale(1.04); box-shadow: 0 4px 16px rgba(255,230,102,.4); }
.yellow-btn.small { padding: 7px 16px; font-size: 12px; }

.form-fields { flex: 1; display: flex; flex-direction: column; gap: 14px; max-width: 320px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: rgba(255,255,255,.7); font-weight: 600; }
.form-input {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  background: #fff;
  outline: none;
  transition: box-shadow .2s;
}
.form-input:focus { box-shadow: 0 0 0 3px rgba(255,230,102,.5); }

.subscription-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sub-label { font-size: 11px; color: #888; }
.sub-name { font-size: 18px; font-weight: 800; color: #222; }
.sub-badge { background: var(--accent-green); border-radius: 100px; padding: 6px 14px; font-size: 12px; font-weight: 700; color: #1a5c2a; }

.delete-btn {
  background: #ff4d4d;
  border: none;
  border-radius: 100px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.delete-btn:hover { background: #e03030; transform: scale(1.03); }

/* Toggle switch */
.toggle-list { display: flex; flex-direction: column; gap: 16px; }
.toggle-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(255,255,255,.12); border-radius: 12px; }
.toggle-item span { font-size: 14px; color: #fff; font-weight: 500; }

.toggle { position: relative; display: inline-block; width: 46px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.25);
  border-radius: 100px;
  transition: .3s;
  cursor: pointer;
}
.slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
}
.toggle input:checked + .slider { background: var(--accent-green); }
.toggle input:checked + .slider::before { transform: translateX(22px); }

/* Quality options */
.quality-options { display: flex; flex-direction: column; gap: 12px; }
.quality-option { padding: 14px 16px; background: rgba(255,255,255,.12); border-radius: 12px; }
.radio-label { display: flex; align-items: center; gap: 10px; cursor: pointer; color: #fff; font-size: 14px; font-weight: 600; }
.radio-label input { width: 16px; height: 16px; accent-color: var(--accent-green); }
.quality-option small { display: block; margin-top: 4px; margin-left: 26px; font-size: 12px; color: rgba(255,255,255,.5); }

/* About */
.about-panel { max-width: 360px; }
.about-logo { font-size: 32px; font-weight: 900; color: #fff; letter-spacing: 2px; margin-bottom: 14px; }
.about-panel p { color: rgba(255,255,255,.75); font-size: 14px; margin-bottom: 8px; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.about-links a { color: rgba(255,255,255,.8); font-size: 13px; text-decoration: underline; transition: color .2s; }
.about-links a:hover { color: #fff; }

/* ===== MUSIC PLAYER ===== */
.music-player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--player-h);
  background: rgba(255,255,255,.97);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  box-shadow: 0 -2px 16px rgba(0,0,0,.1);
  z-index: 999;
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.32,.72,0,1);
  pointer-events: none;
  will-change: transform;
}
.music-player.player-visible {
  transform: translateY(0);
  pointer-events: all;
}
@keyframes playerSlideUp {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

.player-track-info { display: flex; align-items: center; gap: 12px; min-width: 180px; flex-shrink: 0; }
.player-thumb {
  width: 48px; height: 48px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.thumb-gradient { width: 100%; height: 100%; background: linear-gradient(135deg, #ff8c7a, #b09be8); }
.player-meta { min-width: 0; }
.player-title { display: block; font-size: 14px; font-weight: 700; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { display: block; font-size: 12px; color: #888; }

.player-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.player-controls { display: flex; align-items: center; gap: 10px; }

.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
  font-size: 16px;
  padding: 6px;
  border-radius: 50%;
  transition: background .15s, color .15s, transform .15s;
}
.ctrl-btn:hover { background: rgba(0,0,0,.06); color: #222; transform: scale(1.12); }
.ctrl-btn.active { color: var(--accent-dark); }

.play-btn {
  width: 42px; height: 42px;
  background: var(--accent-dark) !important;
  color: #fff !important;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(26,42,108,.3);
  transition: background .15s, transform .15s, box-shadow .15s !important;
}
.play-btn:hover { transform: scale(1.1) !important; box-shadow: 0 6px 20px rgba(26,42,108,.4) !important; }
.play-btn.playing { background: #4ecdc4 !important; animation: playPulse 1.5s ease infinite; }
@keyframes playPulse {
  0%,100% { box-shadow: 0 4px 14px rgba(78,205,196,.3); }
  50%      { box-shadow: 0 4px 28px rgba(78,205,196,.6); }
}

.player-progress { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 480px; }
.time-label { font-size: 11px; color: #888; min-width: 32px; }
.time-label:last-child { text-align: right; }

.progress-track {
  flex: 1;
  height: 5px;
  background: #e0e0e0;
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: height .15s;
}
.progress-track:hover { height: 8px; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), #4ecdc4);
  border-radius: 100px;
  transition: width .2s linear;
  pointer-events: none;
}
.progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: var(--accent-dark);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s, left .2s linear;
}
.progress-track:hover .progress-thumb { opacity: 1; }

.player-right { display: flex; align-items: center; gap: 8px; min-width: 160px; flex-shrink: 0; justify-content: flex-end; }

.volume-slider {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 100px;
  background: #ddd;
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent-dark);
  cursor: pointer;
}

.like-btn.liked { color: #ff6b8a !important; animation: heartPop .3s ease; }

/* Mobile mini-player row & progress — hidden on desktop */
.mini-player-row  { display: none; }
.mini-progress-bar { display: none; }

/* ===== TRACKLIST — row actions ===== */
.tl-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.tl-add-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.tl-add-btn:hover { color: #5dc9b0; background: rgba(93,201,176,.12); }

/* ===== TRACKLIST HEADER — rename + actions ===== */
.tl-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.tl-rename-btn {
  background: rgba(255,255,255,.18);
  border: none;
  border-radius: 10px;
  color: #fff;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s, transform .15s;
}
.tl-rename-btn:hover { background: rgba(255,255,255,.32); transform: scale(1.05); }
.tl-title-text { margin: 0; font-size: 20px; font-weight: 800; }

/* ===== MOBILE EXPANDED PLAYER ===== */
.mob-player-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  background: rgba(0,0,0,.5);
  z-index: 1099;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.mob-player-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mob-player-expanded {
  /* всегда в DOM как flex, но вне экрана */
  display: flex;
  position: fixed;
  left: 0; right: 0;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  top: 0;
  z-index: 1195;
  background: linear-gradient(170deg, #1e3178 0%, #0d1b4a 60%, #091330 100%);
  border-radius: 0;
  padding: 0 20px 16px;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  /* закрытое состояние */
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;

  /* плавный переход */
  transition:
    transform .42s cubic-bezier(.32,.72,0,1),
    opacity   .32s ease,
    visibility 0s linear .42s;
  will-change: transform;
}

.mob-player-expanded.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition:
    transform .42s cubic-bezier(.22,.72,0,1),
    opacity   .28s ease;
}

/* Stagger fade for expanded player children */
@keyframes mobExpFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mob-player-expanded.open .mob-exp-drag-handle  { animation: mobExpFadeUp .22s ease 0s    both; }
.mob-player-expanded.open .mob-exp-header        { animation: mobExpFadeUp .22s ease .04s  both; }
.mob-player-expanded.open .mob-exp-artwork       { animation: mobExpFadeUp .25s ease .07s  both; }
.mob-player-expanded.open .mob-exp-track-info    { animation: mobExpFadeUp .22s ease .10s  both; }
.mob-player-expanded.open .mob-exp-like-row      { animation: mobExpFadeUp .22s ease .12s  both; }
.mob-player-expanded.open .mob-exp-progress-wrap { animation: mobExpFadeUp .22s ease .14s  both; }
.mob-player-expanded.open .mob-exp-controls      { animation: mobExpFadeUp .22s ease .16s  both; }

.mob-exp-drag-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 100px;
  margin: 10px auto 10px;
  flex-shrink: 0;
}

.mob-exp-header {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  gap: 10px;
}
.mob-exp-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background .15s;
  flex-shrink: 0;
}
.mob-exp-close:hover { background: rgba(255,255,255,.1); }
.mob-exp-label {
  flex: 1;
  text-align: center;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mob-exp-more {
  color: rgba(255,255,255,.7) !important;
  font-size: 20px !important;
  flex-shrink: 0;
}
.mob-exp-more:hover { color: #fff !important; }

.mob-exp-artwork {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.mob-exp-thumb {
  width: min(220px, 60vw);
  height: min(220px, 60vw);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  overflow: hidden;
  animation: artworkPulse 3s ease infinite;
}
@keyframes artworkPulse {
  0%,100% { box-shadow: 0 16px 48px rgba(0,0,0,.5); }
  50%      { box-shadow: 0 22px 60px rgba(0,0,0,.65); transform: scale(1.015); }
}
@keyframes artworkIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
.mob-exp-thumb-inner {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #5dc9b0, #b09be8);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  transition: background .5s ease;
}
.mob-exp-thumb-inner.track-change {
  animation: artworkIn .35s cubic-bezier(.34,1.1,.64,1) both;
}

.mob-exp-track-info {
  width: 100%;
  text-align: center;
  margin-bottom: 6px;
}
.mob-exp-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.mob-exp-artist {
  font-size: 13px;
  color: rgba(255,255,255,.6);
}

.mob-exp-like-row {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2px;
}
.mob-exp-like {
  color: rgba(255,255,255,.5) !important;
  font-size: 22px !important;
  padding: 8px !important;
}
.mob-exp-like.liked { color: #ff6b8a !important; }

.mob-exp-progress-wrap {
  width: 100%;
  margin-bottom: 16px;
}
.mob-exp-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,.2);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  margin-bottom: 10px;
  transition: height .15s;
}
.mob-exp-progress-track:active { height: 8px; }
.mob-exp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5dc9b0, #b09be8);
  border-radius: 100px;
  transition: width .1s linear;
}
.mob-exp-progress-thumb {
  position: absolute;
  top: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  transition: left .1s linear;
}
.mob-exp-times {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,.5);
  font-size: 12px;
  font-weight: 500;
}

.mob-exp-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
}
.mob-ctrl {
  color: rgba(255,255,255,.75) !important;
  font-size: 20px !important;
  padding: 10px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  transition: color .15s, transform .15s !important;
}
.mob-ctrl:hover, .mob-ctrl:active { color: #fff !important; transform: scale(1.12) !important; }
.mob-ctrl.active { color: #5dc9b0 !important; }
.mob-play-btn {
  width: 64px !important; height: 64px !important;
  font-size: 24px !important;
  background: #5dc9b0 !important;
  box-shadow: 0 6px 24px rgba(93,201,176,.45) !important;
}
.mob-play-btn.playing { background: #5dc9b0 !important; animation: playPulse 1.5s ease infinite; }

/* ===== PRICING PAGE ===== */
#page-pricing {
  overflow-y: auto;
  overflow-x: hidden;
}

/* absolute wrapper so waves never participate in layout flow */
.pricing-waves-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.pricing-page-inner {
  position: relative !important;
  z-index: 1;
  display: block !important;
  width: 900px !important;
  max-width: calc(100% - 48px) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 28px 0 40px !important;
  text-align: center;
  left: auto !important;
  right: auto !important;
  float: none !important;
}

/* Header */
.pricing-header {
  text-align: center;
  margin-bottom: 32px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pricing-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.pricing-title {
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 4px 24px rgba(0,0,0,.15);
  animation: fadeUp .6s ease both;
}
.pricing-subtitle {
  font-size: clamp(14px, 2vw, 18px);
  color: rgba(255,255,255,.9);
  font-weight: 500;
  margin-top: 10px;
  animation: fadeUp .6s ease .1s both;
}
.pricing-subtitle em {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
}

/* Mini headphone mascot on pricing page */
.pricing-mascot {
  animation: float 3.5s ease-in-out infinite;
  flex-shrink: 0;
}
.pricing-hp-body {
  position: relative;
  width: 72px;
  height: 60px;
}
.pricing-hp-band {
  position: absolute;
  top: 0; left: 6px; right: 6px;
  height: 26px;
  border: 7px solid #6ea8d8;
  border-bottom: none;
  border-radius: 30px 30px 0 0;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.1);
}
.pricing-hp-cup {
  position: absolute;
  bottom: 4px;
  width: 22px;
  height: 30px;
  background: linear-gradient(135deg, #7bc0f0 0%, #4a90d9 60%, #2c6fbe 100%);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(60,120,200,.3);
}
.pricing-hp-cup.left  { left: 0; }
.pricing-hp-cup.right { right: 0; }
.pricing-hp-face {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 16px;
}
.pricing-hp-eye {
  position: absolute;
  width: 5px; height: 3px;
  background: #2c4a8c;
  border-radius: 3px 3px 0 0;
  top: 2px;
}
.pricing-hp-eye.l { left: 4px; }
.pricing-hp-eye.r { right: 4px; }
.pricing-hp-smile {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 6px;
  border: 2px solid #2c4a8c;
  border-top: none;
  border-radius: 0 0 8px 8px;
}
.pricing-hp-wave {
  position: absolute;
  border: 1.5px solid rgba(100,170,230,.6);
  border-radius: 50%;
  animation: ringPulse 1.8s ease-out infinite;
}
.pricing-hp-wave.w1 { width: 10px; height: 10px; top: 20px; right: -14px; }
.pricing-hp-wave.w2 { width: 16px; height: 16px; top: 17px; right: -20px; animation-delay: .35s; }

/* Pricing Cards */
.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
  animation: fadeUp .6s ease .2s both;
  padding-top: 24px;
  width: 100%;
}

.pricing-card {
  background: rgba(255,255,255,.2);
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 24px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform .25s, box-shadow .25s;
  position: relative;
  overflow: visible;
}
.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.pricing-card.popular {
  background: rgba(255,255,255,.26);
  border-color: rgba(255,255,255,.7);
  box-shadow: 0 8px 40px rgba(255,255,255,.2), 0 0 0 2px rgba(255,255,255,.5);
  transform: translateY(-6px) scale(1.02);
}
.pricing-card.popular:hover {
  transform: translateY(-14px) scale(1.02);
  box-shadow: 0 24px 60px rgba(0,0,0,.25), 0 0 0 2px rgba(255,255,255,.6);
}

/* Popular badge */
.popular-badge {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-green);
  color: #1a5c2a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 18px;
  border-radius: 100px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(143,203,155,.4);
}

/* Plan name */
.plan-name {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 16px;
}

/* Price */
.plan-price-wrap {
  text-align: center;
  margin-bottom: 22px;
}
.plan-old-price {
  font-size: 15px;
  color: rgba(255,255,255,.55);
  text-decoration: line-through;
  margin-bottom: 2px;
}
.plan-price {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.plan-period {
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.save-badge {
  background: #ff7043;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  display: inline-block;
}

/* Features */
.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  flex: 1;
}
.plan-features li {
  font-size: 13.5px;
  color: rgba(255,255,255,.88);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.plan-features li i {
  color: var(--accent-green);
  font-size: 12px;
  flex-shrink: 0;
}

/* Buttons */
.plan-btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, filter .2s;
  font-family: var(--font);
  letter-spacing: .3px;
}
.plan-btn:hover { transform: scale(1.04); }
.plan-btn:active { transform: scale(0.97); }

.plan-btn.blue {
  background: rgba(26,42,108,.75);
  color: #fff;
  box-shadow: 0 4px 18px rgba(26,42,108,.3);
}
.plan-btn.blue:hover {
  background: rgba(26,42,108,.95);
  box-shadow: 0 8px 28px rgba(26,42,108,.45);
}

.plan-btn.gradient {
  background: linear-gradient(90deg, #ffe066 0%, #ff8c3a 100%);
  color: #1a2a6c;
  box-shadow: 0 4px 20px rgba(255,140,58,.4);
  animation: gradientPulse 2.5s ease-in-out infinite;
}
.plan-btn.gradient:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 32px rgba(255,140,58,.55);
}
@keyframes gradientPulse {
  0%,100% { box-shadow: 0 4px 20px rgba(255,140,58,.4); }
  50%      { box-shadow: 0 6px 32px rgba(255,140,58,.7); }
}

/* Footer note */
.pricing-footer-note {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.5);
  margin-top: 24px;
  line-height: 1.6;
  animation: fadeUp .6s ease .3s both;
  width: 100%;
  max-width: 600px;
}

/* Success overlay */
.plan-selected-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--accent-green);
  color: #1a5c2a;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(143,203,155,.5);
  pointer-events: none;
  animation: toastPop .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes toastPop {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(.85); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ===== RESPONSIVE ===== */
/* ═══════════════════════════════════════════════════════
   TABLET  ≤ 900px
   ═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .pricing-cards { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .pricing-card.popular { transform: none; }
  .playlist-grid   { grid-template-columns: repeat(3, 1fr); }
  .artists-grid    { grid-template-columns: repeat(3, 1fr); }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-hiphop { grid-column: span 2; }
  .overview-grid   { grid-template-columns: 1fr; }
  .player-right    { display: none; }
  .player-track-info { min-width: 140px; }
}

/* На десктопе expanded плеер полностью скрыт */
@media (min-width: 601px) {
  .mob-player-expanded,
  .mob-player-backdrop { display: none !important; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE  ≤ 600px  —  полная оптимизация
   ═══════════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* ─── CSS переменные ─── */
  :root {
    --tab-bar-h: 60px;
    --player-h:  62px;
    --header-h:  50px;
  }

  /* ─── Base ─── */
  html, body { overflow: hidden; touch-action: manipulation; }

  /* ─── Header ─── */
  .app-header {
    height: var(--header-h);
    padding: 0 12px;
    background: rgba(168,216,234,0.95);
  }
  .logo { font-size: 13px; letter-spacing: 1.5px; }

  /* Скрываем десктопную навигацию */
  #nav-pill-btn, .nav-pill-btn { display: none !important; }
  #nav-dropdown, .nav-dropdown { display: none !important; }
  .header-btns   { display: none !important; }
  .premium-badge { display: none !important; }

  /* Auth кнопка — только иконка/аватар */
  .auth-header-btn {
    top: 9px; right: 10px;
    padding: 6px 10px;
    font-size: 12px;
    gap: 4px;
    border-radius: 50px;
  }
  .auth-name { display: none; }

  /* ─── Мобильный таб-бар ─── */
  .mobile-tab-bar { display: flex !important; }

  /* ─── App main — место под хедер + плеер + таббар ─── */
  .app-main {
    top: var(--header-h);
    bottom: calc(var(--player-h) + var(--tab-bar-h));
  }

  /* ─── Страницы — плавный скролл iOS ─── */
  .page {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .page-content {
    padding: 12px 14px 24px;
    min-height: 100%;
  }
  .page-title {
    font-size: clamp(26px, 8.5vw, 48px);
    letter-spacing: -1px;
    line-height: 0.95;
  }
  .page-header-row {
    margin-bottom: 14px;
    gap: 10px;
    align-items: center;
  }
  .count-badge {
    width: 54px; height: 54px;
    font-size: 10px;
    border-radius: 50%;
  }

  /* ─── HOME ─── */
  .soundwave { display: none; }
  .hero-bg-text {
    font-size: clamp(44px, 15vw, 90px);
    letter-spacing: -3px;
    opacity: 0.06;
  }
  .headphone-mascot {
    transform: scale(0.65) translateY(0px);
    margin-top: -20px;
  }
  .chill-badge {
    font-size: 10px;
    padding: 5px 12px;
    letter-spacing: 3px;
  }
  .hero-subtitle {
    font-size: 13px;
    white-space: normal;
    text-align: center;
    width: 85%;
    line-height: 1.5;
  }

  /* ─── SEARCH ─── */
  .search-content { padding-top: 10px; }
  .search-bar-wrap {
    border-radius: 14px;
    margin-bottom: 12px;
  }
  .search-input {
    font-size: 15px;
    padding: 13px 44px 13px 44px;
  }
  .search-icon-left { left: 14px; }
  .mic-btn { right: 12px; }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .cat-card {
    border-radius: 18px;
    padding: 18px 14px 14px;
    min-height: 88px;
  }
  .cat-name { font-size: 13px; font-weight: 700; }
  .cat-icon { font-size: 28px; }

  .section-label { font-size: 13px; margin-bottom: 10px; }
  .recent-tags { gap: 7px; }
  .search-tag  { font-size: 12px; padding: 6px 12px; }
  .search-results { margin-top: 0; }
  .results-list   { gap: 8px; }

  /* ─── LIBRARY ─── */
  .library-content { padding-top: 6px; }
  .library-layout  {
    flex-direction: column;
    gap: 0;
    min-height: unset;
  }

  /* Сайдбар → горизонтальные таб-чипсы */
  /* ── Обёртка с fade-масками ── */
  .lib-nav-wrap {
    display: block; /* переопределяем display:contents */
    position: relative;
    width: 100%;
    margin-bottom: 4px;
  }
  .lib-nav-fade-left,
  .lib-nav-fade-right { display: block; } /* включаем на мобиле */

  .library-sidebar {
    width: 100%;
    flex-direction: row;
    gap: 8px;
    padding: 4px 4px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    flex-shrink: 0;
    /* чтобы fade-маски не перекрывали клики */
    position: relative;
    z-index: 0;
  }
  .library-sidebar::-webkit-scrollbar { display: none; }

  /* fade-маски — показывают что есть ещё пиллы */
  .lib-nav-fade-left,
  .lib-nav-fade-right {
    position: absolute;
    top: 0;
    bottom: 12px; /* не перекрывает border-bottom */
    width: 32px;
    pointer-events: none;
    z-index: 2;
    transition: opacity .2s;
  }
  .lib-nav-fade-left {
    left: 0;
    background: linear-gradient(to right, #6baed6 20%, transparent);
    opacity: 0;
  }
  .lib-nav-fade-right {
    right: 0;
    background: linear-gradient(to left, #6baed6 20%, transparent);
    opacity: 1;
  }

  .lib-nav {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 50px;
    white-space: nowrap;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15);
    transition: background .15s, color .15s, transform .1s;
  }
  .lib-nav:active { transform: scale(0.95); }
  .lib-nav:hover  { background: rgba(255,255,255,0.18); }
  .lib-nav.active {
    background: var(--accent-yellow);
    color: var(--accent-dark);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(255,224,102,.3);
  }

  .library-main { padding-top: 12px; }

  /* Плейлисты: 2 в ряд */
  .playlist-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .playlist-card {
    min-height: 118px;
    border-radius: 16px;
    padding: 12px 11px 10px;
  }
  .playlist-card-emoji  { font-size: 22px; margin-bottom: 4px; }
  .playlist-card-name   { font-size: 12px; line-height: 1.3; }
  .playlist-card-count  { font-size: 10px; }
  .playlist-card-actions { opacity: 1; bottom: 6px; right: 6px; }
  .plcard-btn { width: 26px; height: 26px; font-size: 10px; }

  /* Создать плейлист карточка */
  .create-card { min-height: 118px; }
  .create-card-icon { width: 38px; height: 38px; font-size: 18px; }

  /* Артисты: 2 в ряд */
  .artists-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .artist-card   { padding: 14px 10px; border-radius: 14px; }
  .artist-avatar { font-size: 26px; width: 48px; height: 48px; }
  .artist-name   { font-size: 12px; }
  .artist-genre, .artist-followers { font-size: 10px; }

  /* Недавние: горизонтальный скролл */
  .recent-playlists {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .recent-playlists::-webkit-scrollbar { display: none; }
  .recent-playlist-card {
    min-width: 120px;
    max-width: 120px;
    flex-shrink: 0;
    padding: 12px 10px;
    border-radius: 14px;
  }
  .rp-emoji { font-size: 22px; margin-bottom: 4px; }
  .rp-name  { font-size: 11px; }
  .rp-count { font-size: 10px; }

  /* Треки */
  .track-row {
    padding: 9px 6px;
    gap: 10px;
    border-radius: 10px;
  }
  .track-thumb    { width: 40px; height: 40px; border-radius: 8px; font-size: 15px; }
  .track-name     { font-size: 13px; }
  .track-artist   { font-size: 11px; }
  .track-duration { font-size: 11px; min-width: 32px; }
  .track-heart    { width: 30px; height: 30px; font-size: 14px; }

  /* Пустые состояния */
  .lib-loading  { padding: 30px 16px; font-size: 14px; }
  .lib-empty-msg { padding: 36px 16px; }
  .lib-empty-msg i { font-size: 32px; }
  .lib-empty-msg p { font-size: 13px; }

  /* ─── PROFILE ─── */
  .profile-bg-title { display: none; }
  .profile-content  { padding-top: 12px; }
  .profile-card {
    padding: 18px 14px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
  }
  .profile-avatar {
    width: 64px; height: 64px;
    border-radius: 20px;
    font-size: 36px;
  }
  .profile-name   { font-size: 18px; margin-top: 10px; }
  .profile-handle { font-size: 12px; }
  .profile-stats  { gap: 16px; margin: 14px 0 0; }
  .stat-num       { font-size: 18px; }
  .stat-label     { font-size: 10px; }

  .profile-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
    margin-bottom: 14px;
  }
  .profile-tabs::-webkit-scrollbar { display: none; }
  .ptab {
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 14px;
    border-radius: 50px;
    white-space: nowrap;
  }

  .overview-grid { grid-template-columns: 1fr; gap: 16px; }
  .overview-heading { font-size: 14px; margin-bottom: 10px; }

  .profile-playlists.playlist-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stats bars */
  .stats-panel { gap: 10px; }
  .stat-bar-item { gap: 8px; font-size: 12px; }
  .bar-track { height: 6px; }

  /* ─── SETTINGS ─── */
  .settings-content { padding-top: 8px; }
  .settings-layout  { flex-direction: column; gap: 0; }
  .settings-sidebar {
    width: 100%;
    flex-direction: row;
    gap: 8px;
    padding: 4px 0 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .settings-sidebar::-webkit-scrollbar { display: none; }
  .set-nav {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 50px;
    white-space: nowrap;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15);
    text-align: center;
  }
  .set-nav.active {
    background: var(--accent-yellow);
    color: var(--accent-dark);
    border-color: transparent;
  }
  .settings-main { padding-top: 12px; }

  /* Аккаунт форма */
  .account-form    { flex-direction: column; gap: 16px; }
  .avatar-upload   { align-items: center; }
  .avatar-circle   { width: 72px; height: 72px; font-size: 30px; }
  .form-fields     { gap: 12px; }
  .form-group label { font-size: 12px; }
  .form-input { padding: 11px 14px; font-size: 14px; border-radius: 10px; }
  .yellow-btn { padding: 11px; font-size: 13px; border-radius: 10px; }
  .subscription-card { padding: 12px 14px; border-radius: 12px; }
  .sub-label { font-size: 11px; }
  .sub-name  { font-size: 14px; }
  .delete-btn { padding: 10px; font-size: 12px; }

  /* Тогглы */
  .toggle-list { gap: 0; }
  .toggle-item { padding: 13px 0; font-size: 13px; }

  /* Quality */
  .quality-options { gap: 8px; }
  .quality-option  { padding: 12px; border-radius: 10px; }
  .quality-option small { font-size: 11px; }

  /* About */
  .about-logo { font-size: 22px; margin-bottom: 10px; }

  /* ─── PRICING ─── */
  .pricing-page-inner {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 0 80px !important;
    margin: 0 !important;
  }
  #page-pricing { padding: 0 14px; }
  .pricing-title  { font-size: clamp(20px, 6.5vw, 36px); }
  .pricing-subtitle { font-size: 13px; }
  .pricing-mascot { display: none; }
  .pricing-cards  {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 100%;
    padding: 0;
  }
  .pricing-card   {
    padding: 20px 16px;
    border-radius: 20px;
  }
  .plan-name     { font-size: 13px; letter-spacing: 2px; }
  .plan-price    { font-size: 34px; }
  .plan-period   { font-size: 12px; }
  .plan-features { gap: 8px; margin: 14px 0 16px; }
  .plan-features li { font-size: 13px; }
  .plan-btn      { padding: 12px; font-size: 14px; border-radius: 12px; }
  .save-badge    { font-size: 10px; padding: 2px 7px; }
  .pricing-footer-note { font-size: 11px; padding: 0 10px; margin-top: 16px; }

  /* ─── МУЗЫКАЛЬНЫЙ ПЛЕЕР — компактный мини ─── */
  .music-player {
    bottom: var(--tab-bar-h);
    height: 64px;
    padding: 0 10px 0 10px;
    gap: 6px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.12);
    position: fixed;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    padding-bottom: 0;
  }

  /* Внутренняя строка: обложка + мета + кнопки */
  .mini-player-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 2px 8px;
    flex: 1;
    min-width: 0;
  }

  /* Прогресс-бар — тонкая интерактивная полоска снизу мини-плеера */
  .mini-progress-bar { display: block; }
  .mini-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,0.10);
    border-radius: 0 0 16px 16px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    touch-action: none;
  }
  .mini-progress-bar:active { height: 5px; transition: height .1s; }
  .mini-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-dark, #3daf96), #4ecdc4);
    border-radius: inherit;
    pointer-events: none;
    transition: width .2s linear;
  }

  /* Скрываем десктопные секции внутри плеера */
  .player-track-info,
  .player-center,
  .player-right { display: none !important; }

  /* Содержимое мини-строки */
  .mini-player-row .player-thumb  { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; }
  .mini-player-row .player-meta   { min-width: 0; flex: 1; overflow: hidden; }
  .mini-player-row .player-title  { font-size: 13px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini-player-row .player-artist { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .65; }
  .mini-time-label { display: flex; align-items: center; gap: 2px; font-size: 10px; opacity: .5; margin-top: 1px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
  .mini-time-sep   { opacity: .6; }
  .mini-player-row .ctrl-btn      { font-size: 16px; padding: 6px; min-width: 36px; min-height: 36px; flex-shrink: 0; }
  .mini-player-row .play-btn      { width: 40px; height: 40px; font-size: 16px; flex-shrink: 0; }
  .mini-player-row .like-btn.liked { color: #ff6b8a !important; }

  /* Expanded плеер — на мобиле управляется классом .open */

  /* ─── МОДАЛКИ ─── */
  .auth-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .auth-modal-card {
    border-radius: 24px 24px 0 0;
    padding: 20px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    max-height: 94vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
  }
  .auth-modal-logo { margin-bottom: 16px; }
  .auth-modal-brand { font-size: 18px; }
  .auth-tabs { margin-bottom: 18px; }
  .auth-field { margin-bottom: 12px; }
  .auth-field input { padding: 11px 14px; font-size: 15px; }
  .auth-submit-btn { padding: 13px; font-size: 14px; }

  /* ─── TRACKLIST OVERLAY ─── */
  .tracklist-overlay { align-items: flex-end; }
  .tracklist-panel {
    border-radius: 22px 22px 0 0;
    max-height: 90vh;
    max-width: 100%;
  }
  .tl-header {
    padding: 14px 14px 10px;
    gap: 10px;
    border-radius: 22px 22px 0 0;
  }
  .tl-emoji { font-size: 26px; }
  .tl-header-info h2 { font-size: 16px; }
  .tl-header-info p  { font-size: 12px; }
  .tl-play-all-btn   { padding: 8px 12px; font-size: 12px; gap: 6px; }
  .tl-back-btn { width: 32px; height: 32px; font-size: 13px; }
  .tl-body { padding: 4px 10px calc(calc(var(--player-h) + var(--tab-bar-h)) + 16px); }
  .tl-row  { padding: 8px 4px; gap: 8px; }
  .tl-thumb { width: 36px; height: 36px; font-size: 13px; }
  .tl-name  { font-size: 13px; }
  .tl-dur   { display: none; }
  .tl-play-btn   { width: 28px; height: 28px; font-size: 10px; }
  .tl-remove-btn { width: 26px; height: 26px; font-size: 10px; }

  /* ─── СОЗДАТЬ ПЛЕЙЛИСТ ─── */
  .create-pl-card {
    border-radius: 24px 24px 0 0;
    padding: 18px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    max-height: 94vh;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
  }
  .create-pl-title { font-size: 18px; margin-bottom: 14px; }
  .create-pl-preview { width: 72px; height: 72px; font-size: 34px; margin-bottom: 14px; }
  .gradient-picker { gap: 8px; }
  .grad-swatch { width: 30px; height: 30px; border-radius: 8px; }
  .emoji-picker { gap: 6px; }
  .emoji-btn { width: 34px; height: 34px; font-size: 17px; border-radius: 8px; }
  .create-pl-section-label { margin: 12px 0 8px; }

  /* ─── ADD TO PLAYLIST ─── */
  #add-to-pl-modal .auth-modal-card {
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 100%;
  }
  .add-to-pl-list { max-height: 260px; }
  .add-to-pl-row  { padding: 10px 6px; }
  .add-to-pl-name { font-size: 13px; }
  .add-to-pl-count { font-size: 11px; }

  /* ─── CONFIRM DIALOG ─── */
  #confirm-dialog .auth-modal-card {
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 100%;
    padding: 22px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* ─── ТОСТ ─── */
  #cs-global-toast {
    bottom: calc(var(--player-h) + var(--tab-bar-h) + 12px);
    font-size: 13px;
    padding: 9px 18px;
  }
  #plan-toast {
    bottom: calc(var(--player-h) + var(--tab-bar-h) + 12px) !important;
  }

  /* ─── USER MENU ─── */
  .user-menu-dropdown {
    right: 8px !important;
    top: 56px !important;
    min-width: 210px;
    border-radius: 16px;
    padding: 8px;
  }
  .user-menu-header { padding: 8px 8px 10px; gap: 10px; }
  .user-menu-avatar { font-size: 28px; }
  .user-menu-name   { font-size: 14px; }
  .user-menu-email  { font-size: 11px; }
  .user-menu-dropdown button { font-size: 13px; padding: 9px 10px; }
}

/* ===== Util: pulse animation for playing track ===== */
@keyframes playing-eq {
  0%,100% { transform: scaleY(1); }
  50% { transform: scaleY(1.6); }
}
.eq-bar {
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--accent-green);
  border-radius: 2px;
  margin: 0 1px;
  animation: playing-eq .6s ease-in-out infinite;
}
.eq-bar:nth-child(2) { animation-delay: .15s; }
.eq-bar:nth-child(3) { animation-delay: .3s; }

/* ═══════════════════════════════════════════════════════
   MOBILE BOTTOM TAB BAR
   ═══════════════════════════════════════════════════════ */
.mobile-tab-bar {
  display: none; /* shown only on mobile via media query */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(0,0,0,0.07);
  z-index: 1200;
  padding-left: 4px;
  padding-right: 4px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.05), 0 -4px 20px rgba(0,0,0,0.08);
  justify-content: space-around;
  align-items: center;
}

.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  font-family: var(--font);
  padding: 6px 4px;
  border-radius: 12px;
  transition: color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 50px;
  position: relative;
}
.mob-tab i    { font-size: 19px; transition: transform .18s, color .18s; }
.mob-tab span { font-size: 10px; font-weight: 600; letter-spacing: .2px; transition: color .18s; }
.mob-tab:hover  { color: #666; }
.mob-tab.active { color: var(--accent-dark); }
.mob-tab.active i { transform: scale(1.1); }

/* Active bar on top */
.mob-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent-dark);
}

/* ═══════════════════════════════════════════════════════
   AUTH BUTTON IN HEADER
   ═══════════════════════════════════════════════════════ */
.auth-header-btn {
  position: fixed;
  top: 14px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--accent-dark);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 100px;
  cursor: pointer;
  z-index: 1100;
  transition: background .2s, transform .15s;
  pointer-events: all;
  white-space: nowrap;
}
.auth-header-btn:hover { background: rgba(255,255,255,0.32); transform: translateY(-1px); }
.auth-avatar { font-size: 18px; line-height: 1; }
.auth-name   { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* User dropdown menu */
.user-menu-dropdown {
  position: fixed;
  background: rgba(20,30,80,0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  padding: 12px;
  min-width: 240px;
  z-index: 5000;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: fadeDown .2s ease;
}
.user-menu-header {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 12px;
}
.user-menu-avatar { font-size: 36px; }
.user-menu-name   { font-weight: 700; color: #fff; font-size: 15px; }
.user-menu-email  { color: rgba(255,255,255,.5); font-size: 12px; }
.user-menu-plan   { color: #ffe066; font-size: 11px; font-weight: 600; text-transform: uppercase; margin-top: 2px; }
.user-menu-divider { height: 1px; background: rgba(255,255,255,.1); margin: 4px 0; }
.user-menu-dropdown button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: transparent; border: none;
  color: rgba(255,255,255,.85); font-size: 14px; font-family: var(--font);
  border-radius: 10px; cursor: pointer; text-align: left;
  transition: background .15s;
}
.user-menu-dropdown button:hover { background: rgba(255,255,255,.08); color: #fff; }
.user-menu-dropdown button i { width: 16px; opacity: .7; }
.user-menu-dropdown .logout-btn { color: #ff8c8c !important; }
.user-menu-dropdown .logout-btn:hover { background: rgba(255,100,100,.1) !important; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════
   AUTH MODAL
   ═══════════════════════════════════════════════════════ */
.auth-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,60,.75);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .25s ease;
}
.auth-modal-overlay.closing { animation: fadeOut .3s ease forwards; }

.auth-modal-card {
  background: linear-gradient(145deg, rgba(20,35,100,.98), rgba(10,20,70,.98));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  padding: 32px 32px 28px;
  width: 100%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
  animation: slideUp .3s cubic-bezier(.34,1.56,.64,1);
}
.auth-modal-overlay.closing .auth-modal-card { animation: slideDown .3s ease forwards; }

.auth-modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.08); border: none;
  color: rgba(255,255,255,.6); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.auth-modal-close:hover { background: rgba(255,255,255,.15); color: #fff; }

.auth-modal-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.auth-modal-logo span:first-child { font-size: 32px; }
.auth-modal-brand {
  font-size: 22px; font-weight: 900; letter-spacing: 2px;
  color: var(--accent-yellow);
}

.auth-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,.06);
  border-radius: 12px; padding: 4px;
  margin-bottom: 24px;
}
.auth-tab-btn {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: rgba(255,255,255,.5); font-family: var(--font);
  font-size: 14px; font-weight: 600; border-radius: 9px;
  cursor: pointer; transition: all .2s;
}
.auth-tab-btn.active {
  background: rgba(255,255,255,.12); color: #fff;
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block; color: rgba(255,255,255,.6);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 6px;
}
.auth-field input {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; color: #fff;
  font-family: var(--font); font-size: 15px;
  outline: none; transition: border-color .2s, background .2s;
}
.auth-field input:focus {
  border-color: rgba(255,224,102,.6);
  background: rgba(255,255,255,.1);
}
.auth-field input::placeholder { color: rgba(255,255,255,.3); }

.auth-pw-wrap { position: relative; }
.auth-pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,.4);
  cursor: pointer; font-size: 14px; padding: 4px;
  transition: color .15s;
}
.pw-toggle:hover { color: rgba(255,255,255,.8); }

.auth-error {
  color: #ff8c8c; font-size: 13px; min-height: 18px;
  margin-bottom: 8px; padding: 0 2px;
}

.auth-submit-btn {
  width: 100%; padding: 14px 20px;
  background: linear-gradient(135deg, #ffe066, #f0b830);
  border: none; border-radius: 14px;
  color: var(--accent-dark); font-family: var(--font);
  font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 10px;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.auth-submit-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,224,102,.4); }
.auth-submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.auth-submit-btn.loading { opacity: .7; }

.auth-switch {
  text-align: center; color: rgba(255,255,255,.5);
  font-size: 13px; margin-top: 16px;
}
.auth-switch a { color: var(--accent-yellow); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes slideDown {
  to { opacity: 0; transform: translateY(20px) scale(.97); }
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to   { opacity: 0; } }

/* ═══════════════════════════════════════════════════════
   GLOBAL TOAST
   ═══════════════════════════════════════════════════════ */
#cs-global-toast {
  position: fixed; bottom: 95px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(26,42,108,.95);
  backdrop-filter: blur(12px);
  color: #fff; padding: 10px 24px;
  border-radius: 100px; font-size: 14px; font-weight: 600;
  z-index: 9999; pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity .3s, transform .3s;
  border: 1px solid rgba(255,255,255,.15);
}
#cs-global-toast.visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════
   TRACKLIST OVERLAY
   ═══════════════════════════════════════════════════════ */
.tracklist-overlay {
  position: fixed; inset: 0;
  z-index: 8000;
  display: flex; align-items: flex-end;
  background: rgba(10,20,60,.7);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .35s;
}
.tracklist-overlay.visible { opacity: 1; }
.tracklist-overlay.visible .tracklist-panel { transform: translateY(0); }

.tracklist-panel {
  width: 100%; max-width: 680px;
  margin: 0 auto;
  background: linear-gradient(160deg, #0f1e60 0%, #1a2a8c 100%);
  border-radius: 28px 28px 0 0;
  max-height: 88vh;
  display: flex; flex-direction: column;
  transform: translateY(60px);
  transition: transform .35s cubic-bezier(.34,1.2,.64,1);
  box-shadow: 0 -20px 80px rgba(0,0,0,.6);
}

.tl-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 24px 18px;
  border-radius: 28px 28px 0 0;
  position: relative;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.tl-back-btn {
  background: rgba(255,255,255,.15); border: none;
  color: #fff; width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.tl-back-btn:hover { background: rgba(255,255,255,.25); }
.tl-emoji { font-size: 32px; flex-shrink: 0; }
.tl-header-info { flex: 1; min-width: 0; }
.tl-header-info h2, .tl-title-text { color: #fff; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-header-info p  { color: rgba(255,255,255,.6); font-size: 13px; margin-top: 2px; }
.tl-header-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.tl-play-all-btn {
  flex-shrink: 0;
  background: var(--accent-yellow); border: none;
  color: var(--accent-dark); padding: 8px 14px;
  border-radius: 100px; font-weight: 700; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: transform .15s, box-shadow .15s;
  font-family: var(--font);
  white-space: nowrap;
}
.tl-play-all-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,224,102,.4); }

.tl-body {
  overflow-y: auto; padding: 8px 16px 120px;
  flex: 1;
}
.tl-body::-webkit-scrollbar { width: 4px; }
.tl-body::-webkit-scrollbar-track { background: transparent; }
.tl-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

.tl-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 12px;
  cursor: pointer; transition: background .15s;
}
.tl-row:hover { background: rgba(255,255,255,.07); }
.tl-num {
  color: rgba(255,255,255,.35); font-size: 13px;
  width: 24px; text-align: center; flex-shrink: 0;
}
.tl-thumb {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.7); font-size: 16px; flex-shrink: 0;
}
.tl-info { flex: 1; min-width: 0; }
.tl-name   { color: #fff; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-artist { color: rgba(255,255,255,.5); font-size: 12px; }
.tl-dur    { color: rgba(255,255,255,.4); font-size: 12px; flex-shrink: 0; }
.tl-play-btn {
  background: rgba(255,255,255,.1); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.tl-play-btn:hover  { background: rgba(255,255,255,.2); }
.tl-remove-btn {
  background: transparent; border: none; color: rgba(255,100,100,.6);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s, color .15s;
}
.tl-remove-btn:hover { background: rgba(255,100,100,.1); color: #ff6b6b; }

/* ===== NOW PLAYING indicator in tracklist rows ===== */

/* Animated equalizer bars */
@keyframes eqBounce1 {
  0%, 100% { height: 4px; }
  50%       { height: 14px; }
}
@keyframes eqBounce2 {
  0%, 100% { height: 10px; }
  35%       { height: 3px; }
  70%       { height: 14px; }
}
@keyframes eqBounce3 {
  0%, 100% { height: 6px; }
  25%       { height: 14px; }
  75%       { height: 3px; }
}

.tl-equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  width: 20px;
}
.tl-eq-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--accent, #5dc9b0);
  transform-origin: bottom;
}
.tl-eq-bar:nth-child(1) { animation: eqBounce1 .7s ease-in-out infinite; }
.tl-eq-bar:nth-child(2) { animation: eqBounce2 .8s ease-in-out infinite .1s; }
.tl-eq-bar:nth-child(3) { animation: eqBounce3 .75s ease-in-out infinite .05s; }

/* Paused state: bars are static and dimmed */
.tl-row--paused .tl-eq-bar,
.track-row--paused .tl-eq-bar { animation-play-state: paused; opacity: .5; }

/* Row highlight when this track is playing */
.tl-row--playing {
  background: rgba(93, 201, 176, .1) !important;
  border-radius: 12px;
}
.tl-row--playing .tl-name {
  color: var(--accent, #5dc9b0) !important;
}
.tl-row--playing.tl-row--paused .tl-name {
  color: rgba(93, 201, 176, .7) !important;
}
.tl-row--playing .tl-play-btn {
  background: rgba(93, 201, 176, .25) !important;
  color: #5dc9b0 !important;
}

/* Number cell — holds either text or equalizer */
.tl-num-text {
  display: inline-block;
  color: rgba(255,255,255,.35);
  font-size: 13px;
}

.tl-empty {
  text-align: center; padding: 60px 20px;
  color: rgba(255,255,255,.4);
}
.tl-empty i { font-size: 40px; margin-bottom: 12px; display: block; }

.tl-add-pl-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; margin-top: 12px;
  background: rgba(255,255,255,.06); border: 1px dashed rgba(255,255,255,.2);
  color: rgba(255,255,255,.5); border-radius: 12px;
  cursor: pointer; font-size: 14px; font-family: var(--font);
  transition: background .15s, color .15s;
}
.tl-add-pl-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ═══════════════════════════════════════════════════════
   CREATE PLAYLIST MODAL
   ═══════════════════════════════════════════════════════ */
.create-pl-card { max-width: 500px; }
.create-pl-title {
  font-size: 22px; font-weight: 800; color: #fff;
  margin-bottom: 20px;
}
.create-pl-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.create-pl-preview {
  width: 110px; height: 110px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; position: relative; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  transition: background .3s;
}
/* Overlay layer that shows uploaded image */
.pl-cover-overlay {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .3s;
}
/* Edit playlist cover in rename/edit modal */
.edit-pl-cover-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.07);
  border-radius: 14px;
  padding: 12px;
}
.edit-pl-cover-preview {
  width: 72px; height: 72px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.edit-pl-cover-btns {
  display: flex; flex-direction: column; gap: 8px;
}
.pl-cover-remove-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,80,80,.15);
  border: 1px solid rgba(255,80,80,.3);
  color: #ff8080;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.pl-cover-remove-btn:hover { background: rgba(255,80,80,.25); }

/* Upload button below preview */
.pl-cover-upload-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.pl-cover-upload-btn:hover { background: rgba(255,255,255,.2); }

/* Playlist card with photo cover */
.playlist-card .pl-card-cover {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  border-radius: inherit;
  z-index: 0;
}
.playlist-card.has-cover .playlist-card-emoji { display: none; }
.playlist-card.has-cover .playlist-card-name,
.playlist-card.has-cover .playlist-card-count {
  position: relative; z-index: 1;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.playlist-card.has-cover .playlist-card-actions { position: relative; z-index: 1; }
.create-pl-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(255,255,255,.4);
  margin: 16px 0 10px;
}

.gradient-picker {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.grad-swatch {
  width: 36px; height: 36px; border-radius: 10px;
  cursor: pointer; border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
}
.grad-swatch:hover { transform: scale(1.1); }
.grad-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.4); }

.emoji-picker {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.emoji-btn {
  width: 40px; height: 40px; border-radius: 10px;
  font-size: 20px; background: rgba(255,255,255,.07);
  border: 2px solid transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.emoji-btn:hover   { background: rgba(255,255,255,.14); }
.emoji-btn.selected { border-color: var(--accent-yellow); background: rgba(255,224,102,.1); }

/* ═══════════════════════════════════════════════════════
   ADD TO PLAYLIST MODAL
   ═══════════════════════════════════════════════════════ */
.add-to-pl-track {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: rgba(255,255,255,.06);
  border-radius: 12px; margin-bottom: 16px;
}
.add-to-pl-list { max-height: 300px; overflow-y: auto; }
.add-to-pl-list::-webkit-scrollbar { width: 4px; }
.add-to-pl-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius:4px; }

.add-to-pl-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 12px; cursor: pointer;
  transition: background .15s;
}
.add-to-pl-row:hover { background: rgba(255,255,255,.08); }
.add-to-pl-thumb {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.add-to-pl-info { flex: 1; }
.add-to-pl-name  { color: #fff; font-weight: 600; font-size: 14px; }
.add-to-pl-count { color: rgba(255,255,255,.5); font-size: 12px; }
.add-to-pl-icon  { color: rgba(255,255,255,.3); }

/* ═══════════════════════════════════════════════════════
   PLAYLIST CARD ENHANCEMENTS
   ═══════════════════════════════════════════════════════ */
.playlist-card { position: relative; overflow: hidden; cursor: pointer; }
.playlist-card-emoji {
  font-size: 32px; margin-bottom: 8px;
  display: block; text-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.playlist-card-actions {
  position: absolute; bottom: 10px; right: 10px;
  display: flex; gap: 6px;
  opacity: 0; transition: opacity .2s;
}
.playlist-card:hover .playlist-card-actions { opacity: 1; }

.plcard-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: transform .15s, background .15s;
}
.plcard-btn.open-btn {
  background: var(--accent-yellow); color: var(--accent-dark);
}
.plcard-btn.open-btn:hover { transform: scale(1.1); }
.plcard-btn.delete-btn-sm {
  background: rgba(255,100,100,.2); color: #ff8c8c;
}
.plcard-btn.delete-btn-sm:hover { background: rgba(255,100,100,.4); }

/* Create playlist card */
.create-card {
  background: rgba(255,255,255,.08) !important;
  border: 2px dashed rgba(255,255,255,.25) !important;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
}
.create-card:hover {
  background: rgba(255,255,255,.14) !important;
  border-color: rgba(255,255,255,.4) !important;
}
.create-card-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: rgba(255,255,255,.6);
  margin-bottom: 12px;
}

/* Loading state */
.lib-loading {
  padding: 40px; text-align: center;
  color: rgba(255,255,255,.5); font-size: 16px;
}
.lib-loading i { margin-right: 8px; }

/* Empty state */
.lib-empty-msg {
  padding: 60px 20px; text-align: center;
  color: rgba(255,255,255,.5);
}
.lib-empty-msg i { font-size: 48px; margin-bottom: 16px; display: block; opacity: .4; }
.lib-empty-msg p { line-height: 1.6; margin-bottom: 20px; }
.lib-empty-msg .auth-submit-btn { max-width: 240px; margin: 0 auto; }

/* Login prompt in library */
.login-prompt .auth-submit-btn {
  max-width: 200px; margin: 16px auto 0;
  padding: 12px 20px; font-size: 14px;
}

/* ═══════════════════════════════════════════════════════
   PLAYER EXTRA BUTTON
   ═══════════════════════════════════════════════════════ */
#add-to-pl-btn { color: rgba(255,255,255,.5); }
#add-to-pl-btn:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════
   CATEGORY CARDS — Clickable with cursor
   ═══════════════════════════════════════════════════════ */
.cat-card { cursor: pointer; }

/* Recent playlist cards — emoji */
.rp-emoji {
  font-size: 28px; margin-bottom: 6px; display: block;
}

/* ═══════════════════════════════════════════════════════
   SETTINGS LOGOUT BUTTON
   ═══════════════════════════════════════════════════════ */
.settings-logout-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,100,100,.12); border: 1px solid rgba(255,100,100,.3);
  color: #ff8c8c; padding: 12px 20px; border-radius: 12px;
  cursor: pointer; font-family: var(--font); font-size: 14px;
  font-weight: 600; margin-top: 20px;
  transition: background .2s;
}
.settings-logout-btn:hover { background: rgba(255,100,100,.2); }

/* =============================================
   PERFORMANCE OPTIMISATIONS
   ============================================= */

/* Remove all heavy animations on low-power / reduced-motion devices */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* On mobile: kill backdrop-filter everywhere (biggest GPU drain) */
@media (max-width: 640px) {
  .nav-dropdown, .auth-modal-card, .tracklist-panel,
  .user-menu-dropdown, .mob-player-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* Lighter track rows — no glass effect needed */
  .track-row { backdrop-filter: none !important; }
  /* Kill entrance animations on lists — they stack up */
  .track-row  { animation: none !important; }
  .tl-row     { animation: none !important; }
  .lib-view   { animation: none !important; }
  /* Simplify playlist card hover on touch */
  .playlist-card { transition: opacity .15s !important; }
  .playlist-card:hover { transform: none !important; box-shadow: none !important; }
  /* Simpler equalizer — less layers */
  .tl-eq-bar:nth-child(2) { animation-duration: .8s; }
  .tl-eq-bar:nth-child(3) { animation-duration: .8s; }
}

/* ═══════════════════════════════════════════════════════
   ARTIST / ALBUM CARD LIKE BUTTON
   ═══════════════════════════════════════════════════════ */

/* Like button inside tracklist-style overlay header */
.card-like-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.35);
  color: rgba(255,255,255,.75);
  font-size: 17px;
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s, border-color .2s;
  flex-shrink: 0;
}
.card-like-btn:hover {
  background: rgba(255,107,138,.25);
  border-color: #ff6b8a;
  color: #ff6b8a;
  transform: scale(1.1);
}
.card-like-btn.liked {
  background: rgba(255,107,138,.2);
  border-color: #ff6b8a;
  color: #ff6b8a;
  animation: heartPop .3s ease;
}
.card-like-btn:disabled { opacity: .5; pointer-events: none; }

/* Unlike button on artist/album cards in library */
.artist-unlike-btn,
.album-unlike-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,107,138,.22);
  border: 1.5px solid rgba(255,107,138,.5);
  color: #ff6b8a;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s, transform .15s;
}
.artist-card:hover .artist-unlike-btn,
.album-card:hover .album-unlike-btn {
  opacity: 1;
}
.artist-unlike-btn:hover,
.album-unlike-btn:hover {
  transform: scale(1.18);
  background: rgba(255,107,138,.4);
}

/* Album emoji on card (used in liked albums view) */
.album-emoji {
  font-size: 24px;
  position: relative;
  z-index: 1;
  margin-bottom: 2px;
}

/* Artist card in library: pointer cursor */
.artist-card { cursor: pointer; }

/* ═══════════════════════════════════════════════════════
   ARTIST CARD HEADER / ALBUM CARD HEADER (overlays)
   ═══════════════════════════════════════════════════════ */

.artist-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.album-card-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.album-stack-sm {
  position: absolute;
  inset: 5px 5px -3px;
  border-radius: 10px;
  opacity: .5;
  z-index: 0;
}
.album-stack-sm2 {
  position: absolute;
  inset: 3px 3px -6px;
  border-radius: 10px;
  opacity: .28;
  z-index: -1;
}

/* ═══════════════════════════════════════════════════════
   SEARCH — Arrow button for artist/album rows
   ═══════════════════════════════════════════════════════ */
.sr-arrow-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color .15s;
}
.sr-arrow-btn:hover { color: rgba(255,255,255,.85); }

/* sr-thumb — round for artists */
.search-result-row[onclick*="openArtistCard"] .sr-thumb {
  border-radius: 50%;
}

/* tl-header-actions: ensure like btn + play-all sit nicely side by side */

@media (max-width: 600px) {
  .card-like-btn { width: 34px; height: 34px; font-size: 15px; }
  .artist-unlike-btn,
  .album-unlike-btn { opacity: 1; } /* always visible on touch */
  .album-emoji { font-size: 20px; }
}
