/* ============================================================
   EKKO MUSIC — PREMIUM 100/100 VISUAL SYSTEM
   ============================================================ */

:root {
  --bg: #07070c;
  --bg-elevated: #0c0c14;
  --surface: rgba(18, 18, 28, 0.72);
  --surface-solid: #12121c;
  --surface-2: rgba(28, 28, 42, 0.85);
  --surface-3: #1e1e2e;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f8f7ff;
  --text-secondary: #b4b2c4;
  --muted: #7a788c;
  --accent: #ff3d6e;
  --accent-2: #a855f7;
  --accent-3: #22d3ee;
  --accent-glow: rgba(255, 61, 110, 0.45);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --player-h: 88px;
  --sidebar-w: 260px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "Vazirmatn", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
input, textarea { font-family: inherit; }

/* Noise texture overlay for depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ambient living background */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  will-change: transform;
}
.ambient span:nth-child(1) {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #ff3d6e 0%, transparent 70%);
  top: -120px; right: 5%;
  animation: orb1 22s ease-in-out infinite;
}
.ambient span:nth-child(2) {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  bottom: 10%; left: -80px;
  animation: orb2 28s ease-in-out infinite;
}
.ambient span:nth-child(3) {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  top: 45%; left: 45%;
  animation: orb3 24s ease-in-out infinite;
}
@keyframes orb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, 40px) scale(1.15); }
}
@keyframes orb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -50px) scale(1.1); }
}
@keyframes orb3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(-40px, 30px) scale(1.2); opacity: 0.5; }
}

/* Layout */
.app {
  display: flex;
  min-height: 100vh;
  padding-bottom: var(--player-h);
  position: relative;
  z-index: 1;
}
.sidebar {
  width: var(--sidebar-w);
  background: rgba(10, 10, 16, 0.85);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-left: 1px solid var(--border);
  position: fixed;
  top: 0; right: 0; bottom: var(--player-h);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}
.main {
  flex: 1;
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(7, 7, 12, 0.75);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.content {
  padding: 32px 36px 60px;
  max-width: 1400px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 28px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
.brand-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff3d6e 0%, #a855f7 50%, #6366f1 100%);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 8px 24px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.25);
  animation: brandGlow 4s ease-in-out infinite;
}
@keyframes brandGlow {
  0%, 100% { box-shadow: 0 8px 24px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.25); }
  50% { box-shadow: 0 8px 36px rgba(168, 85, 247, 0.5), inset 0 1px 0 rgba(255,255,255,.3); }
}

/* Nav */
.nav-section { margin-bottom: 24px; }
.nav-label {
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0 14px 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.25s var(--ease-out);
  margin-bottom: 3px;
  position: relative;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateX(-3px);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 61, 110, 0.15), rgba(168, 85, 247, 0.08));
  color: #fff;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  right: 0; top: 18%; bottom: 18%;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
}
.nav-item.active svg { opacity: 1; color: var(--accent); }

/* Search */
.search-box {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 18px 11px 44px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s var(--ease-out);
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 61, 110, 0.4);
  box-shadow: 0 0 0 4px rgba(255, 61, 110, 0.12), 0 8px 24px rgba(0,0,0,.2);
}
.search-box svg {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.topbar-actions { margin-right: auto; display: flex; align-items: center; gap: 10px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s var(--ease-out);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, #ff3d6e 0%, #e11d48 40%, #a855f7 100%);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 6px 24px var(--accent-glow);
  animation: btnGradient 6s ease infinite;
}
@keyframes btnGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.3) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-out);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 36px rgba(255, 61, 110, 0.55);
}
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff3d6e, #a855f7);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255,255,255,.1);
}

