:root {
  --glass-alpha: 0.58;
  --glass-blur: 28px;
}

:root, [data-theme="obsidian"] {
  --bg: #070709; --panel-rgb: 18, 18, 24; --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.1); --accent: #ff5500; --accent-soft: rgba(255, 85, 0, 0.22);
  --text: #ffffff; --muted: #a1a1aa; --border: rgba(255, 255, 255, 0.11);
}
[data-theme="spotify"] {
  --bg: #060907; --panel-rgb: 16, 20, 17; --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.1); --accent: #1db954; --accent-soft: rgba(29, 185, 84, 0.22);
  --text: #ffffff; --muted: #b3b3b3; --border: rgba(255, 255, 255, 0.11);
}
[data-theme="cyber"] {
  --bg: #060611; --panel-rgb: 14, 14, 30; --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(244, 63, 94, 0.13); --accent: #f43f5e; --accent-soft: rgba(244, 63, 94, 0.24);
  --text: #f8fafc; --muted: #94a3b8; --border: rgba(244, 63, 94, 0.22);
}
[data-theme="gold"] {
  --bg: #080704; --panel-rgb: 20, 17, 11; --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(251, 191, 36, 0.12); --accent: #fbbf24; --accent-soft: rgba(251, 191, 36, 0.22);
  --text: #fefce8; --muted: #d6c79c; --border: rgba(251, 191, 36, 0.22);
}
[data-theme="ocean"] {
  --bg: #030912; --panel-rgb: 10, 22, 38; --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(56, 189, 248, 0.13); --accent: #38bdf8; --accent-soft: rgba(56, 189, 248, 0.22);
  --text: #f0f9ff; --muted: #93c5fd; --border: rgba(56, 189, 248, 0.22);
}
[data-theme="emerald"] {
  --bg: #040b07; --panel-rgb: 10, 22, 16; --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(16, 185, 129, 0.13); --accent: #10b981; --accent-soft: rgba(16, 185, 129, 0.22);
  --text: #ecfdf5; --muted: #6ee7b7; --border: rgba(16, 185, 129, 0.22);
}
[data-theme="lavender"] {
  --bg: #0b0614; --panel-rgb: 21, 12, 36; --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(168, 85, 247, 0.15); --accent: #a855f7; --accent-soft: rgba(168, 85, 247, 0.24);
  --text: #faf5ff; --muted: #d8b4fe; --border: rgba(168, 85, 247, 0.22);
}
[data-theme="arctic"] {
  --bg: #e7eef6; --panel-rgb: 255, 255, 255; --surface: rgba(15, 23, 42, 0.05);
  --surface-hover: rgba(37, 99, 235, 0.09); --accent: #2563eb; --accent-soft: rgba(37, 99, 235, 0.16);
  --text: #0f172a; --muted: #64748b; --border: rgba(15, 23, 42, 0.12);
}
[data-theme="custom"] {
  --bg: #07070a; --panel-rgb: 13, 13, 18; --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.12); --accent: #ff5500; --accent-soft: rgba(255, 85, 0, 0.22);
  --text: #ffffff; --muted: #b4b4c2; --border: rgba(255, 255, 255, 0.12);
}

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

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

.custom-gradient {
  position: fixed;
  inset: -40px;
  background-size: 300% 300%;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
  animation: gradFlow 14s ease infinite;
}
.custom-gradient.active { opacity: 0.55; }
.custom-gradient.track-shift { transform: scale(1.12) rotate(3deg); opacity: 0.88; }

@keyframes gradFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.ambient-art {
  position: fixed;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(10px) saturate(145%);
  opacity: 0.42;
  will-change: opacity, transform;
  transform: translateZ(0) scale(1);
  transition: opacity 0.5s ease, transform 0.65s cubic-bezier(.2,.8,.2,1);
  z-index: 0;
  pointer-events: none;
}
.ambient-art.track-shift {
  opacity: 0.72;
  transform: translateZ(0) scale(1.08);
}

.ambient-scrim {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 55%),
              linear-gradient(180deg, transparent 0%, var(--bg) 92%);
  z-index: 0;
  pointer-events: none;
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  padding: 12px;
  display: grid;
  grid-template-columns: 262px 1fr;
  grid-template-rows: 1fr 98px;
  gap: 12px;
}

