{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "music-player",
  "type": "registry:block",
  "title": "Music Player",
  "description": "A music app with gradient cover art that glows into the room, a waveform you can scrub, a drag-to-reorder queue and lyrics that follow the song line by line.",
  "categories": [
    "screen",
    "Personal"
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils",
    "https://coss.com/ui/r/button.json",
    "https://coss.com/ui/r/slider.json"
  ],
  "files": [
    {
      "path": "registry/devl/music-player.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport {\n  CompassIcon,\n  GripVerticalIcon,\n  HeartIcon,\n  HomeIcon,\n  ListMusicIcon,\n  MenuIcon,\n  MicVocalIcon,\n  PauseIcon,\n  PlayIcon,\n  RadioIcon,\n  Repeat1Icon,\n  RepeatIcon,\n  ShuffleIcon,\n  SkipBackIcon,\n  SkipForwardIcon,\n  Volume1Icon,\n  Volume2Icon,\n  VolumeXIcon,\n  XIcon,\n} from \"lucide-react\";\nimport {\n  AnimatePresence,\n  type DragControls,\n  motion,\n  Reorder,\n  useDragControls,\n  useReducedMotion,\n} from \"motion/react\";\nimport { type KeyboardEvent, type ReactNode, type RefObject, useEffect, useRef, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\nimport { Slider } from \"@/components/ui/slider\";\n\nfunction useReducedMotionAfterMount() {\n  const prefers = useReducedMotion();\n  const [mounted, setMounted] = useState(false);\n  useEffect(() => setMounted(true), []);\n  return mounted && Boolean(prefers);\n}\n\nexport type CoverArt = \"sunset\" | \"ocean\" | \"forest\" | \"dusk\" | \"citrus\" | \"rose\" | \"aurora\" | \"slate\";\n\nexport interface LyricLine {\n  time: number;\n  text: string;\n}\n\nexport interface MusicTrack {\n  id: string;\n  title: string;\n  artist: string;\n  album: string;\n  duration: number;\n  art: CoverArt;\n  lyrics?: LyricLine[];\n}\n\nexport interface MusicPlaylist {\n  id: string;\n  name: string;\n  art: CoverArt;\n  trackIds: string[];\n}\n\nexport interface MusicPlayerProps {\n  className?: string;\n  appName?: string;\n  tracks?: MusicTrack[];\n  playlists?: MusicPlaylist[];\n  initialTrackId?: string;\n  initialPosition?: number;\n  autoPlay?: boolean;\n}\n\nconst spring = { type: \"spring\", stiffness: 520, damping: 46, mass: 1 } as const;\nconst easeOut = [0.23, 1, 0.32, 1] as const;\nconst press = \"transition-[color,background-color,box-shadow,scale] duration-150 ease-out active:scale-[0.97]\";\nconst ring = \"outline-none focus-visible:ring-2 focus-visible:ring-ring\";\n\nconst arts: Record<CoverArt, string> = {\n  sunset: \"from-amber-300 via-orange-500 to-rose-700\",\n  ocean: \"from-sky-300 via-blue-600 to-indigo-950\",\n  forest: \"from-lime-300 via-emerald-600 to-teal-950\",\n  dusk: \"from-fuchsia-400 via-violet-700 to-indigo-950\",\n  citrus: \"from-yellow-200 via-lime-400 to-emerald-600\",\n  rose: \"from-pink-200 via-rose-400 to-red-700\",\n  aurora: \"from-teal-200 via-cyan-500 to-violet-800\",\n  slate: \"from-stone-200 via-stone-500 to-stone-900\",\n};\n\nfunction Motif({ art }: { art: CoverArt }) {\n  const common = { \"aria-hidden\": true, className: \"absolute inset-0 size-full\", viewBox: \"0 0 100 100\", preserveAspectRatio: \"xMidYMid slice\" } as const;\n  switch (art) {\n    case \"sunset\":\n      return (\n        <svg {...common}>\n          <circle className=\"fill-amber-100/90\" cx=\"50\" cy=\"62\" r=\"22\" />\n          <rect className=\"fill-rose-950/35\" height=\"36\" width=\"100\" x=\"0\" y=\"66\" />\n          {[\n            [72, 34],\n            [78, 24],\n            [84, 15],\n            [90, 7],\n          ].map(([y, w]) => (\n            <rect className=\"fill-amber-100/50\" height=\"1.6\" key={y} rx=\"0.8\" width={w} x={50 - w / 2} y={y} />\n          ))}\n        </svg>\n      );\n    case \"ocean\":\n      return (\n        <svg {...common}>\n          {[52, 62, 72, 82].map((y, i) => (\n            <path\n              className=\"fill-none stroke-white/40\"\n              d={`M-5 ${y} Q 12 ${y - 7} 25 ${y} T 55 ${y} T 85 ${y} T 115 ${y}`}\n              key={y}\n              strokeWidth={2.2 - i * 0.3}\n            />\n          ))}\n          <circle className=\"fill-white/70\" cx=\"74\" cy=\"26\" r=\"7\" />\n        </svg>\n      );\n    case \"forest\":\n      return (\n        <svg {...common}>\n          <path className=\"fill-black/25\" d=\"M-10 100 L28 34 L66 100Z\" />\n          <path className=\"fill-white/15\" d=\"M30 100 L64 44 L98 100Z\" />\n          <path className=\"fill-black/30\" d=\"M55 100 L84 56 L113 100Z\" />\n        </svg>\n      );\n    case \"dusk\":\n      return (\n        <svg {...common}>\n          {[\n            [18, 20],\n            [34, 12],\n            [80, 18],\n            [62, 30],\n            [12, 44],\n            [88, 46],\n          ].map(([x, y]) => (\n            <circle className=\"fill-white/70\" cx={x} cy={y} key={`${x}-${y}`} r=\"0.9\" />\n          ))}\n          <circle className=\"fill-amber-50/90\" cx=\"58\" cy=\"58\" r=\"20\" />\n          <circle className=\"fill-violet-700\" cx=\"66\" cy=\"52\" r=\"17\" />\n        </svg>\n      );\n    case \"citrus\":\n      return (\n        <svg {...common}>\n          {[34, 26, 18, 10].map((r) => (\n            <circle className=\"fill-none stroke-white/45\" cx=\"36\" cy=\"64\" key={r} r={r} strokeWidth=\"1.6\" />\n          ))}\n          <circle className=\"fill-yellow-100/80\" cx=\"36\" cy=\"64\" r=\"5\" />\n        </svg>\n      );\n    case \"rose\":\n      return (\n        <svg {...common}>\n          <path className=\"fill-white/20\" d=\"M20 70c-8-22 10-44 32-40s34 26 22 42-46 20-54-2z\" />\n          <circle className=\"fill-none stroke-white/55\" cx=\"50\" cy=\"52\" r=\"14\" strokeWidth=\"1.5\" />\n        </svg>\n      );\n    case \"aurora\":\n      return (\n        <svg {...common}>\n          <path className=\"fill-none stroke-white/35\" d=\"M-5 40 C 25 20, 55 60, 105 30\" strokeWidth=\"9\" />\n          <path className=\"fill-none stroke-emerald-200/40\" d=\"M-5 58 C 30 38, 60 76, 105 50\" strokeWidth=\"6\" />\n          <path className=\"fill-black/30\" d=\"M0 100 L0 84 L18 76 L34 86 L52 72 L70 84 L86 74 L100 82 L100 100Z\" />\n        </svg>\n      );\n    case \"slate\":\n      return (\n        <svg {...common}>\n          {[20, 40, 60, 80].map((v) => (\n            <g key={v}>\n              <line className=\"stroke-white/20\" x1={v} x2={v} y1=\"0\" y2=\"100\" />\n              <line className=\"stroke-white/20\" x1=\"0\" x2=\"100\" y1={v} y2={v} />\n            </g>\n          ))}\n          <rect className=\"fill-white/75\" height=\"20\" width=\"20\" x=\"40\" y=\"40\" />\n        </svg>\n      );\n  }\n}\n\nfunction Cover({ art, className }: { art: CoverArt; className?: string }) {\n  return (\n    <span className={cn(\"relative block shrink-0 overflow-hidden bg-linear-to-br\", arts[art], className)}>\n      <Motif art={art} />\n      <span className=\"pointer-events-none absolute inset-0 rounded-[inherit] ring-1 ring-black/10 ring-inset dark:ring-white/10\" />\n    </span>\n  );\n}\n\nfunction time(s: number) {\n  const t = Math.max(0, Math.floor(s));\n  return `${Math.floor(t / 60)}:${String(t % 60).padStart(2, \"0\")}`;\n}\n\nfunction waveform(seed: string, n: number) {\n  let h = 0;\n  for (let i = 0; i < seed.length; i++) h = (h * 33 + seed.charCodeAt(i)) >>> 0;\n  return Array.from({ length: n }, (_, i) => {\n    h = (h * 1103515245 + 12345) >>> 0;\n    const grit = (h % 1000) / 1000;\n    const swell = 0.55 + 0.45 * Math.sin((i / n) * Math.PI * 3.2 + (seed.length % 5));\n    const v = 0.18 + 0.82 * (0.45 * swell + 0.55 * grit) * Math.min(1, (i + 2) / 5) * Math.min(1, (n - i + 1) / 5);\n    return Math.max(0.12, Math.min(1, v));\n  });\n}\n\nfunction EqBars({ playing, className }: { playing: boolean; className?: string }) {\n  const reduce = useReducedMotionAfterMount();\n  return (\n    <span aria-hidden className={cn(\"flex h-3 items-end gap-[2px]\", className)}>\n      {[0.6, 1, 0.75].map((h, i) => (\n        <motion.span\n          animate={playing && !reduce ? { scaleY: [h, 0.3, 1, 0.5, h] } : { scaleY: h * 0.6 }}\n          className=\"h-3 w-[3px] origin-bottom rounded-full bg-current\"\n          key={i}\n          transition={playing && !reduce ? { duration: 1.1, repeat: Infinity, ease: \"easeInOut\", delay: i * 0.18 } : { duration: 0.2 }}\n        />\n      ))}\n    </span>\n  );\n}\n\nfunction Scrubber({\n  track,\n  position,\n  onSeek,\n  bars = 72,\n}: {\n  track: MusicTrack;\n  position: number;\n  onSeek: (s: number) => void;\n  bars?: number;\n}) {\n  const ref = useRef<HTMLDivElement>(null);\n  const [hover, setHover] = useState<number | null>(null);\n  const [dragging, setDragging] = useState(false);\n  const heights = waveform(track.id, bars);\n  const pct = Math.min(100, (position / track.duration) * 100);\n\n  const at = (clientX: number) => {\n    const box = ref.current?.getBoundingClientRect();\n    if (!box) return 0;\n    return Math.min(1, Math.max(0, (clientX - box.left) / box.width));\n  };\n\n  const onKey = (e: KeyboardEvent) => {\n    const step = e.shiftKey ? 15 : 5;\n    if (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") onSeek(Math.min(track.duration - 1, position + step));\n    else if (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") onSeek(Math.max(0, position - step));\n    else if (e.key === \"Home\") onSeek(0);\n    else if (e.key === \"End\") onSeek(track.duration - 1);\n    else return;\n    e.preventDefault();\n  };\n\n  const layer = (cls: string) => (\n    <div className={cn(\"absolute inset-0 flex items-center gap-[2px]\", cls)}>\n      {heights.map((h, i) => (\n        <span className=\"min-w-0 flex-1 rounded-full bg-current\" key={i} style={{ height: `${Math.round(h * 100)}%` }} />\n      ))}\n    </div>\n  );\n\n  return (\n    <div className=\"flex flex-col gap-1.5\">\n      <div\n        aria-label=\"Seek\"\n        aria-valuemax={Math.round(track.duration)}\n        aria-valuemin={0}\n        aria-valuenow={Math.round(position)}\n        aria-valuetext={`${time(position)} of ${time(track.duration)}`}\n        className={cn(\"group/scrub relative h-12 cursor-pointer touch-none select-none rounded-md\", ring, \"focus-visible:ring-offset-4 focus-visible:ring-offset-background\")}\n        onKeyDown={onKey}\n        onPointerDown={(e) => {\n          e.currentTarget.setPointerCapture(e.pointerId);\n          setDragging(true);\n          onSeek(at(e.clientX) * track.duration);\n        }}\n        onPointerLeave={() => setHover(null)}\n        onPointerMove={(e) => {\n          const f = at(e.clientX);\n          if (dragging) onSeek(f * track.duration);\n          if (e.pointerType === \"mouse\") setHover(f);\n        }}\n        onPointerCancel={() => setDragging(false)}\n        onPointerUp={() => setDragging(false)}\n        ref={ref}\n        role=\"slider\"\n        tabIndex={0}\n      >\n        {layer(\"text-foreground/15\")}\n        {hover !== null && layer(\"text-foreground/35\")}\n        <div className=\"absolute inset-0\" style={{ clipPath: `inset(0 ${100 - pct}% 0 0)` }}>\n          {layer(\"text-foreground\")}\n        </div>\n        {hover !== null && (\n          <div className=\"pointer-events-none absolute inset-0\" style={{ clipPath: `inset(0 ${100 - hover * 100}% 0 0)` }}>\n            {layer(\"text-foreground/35\")}\n          </div>\n        )}\n        <span\n          className=\"pointer-events-none absolute inset-y-0 w-0.5 -translate-x-1/2 rounded-full bg-foreground\"\n          style={{ left: `${pct}%` }}\n        />\n        {hover !== null && (\n          <span\n            className=\"pointer-events-none absolute -top-7 -translate-x-1/2 rounded-md border bg-popover px-1.5 py-0.5 font-medium text-popover-foreground text-xs tabular-nums shadow-md/5\"\n            style={{ left: `${hover * 100}%` }}\n          >\n            {time(hover * track.duration)}\n          </span>\n        )}\n      </div>\n      <div className=\"flex justify-between text-muted-foreground text-xs tabular-nums\">\n        <span>{time(position)}</span>\n        <span>-{time(track.duration - position)}</span>\n      </div>\n    </div>\n  );\n}\n\nfunction QueueRow({\n  track,\n  index,\n  total,\n  onPlay,\n  onRemove,\n  onMove,\n}: {\n  track: MusicTrack;\n  index: number;\n  total: number;\n  onPlay: () => void;\n  onRemove: () => void;\n  onMove: (dir: -1 | 1) => void;\n}) {\n  const controls: DragControls = useDragControls();\n  const reduce = useReducedMotionAfterMount();\n  return (\n    <Reorder.Item\n      as=\"li\"\n      className=\"group/row relative flex items-center gap-1 rounded-xl bg-background pe-1 [&:has(:focus-visible)]:bg-accent\"\n      dragControls={controls}\n      dragListener={false}\n      exit={reduce ? { opacity: 0, transition: { duration: 0.12 } } : { opacity: 0, scale: 0.97, transition: { duration: 0.15, ease: easeOut } }}\n      initial={false}\n      layout={reduce ? undefined : \"position\"}\n      transition={spring}\n      value={track}\n      whileDrag={{ scale: 1.02, boxShadow: \"0 8px 24px -8px rgb(0 0 0 / 0.25)\", zIndex: 10 }}\n    >\n      <button\n        aria-label={`Reorder ${track.title}. Use arrow keys to move.`}\n        className={cn(\n          \"flex h-12 w-7 shrink-0 cursor-grab touch-none items-center justify-center rounded-lg text-muted-foreground/60 hover:text-foreground active:cursor-grabbing\",\n          ring,\n        )}\n        onKeyDown={(e) => {\n          if (e.key === \"ArrowUp\" && index > 0) {\n            e.preventDefault();\n            onMove(-1);\n          } else if (e.key === \"ArrowDown\" && index < total - 1) {\n            e.preventDefault();\n            onMove(1);\n          }\n        }}\n        onPointerDown={(e) => controls.start(e)}\n        type=\"button\"\n      >\n        <GripVerticalIcon className=\"size-4\" />\n      </button>\n      <button\n        className={cn(\"flex min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-lg py-1.5 pe-1 text-left hover:bg-accent/60\", ring, press, \"active:scale-[0.99]\")}\n        onClick={onPlay}\n        type=\"button\"\n      >\n        <Cover art={track.art} className=\"size-9 rounded-md\" />\n        <span className=\"flex min-w-0 flex-1 flex-col\">\n          <span className=\"truncate font-medium\">{track.title}</span>\n          <span className=\"truncate text-muted-foreground text-xs\">{track.artist}</span>\n        </span>\n        <span className=\"text-muted-foreground text-xs tabular-nums\">{time(track.duration)}</span>\n      </button>\n      <button\n        aria-label={`Remove ${track.title} from queue`}\n        className={cn(\n          \"relative flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-100 hover:bg-accent hover:text-foreground after:absolute after:-inset-1.5 after:content-[''] focus-visible:opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/row:opacity-100\",\n          ring,\n        )}\n        onClick={onRemove}\n        type=\"button\"\n      >\n        <XIcon className=\"size-3.5\" />\n      </button>\n    </Reorder.Item>\n  );\n}\n\nconst defaultTracks: MusicTrack[] = [\n  {\n    id: \"t1\",\n    title: \"Paper Lanterns\",\n    artist: \"Wren & the Low Tide\",\n    album: \"Harbour Lights\",\n    duration: 214,\n    art: \"sunset\",\n    lyrics: [\n      { time: 0, text: \"♪\" },\n      { time: 8, text: \"Streetlights hum a song we never learned\" },\n      { time: 14, text: \"Your coat still smells of rain and turning leaves\" },\n      { time: 20, text: \"We count the windows burning on the hill\" },\n      { time: 26, text: \"And name the ones still waiting up for us\" },\n      { time: 33, text: \"Paper lanterns, drifting over water\" },\n      { time: 39, text: \"Every little light a thing we didn't say\" },\n      { time: 45, text: \"Paper lanterns, hold on a little longer\" },\n      { time: 51, text: \"Till the tide comes in and carries them away\" },\n      { time: 60, text: \"♪\" },\n      { time: 70, text: \"The ferry horn is calling out the hour\" },\n      { time: 76, text: \"You laugh the way you did when we were nine\" },\n      { time: 82, text: \"I fold the evening up and keep it small\" },\n      { time: 88, text: \"A pocket full of maybe, one of mine\" },\n      { time: 96, text: \"Paper lanterns, drifting over water\" },\n      { time: 102, text: \"Every little light a thing we didn't say\" },\n      { time: 108, text: \"Paper lanterns, hold on a little longer\" },\n      { time: 114, text: \"Till the tide comes in and carries them away\" },\n      { time: 124, text: \"♪\" },\n      { time: 140, text: \"And if the dark gets heavy, let it\" },\n      { time: 148, text: \"We were never meant to hold the sky\" },\n      { time: 156, text: \"Paper lanterns…\" },\n      { time: 164, text: \"…carry us away\" },\n      { time: 176, text: \"♪\" },\n    ],\n  },\n  {\n    id: \"t2\",\n    title: \"Low Orbit\",\n    artist: \"Pale Static\",\n    album: \"Satellite Summer\",\n    duration: 187,\n    art: \"dusk\",\n    lyrics: [\n      { time: 0, text: \"♪\" },\n      { time: 12, text: \"Radio static where your voice used to be\" },\n      { time: 19, text: \"I keep the dial right where you left it\" },\n      { time: 26, text: \"Low orbit, circling the kitchen light\" },\n      { time: 33, text: \"Too far to land and too close to forget it\" },\n      { time: 44, text: \"♪\" },\n      { time: 58, text: \"Low orbit, low orbit\" },\n      { time: 64, text: \"Spinning slow so I can see you twice\" },\n      { time: 76, text: \"♪\" },\n    ],\n  },\n  { id: \"t3\", title: \"Fieldnotes\", artist: \"Marisol Vega\", album: \"Green Hours\", duration: 241, art: \"forest\" },\n  { id: \"t4\", title: \"Saltwater Radio\", artist: \"The Quiet Coast\", album: \"Long Weekend\", duration: 198, art: \"ocean\" },\n  { id: \"t5\", title: \"Citrus Season\", artist: \"Bloom Arcade\", album: \"Sugar & Static\", duration: 176, art: \"citrus\" },\n  { id: \"t6\", title: \"Velvet Hour\", artist: \"June Okafor\", album: \"Night Swim\", duration: 229, art: \"rose\" },\n  { id: \"t7\", title: \"Northern Hearts\", artist: \"Atlas Frame\", album: \"Polar\", duration: 263, art: \"aurora\" },\n  { id: \"t8\", title: \"Concrete Garden\", artist: \"Mono Theory\", album: \"Grey Matter\", duration: 205, art: \"slate\" },\n  { id: \"t9\", title: \"Afterglow\", artist: \"Wren & the Low Tide\", album: \"Harbour Lights\", duration: 192, art: \"sunset\" },\n];\n\nconst defaultPlaylists: MusicPlaylist[] = [\n  { id: \"p1\", name: \"Late night drives\", art: \"dusk\", trackIds: [\"t2\", \"t6\", \"t7\", \"t1\", \"t8\"] },\n  { id: \"p2\", name: \"Sunday reset\", art: \"citrus\", trackIds: [\"t5\", \"t3\", \"t4\", \"t9\"] },\n  { id: \"p3\", name: \"Deep focus\", art: \"slate\", trackIds: [\"t8\", \"t3\", \"t7\", \"t4\"] },\n  { id: \"p4\", name: \"Harbour Lights\", art: \"sunset\", trackIds: [\"t1\", \"t9\"] },\n];\n\ntype Pane = \"playing\" | \"queue\" | \"lyrics\";\ntype Repeat = \"off\" | \"all\" | \"one\";\n\nexport function MusicPlayer({\n  className,\n  appName = \"Murmur\",\n  tracks = defaultTracks,\n  playlists = defaultPlaylists,\n  initialTrackId,\n  initialPosition = 47,\n  autoPlay = true,\n}: MusicPlayerProps) {\n  const reduce = useReducedMotionAfterMount();\n  const first = tracks.find((t) => t.id === initialTrackId) ?? tracks[0];\n  const [current, setCurrent] = useState<MusicTrack>(first);\n  const [queue, setQueue] = useState<MusicTrack[]>(() => tracks.filter((t) => t.id !== first.id));\n  const [history, setHistory] = useState<MusicTrack[]>([]);\n  const [position, setPosition] = useState(initialPosition);\n  const [playing, setPlaying] = useState(autoPlay);\n  const [shuffle, setShuffle] = useState(false);\n  const [repeat, setRepeat] = useState<Repeat>(\"off\");\n  const [liked, setLiked] = useState<string[]>([\"t2\", \"t6\"]);\n  const [volume, setVolume] = useState(72);\n  const [muted, setMuted] = useState(false);\n  const [side, setSide] = useState<\"queue\" | \"lyrics\">(\"lyrics\");\n  const [pane, setPane] = useState<Pane>(\"playing\");\n  const [direction, setDirection] = useState<1 | -1>(1);\n  const [activePlaylist, setActivePlaylist] = useState<string | null>(null);\n  const [drawer, setDrawer] = useState(false);\n  const preShuffle = useRef<string[] | null>(null);\n  const drawerRef = useRef<HTMLDivElement>(null);\n  const lyricsRef = useRef<HTMLDivElement>(null);\n  const mobileLyricsRef = useRef<HTMLDivElement>(null);\n  const state = useRef({ queue, history, current, repeat });\n  state.current = { queue, history, current, repeat };\n\n  const goTo = (track: MusicTrack, rest: MusicTrack[], dir: 1 | -1 = 1, pushHistory = true) => {\n    if (pushHistory) setHistory((h) => [...h, state.current.current]);\n    setDirection(dir);\n    setCurrent(track);\n    setQueue(rest);\n    setPosition(0);\n  };\n\n  const next = (auto = false) => {\n    const { queue: q, history: h, repeat: r, current: c } = state.current;\n    if (auto && r === \"one\") {\n      setPosition(0);\n      return;\n    }\n    if (q.length) goTo(q[0], q.slice(1));\n    else if (r === \"all\" && h.length) {\n      setHistory([]);\n      goTo(h[0], [...h.slice(1), c], 1, false);\n    } else {\n      setPlaying(false);\n      setPosition(c.duration);\n    }\n  };\n\n  const prev = () => {\n    if (position > 3 || history.length === 0) {\n      setPosition(0);\n      return;\n    }\n    const last = history[history.length - 1];\n    setHistory((h) => h.slice(0, -1));\n    goTo(last, [current, ...queue], -1, false);\n  };\n\n  useEffect(() => {\n    if (!playing) return;\n    const t = setInterval(() => {\n      setPosition((p) => Math.min(state.current.current.duration, p + 0.25));\n    }, 250);\n    return () => clearInterval(t);\n  }, [playing, current.id]);\n\n  useEffect(() => {\n    if (playing && position >= current.duration) next(true);\n  }, [position, playing, current.duration]);\n\n  useEffect(() => {\n    if (drawer) drawerRef.current?.focus({ preventScroll: true });\n  }, [drawer]);\n\n  const lyrics = current.lyrics ?? [];\n  const activeLine = lyrics.reduce((acc, l, i) => (l.time <= position ? i : acc), -1);\n\n  useEffect(() => {\n    for (const box of [lyricsRef.current, mobileLyricsRef.current]) {\n      if (!box || box.offsetParent === null) continue;\n      const line = box.querySelector<HTMLElement>(`[data-line=\"${activeLine}\"]`);\n      if (!line) continue;\n      const top = line.offsetTop - box.clientHeight / 2 + line.clientHeight / 2;\n      box.scrollTo({ top: Math.max(0, top), behavior: reduce ? \"auto\" : \"smooth\" });\n    }\n  }, [activeLine, current.id, side, pane, reduce]);\n\n  const toggleShuffle = () => {\n    if (!shuffle) {\n      preShuffle.current = queue.map((t) => t.id);\n      const copy = [...queue];\n      for (let i = copy.length - 1; i > 0; i--) {\n        const j = Math.floor(Math.random() * (i + 1));\n        [copy[i], copy[j]] = [copy[j], copy[i]];\n      }\n      setQueue(copy);\n    } else if (preShuffle.current) {\n      const order = preShuffle.current;\n      setQueue((q) => [...q].sort((a, b) => (order.indexOf(a.id) + 1 || 999) - (order.indexOf(b.id) + 1 || 999)));\n    }\n    setShuffle((s) => !s);\n  };\n\n  const playFromQueue = (index: number) => {\n    const q = queue;\n    setHistory((h) => [...h, current, ...q.slice(0, index)]);\n    goTo(q[index], q.slice(index + 1), 1, false);\n    setPlaying(true);\n  };\n\n  const playPlaylist = (p: MusicPlaylist) => {\n    const list = p.trackIds.map((id) => tracks.find((t) => t.id === id)).filter(Boolean) as MusicTrack[];\n    if (!list.length) return;\n    setActivePlaylist(p.id);\n    goTo(list[0], list.slice(1));\n    setPlaying(true);\n    setDrawer(false);\n  };\n\n  const move = (index: number, dir: -1 | 1) => {\n    setQueue((q) => {\n      const copy = [...q];\n      const [item] = copy.splice(index, 1);\n      copy.splice(index + dir, 0, item);\n      return copy;\n    });\n  };\n\n  const isLiked = liked.includes(current.id);\n  const toggleLike = () => setLiked((l) => (isLiked ? l.filter((x) => x !== current.id) : [...l, current.id]));\n  const queueTime = queue.reduce((s, t) => s + t.duration, 0);\n  const VolumeIcon = muted || volume === 0 ? VolumeXIcon : volume < 50 ? Volume1Icon : Volume2Icon;\n\n  const playButton = (size: \"lg\" | \"sm\") => (\n    <button\n      aria-label={playing ? \"Pause\" : \"Play\"}\n      className={cn(\n        \"relative flex shrink-0 cursor-pointer items-center justify-center rounded-full bg-primary text-primary-foreground shadow-xs/5 hover:bg-primary/90\",\n        ring,\n        \"focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n        press,\n        \"active:scale-[0.95]\",\n        size === \"lg\" ? \"size-14\" : \"size-9\",\n      )}\n      onClick={() => {\n        if (!playing && position >= current.duration) setPosition(0);\n        setPlaying((p) => !p);\n      }}\n      type=\"button\"\n    >\n      <AnimatePresence initial={false} mode=\"popLayout\">\n        <motion.span\n          animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n          className=\"flex\"\n          exit={{ opacity: 0, scale: 0.7, filter: \"blur(2px)\" }}\n          initial={{ opacity: 0, scale: 0.7, filter: \"blur(2px)\" }}\n          key={playing ? \"pause\" : \"play\"}\n          transition={{ duration: 0.15, ease: easeOut }}\n        >\n          {playing ? (\n            <PauseIcon className={cn(\"fill-current\", size === \"lg\" ? \"size-6\" : \"size-4\")} />\n          ) : (\n            <PlayIcon className={cn(\"fill-current\", size === \"lg\" ? \"ms-0.5 size-6\" : \"ms-px size-4\")} />\n          )}\n        </motion.span>\n      </AnimatePresence>\n    </button>\n  );\n\n  const iconButton = (label: string, onClick: () => void, icon: ReactNode, active?: boolean, className?: string) => (\n    <button\n      aria-label={label}\n      aria-pressed={active}\n      className={cn(\n        \"relative flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-accent [&_svg]:size-5\",\n        ring,\n        press,\n        active === undefined ? \"text-foreground\" : active ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n        className,\n      )}\n      onClick={onClick}\n      type=\"button\"\n    >\n      {icon}\n      {active && <span className=\"absolute bottom-1 size-1 rounded-full bg-foreground\" />}\n    </button>\n  );\n\n  const lyricsList = (refObj: RefObject<HTMLDivElement | null>, big?: boolean) =>\n    lyrics.length === 0 ? (\n      <div className=\"flex h-full flex-col items-center justify-center gap-2 px-8 text-center\">\n        <span className=\"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground\">\n          <MicVocalIcon className=\"size-4.5\" />\n        </span>\n        <span className=\"font-medium\">No lyrics for this one</span>\n        <span className=\"text-pretty text-muted-foreground text-xs\">\n          {current.artist} hasn't shared lyrics for “{current.title}” yet.\n        </span>\n      </div>\n    ) : (\n      <div\n        className=\"relative h-full overflow-y-auto px-5 [mask-image:linear-gradient(to_bottom,transparent,#000_15%,#000_85%,transparent)] [scrollbar-width:none]\"\n        ref={refObj}\n      >\n        <ol className=\"flex flex-col gap-1 py-[45%]\">\n          {lyrics.map((l, i) => {\n            const state = i === activeLine ? \"now\" : i < activeLine ? \"past\" : \"next\";\n            return (\n              <li data-line={i} key={`${l.time}-${i}`}>\n                <button\n                  className={cn(\n                    \"w-full cursor-pointer text-pretty rounded-lg px-2 py-1.5 text-left font-semibold tracking-tight transition-colors duration-300 ease-out hover:text-foreground\",\n                    ring,\n                    big ? \"text-2xl\" : \"text-xl leading-snug\",\n                    state === \"now\" && \"text-foreground\",\n                    state === \"past\" && \"text-foreground/70\",\n                    state === \"next\" && \"text-foreground/85\",\n                  )}\n                  onClick={() => {\n                    setPosition(l.time);\n                    setPlaying(true);\n                  }}\n                  type=\"button\"\n                >\n                  {l.text}\n                </button>\n              </li>\n            );\n          })}\n        </ol>\n      </div>\n    );\n\n  const queueList = (\n    <div className=\"flex h-full flex-col\">\n      <div className=\"px-4 pt-1 pb-2\">\n        <span className=\"font-medium text-muted-foreground text-xs\">Now playing</span>\n        <div className=\"mt-1.5 flex items-center gap-3 rounded-xl bg-accent/60 p-1.5 pe-3\">\n          <Cover art={current.art} className=\"size-9 rounded-md\" />\n          <span className=\"flex min-w-0 flex-1 flex-col\">\n            <span className=\"truncate font-medium\">{current.title}</span>\n            <span className=\"truncate text-muted-foreground text-xs\">{current.artist}</span>\n          </span>\n          <EqBars className=\"text-foreground\" playing={playing} />\n        </div>\n      </div>\n      <div className=\"flex items-center justify-between px-4 pt-2 pb-1\">\n        <span className=\"font-medium text-muted-foreground text-xs\">\n          Up next · <span className=\"tabular-nums\">{queue.length}</span> songs, <span className=\"tabular-nums\">{Math.round(queueTime / 60)}</span> min\n        </span>\n        {queue.length > 0 && (\n          <Button className={press} onClick={() => setQueue([])} size=\"xs\" variant=\"ghost\">\n            Clear\n          </Button>\n        )}\n      </div>\n      {queue.length === 0 ? (\n        <div className=\"flex flex-1 flex-col items-center justify-center gap-2 px-8 pb-10 text-center\">\n          <span className=\"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground\">\n            <ListMusicIcon className=\"size-4.5\" />\n          </span>\n          <span className=\"font-medium\">Queue's empty</span>\n          <span className=\"text-pretty text-muted-foreground text-xs\">Pick a playlist to keep the music going.</span>\n        </div>\n      ) : (\n        <Reorder.Group axis=\"y\" className=\"relative min-h-0 flex-1 overflow-y-auto px-2 pb-3\" onReorder={setQueue} values={queue}>\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            {queue.map((t, i) => (\n              <QueueRow\n                index={i}\n                key={t.id}\n                onMove={(d) => move(i, d)}\n                onPlay={() => playFromQueue(i)}\n                onRemove={() => setQueue((q) => q.filter((x) => x.id !== t.id))}\n                total={queue.length}\n                track={t}\n              />\n            ))}\n          </AnimatePresence>\n        </Reorder.Group>\n      )}\n    </div>\n  );\n\n  const sidebar = (\n    <div className=\"flex h-full flex-col gap-6 p-3\">\n      <div className=\"flex items-center gap-2.5 px-1.5 pt-1\">\n        <span className=\"flex size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground\">\n          <EqBars className=\"text-primary-foreground\" playing={false} />\n        </span>\n        <span className=\"font-heading font-semibold\">{appName}</span>\n      </div>\n      <nav aria-label=\"Main\" className=\"flex flex-col gap-0.5\">\n        {[\n          { label: \"Home\", icon: <HomeIcon />, active: true },\n          { label: \"Browse\", icon: <CompassIcon /> },\n          { label: \"Radio\", icon: <RadioIcon /> },\n        ].map((n) => (\n          <button\n            aria-current={n.active ? \"page\" : undefined}\n            className={cn(\n              \"flex h-8 cursor-pointer items-center gap-2.5 rounded-lg px-2.5 text-left [&_svg]:size-4 [&_svg]:opacity-80\",\n              ring,\n              press,\n              n.active ? \"bg-accent font-medium text-foreground\" : \"text-muted-foreground hover:bg-accent hover:text-foreground\",\n            )}\n            key={n.label}\n            type=\"button\"\n          >\n            {n.icon}\n            {n.label}\n          </button>\n        ))}\n      </nav>\n      <div className=\"flex min-h-0 flex-col gap-1\">\n        <span className=\"px-2.5 font-medium text-muted-foreground text-xs\">Playlists</span>\n        <button\n          aria-current={activePlaylist === \"liked\" || undefined}\n          className={cn(\"flex cursor-pointer items-center gap-2.5 rounded-lg p-1.5 text-left hover:bg-accent\", ring, press)}\n          onClick={() => {\n            const list = liked.map((id) => tracks.find((t) => t.id === id)).filter(Boolean) as MusicTrack[];\n            if (list.length) {\n              setActivePlaylist(\"liked\");\n              goTo(list[0], list.slice(1));\n              setPlaying(true);\n              setDrawer(false);\n            }\n          }}\n          type=\"button\"\n        >\n          <span className=\"flex size-9 shrink-0 items-center justify-center rounded-md bg-linear-to-br from-rose-400 to-fuchsia-600 text-white\">\n            <HeartIcon className=\"size-4 fill-current\" />\n          </span>\n          <span className=\"flex min-w-0 flex-1 flex-col\">\n            <span className={cn(\"truncate\", activePlaylist === \"liked\" ? \"font-medium\" : \"\")}>Liked songs</span>\n            <span className=\"text-muted-foreground text-xs tabular-nums\">\n              {liked.length} {liked.length === 1 ? \"song\" : \"songs\"}\n            </span>\n          </span>\n          {activePlaylist === \"liked\" && <EqBars className=\"me-1.5 text-foreground\" playing={playing} />}\n        </button>\n        {playlists.map((p) => (\n          <button\n            aria-current={activePlaylist === p.id || undefined}\n            className={cn(\"flex cursor-pointer items-center gap-2.5 rounded-lg p-1.5 text-left hover:bg-accent\", ring, press)}\n            key={p.id}\n            onClick={() => playPlaylist(p)}\n            type=\"button\"\n          >\n            <Cover art={p.art} className=\"size-9 rounded-md\" />\n            <span className=\"flex min-w-0 flex-1 flex-col\">\n              <span className={cn(\"truncate\", activePlaylist === p.id && \"font-medium\")}>{p.name}</span>\n              <span className=\"text-muted-foreground text-xs tabular-nums\">{p.trackIds.length} songs</span>\n            </span>\n            {activePlaylist === p.id && <EqBars className=\"me-1.5 text-foreground\" playing={playing} />}\n          </button>\n        ))}\n      </div>\n    </div>\n  );\n\n  const nowPlaying = (\n    <div className=\"flex w-full max-w-md flex-col gap-5 @3xl:gap-6\">\n      <div className=\"relative mx-auto aspect-square w-full max-w-[min(100%,300px)] @3xl:max-w-[320px]\">\n        <AnimatePresence initial={false}>\n          <motion.div\n            animate={{ opacity: 1 }}\n            aria-hidden\n            className=\"absolute inset-4 -z-10\"\n            exit={{ opacity: 0 }}\n            initial={{ opacity: 0 }}\n            key={current.id}\n            transition={{ duration: 0.5, ease: \"easeInOut\" }}\n          >\n            <Cover art={current.art} className=\"size-full scale-110 rounded-full opacity-45 blur-3xl dark:opacity-35\" />\n          </motion.div>\n        </AnimatePresence>\n        <AnimatePresence custom={direction} initial={false} mode=\"popLayout\">\n          <motion.div\n            animate={{ opacity: 1, x: 0, scale: playing ? 1 : 0.96 }}\n            className=\"size-full\"\n            exit={reduce ? { opacity: 0 } : { opacity: 0, x: -direction * 32, scale: 0.94 }}\n            initial={reduce ? { opacity: 0 } : { opacity: 0, x: direction * 32, scale: 0.94 }}\n            key={current.id}\n            transition={{ duration: 0.28, ease: easeOut }}\n          >\n            <Cover art={current.art} className=\"size-full rounded-2xl shadow-lg/15\" />\n          </motion.div>\n        </AnimatePresence>\n      </div>\n\n      <div className=\"flex items-center gap-3\">\n        <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            <motion.div\n              animate={{ opacity: 1, y: 0 }}\n              className=\"flex min-w-0 flex-col gap-0.5\"\n              exit={{ opacity: 0, y: reduce ? 0 : -4, transition: { duration: 0.1, ease: easeOut } }}\n              initial={reduce ? { opacity: 0 } : { opacity: 0, y: 4 }}\n              key={current.id}\n              transition={{ duration: 0.2, ease: easeOut }}\n            >\n              <h2 className=\"truncate font-heading font-semibold text-xl tracking-tight\">{current.title}</h2>\n              <p className=\"truncate text-muted-foreground\">\n                {current.artist} · {current.album}\n              </p>\n            </motion.div>\n          </AnimatePresence>\n        </div>\n        <button\n          aria-label={isLiked ? \"Remove from liked songs\" : \"Add to liked songs\"}\n          aria-pressed={isLiked}\n          className={cn(\n            \"flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-accent\",\n            ring,\n            press,\n            isLiked ? \"text-rose-500 dark:text-rose-400\" : \"text-muted-foreground hover:text-foreground\",\n          )}\n          onClick={toggleLike}\n          type=\"button\"\n        >\n          <motion.span\n            animate={isLiked && !reduce ? { scale: [1, 1.25, 1] } : { scale: 1 }}\n            className=\"flex\"\n            key={String(isLiked)}\n            transition={{ duration: 0.3, ease: easeOut }}\n          >\n            <HeartIcon className={cn(\"size-5\", isLiked && \"fill-current\")} />\n          </motion.span>\n        </button>\n      </div>\n\n      <Scrubber onSeek={setPosition} position={position} track={current} />\n\n      <div className=\"flex items-center justify-between\">\n        {iconButton(\"Shuffle\", toggleShuffle, <ShuffleIcon />, shuffle)}\n        <div className=\"flex items-center gap-2\">\n          {iconButton(\"Previous\", prev, <SkipBackIcon className=\"fill-current\" />)}\n          {playButton(\"lg\")}\n          {iconButton(\"Next\", () => next(), <SkipForwardIcon className=\"fill-current\" />)}\n        </div>\n        {iconButton(\n          repeat === \"one\" ? \"Repeat one\" : repeat === \"all\" ? \"Repeat all\" : \"Repeat\",\n          () => setRepeat((r) => (r === \"off\" ? \"all\" : r === \"all\" ? \"one\" : \"off\")),\n          repeat === \"one\" ? <Repeat1Icon /> : <RepeatIcon />,\n          repeat !== \"off\",\n        )}\n      </div>\n\n      <div className=\"flex items-center gap-2 text-muted-foreground\">\n        {iconButton(muted ? \"Unmute\" : \"Mute\", () => setMuted((m) => !m), <VolumeIcon className=\"!size-4.5\" />, undefined, \"size-8 text-muted-foreground\")}\n        <Slider\n          aria-label=\"Volume\"\n          getAriaLabel={() => \"Volume\"}\n          className=\"flex-1 [&_[data-slot=slider-control]]:min-w-0\"\n          max={100}\n          onValueChange={(v) => {\n            setVolume(Array.isArray(v) ? v[0] : (v as number));\n            setMuted(false);\n          }}\n          value={muted ? 0 : volume}\n        />\n        <span className=\"w-7 text-right text-xs tabular-nums\">{muted ? 0 : volume}</span>\n      </div>\n    </div>\n  );\n\n  const paneTabs: { value: Pane; label: string }[] = [\n    { value: \"playing\", label: \"Playing\" },\n    { value: \"queue\", label: \"Up next\" },\n    { value: \"lyrics\", label: \"Lyrics\" },\n  ];\n\n  return (\n    <div\n      className={cn(\"@container relative isolate flex h-[760px] w-full overflow-hidden bg-background text-foreground text-sm\", className)}\n      onKeyDown={(e) => {\n        if (e.key === \"Escape\" && drawer) setDrawer(false);\n      }}\n    >\n      <aside className=\"hidden w-60 shrink-0 overflow-y-auto border-r bg-muted/40 @5xl:block\">{sidebar}</aside>\n\n      <AnimatePresence>\n        {drawer && (\n          <>\n            <motion.div\n              animate={{ opacity: 1 }}\n              aria-hidden\n              className=\"absolute inset-0 z-40 bg-black/32 @5xl:hidden\"\n              exit={{ opacity: 0 }}\n              initial={{ opacity: 0 }}\n              key=\"scrim\"\n              onClick={() => setDrawer(false)}\n              transition={{ duration: 0.2, ease: easeOut }}\n            />\n            <motion.div\n              animate={{ x: 0 }}\n              aria-label=\"Library\"\n              aria-modal\n              className=\"absolute inset-y-0 left-0 z-50 w-72 max-w-[85%] overflow-y-auto border-r bg-background outline-none @5xl:hidden\"\n              exit={{ x: \"-100%\" }}\n              initial={{ x: \"-100%\" }}\n              key=\"drawer\"\n              ref={drawerRef}\n              role=\"dialog\"\n              tabIndex={-1}\n              transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 420, damping: 42 }}\n            >\n              <Button aria-label=\"Close library\" className=\"absolute top-3 right-3\" onClick={() => setDrawer(false)} size=\"icon-sm\" variant=\"ghost\">\n                <XIcon />\n              </Button>\n              {sidebar}\n            </motion.div>\n          </>\n        )}\n      </AnimatePresence>\n\n      <div className=\"flex min-w-0 flex-1 flex-col\">\n        <header className=\"flex h-12 shrink-0 items-center gap-2 px-3 @5xl:hidden\">\n          <Button aria-label=\"Open library\" onClick={() => setDrawer(true)} size=\"icon-sm\" variant=\"ghost\">\n            <MenuIcon />\n          </Button>\n          <span className=\"font-heading font-semibold\">{appName}</span>\n          <div aria-label=\"View\" className=\"relative ms-auto flex h-8 items-center rounded-lg bg-muted p-0.5 @3xl:hidden\" role=\"tablist\">\n            {paneTabs.map((t) => (\n              <button\n                aria-selected={pane === t.value}\n                className={cn(\"relative flex h-7 cursor-pointer items-center rounded-md px-2.5 font-medium text-xs\", ring)}\n                key={t.value}\n                onClick={() => setPane(t.value)}\n                role=\"tab\"\n                type=\"button\"\n              >\n                {pane === t.value && (\n                  <motion.span\n                    className=\"absolute inset-0 rounded-md bg-background shadow-xs/5 dark:bg-input\"\n                    layoutId=\"mp-pane\"\n                    transition={reduce ? { duration: 0 } : spring}\n                  />\n                )}\n                <span className={cn(\"relative transition-colors\", pane === t.value ? \"text-foreground\" : \"text-muted-foreground\")}>{t.label}</span>\n              </button>\n            ))}\n          </div>\n        </header>\n\n        <div className=\"flex min-h-0 flex-1\">\n          <main\n            className={cn(\n              \"min-w-0 flex-1 overflow-y-auto px-5 pt-4 pb-8 @3xl:flex @3xl:items-center @3xl:justify-center @3xl:px-8 @3xl:py-8\",\n              pane === \"playing\" ? \"flex justify-center\" : \"hidden\",\n            )}\n          >\n            {nowPlaying}\n          </main>\n\n          {pane !== \"playing\" && (\n            <div className=\"flex min-h-0 min-w-0 flex-1 flex-col @3xl:hidden\">\n              <div className=\"min-h-0 flex-1\">{pane === \"queue\" ? queueList : lyricsList(mobileLyricsRef, true)}</div>\n            </div>\n          )}\n\n          <aside className=\"hidden w-80 shrink-0 flex-col border-l @3xl:flex\">\n            <div aria-label=\"Side panel\" className=\"flex h-13 shrink-0 items-center gap-0.5 px-3\" role=\"tablist\">\n              {(\n                [\n                  { value: \"lyrics\", label: \"Lyrics\", icon: <MicVocalIcon /> },\n                  { value: \"queue\", label: \"Up next\", icon: <ListMusicIcon /> },\n                ] as const\n              ).map((t) => (\n                <button\n                  aria-selected={side === t.value}\n                  className={cn(\"relative flex h-8 cursor-pointer items-center gap-1.5 rounded-lg px-2.5 font-medium [&_svg]:size-4\", ring)}\n                  key={t.value}\n                  onClick={() => setSide(t.value)}\n                  role=\"tab\"\n                  type=\"button\"\n                >\n                  {side === t.value && (\n                    <motion.span\n                      className=\"absolute inset-0 rounded-lg bg-accent\"\n                      layoutId=\"mp-side\"\n                      transition={reduce ? { duration: 0 } : spring}\n                    />\n                  )}\n                  <span className={cn(\"relative flex items-center gap-1.5 transition-colors\", side === t.value ? \"text-foreground\" : \"text-muted-foreground\")}>\n                    {t.icon}\n                    {t.label}\n                    {t.value === \"queue\" && <span className=\"text-muted-foreground text-xs tabular-nums\">{queue.length}</span>}\n                  </span>\n                </button>\n              ))}\n            </div>\n            <div className=\"min-h-0 flex-1\">{side === \"queue\" ? queueList : lyricsList(lyricsRef)}</div>\n          </aside>\n        </div>\n\n        <AnimatePresence initial={false}>\n          {pane !== \"playing\" && (\n            <motion.div\n              animate={{ y: 0, opacity: 1 }}\n              className=\"relative shrink-0 border-t bg-background @3xl:hidden\"\n              exit={{ y: 12, opacity: 0, transition: { duration: 0.15 } }}\n              initial={reduce ? { opacity: 0 } : { y: 12, opacity: 0 }}\n              transition={{ duration: 0.22, ease: easeOut }}\n            >\n              <span className=\"absolute inset-x-0 top-0 h-0.5 bg-muted\">\n                <span className=\"block h-full origin-left bg-primary transition-transform duration-250 ease-linear\" style={{ transform: `scaleX(${position / current.duration})` }} />\n              </span>\n              <div className=\"flex items-center gap-3 px-3 py-2.5\">\n                <button className={cn(\"flex min-w-0 flex-1 cursor-pointer items-center gap-3 rounded-lg text-left\", ring)} onClick={() => setPane(\"playing\")} type=\"button\">\n                  <Cover art={current.art} className=\"size-10 rounded-md\" />\n                  <span className=\"flex min-w-0 flex-col\">\n                    <span className=\"truncate font-medium\">{current.title}</span>\n                    <span className=\"truncate text-muted-foreground text-xs\">{current.artist}</span>\n                  </span>\n                </button>\n                {playButton(\"sm\")}\n                {iconButton(\"Next\", () => next(), <SkipForwardIcon className=\"fill-current\" />)}\n              </div>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}