/* ========== HERO — CINEMATIC ========== */
.hero {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 48px 52px;
  margin-bottom: 48px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,61,110,.12) 0%, rgba(168,85,247,.08) 40%, rgba(7,7,12,.9) 100%);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse 50% 50% at 20% 30%, rgba(255,61,110,.3), transparent),
    radial-gradient(ellipse 40% 40% at 85% 70%, rgba(168,85,247,.25), transparent),
    radial-gradient(ellipse 30% 30% at 50% 100%, rgba(34,211,238,.12), transparent);
  animation: heroBreathe 12s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes heroBreathe {
  from { transform: scale(1) rotate(0deg); }
  to { transform: scale(1.2) rotate(6deg); }
}
.hero-copy { position: relative; z-index: 2; max-width: 520px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.hero-kicker-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pingDot 2s ease-in-out infinite;
}
@keyframes pingDot {
  0% { box-shadow: 0 0 0 0 rgba(255,61,110,.5); }
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}
.hero h1 span {
  background: linear-gradient(115deg, #fff 0%, #ff8fa3 35%, #c084fc 70%, #67e8f9 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textShine 6s linear infinite;
}
@keyframes textShine {
  to { background-position: 250% center; }
}
.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 28px;
  max-width: 420px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.hero-note {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.hero-art-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}
.hero-art {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff3d6e, #7c3aed 50%, #1e1b4b);
  display: grid;
  place-items: center;
  box-shadow:
    0 0 60px rgba(255,61,110,.3),
    0 0 120px rgba(168,85,247,.15),
    inset 0 -20px 40px rgba(0,0,0,.3);
  position: relative;
  z-index: 2;
}
.hero-art-core {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
  animation: noteFloat 3s ease-in-out infinite;
}
@keyframes noteFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}
.hero-orbit {
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  animation: orbit 18s linear infinite;
}
.hero-orbit-two {
  inset: -28px;
  border-color: rgba(255,61,110,.2);
  animation-duration: 28s;
  animation-direction: reverse;
}
@keyframes orbit { to { transform: rotate(360deg); } }
.hero-spark {
  position: absolute;
  font-size: 1.1rem;
  color: #fff;
  opacity: 0.7;
  animation: sparkle 2.5s ease-in-out infinite;
  z-index: 3;
}
.hero-spark-one { top: 8%; right: 12%; }
.hero-spark-two { bottom: 18%; left: 5%; animation-delay: 1.2s; }
@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.2); }
}
.hero-bottom-glow {
  position: absolute;
  bottom: -40px; left: 20%; right: 20%;
  height: 60px;
  background: radial-gradient(ellipse, rgba(255,61,110,.25), transparent 70%);
  filter: blur(20px);
  z-index: 0;
}

/* Sections */
.section { margin-bottom: 52px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-head h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  position: relative;
  display: inline-block;
}
.section-head h2::after {
  content: "";
  position: absolute;
  right: 0; bottom: -8px;
  height: 3px;
  width: 40%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.8;
}
.section-head a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s;
}
.section-head a:hover { color: var(--accent); }

/* Song grid */
.song-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}
.song-card {
  background: transparent;
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.4s var(--ease-out), background 0.3s;
  border: 1px solid transparent;
  position: relative;
}
.song-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  transform: translateY(-8px);
}
.song-cover {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-3);
  margin-bottom: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.song-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.song-card:hover .song-cover img {
  transform: scale(1.1);
}
.song-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.3s;
}
.song-card:hover .song-cover::after { opacity: 1; }
.play-btn {
  position: absolute;
  bottom: 12px; left: 12px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff3d6e, #e11d48);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(12px) scale(0.85);
  transition: all 0.35s var(--ease-spring);
  box-shadow: 0 8px 24px rgba(255, 61, 110, 0.5);
  z-index: 2;
}
.song-card:hover .play-btn {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.play-btn:hover {
  transform: scale(1.12) !important;
  box-shadow: 0 10px 32px rgba(255, 61, 110, 0.7);
}
.song-title {
  font-weight: 700;
  font-size: 0.93rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.song-artist {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* List style */
.song-list { display: flex; flex-direction: column; gap: 4px; }
.song-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}
.song-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(-4px);
}
.song-list-item .thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.song-list-item .meta { flex: 1; min-width: 0; }
.song-list-item .meta .t {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-list-item .meta .a {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Player */
.player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--player-h);
  background: rgba(12, 12, 18, 0.92);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 24px;
  z-index: 50;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
}
.player-track {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 260px;
  min-width: 180px;
}
.player-track img {
  width: 56px; height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-3);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.player-track .info { min-width: 0; }
.player-track .info .t {
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-track .info .a {
  color: var(--muted);
  font-size: 0.8rem;
}
.player-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 540px;
  margin: 0 auto;
}
.controls-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.ctrl-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease-out);
}
.ctrl-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.ctrl-btn.play {
  width: 46px; height: 46px;
  background: #fff;
  color: #111;
  box-shadow: 0 4px 16px rgba(255,255,255,.2);
}
.ctrl-btn.play:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(255,255,255,.3);
}
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.progress {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3d6e, #a855f7);
  border-radius: 4px;
  width: 0%;
  position: relative;
  box-shadow: 0 0 12px rgba(255,61,110,.5);
}
.player-extra {
  width: 200px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 120px;
}
.volume input[type=range] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}