.glass {
  background: rgba(var(--panel-rgb), var(--glass-alpha));
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 16px 40px rgba(0, 0, 0, 0.35);
}

body.liquid-glass .glass {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(var(--panel-rgb), var(--glass-alpha)) 45%, rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(calc(var(--glass-blur) + 8px)) saturate(200%) contrast(106%);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.38),
    inset 0 -1px 1px rgba(255, 255, 255, 0.1),
    0 20px 50px rgba(0, 0, 0, 0.45);
}

body.liquid-glass .track-row {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* SIDEBAR */
.sidebar {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-left: 6px;
}
.logo-mark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}
.logo-mark span {
  width: 4px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.logo-mark span:nth-child(1) { height: 10px; }
.logo-mark span:nth-child(2) { height: 18px; }
.logo-mark span:nth-child(3) { height: 13px; }

.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 13px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.nav-ic svg { width: 16px; height: 16px; }
.nav-btn:hover { background: var(--surface-hover); color: var(--text); transform: translateX(3px); }
.nav-btn:hover .nav-ic { border-color: var(--accent); color: var(--accent); }
.nav-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 22px var(--accent-soft);
}
.nav-btn.active .nav-ic {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.theme-card {
  background: var(--surface);
  border-radius: 15px;
  padding: 12px;
}
.theme-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 9px;
}
.theme-dots { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.theme-dot:hover { transform: scale(1.22); }
.btn-theme-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-theme-trigger:hover { background: var(--surface-hover); border-color: var(--accent); transform: translateY(-1px); }

.modal-theme { max-width: 500px; max-height: 88vh; overflow-y: auto; }
.theme-section-title { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.09em; color: var(--muted); margin-bottom: 10px; }

.theme-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.theme-preset-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s;
}
.theme-preset-btn:hover { border-color: var(--accent); background: var(--surface-hover); }
.theme-preset-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.theme-swatch-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.8); }

.saved-gradients-list { display: flex; flex-direction: column; gap: 8px; }
.saved-grad-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: 0.18s;
}
.saved-grad-row:hover { border-color: var(--accent); }
.saved-grad-pill { width: 54px; height: 22px; border-radius: 999px; flex-shrink: 0; }
.saved-grad-name { flex: 1; font-size: 0.85rem; font-weight: 700; }
.saved-grad-del { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 0.95rem; padding: 2px 6px; }
.saved-grad-del:hover { color: #f87171; }

.color-pickers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.color-pickers label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.color-pickers input[type="color"] {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  padding: 2px;
}
.grad-preview {
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  background-size: 200% 200%;
  animation: gradFlow 6s ease infinite;
}

.profile-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-status { font-size: 0.83rem; color: var(--muted); }
.profile-user { display: flex; align-items: center; gap: 10px; }
.profile-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }

.btn-accent {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--accent-soft);
  transition: transform 0.16s, filter 0.16s;
}
.btn-accent:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* MAIN */
.main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.topbar {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.search-box {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-ic { font-size: 0.9rem; opacity: 0.7; }
#search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
}
.search-go {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.view-pill {
  margin-left: auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.main-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 24px;
}
.main-scroll::-webkit-scrollbar { width: 7px; }
.main-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 999px; }

/* HERO NOW PLAYING */
.hero-now {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border);
  margin-bottom: 18px;
  animation: fadeSlide 0.35s ease;
}
.hero-now.hidden { display: none; }
.hero-now img {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.hero-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
}
.hero-meta h1 { font-size: 1.4rem; font-weight: 800; line-height: 1.25; margin-bottom: 4px; }
.hero-meta p { font-size: 0.92rem; color: var(--muted); }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* TRACK ROWS */
.track-list { display: flex; flex-direction: column; gap: 8px; }
.track-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease;
  animation: fadeSlide 0.28s ease backwards;
}
.track-row:hover {
  transform: translateY(-2px);
  background: var(--surface-hover);
  border-color: var(--border);
}
.track-row.playing {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.art-cell { position: relative; width: 52px; height: 52px; }
.track-art {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--panel);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.art-play-badge {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.18s;
}
.track-row:hover .art-play-badge,
.track-row.playing .art-play-badge { opacity: 1; }

.track-title { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.track-dur { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-right: 4px; }

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.15rem;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, color 0.15s, background 0.15s;
}
.ctrl-btn:hover { color: var(--text); background: var(--surface-hover); transform: scale(1.1); }
.ctrl-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 12px var(--accent-soft);
  position: relative;
}
#btn-repeat.active::after,
#btn-shuffle.active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.ctrl-btn.like-burst {
  position: relative;
  animation: heartPop 0.48s cubic-bezier(.17,.89,.32,1.49);
}
.ctrl-btn.like-burst::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: heartRing 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes heartPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.6); }
  65%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
