/* ── Touch scroll lock ───────────────────────────────── */
html {
  overscroll-behavior: none;
}
body {
  overscroll-behavior: none;
  touch-action: pan-y;
  overflow-x: clip;
}

/* ── Range inputs ─────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.12);
  border-radius: 9999px;
  height: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
/* Filled track via accent-color fallback */
input[type="range"] {
  accent-color: #04AA6D;
}

/* ── View transitions ─────────────────────────────────── */
@supports (view-transition-name: none) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.18s;
  }
}

/* ── Skeleton loader ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #1c1c1f 25%, #28282d 50%, #1c1c1f 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 0.5rem;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Scrollable horizontal rows ──────────────────────── */
.scroll-row {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }

/* ── Card hover ───────────────────────────────────────── */
.card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* ── Bottom nav spacing when player is visible ────────── */
body.player-visible #bottom-nav {
  bottom: 7.5rem;
}

/* ── Bottom nav safe area padding (iOS home indicator) ── */
#bottom-nav {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  height: auto;
  min-height: 3.5rem;
}
#bottom-nav a {
  padding-top: 0.625rem;
  padding-bottom: 0.375rem;
}

/* ── Active nav link ────────────────────────────── */
.bottom-nav-item.active,
.nav-link.active {
  color: #04AA6D;
}

/* ── Section label ─────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.75rem;
}

/* ── Filter chips ──────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  background: #1c1c1f;
  border: 1px solid rgba(255,255,255,0.09);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.chip:hover {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.2);
  background: #242428;
}
.chip-active {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  color: #04AA6D;
  background: rgba(4,170,109,0.1);
  border: 1px solid rgba(4,170,109,0.4);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

/* ── Now playing row indicator ───────────────────────── */
.now-playing {
  border-color: rgba(4,170,109,0.35) !important;
  background: rgba(4,170,109,0.06) !important;
}
.now-playing .note-icon { display: none; }
.now-playing .eq-bars   { display: flex; }

/* Animated equaliser bars */
.eq-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  width: 16px;
}
.eq-bars span {
  display: block;
  width: 3px;
  background: #04AA6D;
  border-radius: 1px;
  animation: eq 0.8s ease-in-out infinite alternate;
}
.eq-bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq-bars span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.eq-bars span:nth-child(3) { height: 60%; animation-delay: 0.1s; }
@keyframes eq {
  from { transform: scaleY(0.3); }
  to   { transform: scaleY(1); }
}
body.paused .eq-bars span {
  animation-play-state: paused;
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Back to top button ────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 35;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(28,28,31,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#back-to-top:hover { color: #04AA6D; border-color: rgba(4,170,109,0.4); }
body.player-visible #back-to-top { bottom: 13rem; }

/* ── Info bottom sheet ──────────────────────────────── */
#info-sheet {
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

/* ── Sticky count bar ───────────────────────────────── */
#sticky-count-bar {
  position: sticky;
  top: 3.5rem;
  z-index: 30;
  background: rgba(17,17,19,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 0.4rem 1rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