/* Auth */
.auth-page {
  min-height: auto;
  display: grid;
  place-items: center;
  padding: 48px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(18, 18, 28, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,.04);
}
.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.auth-card .sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 32px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.form-group input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s var(--ease-out);
}
.form-group input:focus {
  border-color: rgba(255,61,110,.5);
  box-shadow: 0 0 0 4px rgba(255,61,110,.12);
  background: rgba(255,255,255,.06);
}
.auth-error {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 18px;
  border: 1px solid rgba(248,113,113,.2);
}
.auth-card .btn-primary {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
}
.auth-switch {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-switch a {
  color: var(--accent);
  font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }

/* Empty / loading */
.empty {
  text-align: center;
  padding: 72px 24px;
  color: var(--muted);
}
.empty p { font-size: 1rem; }

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: var(--player-h);
  left: 0; right: 0;
  background: rgba(12, 12, 18, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 10px 0 env(safe-area-inset-bottom);
  z-index: 45;
  justify-content: space-around;
}
.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 14px;
  transition: color 0.2s;
}
.mobile-nav a.active { color: var(--accent); }
.mobile-nav svg { width: 22px; height: 22px; }

/* Scroll reveal */
.motion-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: calc(var(--reveal-order, 0) * 70ms);
}
.motion-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* YT embed */
#yt-container {
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08) !important;
}