@keyframes heartRing {
  0%   { transform: scale(0.5); opacity: 0.95; }
  100% { transform: scale(1.9); opacity: 0; }
}

.sync-toast {
  position: fixed;
  bottom: 118px;
  right: 24px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 18px var(--accent-soft);
  backdrop-filter: blur(18px);
  z-index: 80;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.sync-toast.show { opacity: 1; transform: translateY(0); }

/* PLAYER BAR */
.player-bar {
  grid-column: 1 / -1;
  padding: 0 22px;
  display: grid;
  grid-template-columns: 1fr 1.45fr 0.95fr;
  align-items: center;
  gap: 20px;
}

.player-info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.p-art-wrap {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.p-art-wrap img { width: 100%; height: 100%; object-fit: cover; }
.p-art-wrap img.hidden { display: none; }
.p-meta { min-width: 0; }
.p-title { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-artist { font-size: 0.8rem; color: var(--muted); margin: 2px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 12px; }
.eq span { width: 3.5px; height: 12px; border-radius: 2px; background: var(--accent); transform-origin: bottom; transform: scaleY(0.25); transition: transform 0.12s linear; will-change: transform; }

.player-controls { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.p-buttons { display: flex; align-items: center; gap: 8px; }
.play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--accent-soft);
  transition: transform 0.15s, filter 0.15s;
}
.play-btn:hover { transform: scale(1.08); filter: brightness(1.1); }

.p-progress { width: 100%; display: flex; align-items: center; gap: 10px; font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* CUSTOM SMOOTH ANIMATED SLIDERS */
.slider-wrap {
  position: relative;
  flex: 1;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.slider-wrap.vol-wrap {
  flex: none;
  width: 155px;
}
.slider-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  transition: height 0.2s ease;
}
.slider-wrap:hover .slider-track { height: 8px; }
.slider-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #fff8);
  box-shadow: 0 0 12px var(--accent-soft);
  transition: width 0.24s cubic-bezier(.2,.8,.2,1);
}
.slider-thumb {
  position: absolute;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%) scale(0.85);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transition: left 0.24s cubic-bezier(.2,.8,.2,1), transform 0.2s cubic-bezier(.2,.8,.2,1), background 0.2s, box-shadow 0.2s;
}
.slider-wrap:hover .slider-thumb,
.slider-wrap.dragging .slider-thumb {
  transform: translateX(-50%) scale(1.25);
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}
.slider-wrap.dragging .slider-fill,
.slider-wrap.dragging .slider-thumb {
  transition: transform 0.15s ease, background 0.15s, box-shadow 0.15s;
}
.slider-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.player-vol { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.speed-pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.vol-ic { display: inline-flex; align-items: center; color: var(--muted); }
.vol-pct { font-size: 0.78rem; font-weight: 700; color: var(--muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; padding: 54px 20px; color: var(--muted); font-size: 0.95rem; }

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, backdrop-filter 0.24s ease, background 0.24s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  max-width: 440px;
  width: 92%;
  padding: 26px;
  position: relative;
  opacity: 0;
  scale: 0.92;
  translate: 0 14px;
  transition: opacity 0.24s ease, scale 0.28s cubic-bezier(.2,.8,.2,1), translate 0.28s cubic-bezier(.2,.8,.2,1);
}
.modal-backdrop.open .modal {
  opacity: 1;
  scale: 1;
  translate: 0 0;
}
.modal-close { position: absolute; top: 16px; right: 16px; background: transparent; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.modal h2 { margin-bottom: 10px; font-size: 1.25rem; }
.muted { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }
.modal-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  margin-bottom: 14px;
  outline: none;
}
.modal-input:focus { border-color: var(--accent); }
.auth-msg { margin-top: 10px; font-size: 0.85rem; color: #f87171; }
.bookmarklet-btn {
  display: block;
  text-align: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  cursor: grab;
}
.bookmarklet-btn:hover { filter: brightness(1.12); }

.btn-guide-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s;
}
.btn-guide-toggle:hover { border-color: var(--accent); background: var(--surface-hover); }
.auth-guide {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  max-height: 210px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-guide.hidden { display: none; }
.guide-block strong { color: var(--text); display: block; margin-bottom: 4px; }
.guide-block ol { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

.clickable-link { cursor: pointer; transition: color 0.15s; }
.clickable-link:hover { color: var(--accent); text-decoration: underline; }

/* USER PROFILE HEADER */
.profile-header {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  animation: fadeSlide 0.3s ease;
}
.profile-header.hidden { display: none; }
.ph-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ph-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.ph-info { flex: 1; min-width: 200px; }
.ph-info h2 { font-size: 1.45rem; font-weight: 800; }
.ph-stats { display: flex; gap: 16px; margin-top: 6px; font-size: 0.84rem; color: var(--muted); }
.ph-bio { margin-top: 10px; font-size: 0.88rem; color: var(--muted); max-height: 64px; overflow-y: auto; }
.ph-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.ph-tab {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.ph-tab.active { background: var(--accent); color: #fff; border-color: transparent; }

/* TRACK MODAL & COMMENTS */
.modal-wide { max-width: 680px; max-height: 86vh; display: flex; flex-direction: column; gap: 14px; }
.tm-head { display: flex; gap: 16px; align-items: flex-start; }
.tm-head img { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; flex-shrink: 0; }
.tm-info { flex: 1; min-width: 0; }
.tm-info h2 { font-size: 1.25rem; margin-bottom: 4px; }
.tm-artist { font-size: 0.92rem; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.tm-stats { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.tm-desc { font-size: 0.84rem; color: var(--muted); max-height: 60px; overflow-y: auto; }
.tm-comment-form { display: flex; gap: 10px; }
.tm-comments { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; max-height: 300px; padding-right: 4px; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); padding: 10px 12px; border-radius: 12px; }
.comment-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; cursor: pointer; }
.comment-author { font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.comment-author:hover { color: var(--accent); }
.comment-time { font-size: 0.72rem; color: var(--muted); margin-left: 6px; }
.comment-body { font-size: 0.86rem; color: var(--text); margin-top: 2px; word-break: break-word; }

/* CUSTOMIZE MODAL */
.cust-row { margin-bottom: 16px; }
.cust-label { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 600; margin-bottom: 8px; }
.cust-label strong { color: var(--accent); }
.cust-range { width: 100%; accent-color: var(--accent); cursor: pointer; }

.cust-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}
.cust-switch input { display: none; }
.switch-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.cust-switch input:checked + .switch-ui { background: var(--accent); }
.cust-switch input:checked + .switch-ui::after { transform: translateX(20px); }

.modal-backdrop.open.preview-mode {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}
.modal-backdrop.open.preview-mode .modal {
  pointer-events: auto;
}
.cust-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  cursor: grab;
  user-select: none;
}
.cust-header:active { cursor: grabbing; }
.cust-header h2 { margin: 0; font-size: 1.15rem; }
.cust-header-actions { display: flex; align-items: center; gap: 8px; }
.btn-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s;
}
.btn-preview-toggle.active { background: var(--accent); border-color: transparent; color: #fff; }
.modal-close-inline {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 4px;
}

.fx-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s;
}
.fx-btn:hover { border-color: var(--accent); }
.fx-btn.active { background: var(--accent-soft); border-color: var(--accent); }

.track-row { grid-template-columns: 56px 1fr auto auto auto auto auto; }
