:root {
  --bg: #0a0a0f;
  --panel: #14141c;
  --panel-2: #1b1b26;
  --border: rgba(255,255,255,0.08);
  --text: #e8e8ee;
  --muted: #8a8a96;
  --accent: #ff4d6d;
  --accent-soft: rgba(255,77,109,0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(255,77,109,0.10), transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(34,211,238,0.06), transparent 45%);
  background-attachment: fixed;
}

.mono { font-family: 'Space Grotesk', monospace; }
.title-font { font-family: 'Vazirmatn', sans-serif; }
.accent { color: var(--accent); }

.counter {
  font-family: 'Space Grotesk', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ---- loader panel ---- */
.loader-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: fadeIn 0.3s ease;
}
.field {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.field:focus { border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; }
.btn-ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); }
.or-divider {
  display: flex; align-items: center;
  color: var(--muted); font-size: 12px;
}
.or-divider::before, .or-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.or-divider span { padding: 0 12px; }
.err-box {
  background: rgba(255,77,109,0.1);
  border: 1px solid rgba(255,77,109,0.3);
  color: #ffb3c1;
  padding: 8px 12px; border-radius: 8px; font-size: 13px;
}

/* ---- search ---- */
.search-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-icon { padding: 0 12px; opacity: 0.6; font-size: 14px; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); padding: 11px 0; font-size: 14px;
  font-family: 'Vazirmatn', sans-serif;
}
.clear-x {
  background: none; border: none; color: var(--muted);
  font-size: 22px; padding: 0 12px; cursor: pointer; line-height: 1;
}
.chip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-family: 'Space Grotesk', monospace;
  transition: all 0.2s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); }
.chip-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.gchip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.2s;
}
.gchip:hover { color: var(--text); }
.gchip-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- rows ---- */
.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.row:hover { background: var(--panel-2); transform: translateX(-3px); }
.row-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 20px rgba(255,77,109,0.15);
}
.row-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.play-tri { font-size: 13px; opacity: 0.85; }
.row-body { flex: 1; min-width: 0; }
.row-name {
  font-size: 14.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-group {
  font-size: 11px; color: var(--muted);
  font-family: 'Space Grotesk', monospace; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.star {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--muted); flex-shrink: 0;
  transition: transform 0.15s, color 0.2s; line-height: 1;
}
.star:hover { transform: scale(1.2); color: var(--accent); }
.star-on { color: #ffc857; }

/* ---- equalizer ---- */
.eq { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq span {
  width: 3px; background: var(--accent); border-radius: 2px; height: 4px;
}
.eq-on span { animation: bounce 0.9s ease-in-out infinite; }
.eq-on span:nth-child(1) { animation-delay: 0s; }
.eq-on span:nth-child(2) { animation-delay: 0.2s; }
.eq-on span:nth-child(3) { animation-delay: 0.4s; }
.eq-on span:nth-child(4) { animation-delay: 0.15s; }
@keyframes bounce {
  0%,100% { height: 4px; } 50% { height: 16px; }
}

/* ---- spinner ---- */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,77,109,0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 20px; height: 20px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- empty ---- */
.empty { text-align: center; padding: 60px 20px; }

/* ---- player ---- */
.player {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(16,16,22,0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
}
.player-inner {
  display: flex; align-items: center; gap: 12px;
}
.player-play {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0f;
  border: none; cursor: pointer;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 4px 18px rgba(255,77,109,0.4);
}
.player-play:hover:not(:disabled) { transform: scale(1.06); }
.player-play:disabled { background: var(--panel-2); color: var(--muted); box-shadow: none; cursor: default; }
.player-info { flex: 1; min-width: 0; overflow: hidden; }
.marquee-wrap { overflow: hidden; white-space: nowrap; }
.marquee {
  display: inline-block; font-size: 13.5px;
  font-family: 'Space Grotesk', monospace;
  color: var(--text);
}
.marquee-anim { animation: none; }
@media (max-width: 480px) {
  .marquee-anim { animation: scroll-x 12s linear infinite; }
}
@keyframes scroll-x {
  0% { transform: translateX(0); }
  100% { transform: translateX(-40%); }
}
.vol-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.vol-btn {
  background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 2px;
}
.vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 80px; height: 5px; border-radius: 4px;
  background: linear-gradient(to left, var(--accent) var(--fill), var(--panel-2) var(--fill));
  cursor: pointer; outline: none;
}
@media (max-width: 420px) { .vol-slider { width: 56px; } }
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: 0 0 8px rgba(255,77,109,0.6);
}
.vol-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
}

/* ---- toast ---- */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 18px; border-radius: 12px;
  font-size: 13px; z-index: 100;
  max-width: 90vw; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}