/* Responsive */
@media (max-width: 960px) {
  .sidebar { display: none; }
  .main { margin-right: 0; }
  .mobile-nav { display: flex; }
  .content { padding: 20px 16px 110px; }
  .topbar { padding: 12px 16px; }
  .hero {
    padding: 32px 24px;
    flex-direction: column;
    text-align: center;
    min-height: auto;
  }
  .hero-copy { max-width: 100%; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-art-wrap { width: 140px; height: 140px; }
  .player-track { width: 140px; min-width: 100px; }
  .player-extra { display: none; }
  .song-row { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

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

/* ===== YouTube Music style categories ===== */
.page-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.page-sub {
  color: var(--muted);
  margin-bottom: 22px;
  font-size: 0.95rem;
}

.chip-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 20px;
  margin-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all .25s var(--ease-out);
  white-space: nowrap;
}
.chip:hover {
  background: rgba(255,255,255,.1);
  color: var(--text);
  transform: translateY(-2px);
}
.chip-active {
  background: #fff;
  color: #111;
  border-color: #fff;
}
.chip-active:hover { background: #f0f0f0; color: #111; }

/* Horizontal scroll rows like YTM */
.h-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.h-scroll::-webkit-scrollbar { height: 6px; }
.h-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15);
  border-radius: 4px;
}
.h-card {
  flex: 0 0 168px;
  width: 168px;
  scroll-snap-align: start;
}

/* Category tiles grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.cat-tile {
  position: relative;
  border-radius: 16px;
  padding: 28px 18px 22px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: transform .3s var(--ease-out), box-shadow .3s;
  border: 1px solid var(--border);
}
.cat-tile:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.cat-emoji { font-size: 1.8rem; margin-bottom: 10px; }
.cat-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }

.cat-tile-1 { background: linear-gradient(135deg, #ff3d6e55, #ff3d6e18); }
.cat-tile-2 { background: linear-gradient(135deg, #a855f755, #a855f718); }
.cat-tile-3 { background: linear-gradient(135deg, #22d3ee55, #22d3ee18); }
.cat-tile-4 { background: linear-gradient(135deg, #f59e0b55, #f59e0b18); }
.cat-tile-5 { background: linear-gradient(135deg, #10b98155, #10b98118); }
.cat-tile-6 { background: linear-gradient(135deg, #3b82f655, #3b82f618); }
.cat-tile-7 { background: linear-gradient(135deg, #ec489955, #ec489918); }
.cat-tile-8 { background: linear-gradient(135deg, #8b5cf655, #8b5cf618); }
.cat-tile-9 { background: linear-gradient(135deg, #ef444455, #ef444418); }
.cat-tile-10 { background: linear-gradient(135deg, #14b8a655, #14b8a618); }
.cat-tile-11 { background: linear-gradient(135deg, #f9731655, #f9731618); }
.cat-tile-12 { background: linear-gradient(135deg, #6366f155, #6366f118); }
.cat-tile-13 { background: linear-gradient(135deg, #06b6d455, #06b6d418); }
.cat-tile-14 { background: linear-gradient(135deg, #d946ef55, #d946ef18); }
.cat-tile-15 { background: linear-gradient(135deg, #84cc1655, #84cc1618); }
.cat-tile-16 { background: linear-gradient(135deg, #e11d4855, #e11d4818); }
.cat-tile-17 { background: linear-gradient(135deg, #0ea5e955, #0ea5e918); }
.cat-tile-18 { background: linear-gradient(135deg, #a78bfa55, #a78bfa18); }

@media (max-width: 640px) {
  .h-card { flex-basis: 140px; width: 140px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ===== Now Playing Sheet (YouTube Music style) ===== */
.np-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 80;
  backdrop-filter: blur(4px);
  display: none;
}
.np-overlay.is-open { display: block; }
.np-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  top: 8%;
  z-index: 90;
  background: linear-gradient(180deg, #1a1020 0%, #0c0c14 35%, #07070c 100%);
  border-radius: 24px 24px 0 0;
  border: 1px solid rgba(255,255,255,.08);
  border-bottom: none;
  display: none;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 -20px 80px rgba(0,0,0,.55);
  overflow: hidden;
}
.np-sheet.is-open {
  display: flex;
  animation: npSlide .35s cubic-bezier(.16,1,.3,1);
}
@keyframes npSlide {
  from { transform: translateY(40%); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.np-handle-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}
.np-handle {
  width: 44px;
  height: 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.25);
  border: none;
  cursor: pointer;
}
.np-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 32px;
  scrollbar-width: thin;
}
.np-cover-wrap {
  width: min(100%, 320px);
  margin: 8px auto 20px;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  background: #1a1a24;
  position: relative;
}
.np-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.np-yt-wrap {
  position: absolute;
  inset: 0;
}
.np-yt-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.np-meta { text-align: center; margin-bottom: 18px; }
.np-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.np-artist { color: var(--muted); font-size: 0.95rem; }
.np-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.np-progress { flex: 1; height: 5px; }
.np-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 18px;
}
.np-play {
  width: 64px !important;
  height: 64px !important;
}
.np-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.np-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 14px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  transition: background .2s, color .2s;
}
.np-action:hover, .np-action.liked {
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.np-action.liked { color: #ff3d6e; }
.np-volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
}
.np-volume-row input[type=range] {
  flex: 1;
  accent-color: var(--accent);
}
.np-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.np-tab {
  flex: 1;
  padding: 12px 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.np-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.np-panel { display: none; }
.np-panel.active { display: block; }
.np-muted {
  color: var(--muted);
  text-align: center;
  padding: 24px 12px;
  font-size: 0.9rem;
}
.np-q-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  text-align: right;
  transition: background .2s;
  color: var(--text);
}
.np-q-item:hover { background: rgba(255,255,255,.06); }
.np-q-item img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #222;
  flex-shrink: 0;
}
.np-q-item .t {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-q-item .a {
  color: var(--muted);
  font-size: 0.8rem;
}
.np-lyrics-text {
  white-space: pre-wrap;
  line-height: 1.85;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-family: inherit;
  padding: 8px 4px 24px;
}

/* Playlist modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.6);
  display: none;
  place-items: center;
  padding: 20px;
}
.modal-overlay.is-open {
  display: grid;
}
.modal-card {
  width: 100%;
  max-width: 360px;
  background: #14141e;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.modal-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 16px;
  text-align: center;
}
.pl-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.pl-item {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  text-align: right;
  font-weight: 600;
  transition: background .2s;
  color: var(--text);
}
.pl-item:hover { background: rgba(255,61,110,.15); }

body.np-open { overflow: hidden; }
body.np-open .player { opacity: 0.5; }

@media (min-width: 700px) {
  .np-sheet {
    top: auto;
    bottom: 0;
    height: min(92vh, 820px);
  }
}

/* Cover fallback */
.np-cover-empty,
.np-cover:not([src]),
.np-cover[src=""] {
  background: linear-gradient(135deg, #ff3d6e55, #a855f755, #1e1b4b);
  min-height: 100%;
}
.np-cover-wrap {
  background: linear-gradient(135deg, #2a1530, #1a1028 40%, #12101c);
}
.np-meta .np-title {
  color: #fff !important;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.np-meta .np-artist {
  color: #c4c2d4 !important;
}

/* Fix playlist modal RTL layout */
.pl-create {
  flex-direction: row-reverse;
}
.pl-create input {
  text-align: right;
}

/* Ensure song cards always show image area */
.song-cover {
  background: linear-gradient(135deg, #2a1530, #1a1a28);
}

/* Fix: [hidden] must win over display:grid/flex */
.modal-overlay[hidden],
.np-sheet[hidden],
.np-overlay[hidden],
#pl-modal[hidden],
#np-sheet[hidden],
#np-overlay[hidden],
#yt-container[hidden],
#np-yt-wrap[hidden] {
  display: none !important;
}


/* FORCE HIDE MODALS until opened */
#pl-modal:not(.is-open),
#np-sheet:not(.is-open),
#np-overlay:not(.is-open) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
#pl-modal.is-open {
  display: grid !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
#np-sheet.is-open {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
#np-overlay.is-open {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Profile menu */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px 8px;
  border-top: 1px solid var(--border);
  position: relative;
}
.profile-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background .2s;
  text-align: right;
}
.profile-trigger:hover { background: rgba(255,255,255,.08); }
.profile-meta { flex: 1; min-width: 0; }
.profile-name {
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-hint { color: var(--muted); font-size: .75rem; }
.profile-caret { opacity: .6; flex-shrink: 0; }
.profile-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 8px;
  left: 8px;
  background: #161622;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  z-index: 60;
  display: none;
}
.profile-dropdown.is-open { display: block; }
.profile-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.profile-dd-item:hover { background: rgba(255,255,255,.06); color: var(--text); }
.profile-dd-item.danger { color: #f87171; }
.profile-dd-item.danger:hover { background: rgba(248,113,113,.12); }

.top-profile { position: relative; }
.top-avatar {
  border: none;
  cursor: pointer;
}
.top-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: auto;
  min-width: 160px;
  bottom: auto;
}
#profile-dropdown:not(.is-open),
#top-profile-dropdown:not(.is-open) {
  display: none !important;
}
