/* ── 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;
}
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); }

/* ── 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;
}

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

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

/* ── 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: 8rem; }

/* ── Bottom nav spacing when player is visible ────────── */
body.player-visible #bottom-nav { bottom: 5rem; }
#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; }

/* ── 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;
}

/* ── Video player overlay ───────────────────────────── */
#video-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: #000; display: none; flex-direction: column;
}
#video-overlay.active { display: flex; }
#video-wrap {
  position: relative; flex: 1; display: flex;
  align-items: center; justify-content: center; overflow: hidden;
}
#video-wrap video { width: 100%; height: 100%; object-fit: contain; }

/* Controls fade */
#video-controls {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 2rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  transition: opacity 0.3s;
}
#video-overlay.controls-hidden #video-controls { opacity: 0; pointer-events: none; }
#video-controls button { cursor: pointer; }

/* Top bar fade */
#video-top-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  padding: 1rem 1rem 2rem;
  background: linear-gradient(rgba(0,0,0,0.7), transparent);
  transition: opacity 0.3s;
}
#video-overlay.controls-hidden #video-top-bar { opacity: 0; pointer-events: none; }
#video-top-bar button { cursor: pointer; }

/* Double-tap seek zones */
.seek-zone {
  position: absolute; top: 0; bottom: 0; width: 30%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.seek-zone.flash { opacity: 1; }
#seek-left  { left: 0; }
#seek-right { right: 0; }
