diff --git a/themes/lumen-glass/README.md b/themes/lumen-glass/README.md new file mode 100644 index 0000000..a76245b --- /dev/null +++ b/themes/lumen-glass/README.md @@ -0,0 +1,69 @@ +# Lumen Glass + +Apple **Liquid Glass** × **Material You** × **Pixel OS** theme for LastWave Desktop — a ground-up rebuild of the Aura theme around the liquid-glass design language. + +## Install + +1. In LastWave open **Settings → Plugins → Install Local Plugin**. +2. Choose **Choose Folder** and pick this `lumen-glass-theme` folder (the one containing `manifest.json`). +3. Click **Install & Activate**. + +Needs LastWave 3.0.0 or newer. + +## What it looks like + +- **Liquid Glass material** — deep `blur + saturate + contrast` lenses with convex perimeter highlights, chromatic inner rims and spring-physics hover states on every panel, the dock and both players. +- **Pointer-reactive specular sheen** — a soft light spot follows your cursor across the whole window, like glass catching a real light source. +- **Ambient orbs** — two slow, blurred colour fields floating behind the app, tinted by the current finish (toggle with **Alt+O**). +- **Clear ↔ Tint slider** — one dial on the Lumen Lens deck that morphs every glass surface from near-invisible (16) to frosted tinted (74), just like iOS 26's material control. + +## Canvas shell (new in 1.1.0) + +A translation layer that re-presents LastWave's real UI as the Liquid Glass canvas design. Nothing is replaced: the app keeps its own navigation, search, queue and synced lyrics. The theme restyles the live shell through LastWave's tokens and `data-lw` hooks (the same approach Better UI uses), and adds only the few pieces CSS can't make. The app's hairline divider lines are switched off in this mode — the floating panes carry their own rims. + +| Real LastWave region | Becomes | +| --- | --- | +| Title bar | Floating glass capsule toolbar, pill search, live signal-path pill (codec · bit depth / sample rate, opens Output) and a Clear↔Tint slider | +| Side rail | Capsule pane with brand block, Discover / Your Vault / Offline / Plugins labels and an "Up next" card | +| Home | Hero card (squircle art, Play/Pause, Lyrics) and a Signal path tile, filled from the playing track; sections become tonal cards | +| Queue / EQ / Output panels | Floating glass drawer inspector | +| Player bar | Floating dock capsule with a vinyl-style spinning cover and gradient scrubber | + +Press **Alt+K** (or the layers button in the player bar) for the Control Center, where **Canvas layout** switches the whole layer off to return to classic Lumen Glass. The setting is remembered. + +## Finishes (Material You seed hues) + +Burgundy, Glacier, Cosmic Orange, Night Sky, Sage, Lavender, Light Gold — plus **Adaptive**, which extracts a seed hue from the current cover art and retints the entire UI in real time. Pick one from the pill bar on the Lumen Lens deck (the active pill morphs between finishes with a Blender-style metaball goo animation), the colour dots on the Mini-Player card, or press **Alt+S** to cycle. + +## Lumen Lens deck + +A floating Liquid Glass player with squircle cover art (float-pulse while playing), live spectrum, precision scrubber, transport and like button. + +| Action | How | +| --- | --- | +| Move | Drag the header. It snaps to the left edge. | +| Resize | Drag the bottom-right corner. | +| Show / hide | **Alt+L**, the ✕ button, or the sparkle button in the player bar | +| Toggle orbs | **Alt+O** or the ◍ button | +| Control Center / Canvas layout | **Alt+K** | +| Cycle finishes | **Alt+S** or the metaball pill bar | +| Glass clarity | The Clear ↔ Tint slider | + +The deck hides itself while the Mini Player is open, and docks into a compact strip in very small windows. Shortcuts are ignored while you are typing in a text field. + +## Mini Player bar + +When the Mini Player window opens, Lumen Glass replaces its contents with a wide Liquid Glass bar that **is** the window — squircle artwork on the left; title, artist, a scrubber with the time on each side of it, and a shuffle · previous · play/pause · next · repeat transport spread across the right. ⤢ docks back to the full app and ✕ closes the Mini Player (subtle buttons in the top-right corner). + +- The bar is square-edged and opaque, so it fills the Mini Player window exactly and nothing behind the window shows through. It re-flows to any window size: portrait windows stack the artwork above the info column, narrow windows drop the artwork, short windows tighten the rows. Nothing clips. +- Shuffle and repeat light up when the app reports them. +- Grab the bar anywhere that is not a button to move the window. +- To pick a size, resize the window or set **Settings → Playback → Mini Player Style**. If the theme script fails to mount, the app's native mini player stays visible as a fallback. + +## Notes + +- Finish selection and deck position persist across restarts. +- Reduced Motion disables animation; Performance Mode pauses ambient effects and the visualiser. +- Adaptive colour sampling falls back to the track accent when artwork cannot be sampled. +- Native menus and popovers use the active finish palette; palette notifications stay clear of the player controls. + diff --git a/themes/lumen-glass/manifest.json b/themes/lumen-glass/manifest.json new file mode 100644 index 0000000..cdd5399 --- /dev/null +++ b/themes/lumen-glass/manifest.json @@ -0,0 +1,110 @@ +{ + "id": "lumen-glass-theme", + "name": "Lumen Glass", + "type": "theme", + "version": "1.0.0", + "apiVersion": 1, + "minAppVersion": "3.0.0", + "author": { + "name": "Pol Daniel Bordoy" + }, + "description": "Apple Liquid Glass × Material You × Pixel OS rebuild of Aura, now with a Canvas shell: a translation layer that re-presents LastWave's real UI.", + "tags": [ + "adaptive-color", + "canvas-layout", + "custom-ui", + "dark", + "glass", + "liquid-glass", + "material-you", + "mini-player", + "reactive", + "visualizer" + ], + "previews": [ + "preview.jpg" + ], + "swatch": [ + "#1d060d", + "#33121f", + "#f7a8c8", + "#ffffff" + ], + "variants": [ + { + "id": "burgundy", + "name": "Burgundy", + "swatch": [ + "#1d060d", + "#33121f", + "#f7a8c8" + ] + }, + { + "id": "glacier", + "name": "Glacier", + "swatch": [ + "#061017", + "#10222f", + "#a5d5f2" + ] + }, + { + "id": "orange", + "name": "Cosmic Orange", + "swatch": [ + "#1a0c02", + "#331906", + "#f5b06a" + ] + }, + { + "id": "night", + "name": "Night Sky", + "swatch": [ + "#040815", + "#0c1731", + "#9db8ee" + ] + }, + { + "id": "sage", + "name": "Sage", + "swatch": [ + "#080f0a", + "#152219", + "#b7d4c0" + ] + }, + { + "id": "lavender", + "name": "Lavender", + "swatch": [ + "#0d0716", + "#1d1231", + "#d4c4f2" + ] + }, + { + "id": "gold", + "name": "Light Gold", + "swatch": [ + "#171004", + "#2d2109", + "#ecd9a4" + ] + }, + { + "id": "adaptive", + "name": "Adaptive", + "swatch": [ + "#120610", + "#261021", + "#f2b8d4" + ] + } + ], + "updatedAt": "2026-12-05", + "entry": "theme.css", + "script": "theme.js" +} diff --git a/themes/lumen-glass/preview.jpg b/themes/lumen-glass/preview.jpg new file mode 100644 index 0000000..0f47213 Binary files /dev/null and b/themes/lumen-glass/preview.jpg differ diff --git a/themes/lumen-glass/theme.css b/themes/lumen-glass/theme.css new file mode 100644 index 0000000..22727a8 --- /dev/null +++ b/themes/lumen-glass/theme.css @@ -0,0 +1,2132 @@ +:root, +:root[data-lw-theme-variant="burgundy"], +:root[data-lumen-skin="burgundy"] { + color-scheme: dark; + --lumen-seed-hue: 344; + --lumen-seed-sat: 78%; +} + +:root[data-lw-theme-variant="glacier"], +:root[data-lumen-skin="glacier"] { + --lumen-seed-hue: 204; + --lumen-seed-sat: 76%; +} + +:root[data-lw-theme-variant="orange"], +:root[data-lumen-skin="orange"] { + --lumen-seed-hue: 24; + --lumen-seed-sat: 90%; +} + +:root[data-lw-theme-variant="night"], +:root[data-lumen-skin="night"] { + --lumen-seed-hue: 230; + --lumen-seed-sat: 72%; +} + +:root[data-lw-theme-variant="sage"], +:root[data-lumen-skin="sage"] { + --lumen-seed-hue: 152; + --lumen-seed-sat: 58%; +} + +:root[data-lw-theme-variant="lavender"], +:root[data-lumen-skin="lavender"] { + --lumen-seed-hue: 268; + --lumen-seed-sat: 72%; +} + +:root[data-lw-theme-variant="gold"], +:root[data-lumen-skin="gold"] { + --lumen-seed-hue: 40; + --lumen-seed-sat: 74%; +} + +:root[data-lw-theme-variant="adaptive"], +:root[data-lumen-skin="adaptive"] { + --lumen-seed-hue: var(--lumen-dynamic-hue, 320); + --lumen-seed-sat: var(--lumen-dynamic-sat, 74%); +} + +:root { + color-scheme: dark; + --lumen-glass-alpha: 0.42; + --lumen-mouse-x: 50%; + --lumen-mouse-y: 20%; + --lumen-bass-level: 0; + + --lumen-accent: hsl(var(--lumen-seed-hue), var(--lumen-seed-sat), 74%); + --lumen-on-accent: hsl(var(--lumen-seed-hue), 45%, 14%); + --lumen-accent-container: hsla(var(--lumen-seed-hue), 55%, 30%, 0.48); + --lumen-on-container: hsl(var(--lumen-seed-hue), 92%, 93%); + --lumen-surface-base: hsl(var(--lumen-seed-hue), 20%, 6%); + --lumen-surface-deep: hsl(var(--lumen-seed-hue), 24%, 4%); + --lumen-mini-base: hsl(var(--lumen-seed-hue), 26%, 8%); + --lumen-surface-elevated: hsla(var(--lumen-seed-hue), 18%, 12%, var(--lumen-glass-alpha)); + --lumen-surface-modal: hsl(var(--lumen-seed-hue), 20%, 11%); + --lumen-surface-card: hsla(var(--lumen-seed-hue), 16%, 16%, calc(var(--lumen-glass-alpha) * 0.85)); + --lumen-surface-card-hover: hsla(var(--lumen-seed-hue), 22%, 22%, calc(var(--lumen-glass-alpha) + 0.14)); + --lumen-glow: hsla(var(--lumen-seed-hue), 85%, 54%, 0.28); + --lumen-border: rgba(255, 255, 255, 0.14); + --lumen-border-strong: rgba(255, 255, 255, 0.26); + --lumen-text: #f5f5f7; + --lumen-text-muted: rgba(245, 245, 247, 0.68); + --lumen-text-subtle: rgba(245, 245, 247, 0.48); + --lumen-radius: 26px; + --lumen-shadow: + 0 34px 95px rgba(0, 0, 0, 0.78), + inset 0 1.5px 0 0 rgba(255, 255, 255, 0.32), + inset 0 -1px 0 0 rgba(255, 255, 255, 0.10), + inset 0 0 0 1px rgba(255, 255, 255, 0.12); +} + +:root { + --lw-bg: var(--lumen-surface-base); + --lw-bg-deep: var(--lumen-surface-deep); + --lw-bg-base: var(--lumen-surface-base); + --lw-glass-veil: var(--lumen-surface-base); + --lw-surface: color-mix(in srgb, hsl(var(--lumen-seed-hue), 16%, 16%) calc(var(--lumen-glass-alpha) * 100%), transparent); + --lw-surface-raised: var(--lumen-surface-elevated); + --lw-surface-overlay: var(--lumen-surface-modal); + --lw-bg-elevated: var(--lumen-surface-elevated); + + --lw-panel-translucent: color-mix(in srgb, hsl(var(--lumen-seed-hue), 18%, 12%) calc((var(--lumen-glass-alpha) + 0.10) * 100%), transparent); + --lw-dock-translucent: color-mix(in srgb, hsl(var(--lumen-seed-hue), 18%, 12%) calc((var(--lumen-glass-alpha) + 0.14) * 100%), transparent); + --lw-rail-translucent: color-mix(in srgb, var(--lumen-surface-base) 88%, transparent); + + --lw-outline: var(--lumen-border); + --lw-outline-soft: rgba(255, 255, 255, 0.08); + --lw-divider: rgba(255, 255, 255, 0.08); + + --lw-text-primary: var(--lumen-text); + --lw-text-secondary: var(--lumen-text-muted); + --lw-text-tertiary: var(--lumen-text-subtle); + + --lw-accent: var(--lumen-accent); + --lw-accent-ink: var(--lumen-accent); + --lw-on-accent: var(--lumen-on-accent); + --lw-accent-subtle: var(--lumen-accent-container); + --lw-focus-ring: color-mix(in srgb, var(--lumen-accent) 82%, transparent); + + --lw-wash-hover: color-mix(in srgb, var(--lumen-accent) 12%, rgba(255, 255, 255, 0.05)); + --lw-wash-pressed: color-mix(in srgb, var(--lumen-accent) 20%, rgba(255, 255, 255, 0.07)); + --lw-control-fill: color-mix(in srgb, var(--lumen-accent) 8%, rgba(255, 255, 255, 0.045)); + --lw-control-fill-hover: color-mix(in srgb, var(--lumen-accent) 14%, rgba(255, 255, 255, 0.07)); + --lw-control-stroke: rgba(255, 255, 255, 0.12); + --lw-control-stroke-bottom: var(--lumen-border); + --lw-card-fill: var(--lumen-surface-card); + --lw-card-fill-secondary: color-mix(in srgb, hsl(var(--lumen-seed-hue), 16%, 14%) calc(var(--lumen-glass-alpha) * 64%), transparent); + --lw-card-stroke: rgba(255, 255, 255, 0.11); + + --lw-scrollbar-thumb: rgba(255, 255, 255, 0.22); + accent-color: var(--lumen-accent); +} + +[data-lw="app-shell"] { + background-color: var(--lumen-surface-base) !important; + background-image: + radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--lumen-accent) 16%, transparent) 0%, transparent 46%), + radial-gradient(circle at 88% 90%, color-mix(in srgb, var(--lumen-accent) 12%, transparent) 0%, transparent 48%) !important; + transition: background-color 0.75s cubic-bezier(0.22, 1, 0.36, 1); +} + +[data-lw="title-bar"] { + background: color-mix(in srgb, hsl(var(--lumen-seed-hue), 18%, 12%) calc(var(--lumen-glass-alpha) * 100%), transparent) !important; + backdrop-filter: blur(28px) saturate(180%) !important; + -webkit-backdrop-filter: blur(28px) saturate(180%) !important; + border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important; +} + +[data-lw="sidebar"].rail { + box-shadow: inset -1px 0 0 0 rgba(255, 255, 255, 0.07) !important; +} + +[data-lw="sidebar-item"][data-active="true"] { + background: var(--lumen-accent-container) !important; + color: var(--lumen-on-container) !important; + border-radius: 9999px !important; + box-shadow: + 0 6px 18px -4px rgba(0, 0, 0, 0.35), + inset 0 1.5px 0 hsla(0, 0%, 100%, 0.36), + inset 0 0 0 1px hsla(0, 0%, 100%, 0.16) !important; + transition: all 0.28s cubic-bezier(0.34, 1.4, 0.45, 1); +} + +[data-lw="sidebar-item"]::before, +[data-lw="sidebar-item"][data-active="true"]::before, +[data-lw="sidebar-item"]:hover::before { + content: none !important; + display: none !important; + background: none !important; + box-shadow: none !important; +} + +[data-lw="sidebar-item"] { + border-radius: 9999px !important; + transition: background 0.25s ease, color 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.4, 0.45, 1); +} + +[data-lw="sidebar-item"]:hover { + background: rgba(255, 255, 255, 0.07) !important; +} + +[data-lw="player-bar"].player-dock { + --lw-dock-edge: var(--lumen-border-strong); +} + +[data-lw="player-bar"].player-dock > .dock-backdrop { + background: linear-gradient( + 180deg, + rgba(255, 255, 255, 0.13) 0%, + rgba(255, 255, 255, 0.03) 50%, + rgba(255, 255, 255, 0.09) 100% + ) !important; + backdrop-filter: blur(22px) saturate(245%) contrast(110%) !important; + -webkit-backdrop-filter: blur(22px) saturate(245%) contrast(110%) !important; + box-shadow: + inset 0 2px 1px rgba(255, 255, 255, 0.50), + inset 0 -2px 1.5px rgba(255, 255, 255, 0.20), + inset 6px 0 12px hsla(calc(var(--lumen-seed-hue) + 190), 100%, 74%, 0.10), + inset -6px 0 12px hsla(calc(var(--lumen-seed-hue) + 10), 100%, 78%, 0.10), + 0 14px 36px -6px rgba(0, 0, 0, 0.56) !important; + border-radius: 28px !important; + border: 1px solid rgba(255, 255, 255, 0.22) !important; +} + +[data-lw="player-bar"] .dock-play { + background: var(--lumen-accent) !important; + color: var(--lumen-on-accent) !important; + box-shadow: + inset 0 1px 0 rgba(255, 255, 255, 0.45), + 0 4px 16px var(--lumen-glow) !important; + transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important; +} + +[data-lw="player-bar"] .dock-play:hover { + transform: scale(1.05); +} + +[data-lw="player-bar"] .dock-play:active { + transform: scale(0.93); +} + +body.lumen-in-mini-player { + overflow: hidden !important; +} + +body.lumen-in-mini-player:has([data-lw="app-shell"]) { + background: var(--lumen-surface-base) !important; +} + +body.lumen-mini-custom, +html:has(body.lumen-mini-custom) { + margin: 0 !important; + padding: 0 !important; + width: 100%; + height: 100%; + background: var(--lumen-mini-base) !important; + background-image: none !important; + overflow: hidden !important; +} + +body.lumen-mini-custom [data-lw="mini-player"], +body.lumen-mini-custom [data-lw="app-shell"], +body.lumen-mini-custom [data-lw="app-shell"] > *, +body.lumen-mini-custom header, +body.lumen-mini-custom nav, +body.lumen-mini-custom aside:not(.lumen-mini-card), +body.lumen-mini-custom main, +body.lumen-mini-custom footer, +body.lumen-mini-custom [data-lw="sidebar"], +body.lumen-mini-custom [data-lw="side-nav"], +body.lumen-mini-custom [data-lw="nav-rail"], +body.lumen-mini-custom [data-lw="topbar"], +body.lumen-mini-custom [data-lw="content"] { + display: none !important; + background: transparent !important; + background-image: none !important; +} + +body.lumen-mini-custom #lumen-ambient-layer { + display: none !important; +} + +:root:has([data-lw="mini-player"]) .lumen-lens-deck, +body.lumen-in-mini-player .lumen-lens-deck, +[data-lw="mini-player"] ~ .lumen-lens-deck, +body:has([data-lw="mini-player"]) .lumen-lens-deck { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +[data-lw="mini-player"] { + background: + radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--lumen-accent) 20%, transparent) 0%, transparent 55%), + radial-gradient(circle at 90% 88%, color-mix(in srgb, var(--lumen-accent) 14%, transparent) 0%, transparent 55%), + var(--lumen-surface-elevated) !important; + backdrop-filter: blur(42px) saturate(215%) contrast(106%) !important; + -webkit-backdrop-filter: blur(42px) saturate(215%) contrast(106%) !important; + border-color: rgba(255, 255, 255, 0.24) !important; + box-shadow: var(--lumen-shadow) !important; + color: var(--lumen-text) !important; +} + +[data-lw="mini-player"] [data-lw="mini-player-lyrics"] { + background: var(--lumen-accent-container) !important; + border: 1px solid rgba(255, 255, 255, 0.14) !important; + color: var(--lumen-on-container) !important; + text-shadow: 0 0 20px var(--lumen-glow); +} + +[data-lw="mini-player"] .mini-play { + background: var(--lumen-accent) !important; + color: var(--lumen-on-accent) !important; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 3px 12px var(--lumen-glow) !important; +} + +[data-lw="mini-player"] .mini-progress-fill { + background: linear-gradient(90deg, var(--lumen-accent), #ffffff) !important; + box-shadow: 0 0 14px var(--lumen-glow); +} + +[data-lw="mini-player"] .mini-glyph:hover { + background: rgba(255, 255, 255, 0.12) !important; + color: var(--lumen-text) !important; +} + +:where([data-lw="main-stage"] p, [data-lw="main-stage"] h1, [data-lw="main-stage"] h2, [data-lw="main-stage"] h3, [data-lw="main-stage"] span) { + max-width: 100%; + overflow-wrap: anywhere; +} + +:where([data-lw="main-stage"] img) { + max-width: 100%; +} + +:is([role="dialog"], [role="alertdialog"], [aria-modal="true"], dialog[open], [role="menu"]):not(.lumen-cc) { + background-color: var(--lumen-surface-modal) !important; + background-image: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 50%, rgba(255, 255, 255, 0.05)) !important; + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; +} + +:where([data-lw="main-stage"] .card, [data-lw="card"]) { + border-radius: var(--lumen-radius); +} + +:where(button) { + transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s ease !important; +} + +input[type="range"] { + -webkit-appearance: none; + appearance: none; + background: transparent; + cursor: pointer; +} + +input[type="range"]::-webkit-slider-runnable-track { + height: 5px; + border-radius: 999px; + background: rgba(255, 255, 255, 0.18); +} + +input[type="range"]::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 14px; + height: 14px; + border-radius: 999px; + background: #ffffff; + margin-top: -4.5px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); + transition: transform 0.15s ease; +} + +input[type="range"]::-webkit-slider-thumb:hover { + transform: scale(1.22); +} + +::-webkit-scrollbar { + width: 6px; + height: 6px; +} +::-webkit-scrollbar-track { + background: transparent; +} +::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.16); + border-radius: 9999px; +} +::-webkit-scrollbar-thumb:hover { + background: rgba(255, 255, 255, 0.32); +} + +.lumen-ambient { + position: fixed; + inset: 0; + z-index: 0; + pointer-events: none; + overflow: hidden; +} + +.lumen-ambient-orb { + position: absolute; + border-radius: 9999px; + filter: blur(105px); + pointer-events: none; + background: var(--lumen-glow); + transition: background 0.9s ease, transform 1.2s ease; + animation: lumen-orb-float 14s ease-in-out infinite alternate; + will-change: transform; +} + +.lumen-ambient-orb.orb-2 { + animation-delay: -7s; + animation-duration: 18s; +} + +.lumen-ambient-orb.orb-1 { + width: 560px; + height: 560px; + top: -112px; + left: -96px; + opacity: 0.75; +} + +.lumen-ambient-orb.orb-2 { + width: 520px; + height: 520px; + bottom: -120px; + right: -80px; + opacity: 0.65; +} + +@keyframes lumen-orb-float { + 0% { transform: translate(0px, 0px) scale(1); } + 50% { transform: translate(55px, -40px) scale(1.1); } + 100% { transform: translate(-35px, 35px) scale(0.94); } +} + +.lumen-specular { + position: fixed; + inset: 0; + z-index: 1; + pointer-events: none; + background: radial-gradient( + 680px circle at var(--lumen-mouse-x) var(--lumen-mouse-y), + rgba(255, 255, 255, 0.075), + transparent 55% + ); + transition: opacity 0.4s ease; +} + +.lumen-lens-deck { + box-sizing: border-box; + position: fixed; + z-index: 45; + right: 24px; + bottom: 106px; + width: 400px; + height: 260px; + display: flex; + flex-direction: column; + justify-content: space-between; + border-radius: 34px; + user-select: none; + overflow: hidden; + color: var(--lumen-text); + font-family: inherit; + background: + linear-gradient(165deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.02) 48%, rgba(255, 255, 255, 0.11) 100%), + var(--lumen-surface-elevated); + backdrop-filter: blur(32px) saturate(230%) contrast(108%); + -webkit-backdrop-filter: blur(32px) saturate(230%) contrast(108%); + border: 1px solid rgba(255, 255, 255, 0.26); + box-shadow: + 0 34px 85px -10px rgba(0, 0, 0, 0.85), + 0 0 55px -10px var(--lumen-glow), + inset 0 2.5px 1px rgba(255, 255, 255, 0.55), + inset 0 -2.5px 1.5px rgba(255, 255, 255, 0.24), + inset 10px 0 18px hsla(calc(var(--lumen-seed-hue) + 190), 100%, 76%, 0.13), + inset -10px 0 18px hsla(calc(var(--lumen-seed-hue) + 10), 100%, 78%, 0.13), + inset 0 0 0 1px rgba(255, 255, 255, 0.16); + transition: border-color 0.3s ease, box-shadow 0.35s ease, opacity 0.2s ease, transform 0.2s ease; +} + +.lumen-lens-deck:hover { + border-color: rgba(255, 255, 255, 0.38); +} + +.lumen-lens-deck.is-hidden { + opacity: 0; + visibility: hidden; + pointer-events: none; + transform: scale(0.96) translateY(8px); + transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s; +} + +.lumen-deck-header { + display: flex; + align-items: center; + justify-content: space-between; + flex: none; + gap: 8px; + padding: 12px 16px 8px; + cursor: grab; +} + +.lumen-deck-header:active { + cursor: grabbing; +} + +.lumen-deck-brand { + display: inline-flex; + align-items: center; + gap: 8px; + flex-shrink: 0; +} + +.lumen-brand-pill { + display: inline-flex; + align-items: center; + gap: 7px; + padding: 4px 11px; + border-radius: 9999px; + background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 50%, rgba(255, 255, 255, 0.12) 100%); + border: 1px solid rgba(255, 255, 255, 0.26); + box-shadow: + inset 0 2px 1px rgba(255, 255, 255, 0.45), + 0 4px 14px -3px rgba(0, 0, 0, 0.5); + font-size: 10.5px; + font-weight: 700; + letter-spacing: 0.05em; +} + +.lumen-brand-dot { + width: 7px; + height: 7px; + border-radius: 50%; + background: var(--lumen-accent); + box-shadow: 0 0 10px var(--lumen-accent); + animation: lumen-pulse 2.4s ease-in-out infinite; +} + +@keyframes lumen-pulse { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.45; } +} + +.lumen-header-actions { + display: flex; + align-items: center; + gap: 5px; +} + +.lumen-icon-btn { + appearance: none; + border: 1px solid transparent; + background: rgba(255, 255, 255, 0.08); + color: var(--lumen-text-muted); + border-radius: 9999px; + width: 25px; + height: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + font-size: 11px; + cursor: pointer; + font-family: inherit; + flex: none; + line-height: 1; + overflow: hidden; + transition: all 0.25s cubic-bezier(0.34, 1.4, 0.45, 1); +} + +.lumen-icon-btn:hover { + color: var(--lumen-text); + background: rgba(255, 255, 255, 0.16); + transform: scale(1.06); +} + +.lumen-icon-btn:active { + transform: scale(0.92); +} + +.lumen-icon-btn.active { + background: var(--lumen-accent-container); + color: var(--lumen-on-container); + border-color: rgba(255, 255, 255, 0.24); +} + +.lumen-icon-btn:focus-visible, +.lumen-lens-deck button:focus-visible { + outline: 2px solid var(--lumen-accent); + outline-offset: 2px; +} + +.lumen-deck-body { + flex: 1 1 0; + min-height: 0; + overflow: hidden; + display: flex; + flex-direction: column; + gap: 8px; + padding: 2px 16px 0; +} + +.lumen-finish-bar { + position: relative; + display: inline-flex; + align-items: center; + padding: 6px; + border-radius: 9999px; + background: rgba(0, 0, 0, 0.22); + border: 1px solid rgba(255, 255, 255, 0.12); + overflow: hidden; + flex: none; + max-width: 100%; +} + +.lumen-metaball-stage { + position: absolute; + inset: 0; + pointer-events: none; + border-radius: inherit; + overflow: hidden; + filter: url(#lumen-metaball-filter); +} + +.lumen-metaball-blob { + position: absolute; + top: 6px; + bottom: 6px; + border-radius: 9999px; + background: var(--lumen-accent); + left: 6px; + width: 64px; + transition: + left 0.52s cubic-bezier(0.34, 1.48, 0.44, 1), + width 0.52s cubic-bezier(0.34, 1.48, 0.44, 1), + transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), + opacity 0.2s ease; + will-change: left, width, transform; +} + +.lumen-metaball-blob.hover-blob { + top: 8px; + bottom: 8px; + opacity: 0; +} + +.lumen-metaball-lens { + position: absolute; + top: 6px; + bottom: 6px; + left: 6px; + width: 64px; + border-radius: 9999px; + pointer-events: none; + background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.04) 48%, rgba(255, 255, 255, 0.16) 100%); + box-shadow: + inset 0 1.5px 0.5px rgba(255, 255, 255, 0.65), + inset 0 -1.5px 1px rgba(255, 255, 255, 0.22), + 0 6px 20px rgba(0, 0, 0, 0.32); + transition: + left 0.52s cubic-bezier(0.34, 1.48, 0.44, 1), + width 0.52s cubic-bezier(0.34, 1.48, 0.44, 1), + transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1); +} + +.lumen-finish-btn { + appearance: none; + border: none; + background: transparent; + position: relative; + z-index: 1; + padding: 5px 11px; + border-radius: 9999px; + font-size: 10px; + font-weight: 700; + letter-spacing: 0.02em; + color: var(--lumen-text-muted); + cursor: pointer; + font-family: inherit; + white-space: nowrap; + transition: color 0.2s ease; +} + +.lumen-finish-btn:hover { + color: var(--lumen-text); +} + +.lumen-finish-btn.active { + color: var(--lumen-on-accent); +} + +.lumen-deck-stage { + display: flex; + align-items: stretch; + gap: 14px; + flex: 1; + min-height: 0; +} + +.lumen-art-wrap { + align-self: center; + position: relative; + width: 84px; + height: 84px; + flex-shrink: 0; + border-radius: 22px; + overflow: hidden; + box-shadow: + 0 22px 48px -12px rgba(0, 0, 0, 0.68), + 0 0 0 1px rgba(255, 255, 255, 0.18), + inset 0 1px 0 rgba(255, 255, 255, 0.32); +} + +.lumen-lens-deck.is-playing .lumen-art-wrap { + animation: lumen-art-float 4.5s ease-in-out infinite; +} + +.lumen-art-wrap img { + width: 100%; + height: 100%; + object-fit: cover; + display: block; + background: hsl(var(--lumen-seed-hue), 22%, 16%); +} + +.lumen-art-wrap img.lumen-spin-art { + animation: lumen-spin 22s linear infinite; + animation-play-state: paused; +} + +.lumen-lens-deck.is-playing .lumen-art-wrap img.lumen-spin-art { + animation-play-state: running; +} + +@keyframes lumen-spin { + to { transform: rotate(360deg); } +} + +@keyframes lumen-art-float { + 0%, 100% { + transform: translateY(0px) scale(1); + box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.65), 0 0 25px -5px var(--lumen-glow), + 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.32); + } + 50% { + transform: translateY(-4px) scale(1.015); + box-shadow: 0 28px 55px -10px rgba(0, 0, 0, 0.75), 0 0 42px 2px var(--lumen-glow), + 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.32); + } +} + +.lumen-telemetry { + display: flex; + flex-direction: column; + justify-content: space-between; + flex: 1; + min-width: 0; + min-height: 0; + height: 100%; + max-height: 100%; + gap: 6px; +} + +.lumen-meta-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; +} + +.lumen-track-title { + font-size: 13px; + font-weight: 800; + letter-spacing: -0.01em; + color: var(--lumen-text); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.lumen-track-artist { + font-size: 11px; + color: var(--lumen-text-muted); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.lumen-codec-pill { + font-size: 9px; + font-weight: 700; + letter-spacing: 0.05em; + padding: 3px 8px; + border-radius: 9999px; + background: var(--lumen-accent-container); + border: 1px solid rgba(255, 255, 255, 0.2); + color: var(--lumen-on-container); + font-family: ui-monospace, "SF Mono", Consolas, monospace; + flex-shrink: 0; +} + +.lumen-viz-canvas { + width: 100%; + flex: 1 1 0; + + min-height: 0; + height: 0; + border-radius: 12px; + background: rgba(0, 0, 0, 0.22); + border: 1px solid rgba(255, 255, 255, 0.08); +} + +.lumen-scrubber-group { + position: relative; + width: 100%; + height: 20px; + display: flex; + align-items: center; + cursor: pointer; + user-select: none; +} + +.lumen-scrubber-track { + height: 5px; + width: 100%; + border-radius: 9999px; + background: rgba(255, 255, 255, 0.16); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.35); + transition: height 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease; + position: relative; +} + +.lumen-scrubber-group:hover .lumen-scrubber-track { + height: 7px; + background: rgba(255, 255, 255, 0.24); +} + +.lumen-scrubber-fill { + height: 100%; + border-radius: 9999px; + background: linear-gradient(90deg, var(--lumen-accent), #ffffff); + box-shadow: 0 0 14px var(--lumen-glow); + transition: width 0.12s linear; +} + +.lumen-scrubber-thumb { + position: absolute; + top: 50%; + width: 14px; + height: 14px; + border-radius: 9999px; + background: #ffffff; + border: 1px solid rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); + opacity: 0; + transform: translate(-50%, -50%) scale(0.75); + transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1); + pointer-events: none; +} + +.lumen-scrubber-group:hover .lumen-scrubber-thumb { + opacity: 1; + transform: translate(-50%, -50%) scale(1); +} + +.lumen-deck-scrub-row { + display: flex; + align-items: center; + gap: 8px; + flex: none; + min-width: 0; +} + +.lumen-deck-time { + flex: none; + font: 600 10px/1 ui-monospace, "SF Mono", Consolas, monospace; + font-variant-numeric: tabular-nums; + color: var(--lumen-text-muted); +} + +.lumen-deck-scrub-row .lumen-scrubber-group { + flex: 1; + min-width: 0; + width: auto; +} + +.lumen-deck-bottom { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + padding: 8px 14px 12px; + min-width: 0; + flex: none; +} + +.lumen-clarity { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 5px 12px; + border-radius: 9999px; + background: rgba(255, 255, 255, 0.07); + border: 1px solid rgba(255, 255, 255, 0.12); + flex: none; +} + +.lumen-clarity label { + flex: none; + font-size: 9px; + line-height: 1; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.08em; + white-space: nowrap; + color: var(--lumen-text-subtle); +} + +.lumen-clarity input[type="range"] { + flex: none; + width: 64px; + margin: 0; +} + +.lumen-lens-deck.is-compact .lumen-clarity label { + display: none; +} + +.lumen-lens-deck.is-compact .lumen-clarity input[type="range"] { + width: 56px; +} + +.lumen-transport { + display: flex; + align-items: center; + gap: 6px; + flex: none; + margin-left: auto; +} + +.lumen-lens-deck.is-narrow .lumen-clarity { + display: none; +} + +.lumen-lens-deck.is-narrow .lumen-transport { + margin-left: auto; +} + +.lumen-play-btn { + appearance: none; + border: none; + width: 34px; + height: 34px; + border-radius: 50%; + background: var(--lumen-accent); + color: var(--lumen-on-accent); + font-size: 12px; + font-weight: 700; + cursor: pointer; + display: inline-flex; + align-items: center; + justify-content: center; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 16px var(--lumen-glow); + transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); + font-family: inherit; +} + +.lumen-play-btn:hover { + transform: scale(1.07); +} + +.lumen-play-btn:active { + transform: scale(0.92); +} + +.lumen-like-btn.active { + color: #fb7185; +} + +.lumen-resize-handle { + position: absolute; + right: 5px; + bottom: 5px; + width: 14px; + height: 14px; + cursor: nwse-resize; + opacity: 0.6; + border-radius: 0 0 8px 0; + background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.55) 50%); +} + +.lumen-resize-handle:hover { + opacity: 1; +} + +.lumen-mini-card { + --mini-pad: clamp(14px, 7cqh, 26px); + --mini-gap: clamp(10px, 4.5cqh, 20px); + position: fixed; + + inset: -2px; + z-index: 60; + box-sizing: border-box; + width: calc(100% + 4px); + height: calc(100% + 4px); + container: lumenmini / size; + overflow: hidden; + user-select: none; + cursor: grab; + color: var(--lumen-text); + font-family: inherit; + + border-radius: 0; + + background: + radial-gradient(130% 130% at 8% -20%, hsla(var(--lumen-seed-hue), 68%, 44%, 0.36), transparent 62%), + radial-gradient(120% 120% at 102% 122%, hsla(calc(var(--lumen-seed-hue) + 18), 62%, 40%, 0.28), transparent 62%), + linear-gradient(165deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.03) 48%, rgba(255, 255, 255, 0.10) 100%), + var(--lumen-mini-base); + border: 0; + + box-shadow: + inset 0 2px 1px rgba(255, 255, 255, 0.35), + inset 0 -2px 1.5px rgba(255, 255, 255, 0.14), + inset 0 0 0 3px rgba(255, 255, 255, 0.10); + + animation: lumen-mini-fade-in 0.28s ease-out; +} + +@keyframes lumen-mini-fade-in { + 0% { opacity: 0; } + 100% { opacity: 1; } +} + +.lumen-mini-card:active { + cursor: grabbing; +} + +.lumen-mini-card::before { + content: ""; + position: absolute; + inset: 0; + pointer-events: none; + background: radial-gradient(420px circle at var(--lumen-mouse-x, 50%) var(--lumen-mouse-y, 20%), rgba(255, 255, 255, 0.09), transparent 55%); +} + +.lumen-mini-card button:focus-visible { + outline: 2px solid var(--lumen-accent); + outline-offset: 2px; +} + +.lumen-mini-body { + position: relative; + z-index: 1; + box-sizing: border-box; + width: 100%; + height: 100%; + min-width: 0; + min-height: 0; + padding: var(--mini-pad); + display: flex; + align-items: center; + gap: var(--mini-gap); +} + +.lumen-mini-art { + height: min(100%, 44cqw); + aspect-ratio: 1 / 1; + flex: none; + border-radius: clamp(14px, 8cqh, 32px); + overflow: hidden; + background: linear-gradient(135deg, hsl(var(--lumen-seed-hue), 40%, 30%), hsl(calc(var(--lumen-seed-hue) + 35), 45%, 20%)); + box-shadow: + 0 18px 40px -12px rgba(0, 0, 0, 0.65), + 0 0 0 1px rgba(255, 255, 255, 0.16), + inset 0 1px 0 rgba(255, 255, 255, 0.28); +} + +.lumen-mini-card.is-playing .lumen-mini-art { + animation: lumen-art-float 4.5s ease-in-out infinite; +} + +.lumen-mini-art img { + width: 100%; + height: 100%; + object-fit: cover; + display: block; +} + +.lumen-mini-art img:not([src]), +.lumen-mini-art img[src=""] { + visibility: hidden; +} + +.lumen-mini-info { + flex: 1; + min-width: 0; + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + gap: var(--mini-gap); + padding-right: 2px; +} + +.lumen-mini-texts { + min-width: 0; + display: flex; + flex-direction: column; + gap: 2px; + padding-right: 56px; +} + +.lumen-mini-title { + min-width: 0; + font-size: clamp(15px, 12cqh, 34px); + font-weight: 800; + letter-spacing: -0.02em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.lumen-mini-artist { + min-width: 0; + font-size: clamp(12px, 7cqh, 22px); + font-weight: 500; + color: rgba(255, 255, 255, 0.78); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.lumen-mini-scrub-row { + display: flex; + align-items: center; + gap: 12px; + min-width: 0; +} + +.lumen-mini-times { + flex: none; + font-family: ui-monospace, "SF Mono", Consolas, monospace; + font-size: clamp(10px, 5.5cqh, 15px); + font-weight: 600; + font-variant-numeric: tabular-nums; + color: rgba(255, 255, 255, 0.92); +} + +.lumen-mini-card .lumen-scrubber-group { + flex: 1; + min-width: 0; +} + +.lumen-mini-card .lumen-scrubber-track { + background: rgba(255, 255, 255, 0.32) !important; + background-image: none !important; +} + +.lumen-mini-card .lumen-scrubber-fill { + background: #ffffff !important; + box-shadow: none !important; +} + +.lumen-mini-card .lumen-scrubber-thumb { + width: clamp(10px, 5.5cqh, 16px); + height: clamp(10px, 5.5cqh, 16px); + background: #ffffff; + opacity: 1; + transform: translate(-50%, -50%) scale(1); + box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); +} + +.lumen-mini-transport-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; + min-width: 0; +} + +.lumen-mini-ghost, +.lumen-mini-skip, +.lumen-mini-play { + appearance: none; + border: 0; + background: none; + color: #ffffff; + cursor: pointer; + padding: 0; + border-radius: 9999px; + display: grid; + place-items: center; + flex: none; + font-family: inherit; + transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease, opacity 0.2s ease; +} + +.lumen-mini-ghost { + width: clamp(22px, 12cqh, 38px); + height: clamp(22px, 12cqh, 38px); + color: rgba(255, 255, 255, 0.85); +} + +.lumen-mini-ghost svg, +.lumen-mini-skip svg { + width: 68%; + height: 68%; +} + +.lumen-mini-ghost:hover { color: #ffffff; transform: scale(1.08); } +.lumen-mini-ghost:active { transform: scale(0.92); } + +.lumen-mini-ghost.active { + color: var(--lumen-accent); + filter: drop-shadow(0 0 8px var(--lumen-glow)); +} + +.lumen-mini-skip { + width: clamp(26px, 14cqh, 44px); + height: clamp(26px, 14cqh, 44px); +} + +.lumen-mini-skip:hover { transform: scale(1.08); } +.lumen-mini-skip:active { transform: scale(0.92); } + +.lumen-mini-play { + width: clamp(34px, 20cqh, 62px); + height: clamp(34px, 20cqh, 62px); +} + +.lumen-mini-play svg { width: 100%; height: 100%; } +.lumen-mini-play:hover { transform: scale(1.06); } +.lumen-mini-play:active { transform: scale(0.93); } + +.lumen-mini-win { + position: absolute; + top: 10px; + right: 12px; + z-index: 2; + display: flex; + align-items: center; + gap: 4px; +} + +.lumen-mini-win .lumen-icon-btn { + width: 24px; + height: 24px; + font-size: 11px; + border: 0; + background: rgba(255, 255, 255, 0.10); + color: rgba(255, 255, 255, 0.55); + opacity: 0.8; +} + +.lumen-mini-win .lumen-icon-btn:hover { + color: #ffffff; + background: rgba(255, 255, 255, 0.20); + opacity: 1; +} + +@container lumenmini (max-aspect-ratio: 4/5) { + .lumen-mini-body { + flex-direction: column; + justify-content: center; + align-items: center; + } + .lumen-mini-art { + height: auto; + width: min(56cqw, 42cqh); + } + .lumen-mini-info { + width: 100%; + flex: none; + } + .lumen-mini-texts { + padding-right: 0; + text-align: center; + align-items: center; + } + .lumen-mini-scrub-row, + .lumen-mini-transport-row { + width: 100%; + } + .lumen-mini-win { + top: 8px; + right: 10px; + } +} + +@container lumenmini (max-width: 339px) { + .lumen-mini-art { + display: none; + } +} + +@container lumenmini (max-width: 289px) { + .lumen-mini-ghost { + display: none; + } + .lumen-mini-transport-row { + justify-content: center; + gap: 18px; + } + .lumen-mini-texts { + padding-right: 0; + } +} + +@container lumenmini (max-height: 139px) { + .lumen-mini-artist { + display: none; + } + .lumen-mini-texts { + padding-right: 52px; + } +} + +@container lumenmini (max-height: 109px) { + .lumen-mini-card { + --mini-pad: 10px; + --mini-gap: 6px; + } + .lumen-mini-title { + font-size: 14px; + } + .lumen-mini-play { + width: 30px; + height: 30px; + } + .lumen-mini-skip { + width: 24px; + height: 24px; + } + .lumen-mini-ghost { + width: 20px; + height: 20px; + } + .lumen-mini-times { + font-size: 9px; + } +} + +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-lens-deck { + left: 12px !important; + right: 12px !important; + top: auto !important; + bottom: 84px !important; + width: calc(100vw - 24px) !important; + height: 84px !important; + min-width: 0 !important; + min-height: 84px !important; + border-radius: 26px !important; + padding: 0 !important; + flex-direction: row !important; + align-items: center !important; + gap: 12px; +} + +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-deck-header, +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-resize-handle, +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-finish-bar { + display: none !important; +} + +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-deck-body { + padding: 0 14px !important; + flex-direction: row !important; + align-items: center !important; + min-height: 0 !important; + overflow: hidden !important; +} + +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-deck-stage { + height: 100% !important; + min-height: 0 !important; + min-width: 0 !important; +} + +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-art-wrap { + width: 52px !important; + height: 52px !important; + border-radius: 15px !important; +} + +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-deck-bottom { + padding: 0 14px 0 0 !important; + flex-shrink: 0; +} + +body.lumen-compact-docked:not(.lumen-in-mini-player) .lumen-clarity { + display: none !important; +} + +@media (prefers-reduced-motion: reduce) { + .lumen-ambient-orb, + .lumen-brand-dot, + .lumen-art-wrap, + .lumen-mini-art, + .lumen-art-wrap img.lumen-spin-art { + animation: none !important; + } + + .lumen-lens-deck, + .lumen-lens-deck *, + .lumen-mini-card, + .lumen-mini-card * { + transition-duration: 0.01ms !important; + animation-duration: 0.01ms !important; + } +} + +:root[data-performance="true"] .lumen-specular, +:root[data-performance="true"] .lumen-ambient { + display: none !important; +} + +:root[data-lumen-shell="canvas"] { + --lw-titlebar-h: 58px; + --lw-dock-h: 84px; + --lw-rail-expanded: 236px; + --lw-rail-collapsed: 84px; + --lumen-pane-gap: 14px; + --lumen-pane-radius: 26px; + --lumen-pane-fill: color-mix(in srgb, hsl(var(--lumen-seed-hue), 18%, 12%) calc(var(--lumen-glass-alpha) * 100%), transparent); + --lumen-pane-rim: + inset 0 1.5px 0 rgba(255, 255, 255, 0.30), + inset 0 -1px 0 rgba(255, 255, 255, 0.09), + inset 0 0 0 1px rgba(255, 255, 255, 0.11); + + --lw-divider: transparent; +} + +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] hr, +:root[data-lumen-shell="canvas"] [data-lw="divider"], +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] [class*="divide-y"] > * + * { + border: none !important; + box-shadow: none !important; + background: none !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="player-bar"] { + background: transparent !important; + border: 0 !important; + box-shadow: none !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="app-shell"] > *:not([data-lw="title-bar"]):not([data-lw="sidebar"]):not([data-lw="main-stage"]):not([data-lw="player-bar"]) { + background: transparent !important; + background-image: none !important; + border: 0 !important; + box-shadow: none !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="app-shell"] :is(header, footer):not([data-lw="title-bar"]):not([data-lw="player-bar"]), +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] header { + border: 0 !important; + box-shadow: none !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="app-shell"] { + position: relative; + z-index: 2; + padding: 10px 0 0; +} + +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] { + margin: 0 var(--lumen-pane-gap); + width: auto !important; + height: var(--lw-titlebar-h) !important; + border: 1px solid rgba(255, 255, 255, 0.16) !important; + border-radius: 9999px !important; + background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03) 55%, rgba(255,255,255,0.08)), var(--lumen-pane-fill) !important; + box-shadow: var(--lumen-pane-rim), 0 14px 36px -10px rgba(0, 0, 0, 0.55) !important; + backdrop-filter: blur(22px) saturate(220%) contrast(106%) !important; + -webkit-backdrop-filter: blur(22px) saturate(220%) contrast(106%) !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] .title-bar { + height: 100%; + padding-inline: 10px; + gap: 6px; + + background: transparent !important; + background-image: none !important; + border: 0 !important; + box-shadow: none !important; + border-radius: inherit; +} + +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] { + background-clip: padding-box !important; + isolation: isolate; +} + +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] .bar-btn { + border-radius: 9999px !important; + transition: background 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); +} +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] .bar-btn:hover:not(:disabled) { + background: rgba(255, 255, 255, 0.14) !important; + transform: scale(1.06); +} +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] .bar-btn:active:not(:disabled) { + transform: scale(0.92); +} + +:root[data-lumen-shell="canvas"] [data-lw="title-search"] { + height: 34px !important; + max-width: 420px !important; + border-radius: 9999px !important; + padding-left: 32px !important; + border: 1px solid rgba(255, 255, 255, 0.2) !important; + background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03) 50%, rgba(255,255,255,0.08)) !important; + box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.35), inset 0 -2px 1.5px rgba(255, 255, 255, 0.14) !important; + transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease !important; +} +:root[data-lumen-shell="canvas"] [data-lw="title-search"]:focus { + border-color: var(--lumen-accent) !important; + box-shadow: 0 0 0 3px color-mix(in srgb, var(--lumen-accent) 28%, transparent), inset 0 2px 1px rgba(255, 255, 255, 0.4) !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] { + z-index: 30; +} +:root[data-lumen-shell="canvas"] [data-lw="title-bar"], +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] .title-bar { + overflow: visible !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] :is([role="listbox"], [class*="dropdown"], [class*="suggest"], [class*="search-results"], [class*="search-panel"], [class*="search-popover"], [data-lw*="search-results"], [data-lw*="search-dropdown"], [data-lw*="suggest"]) { + box-sizing: border-box; + margin-top: 10px !important; + padding: 8px !important; + z-index: 80 !important; + max-height: min(460px, calc(100vh - 140px)); + overflow-x: hidden; + overflow-y: auto; + border-radius: 22px !important; + border: 1px solid rgba(255, 255, 255, 0.16) !important; + background-color: var(--lumen-surface-modal) !important; + background-image: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 50%, rgba(255, 255, 255, 0.05)) !important; + box-shadow: + inset 0 1px 0 rgba(255, 255, 255, 0.18), + 0 24px 60px -12px rgba(0, 0, 0, 0.75) !important; + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; + scrollbar-width: thin; + scrollbar-color: rgba(255, 255, 255, 0.22) transparent; +} + +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] :is([role="listbox"], [class*="dropdown"], [class*="suggest"], [class*="search-results"], [class*="search-panel"], [class*="search-popover"]) :is([role="listbox"], [class*="dropdown"], [class*="suggest"], [class*="search-results"], [class*="search-panel"], [class*="search-popover"]) { + margin: 0 !important; + padding: 0 !important; + max-height: none; + overflow: visible; + border: 0 !important; + background: none !important; + box-shadow: none !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] :is([role="option"], [data-lw$="-row"], [class*="result-item"], [class*="suggestion"]) { + border-radius: 16px !important; + transition: background 0.2s ease; +} +:root[data-lumen-shell="canvas"] [data-lw="title-bar"] :is([role="option"], [data-lw$="-row"], [class*="result-item"], [class*="suggestion"]):is(:hover, [aria-selected="true"], [data-active="true"], .active, .selected, :focus-visible) { + background: color-mix(in srgb, var(--lumen-accent) 16%, rgba(255, 255, 255, 0.04)) !important; +} + +[data-lumen-popover] { + box-sizing: border-box; + margin-top: 10px !important; + padding: 8px !important; + z-index: 80 !important; + max-height: min(460px, calc(100vh - 140px)); + overflow-x: hidden; + overflow-y: auto; + border-radius: 22px !important; + border: 1px solid rgba(255, 255, 255, 0.16) !important; + background-color: var(--lumen-surface-modal) !important; + background-image: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 50%, rgba(255, 255, 255, 0.05)) !important; + box-shadow: + inset 0 1px 0 rgba(255, 255, 255, 0.18), + 0 24px 60px -12px rgba(0, 0, 0, 0.75) !important; + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; + opacity: 1 !important; +} +[data-lumen-popover] * { + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; +} +[data-lumen-popover] :is([role="option"], button, a, li):not([aria-label*="ore" i]):hover { + background: color-mix(in srgb, var(--lumen-accent) 16%, rgba(255, 255, 255, 0.04)) !important; + border-radius: 16px; +} + +.lumen-hdr-slot { + display: flex; + align-items: center; + gap: 8px; + margin-left: auto; + padding-right: 4px; + + flex: 0 1 auto; + min-width: 0; + overflow: hidden; +} +.lumen-capsule { + position: relative; + display: inline-flex; + align-items: center; + gap: 8px; + padding: 5px 12px; + border-radius: 9999px; + border: 1px solid rgba(255, 255, 255, 0.22); + background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.03) 50%, rgba(255,255,255,0.10)); + box-shadow: + inset 0 2px 1px rgba(255, 255, 255, 0.45), + inset 0 -2px 1.5px rgba(255, 255, 255, 0.18), + inset 6px 0 12px hsla(calc(var(--lumen-seed-hue) + 190), 100%, 74%, 0.10), + inset -6px 0 12px hsla(calc(var(--lumen-seed-hue) + 10), 100%, 78%, 0.10); + color: var(--lumen-text); + font: 500 11px/1 ui-monospace, "JetBrains Mono", SFMono-Regular, Consolas, monospace; + letter-spacing: -0.01em; + white-space: nowrap; + cursor: pointer; + flex: none; + transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, background 0.25s ease; +} +.lumen-capsule.lumen-dac { + flex: 0 1 auto; + min-width: 0; + max-width: 260px; +} +.lumen-capsule .lumen-dac-text { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; +} +.lumen-capsule:hover { transform: scale(1.03); border-color: rgba(255, 255, 255, 0.36); } +.lumen-capsule:active { transform: scale(0.96); } +.lumen-capsule .lumen-pulse { + position: relative; + width: 8px; + height: 8px; + border-radius: 9999px; + background: var(--lumen-accent); + flex: none; +} +.lumen-capsule .lumen-pulse::after { + content: ""; + position: absolute; + inset: 0; + border-radius: inherit; + background: var(--lumen-accent); + opacity: 0; +} +.lumen-capsule.is-live .lumen-pulse::after { animation: lumen-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; } +@keyframes lumen-ping { 0% { transform: scale(1); opacity: 0.75; } 100% { transform: scale(2.8); opacity: 0; } } +.lumen-capsule .lumen-chip { + padding: 3px 8px; + border-radius: 9999px; + background: var(--lumen-accent-container); + color: var(--lumen-on-container); + font: 700 10px/1 var(--lw-font-family, system-ui, sans-serif); +} +.lumen-clarity-mini { cursor: default; gap: 8px; font: 600 10px/1 var(--lw-font-family, system-ui, sans-serif); color: var(--lumen-text-muted); } +.lumen-clarity-mini input[type="range"] { width: 64px; accent-color: var(--lumen-accent); } +@media (max-width: 1500px) { .lumen-clarity-mini { display: none; } } +@media (max-width: 900px) { .lumen-capsule.lumen-dac .lumen-dac-text { display: none; } } + +:root[data-lumen-shell="canvas"] [data-lw="sidebar"].rail { + margin: var(--lumen-pane-gap) 0 var(--lumen-pane-gap) var(--lumen-pane-gap) !important; + border-radius: var(--lumen-pane-radius); + border: 1px solid rgba(255, 255, 255, 0.16); + background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.07)), var(--lumen-pane-fill) !important; + box-shadow: var(--lumen-pane-rim), 0 18px 44px -14px rgba(0, 0, 0, 0.6) !important; + backdrop-filter: blur(24px) saturate(200%) !important; + -webkit-backdrop-filter: blur(24px) saturate(200%) !important; + display: flex; + flex-direction: column; + height: auto; + min-height: 0; + max-height: calc(100% - var(--lumen-pane-gap) * 2); + overflow: hidden; +} +:root[data-lumen-shell="canvas"] [data-lw="sidebar"].rail .rail-nav { + flex: 1 1 auto; + min-height: 0; + height: auto; + padding: 4px 10px 10px; + overflow-y: auto; + overflow-x: hidden; +} +:root[data-lumen-shell="canvas"] .rail .rail-sep, +:root[data-lumen-shell="canvas"] .rail .rail-bottom-sep { display: none; } +:root[data-lumen-shell="canvas"] .rail .rail-group { gap: 4px; } +:root[data-lumen-shell="canvas"] .rail .rail-scroll > .rail-group { margin-bottom: 14px; } + +:root[data-lumen-shell="canvas"] .rail.expanded .rail-scroll > .rail-group::before { + display: block; + padding: 0 14px 6px; + font: 700 10px/1 var(--lw-font-family, system-ui, sans-serif); + letter-spacing: 0.14em; + text-transform: uppercase; + color: rgba(245, 245, 247, 0.45); +} +:root[data-lumen-shell="canvas"] .rail.expanded .rail-scroll > .rail-group:nth-child(1)::before { content: "Discover"; } +:root[data-lumen-shell="canvas"] .rail.expanded .rail-scroll > .rail-group:nth-child(3)::before { content: "Your Vault"; } +:root[data-lumen-shell="canvas"] .rail.expanded .rail-scroll > .rail-group:nth-child(5)::before { content: "Offline"; } +:root[data-lumen-shell="canvas"] .rail.expanded .rail-scroll > .rail-group:nth-child(7)::before { content: "Plugins"; } +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-scroll > .rail-group:not(:first-child) { + padding-top: 10px; + border-top: 1px solid rgba(255, 255, 255, 0.07); +} + +:root[data-lumen-shell="canvas"] .rail .rail-item { + height: 42px; + width: 100%; + max-width: 100%; + box-sizing: border-box; + overflow: hidden; + font-weight: 600; +} +:root[data-lumen-shell="canvas"] .rail .rail-item svg, +:root[data-lumen-shell="canvas"] .rail .rail-item .icon, +:root[data-lumen-shell="canvas"] .rail .rail-item img { + flex: none; + max-width: 100%; +} +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-item { + justify-content: center; +} + +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-nav, +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-scroll { + scrollbar-width: none; + scrollbar-gutter: auto; + -ms-overflow-style: none; +} +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-nav::-webkit-scrollbar, +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-scroll::-webkit-scrollbar { + display: none; + width: 0; + height: 0; +} +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-nav { + padding-inline: 0; +} +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-scroll, +:root[data-lumen-shell="canvas"] .rail:not(.expanded) .rail-group { + width: 100%; + align-items: center; +} +:root[data-lumen-shell="canvas"] .rail:not(.expanded) :is([data-lw="sidebar-item"], .rail-item) { + display: grid !important; + place-items: center !important; + justify-self: center; + box-sizing: border-box; + width: 52px !important; + min-width: 0 !important; + max-width: 52px !important; + height: 52px !important; + margin-inline: auto !important; + padding: 0 !important; + gap: 0 !important; + text-indent: 0; +} +:root[data-lumen-shell="canvas"] .rail:not(.expanded) :is([data-lw="sidebar-item"], .rail-item) > * { + grid-area: 1 / 1; + margin: 0 !important; + flex: none; +} +:root[data-lumen-shell="canvas"] .rail:not(.expanded) :is([data-lw="sidebar-item"], .rail-item)::after { + content: none !important; + display: none !important; +} + +.lumen-brand { + display: flex; + align-items: center; + gap: 12px; + padding: 14px 16px 10px; + flex: none; +} +.lumen-brand-mark { + width: 36px; + height: 36px; + border-radius: 14px; + display: grid; + place-items: center; + flex: none; + color: var(--lumen-on-accent); + background: linear-gradient(135deg, var(--lumen-accent), hsl(calc(var(--lumen-seed-hue) + 35), 80%, 55%)); + box-shadow: 0 8px 20px -6px var(--lumen-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5); +} +.lumen-brand-mark svg { width: 20px; height: 20px; } +.lumen-brand-text { min-width: 0; } +.lumen-brand-name { font: 800 14px/1 var(--lw-font-display, var(--lw-font-family, system-ui)); letter-spacing: -0.01em; color: var(--lumen-text); } +.lumen-brand-sub { margin-top: 5px; font: 500 11px/1 var(--lw-font-family, system-ui); color: var(--lumen-text-subtle); } +.rail:not(.expanded) .lumen-brand { justify-content: center; padding-inline: 0; } +.rail:not(.expanded) .lumen-brand-text { display: none; } + +.lumen-rail-card { + flex: none; + margin: 0 12px 12px; + padding: 12px 14px; + border-radius: 20px; + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.12); +} +.lumen-rail-card-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; } +.lumen-rail-card-title { font: 600 11px/1.2 var(--lw-font-family, system-ui); color: rgba(255, 255, 255, 0.9); } +.lumen-rail-card-state { font: 500 10px/1 ui-monospace, "JetBrains Mono", Consolas, monospace; color: hsl(152, 62%, 62%); } +.lumen-rail-card-state.is-idle { color: var(--lumen-text-subtle); } +.lumen-rail-card p { margin: 0; font: 400 11px/1.45 var(--lw-font-family, system-ui); color: var(--lumen-text-subtle); } +.rail:not(.expanded) .lumen-rail-card { display: none; } + +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] { + margin: var(--lumen-pane-gap); + border-radius: var(--lumen-pane-radius); + border: 1px solid rgba(255, 255, 255, 0.10); + background: color-mix(in srgb, hsl(var(--lumen-seed-hue), 16%, 10%) calc(var(--lumen-glass-alpha) * 70%), transparent); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); + backdrop-filter: blur(18px) saturate(160%); + -webkit-backdrop-filter: blur(18px) saturate(160%); +} + +:root[data-lumen-shell="canvas"] [data-lw="main-stage"], +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] * { + scrollbar-width: auto !important; + scrollbar-color: auto !important; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar, +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] *::-webkit-scrollbar { + width: 14px; + height: 14px; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar-track, +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] *::-webkit-scrollbar-track { + background: transparent; + margin-block: 24px; + margin-inline: 0; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar-thumb, +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] *::-webkit-scrollbar-thumb { + background-color: rgba(255, 255, 255, 0.24); + background-clip: padding-box; + border: 4px solid transparent; + border-radius: 9999px; + min-height: 40px; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar-thumb:hover, +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] *::-webkit-scrollbar-thumb:hover { + background-color: rgba(255, 255, 255, 0.38); +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar-button, +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] *::-webkit-scrollbar-button { + display: none; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar-corner { + background: transparent; +} + +:root[data-lumen-shell="canvas"] [data-lw="home-page"] { padding-bottom: 12px; } +:root[data-lumen-shell="canvas"] [data-lw="home-page"] > * section:not(section section), +:root[data-lumen-shell="canvas"] [data-lw="home-page"] section[class*="rounded"]:not(section section) { + box-sizing: border-box; + padding: 16px 20px 18px !important; + border-radius: 26px !important; + background: var(--lumen-surface-card) !important; + border: 1px solid rgba(255, 255, 255, 0.11) !important; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); + backdrop-filter: blur(24px) saturate(180%); + -webkit-backdrop-filter: blur(24px) saturate(180%); +} +:root[data-lumen-shell="canvas"] [data-lw="home-page"] h1 { + font-family: var(--lw-font-display, inherit); + font-weight: 800; + letter-spacing: -0.02em; +} +:root[data-lumen-shell="canvas"] .quick-picks-grid > * button, +:root[data-lumen-shell="canvas"] [data-lw="track-row"] { + border-radius: 16px !important; + transition: background 0.25s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1); +} +:root[data-lumen-shell="canvas"] .quick-picks-grid > * button:hover { transform: translateY(-2px); } +:root[data-lumen-shell="canvas"] [data-lw="artwork"] { border-radius: 14px; } +:root[data-lumen-shell="canvas"] [data-lw="shelf"] [data-lw="artwork"] { + box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.14); + border-radius: 20px; +} + +.lumen-hero-wrap { + display: grid; + grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); + gap: 20px; + margin: 4px 0 22px; +} +@media (max-width: 1180px) { .lumen-hero-wrap { grid-template-columns: 1fr; } } +.lumen-tonal { + position: relative; + overflow: hidden; + border-radius: 26px; + padding: 24px 26px; + background: var(--lumen-surface-card); + border: 1px solid rgba(255, 255, 255, 0.11); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); + backdrop-filter: blur(24px) saturate(180%); + -webkit-backdrop-filter: blur(24px) saturate(180%); + transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1), background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease; +} +.lumen-tonal:hover { + background: var(--lumen-surface-card-hover); + border-color: rgba(255, 255, 255, 0.22); + transform: translateY(-2px); + box-shadow: 0 20px 44px -15px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.24); +} +.lumen-hero { display: flex; align-items: center; gap: 24px; } +.lumen-hero-art { + width: 164px; + height: 164px; + flex: none; + border-radius: 24px; + overflow: hidden; + position: relative; + cursor: pointer; + background: linear-gradient(135deg, var(--lumen-accent-container), var(--lumen-surface-card)); + box-shadow: 0 22px 48px -12px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.32); +} +.lumen-hero.is-playing .lumen-hero-art { animation: lumen-art-float 4.5s ease-in-out infinite; } +@keyframes lumen-art-float { + 0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 20px 45px -12px rgba(0,0,0,0.65), 0 0 25px -5px var(--lumen-glow); } + 50% { transform: translateY(-4px) scale(1.015); box-shadow: 0 28px 55px -10px rgba(0,0,0,0.75), 0 0 42px 2px var(--lumen-glow); } +} +.lumen-hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; } +.lumen-hero-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; } +.lumen-eyebrow { align-self: flex-start; cursor: default; color: var(--lumen-on-container); font: 600 11px/1 var(--lw-font-family, system-ui); } +.lumen-hero-title { margin: 0; font: 800 28px/1.12 var(--lw-font-display, var(--lw-font-family, system-ui)); letter-spacing: -0.02em; color: var(--lumen-text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } +.lumen-hero-artist { margin: 0; font: 500 14px/1.3 var(--lw-font-family, system-ui); color: rgba(245, 245, 247, 0.75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.lumen-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; } +.lumen-btn-primary { + display: inline-flex; align-items: center; gap: 8px; + padding: 10px 20px; border: 0; border-radius: 9999px; cursor: pointer; + font: 700 12px/1 var(--lw-font-family, system-ui); + background: var(--lumen-accent); color: var(--lumen-on-accent); + box-shadow: 0 8px 24px -4px var(--lumen-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45); + transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); +} +.lumen-btn-primary:hover { transform: scale(1.04); } +.lumen-btn-primary:active { transform: scale(0.93); } +.lumen-btn-primary svg, .lumen-btn-glass svg { width: 14px; height: 14px; } +.lumen-btn-glass { padding: 10px 16px; font: 600 12px/1 var(--lw-font-family, system-ui); } + +.lumen-engine-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; } +.lumen-engine-title { font: 700 11px/1 var(--lw-font-family, system-ui); letter-spacing: 0.08em; text-transform: uppercase; color: rgba(245, 245, 247, 0.55); } +.lumen-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; } +.lumen-bars i { width: 2px; height: 100%; border-radius: 9999px; background: var(--lumen-accent); transform-origin: bottom; transform: scaleY(0.28); } +.lumen-engine.is-playing .lumen-bars i { animation: lumen-eq 0.85s ease-in-out infinite; } +.lumen-engine.is-playing .lumen-bars i:nth-child(2) { animation-delay: 0.2s; } +.lumen-engine.is-playing .lumen-bars i:nth-child(3) { animation-delay: 0.4s; } +.lumen-engine.is-playing .lumen-bars i:nth-child(4) { animation-delay: 0.1s; } +@keyframes lumen-eq { 0%, 100% { transform: scaleY(0.28); } 50% { transform: scaleY(1); } } +.lumen-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } +.lumen-stat { padding: 12px 14px; border-radius: 20px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.10); } +.lumen-stat-label { font: 500 11px/1 var(--lw-font-family, system-ui); color: rgba(245, 245, 247, 0.55); } +.lumen-stat-value { margin-top: 6px; font: 700 19px/1 var(--lw-font-display, var(--lw-font-family, system-ui)); color: var(--lumen-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.lumen-stat-value.is-accent { color: var(--lumen-accent); } +.lumen-stat-value small { font: 400 11px/1 var(--lw-font-family, system-ui); color: rgba(245, 245, 247, 0.5); margin-left: 3px; } +.lumen-engine-foot { margin-top: 14px; font: 500 11px/1.4 var(--lw-font-family, system-ui); color: rgba(245, 245, 247, 0.5); } + +:root[data-lumen-shell="canvas"] .shell-panels { padding: 10px 10px 0 0; } +:root[data-lumen-shell="canvas"] .shell-panel > * { + border: 1px solid rgba(255, 255, 255, 0.16) !important; + border-radius: 24px !important; + height: calc(100% - 10px) !important; + overflow: hidden; + + background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.07)), + color-mix(in srgb, hsl(var(--lumen-seed-hue), 18%, 9%) calc(min(var(--lumen-glass-alpha) + 0.40, 0.92) * 100%), transparent) !important; + box-shadow: var(--lumen-pane-rim), 0 24px 60px -18px rgba(0, 0, 0, 0.7) !important; + backdrop-filter: blur(26px) saturate(210%) contrast(106%) !important; + -webkit-backdrop-filter: blur(26px) saturate(210%) contrast(106%) !important; +} +:root[data-lumen-shell="canvas"] .shell-panel h2 { font-family: var(--lw-font-display, inherit); font-weight: 800; } + +:root[data-lumen-shell="canvas"] [data-lw="player-bar"].player-dock { + margin: 0 var(--lumen-pane-gap) var(--lumen-pane-gap); + width: auto !important; +} +:root[data-lumen-shell="canvas"] [data-lw="player-bar"] .dock-cover { border-radius: 9999px !important; } +:root[data-lumen-shell="canvas"] [data-lw="player-bar"] .dock-cover img, +:root[data-lumen-shell="canvas"] [data-lw="player-bar"] .dock-cover [data-lw="artwork"] { border-radius: 9999px !important; } + +:root[data-lumen-shell="canvas"][data-lumen-playing="true"] [data-lw="player-bar"] .dock-cover img { animation: lumen-spin 22s linear infinite; } +:root[data-lumen-shell="canvas"] [data-lw="player-bar"] .dock-cover { position: relative; } +:root[data-lumen-shell="canvas"] [data-lw="player-bar"] .dock-cover::after { + content: ""; + position: absolute; + inset: 0; + margin: auto; + width: 10px; + height: 10px; + border-radius: 9999px; + background: hsl(var(--lumen-seed-hue), 20%, 7%); + border: 1px solid rgba(255, 255, 255, 0.3); + pointer-events: none; +} +@keyframes lumen-spin { to { transform: rotate(360deg); } } + +:root[data-lumen-shell="canvas"] [data-lw="player-seekbar"] .dock-slider-fill { + background: linear-gradient(90deg, var(--lumen-accent), #fff) !important; + box-shadow: 0 0 14px var(--lumen-glow); +} +:root[data-lumen-shell="canvas"] [data-lw="player-seekbar"] .dock-slider-track { border-radius: 9999px; } + +.lumen-cc { + position: fixed; + right: 24px; + bottom: 138px; + z-index: 70; + width: 300px; + padding: 16px; + border-radius: 26px; + border: 1px solid rgba(255, 255, 255, 0.22); + background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.03) 55%, rgba(255,255,255,0.09)), color-mix(in srgb, hsl(var(--lumen-seed-hue), 18%, 10%) 72%, transparent); + box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.8), inset 0 2px 1px rgba(255, 255, 255, 0.4), inset 0 -2px 1.5px rgba(255, 255, 255, 0.16); + backdrop-filter: blur(30px) saturate(230%) contrast(108%); + -webkit-backdrop-filter: blur(30px) saturate(230%) contrast(108%); + color: var(--lumen-text); + font: 400 12px/1.4 var(--lw-font-family, system-ui); + opacity: 0; + transform: translateY(10px) scale(0.96); + pointer-events: none; + transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1); +} +.lumen-cc.is-open { opacity: 1; transform: none; pointer-events: auto; } +.lumen-cc h3 { margin: 0 0 2px; font: 800 15px/1.2 var(--lw-font-display, inherit); } +.lumen-cc .lumen-cc-sub { color: var(--lumen-text-subtle); font-size: 11px; margin-bottom: 12px; } +.lumen-cc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); } +.lumen-cc-row b { display: block; font-weight: 600; font-size: 12px; } +.lumen-cc-row span { display: block; color: var(--lumen-text-subtle); font-size: 11px; } +.lumen-switch { width: 44px; height: 26px; padding: 3px; border: 0; border-radius: 9999px; cursor: pointer; flex: none; background: rgba(255, 255, 255, 0.18); transition: background 0.25s ease; display: flex; align-items: center; } +.lumen-switch[aria-checked="true"] { background: var(--lumen-accent); } +.lumen-switch i { width: 20px; height: 20px; border-radius: 9999px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.4); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); } +.lumen-switch[aria-checked="true"] i { transform: translateX(18px); background: var(--lumen-on-accent); } + +@media (prefers-reduced-motion: reduce) { + .lumen-hero.is-playing .lumen-hero-art, + .lumen-engine.is-playing .lumen-bars i, + .lumen-capsule.is-live .lumen-pulse::after, + :root[data-lumen-playing="true"] [data-lw="player-bar"] .dock-cover img { animation: none !important; } + .lumen-cc, .lumen-capsule, .lumen-tonal { transition-duration: 0.01ms !important; } +} +:root[data-performance="true"][data-lumen-shell="canvas"] [data-lw="title-bar"], +:root[data-performance="true"][data-lumen-shell="canvas"] [data-lw="sidebar"].rail, +:root[data-performance="true"][data-lumen-shell="canvas"] [data-lw="main-stage"], +:root[data-performance="true"][data-lumen-shell="canvas"] .shell-panel > *, +:root[data-performance="true"] .lumen-tonal, +:root[data-performance="true"] .lumen-cc { + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; +} + +body.lumen-in-mini-player .lumen-hdr-slot, +body.lumen-in-mini-player .lumen-brand, +body.lumen-in-mini-player .lumen-rail-card, +body.lumen-in-mini-player .lumen-hero-wrap, +body.lumen-in-mini-player .lumen-cc { display: none !important; } + +:where( + [role="menu"], + [role="listbox"], + [data-radix-popper-content-wrapper] > *, + [data-floating-ui-portal] [role="dialog"], + [class*="context-menu"], + [class*="ContextMenu"], + [class*="popover-content"], + [class*="PopoverContent"], + [class*="dropdown-menu"], + [class*="DropdownMenu"] +):not(.lumen-cc) { + box-sizing: border-box; + color: var(--lumen-text, #f5f1f3) !important; + background-color: var(--lumen-surface-modal, rgba(35, 23, 30, .96)) !important; + background-image: + linear-gradient(155deg, rgba(255,255,255,.095), rgba(255,255,255,.025) 52%, rgba(255,255,255,.055)) !important; + border: 1px solid rgba(255,255,255,.16) !important; + border-radius: 18px !important; + box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 18px 48px -12px rgba(0,0,0,.72) !important; + backdrop-filter: blur(22px) saturate(165%) !important; + -webkit-backdrop-filter: blur(22px) saturate(165%) !important; +} +:where([role="menu"], [class*="context-menu"], [class*="ContextMenu"], [class*="dropdown-menu"], [class*="DropdownMenu"]) + :is([role="menuitem"], button, [role="option"], a) { + box-sizing: border-box; + display: flex; + align-items: center; + gap: 10px; + min-height: 36px; + padding: 8px 12px !important; + border-radius: 11px !important; + color: var(--lumen-text, #f5f1f3) !important; + text-align: left; + line-height: 1.35; +} +:where([role="menu"], [class*="context-menu"], [class*="ContextMenu"], [class*="dropdown-menu"], [class*="DropdownMenu"]) + :is([role="menuitem"], button, [role="option"], a):is(:hover, :focus-visible, [aria-selected="true"]) { + background: color-mix(in srgb, var(--lumen-accent, #c58b9e) 22%, rgba(255,255,255,.055)) !important; + outline: none; +} +:where([role="menu"], [class*="context-menu"], [class*="ContextMenu"], [class*="dropdown-menu"], [class*="DropdownMenu"]) + :is(svg, img, [data-icon]) { + flex: 0 0 18px; + width: 18px; + height: 18px; + align-self: center; +} +:where([role="menu"], [class*="context-menu"], [class*="ContextMenu"], [class*="dropdown-menu"], [class*="DropdownMenu"]) + :is([role="menuitem"], button, [role="option"], a) > :last-child { + min-width: 0; +} + +:where([role="menu"], [class*="context-menu"], [class*="ContextMenu"], [class*="dropdown-menu"], [class*="DropdownMenu"]) + :is([role="menuitem"], button, [role="option"], a) :is(small, kbd, [class*="shortcut"], [class*="hint"]) { + margin-left: auto; + flex: 0 0 auto; + color: var(--lumen-text-muted, rgba(245,241,243,.62)) !important; +} + +:root[data-lumen-shell="canvas"] [data-lw="main-stage"], +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] * { + scrollbar-gutter: stable; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar, +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] *::-webkit-scrollbar { + width: 12px; + height: 12px; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar-track, +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] *::-webkit-scrollbar-track { + margin-block: 18px; + margin-inline: 2px; + border-radius: 999px; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"]::-webkit-scrollbar-thumb, +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] *::-webkit-scrollbar-thumb { + border-width: 3px; + min-height: 48px; +} +:root[data-lumen-shell="canvas"] [data-lw="main-stage"] { + scrollbar-width: thin !important; + scrollbar-color: rgba(255,255,255,.24) transparent !important; +} diff --git a/themes/lumen-glass/theme.js b/themes/lumen-glass/theme.js new file mode 100644 index 0000000..65e9e8b --- /dev/null +++ b/themes/lumen-glass/theme.js @@ -0,0 +1,1849 @@ +const DECK_MIN_H = 272; + +const SKINS = [ + { id: 'burgundy', label: 'Burgundy', hue: 344, sat: 78, dot: '#7A2238' }, + { id: 'glacier', label: 'Glacier', hue: 204, sat: 76, dot: '#A5C8E1' }, + { id: 'orange', label: 'Cosmic Orange', hue: 24, sat: 90, dot: '#E86F2C' }, + { id: 'night', label: 'Night Sky', hue: 230, sat: 72, dot: '#24345C' }, + { id: 'sage', label: 'Sage', hue: 152, sat: 58, dot: '#8AB09B' }, + { id: 'lavender', label: 'Lavender', hue: 268, sat: 72, dot: '#B8A6D9' }, + { id: 'gold', label: 'Light Gold', hue: 40, sat: 74, dot: '#DFCFA8' }, + { id: 'adaptive', label: 'Adaptive', hue: 320, sat: 74, dot: 'var(--lumen-accent)' }, +]; + +const DEFAULT_STATE = { + skin: 'burgundy', + deckVisible: true, + orbs: true, + clarity: 42, + deck: { x: null, y: null, width: 400, height: 288 }, + mini: { lyrics: true }, + shell: true, +}; + +const clamp = (v, lo, hi, fallback) => + typeof v === 'number' && Number.isFinite(v) ? Math.min(hi, Math.max(lo, v)) : fallback; + +function sanitizeState(raw) { + const out = { ...DEFAULT_STATE, deck: { ...DEFAULT_STATE.deck }, mini: { ...DEFAULT_STATE.mini } }; + if (!raw || typeof raw !== 'object') return out; + if (SKINS.some((k) => k.id === raw.skin)) out.skin = raw.skin; + if (typeof raw.deckVisible === 'boolean') out.deckVisible = raw.deckVisible; + if (typeof raw.orbs === 'boolean') out.orbs = raw.orbs; + out.clarity = clamp(raw.clarity, 16, 74, DEFAULT_STATE.clarity); + const d = raw.deck && typeof raw.deck === 'object' ? raw.deck : {}; + out.deck.width = clamp(d.width, 340, 720, DEFAULT_STATE.deck.width); + out.deck.height = clamp(d.height, DECK_MIN_H, 520, DEFAULT_STATE.deck.height); + out.deck.x = clamp(d.x, 0, 20000, null); + out.deck.y = clamp(d.y, 0, 20000, null); + const m = raw.mini && typeof raw.mini === 'object' ? raw.mini : {}; + if (typeof m.lyrics === 'boolean') out.mini.lyrics = m.lyrics; + if (typeof raw.shell === 'boolean') out.shell = raw.shell; + return out; +} + +const store = LastWave?.storage ? LastWave.storage(pluginId || 'lumen-glass-theme') : null; + +function readSavedState() { + try { + const v1 = store?.get('v1_state'); + if (v1 && typeof v1 === 'object') return v1; + } catch (_) {} + return null; +} + +const savedState = readSavedState(); +const state = sanitizeState(savedState); +const hadSavedSkin = Boolean(savedState) && SKINS.some((s) => s.id === savedState.skin); +const initialStoreVariant = LastWave?.theme?.getVariant?.(); +if (!hadSavedSkin && initialStoreVariant && SKINS.some((s) => s.id === initialStoreVariant)) { + state.skin = initialStoreVariant; +} + +const channel = + typeof BroadcastChannel !== 'undefined' ? new BroadcastChannel('lumen-glass-sync') : null; + +function persistState() { + try { + store?.set('v1_state', state); + } catch (_) {} + try { + channel?.postMessage({ type: 'LUMEN_STATE_SYNC', state }); + } catch (_) {} +} + +function pushSkinToApp() { + const applied = LastWave?.theme?.setVariant?.(state.skin); + if (!applied) document.documentElement.dataset.lwThemeVariant = state.skin; + document.documentElement.dataset.lumenSkin = state.skin; +} + +function applyFinish(notify) { + const skin = SKINS.find((s) => s.id === state.skin) || SKINS[0]; + const root = document.documentElement.style; + if (state.skin === 'adaptive') { + root.removeProperty('--lumen-seed-hue'); + root.removeProperty('--lumen-seed-sat'); + } else { + root.setProperty('--lumen-seed-hue', String(skin.hue)); + root.setProperty('--lumen-seed-sat', skin.sat + '%'); + } + if (notify) showToast(`Finish: ${skin.label}`); +} + +function setSkin(id, notify = true) { + if (!SKINS.some((k) => k.id === id)) return; + const changed = state.skin !== id; + state.skin = id; + if (changed) { + pushSkinToApp(); + applyFinish(notify); + positionMetaball(activeMetaballBtn, true); + persistState(); + } + syncDeckUI(); +} + +const reduceMotion = + typeof window.matchMedia === 'function' && + window.matchMedia('(prefers-reduced-motion: reduce)').matches; +const perfMode = () => document.documentElement.dataset.performance === 'true'; + +function fmtMs(ms) { + const s = Math.max(0, Math.floor((ms || 0) / 1000)); + return Math.floor(s / 60) + ':' + ('0' + (s % 60)).slice(-2); +} + +function isMiniPlayerActive() { + if (document.querySelector('[data-lw="mini-player"]')) return true; + if (!document.querySelector('[data-lw="app-shell"]') && window.innerHeight <= 620 && window.innerWidth <= 940) { + return true; + } + return false; +} + +function hasTauri() { + return typeof window.__TAURI_INTERNALS__?.invoke === 'function'; +} + +function tauriInvoke(command, args) { + try { + const internals = window.__TAURI_INTERNALS__; + if (internals && typeof internals.invoke === 'function') { + return Promise.resolve(internals.invoke(command, args || {})); + } + } catch (err) { + return Promise.reject(err); + } + return Promise.reject(new Error('no-native-shell')); +} + +async function tauriTry(commands, args) { + for (const cmd of commands) { + try { + await tauriInvoke(cmd, args); + return true; + } catch (_) {} + } + return false; +} + +const WIN_CMD = (name) => [`plugin:window|${name.replace(/-/g, '_')}`, `plugin:window:${name}`, name]; + +let windowShaped = false; +let decoratedBefore = null; + +async function applyDesktopLens() { + if (windowShaped) return; + windowShaped = true; + if (!hasTauri()) return; + try { + decoratedBefore = await tauriInvoke('plugin:window|is_decorated', {}); + } catch (_) { + decoratedBefore = null; + } + if (decoratedBefore === false) return; + await tauriTry(WIN_CMD('set-decorations'), { decorations: false, value: false }); +} + +async function clearDesktopLens() { + if (!windowShaped) return; + windowShaped = false; + if (!hasTauri() || decoratedBefore !== true) return; + await tauriTry(WIN_CMD('set-decorations'), { decorations: true, value: true }); +} + +async function startWindowDrag() { + if (!hasTauri()) return false; + return tauriTry(WIN_CMD('start-dragging'), {}); +} + +function clickNativeGlyph(...labels) { + const root = document.querySelector('[data-lw="mini-player"]'); + if (!root) return false; + for (const label of labels) { + const btn = root.querySelector(`button[aria-label="${label}"]`); + if (btn) { + try { + btn.click(); + return true; + } catch (_) {} + } + } + return false; +} + +function playerSnapshot() { + const player = LastWave?.player; + const t = player && player.getCurrentTrack ? player.getCurrentTrack() : null; + let posSec = player && player.getPosition ? player.getPosition() : 0; + let durSec = player && player.getDuration ? player.getDuration() : 0; + if (!posSec) posSec = lastProgress.positionSec || 0; + if (!durSec) durSec = lastProgress.durationSec || (t ? t.durationSec || 0 : 0); + return { + track: t, + isPlaying: Boolean(player && player.isPlaying && player.isPlaying()), + positionMs: Math.round((posSec || 0) * 1000), + durationMs: Math.round((durSec || 0) * 1000), + }; +} + +const lastProgress = { positionSec: 0, durationSec: 0 }; + +let ambientEl = null; +let specularEl = null; +let specularQueued = false; +let lastSpecular = { x: '50', y: '20', key: null }; + +function ensureGlassLayers() { + if (!ambientEl || !document.body.contains(ambientEl)) { + document.getElementById('lumen-ambient-layer')?.remove(); + ambientEl = document.createElement('div'); + ambientEl.id = 'lumen-ambient-layer'; + ambientEl.className = 'lumen-ambient'; + ambientEl.setAttribute('aria-hidden', 'true'); + ambientEl.innerHTML = '
'; + document.body.prepend(ambientEl); + } + ambientEl.style.display = state.orbs && !perfMode() ? '' : 'none'; + + if (!specularEl || !document.body.contains(specularEl)) { + document.getElementById('lumen-specular-layer')?.remove(); + specularEl = document.createElement('div'); + specularEl.id = 'lumen-specular-layer'; + specularEl.className = 'lumen-specular'; + specularEl.setAttribute('aria-hidden', 'true'); + document.body.prepend(specularEl); + } + specularEl.style.opacity = reduceMotion || perfMode() ? '0' : ''; +} + +function ensureMetaballDefs() { + if (document.getElementById('lumen-metaball-defs')) return; + const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + svg.id = 'lumen-metaball-defs'; + svg.setAttribute('class', 'hidden'); + svg.setAttribute('aria-hidden', 'true'); + svg.style.position = 'absolute'; + svg.style.width = '0'; + svg.style.height = '0'; + svg.innerHTML = + '' + + '' + + '' + + '' + + ''; + document.body.appendChild(svg); +} + +function updateSpecular(clientX, clientY) { + if (reduceMotion || perfMode()) return; + if (specularQueued) return; + specularQueued = true; + requestAnimationFrame(() => { + specularQueued = false; + const shell = document.querySelector('[data-lw="app-shell"]') || document.body; + const rect = shell.getBoundingClientRect(); + if (rect.width <= 0 || rect.height <= 0) return; + const x = ((clientX - rect.left) / rect.width) * 100; + const y = ((clientY - rect.top) / rect.height) * 100; + const nx = Math.max(-40, Math.min(140, x)).toFixed(1); + const ny = Math.max(-40, Math.min(140, y)).toFixed(1); + if (lastSpecular.key === nx + ':' + ny) return; + lastSpecular = { x: nx, y: ny, key: nx + ':' + ny }; + const root = document.documentElement.style; + root.setProperty('--lumen-mouse-x', nx + '%'); + root.setProperty('--lumen-mouse-y', ny + '%'); + }); +} + +const onPointerMove = (e) => updateSpecular(e.clientX, e.clientY); +window.addEventListener('pointermove', onPointerMove, { passive: true }); + +let lastChromaUrl = ''; + +function rgbToHsl(r, g, b) { + r /= 255; g /= 255; b /= 255; + const max = Math.max(r, g, b); + const min = Math.min(r, g, b); + const l = (max + min) / 2; + if (max === min) return { h: 0, s: 0 }; + const d = max - min; + const s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + let h; + if (max === r) h = ((g - b) / d + (g < b ? 6 : 0)) / 6; + else if (max === g) h = ((b - r) / d + 2) / 6; + else h = ((r - g) / d + 4) / 6; + return { h: Math.round(h * 360), s: Math.round(s * 100) }; +} + +function updateArtworkSeed(url) { + if (!url || url === lastChromaUrl) return; + lastChromaUrl = url; + + const applyFallback = () => { + const accent = LastWave?.player?.getCurrentTrack?.()?.accentColor; + if (accent && /^#[0-9a-f]{6}$/i.test(accent)) { + const hsl = rgbToHsl(parseInt(accent.slice(1, 3), 16), parseInt(accent.slice(3, 5), 16), parseInt(accent.slice(5, 7), 16)); + seedFrom(hsl.h, hsl.s); + } + }; + + const img = new Image(); + img.crossOrigin = 'anonymous'; + img.onload = () => { + try { + const canvas = document.createElement('canvas'); + canvas.width = 16; + canvas.height = 16; + const ctx = canvas.getContext('2d'); + if (!ctx) return applyFallback(); + ctx.drawImage(img, 0, 0, 16, 16); + const { data } = ctx.getImageData(0, 0, 16, 16); + + let hx = 0, hy = 0, weight = 0, satSum = 0; + for (let i = 0; i < data.length; i += 4) { + const r = data[i], g = data[i + 1], b = data[i + 2]; + const max = Math.max(r, g, b); + const min = Math.min(r, g, b); + const lum = (max + min) / 2; + if (lum < 36 || lum > 234) continue; + const sat = max === 0 ? 0 : (max - min) / max; + if (sat < 0.18) continue; + const hsl = rgbToHsl(r, g, b); + const rad = (hsl.h * Math.PI) / 180; + hx += Math.cos(rad) * sat; + hy += Math.sin(rad) * sat; + satSum += hsl.s; + weight += sat; + } + if (weight <= 0) return applyFallback(); + let h = (Math.atan2(hy / weight, hx / weight) * 180) / Math.PI; + if (h < 0) h += 360; + seedFrom(Math.round(h), Math.max(30, Math.min(92, Math.round(satSum / (data.length / 4))))); + } catch (_) { + applyFallback(); + } + }; + img.onerror = applyFallback; + img.src = url; +} + +function seedFrom(hue, sat) { + const root = document.documentElement.style; + root.setProperty('--lumen-dynamic-hue', String(hue)); + root.setProperty('--lumen-dynamic-sat', sat + '%'); +} + +const lyricsCache = { trackId: null, lines: [], synced: false, instrumental: false, error: false }; +let lyricsInflight = false; +let plainLastIdx = -1; + +function applyLyricsResult(trackId, res) { + if (!res) { + Object.assign(lyricsCache, { trackId, lines: [], synced: false, instrumental: false, error: true }); + return; + } + if (res.isInstrumental) { + Object.assign(lyricsCache, { trackId, lines: [], synced: false, instrumental: true, error: false }); + return; + } + const raw = Array.isArray(res.lines) ? res.lines : []; + let lines = raw + .map((l) => { + const startMs = Math.max(0, Number(l.timeMs) || 0); + const durMs = Math.max(0, Number(l.durationMs) || 0); + return { startMs, endMs: startMs + durMs, text: String(l.text || '').trim() }; + }) + .filter((l) => l.text); + if (lines.length === 0 && res.plainLyrics && String(res.plainLyrics).trim()) { + lines = String(res.plainLyrics) + .split(/\r?\n/) + .map((t) => ({ startMs: 0, endMs: 0, text: t.trim() })) + .filter((t) => t.text); + } + Object.assign(lyricsCache, { + trackId, + lines, + synced: Boolean(res.isSynced && raw.length > 0), + instrumental: false, + error: lines.length === 0, + }); +} + +function listenLyricsPartials() { + const internals = window.__TAURI_INTERNALS__; + if (!internals || typeof internals.listen !== 'function') return null; + let off = null; + try { + Promise.resolve( + internals.listen('lyrics-partial', (ev) => { + try { + const payload = ev && ev.payload ? ev.payload : ev; + if (payload && payload.trackId && payload.result) { + applyLyricsResult(payload.trackId, payload.result); + renderMiniLyrics(playerSnapshot()); + } + } catch (_) {} + }) + ) + .then((un) => { off = typeof un === 'function' ? un : null; }) + .catch(() => {}); + } catch (_) {} + return () => { if (off) { try { off(); } catch (_) {} } }; +} + +async function ensureLyrics(track) { + if (!track || lyricsCache.trackId === track.id || lyricsInflight) return; + lyricsInflight = true; + try { + const dur = Math.max(0, Math.round(track.durationSec || 0)); + const res = await tauriInvoke('lyrics_fetch', { + title: track.title || '', + artist: track.artist || '', + album: track.album || '', + durationSeconds: dur > 0 ? dur : null, + forceRefresh: false, + wordByWord: false, + videoId: track.videoId || null, + preferredProviderId: 'auto', + excludeProviderIds: [], + trackId: track.id, + requestId: 'lumen-mini-' + track.id + '-' + Date.now(), + }); + applyLyricsResult(track.id, res); + } catch (err) { + console.warn('[lumen] lyrics_fetch failed for', track?.id, err); + Object.assign(lyricsCache, { trackId: track.id, lines: [], synced: false, instrumental: false, error: true }); + } finally { + lyricsInflight = false; + } +} + +function syncedLineIndex(lines, positionMs) { + if (!lines.length || positionMs < lines[0].startMs) return -1; + let lo = 0; + let hi = lines.length - 1; + let out = 0; + while (lo <= hi) { + const mid = (lo + hi) >> 1; + if (lines[mid].startMs <= positionMs) { + out = mid; + lo = mid + 1; + } else { + hi = mid - 1; + } + } + return out; +} + +function nativeLyricsText() { + const span = document.querySelector('[data-lw="mini-player-lyrics"] span'); + const txt = span?.textContent?.trim() || ''; + return txt && txt !== '♪︎' ? txt : ''; +} + +function renderMiniLyrics(snap) { + const el = miniEls.lyricsText; + if (!el) return; + if (!state.mini.lyrics) { el.textContent = ''; return; } + if (!snap.track) { el.textContent = '♪︎'; return; } + if (lyricsCache.trackId !== snap.track.id) { + ensureLyrics(snap.track); + el.textContent = nativeLyricsText() || 'Loading lyrics…'; + return; + } + if (lyricsCache.instrumental) { el.textContent = '♪︎ instrumental'; return; } + const lines = lyricsCache.lines; + if (!lines.length) { + el.textContent = nativeLyricsText() || (lyricsCache.error ? 'No lyrics found' : '♪︎'); + return; + } + let idx = -1; + if (lyricsCache.synced) { + idx = syncedLineIndex(lines, snap.positionMs); + } else if (snap.isPlaying) { + idx = Math.floor(snap.positionMs / 5000) % lines.length; + plainLastIdx = idx; + } else { + idx = plainLastIdx; + } + el.textContent = idx >= 0 ? lines[idx].text : nativeLyricsText() || '♪︎'; +} + +let deckEl = null; +let vizCanvas = null; +let vizCtx = null; +let activeMetaballBtn = null; + +const DECK_NARROW_PX = 386; +const DECK_COMPACT_PX = 470; + +function syncDeckDensity() { + if (!deckEl) return; + const w = deckEl.offsetWidth; + deckEl.classList.toggle('is-narrow', w < DECK_NARROW_PX); + deckEl.classList.toggle('is-compact', w < DECK_COMPACT_PX); +} + +function destroyDeck() { + deckEl?.remove(); + deckEl = null; + vizCanvas = null; + vizCtx = null; + activeMetaballBtn = null; + document.getElementById('lumen-lens-deck')?.remove(); +} + +function updatePillFade(pills) { + if (!pills) return; + const max = pills.scrollWidth - pills.clientWidth; + pills.style.maskImage = + max > 2 + ? 'linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%)' + : ''; +} + +function positionMetaball(btn, stretch = true) { + const bar = deckEl?.querySelector('.lumen-finish-bar'); + if (!bar || !btn) return; + const blob = bar.querySelector('.lumen-metaball-blob:not(.hover-blob)'); + const hover = bar.querySelector('.lumen-metaball-blob.hover-blob'); + const lens = bar.querySelector('.lumen-metaball-lens'); + if (!blob || !lens) return; + + const left = btn.offsetLeft; + const width = btn.offsetWidth; + blob.style.left = left + 'px'; + blob.style.width = width + 'px'; + lens.style.left = left + 'px'; + lens.style.width = width + 'px'; + if (hover) { hover.style.left = left + 'px'; hover.style.width = width + 'px'; } + + if (stretch && !reduceMotion) { + blob.style.transform = 'scaleX(1.14) scaleY(0.88)'; + lens.style.transform = 'scaleX(1.14) scaleY(0.88)'; + setTimeout(() => { + blob.style.transform = 'scaleX(1) scaleY(1)'; + lens.style.transform = 'scaleX(1) scaleY(1)'; + }, 210); + } +} + +function hoverMetaball(btn) { + const hover = deckEl?.querySelector('.lumen-metaball-blob.hover-blob'); + if (!hover || !btn || btn === activeMetaballBtn) return; + hover.style.opacity = '0.88'; + hover.style.left = btn.offsetLeft + 4 + 'px'; + hover.style.width = Math.max(24, btn.offsetWidth - 8) + 'px'; +} + +function leaveMetaball() { + const hover = deckEl?.querySelector('.lumen-metaball-blob.hover-blob'); + if (!hover || !activeMetaballBtn) return; + hover.style.left = activeMetaballBtn.offsetLeft + 'px'; + hover.style.width = activeMetaballBtn.offsetWidth + 'px'; + hover.style.opacity = '0'; +} + +function syncDeckUI() { + if (!deckEl) return; + const snap = playerSnapshot(); + deckEl.classList.toggle('is-playing', snap.isPlaying); + syncDeckDensity(); + + deckEl.querySelectorAll('.lumen-finish-btn').forEach((btn) => { + const on = btn.dataset.skin === state.skin; + btn.classList.toggle('active', on); + btn.setAttribute('aria-pressed', String(on)); + if (on) { activeMetaballBtn = btn; positionMetaball(btn, false); } + }); + + const title = snap.track ? snap.track.title : 'Lumen Glass Ready'; + const artist = snap.track ? snap.track.artist : 'LastWave Desktop'; + const titleEl = deckEl.querySelector('#lumen-deck-title'); + const artistEl = deckEl.querySelector('#lumen-deck-artist'); + if (titleEl) titleEl.textContent = title; + if (artistEl) artistEl.textContent = artist; + + const art = deckEl.querySelector('#lumen-deck-art'); + if (art) { + if (snap.track?.artworkUrl && art.src !== snap.track.artworkUrl) art.src = snap.track.artworkUrl; + else if (!snap.track?.artworkUrl && art.src) art.removeAttribute('src'); + } + + const codec = deckEl.querySelector('#lumen-deck-codec'); + if (codec) { + const label = snap.track?.codec ? String(snap.track.codec).toUpperCase() : ''; + if (label) { + const hires = Number(snap.track?.bitDepth) >= 24 || (snap.track?.sampleRateHz || 0) > 48000; + codec.textContent = hires ? label + ' HI-RES' : label; + codec.style.display = 'inline-block'; + } else { + codec.style.display = 'none'; + } + } + + const playBtn = deckEl.querySelector('#lumen-deck-play'); + if (playBtn) { + playBtn.textContent = snap.isPlaying ? '❚❚' : '▶'; + playBtn.setAttribute('aria-label', snap.isPlaying ? 'Pause' : 'Play'); + } + + const likeBtn = deckEl.querySelector('#lumen-deck-like'); + if (likeBtn) { + const liked = snap.track?.id ? Boolean(LastWave?.library?.isLiked?.(snap.track.id)) : false; + likeBtn.textContent = liked ? '♥' : '♡'; + likeBtn.classList.toggle('active', liked); + likeBtn.setAttribute('aria-pressed', String(liked)); + } + + const claritySlider = deckEl.querySelector('#lumen-clarity-slider'); + if (claritySlider && Number(claritySlider.value) !== state.clarity) claritySlider.value = state.clarity; + + const orbsBtn = deckEl.querySelector('#lumen-orbs-btn'); + if (orbsBtn) { + orbsBtn.classList.toggle('active', state.orbs); + orbsBtn.setAttribute('aria-pressed', String(state.orbs)); + } +} + +function updateScrubbers(snap) { + const p = snap.durationMs > 0 ? Math.min(1, snap.positionMs / snap.durationMs) : 0; + const pct = (p * 100).toFixed(2) + '%'; + const fill = deckEl?.querySelector('#lumen-deck-scrub-fill'); + const thumb = deckEl?.querySelector('#lumen-deck-scrub-thumb'); + if (fill) fill.style.width = pct; + if (thumb) thumb.style.left = pct; + const mFill = miniEls.scrubFill; + const mThumb = miniEls.scrubThumb; + if (mFill) mFill.style.width = pct; + if (mThumb) mThumb.style.left = pct; + + const cur = fmtMs(snap.positionMs); + const total = snap.durationMs > 0 ? fmtMs(snap.durationMs) : '--:--'; + if (deckEl) { + const curEl = deckEl.querySelector('#lumen-deck-time-cur'); + const totEl = deckEl.querySelector('#lumen-deck-time-total'); + if (curEl) curEl.textContent = cur; + if (totEl) totEl.textContent = total; + } + if (miniEls.timeCur) miniEls.timeCur.textContent = cur; + if (miniEls.timeTotal) miniEls.timeTotal.textContent = total; + + if (snap.track) renderMiniLyrics(snap); +} + +function wireDeckInteractions(el) { + el.querySelector('#lumen-deck-drag')?.addEventListener('pointerdown', (e) => { + if (e.target.closest('button') || e.target.closest('input')) return; + const rect = el.getBoundingClientRect(); + const startX = e.clientX; + const startY = e.clientY; + const origX = rect.left; + const origY = rect.top; + e.currentTarget.setPointerCapture(e.pointerId); + const onMove = (ev) => { + const maxX = window.innerWidth - state.deck.width - 12; + const maxY = window.innerHeight - state.deck.height - 104; + let nx = Math.min(Math.max(12, origX + (ev.clientX - startX)), Math.max(12, maxX)); + let ny = Math.min(Math.max(52, origY + (ev.clientY - startY)), Math.max(52, maxY)); + if (Math.abs(nx - 16) < 18) nx = 16; + if (Math.abs(nx - maxX) < 18) nx = maxX; + state.deck.x = nx; + state.deck.y = ny; + el.style.left = nx + 'px'; + el.style.top = ny + 'px'; + }; + const onUp = () => { + el.removeEventListener('pointermove', onMove); + el.removeEventListener('pointerup', onUp); + el.removeEventListener('pointercancel', onUp); + persistState(); + }; + el.addEventListener('pointermove', onMove); + el.addEventListener('pointerup', onUp); + el.addEventListener('pointercancel', onUp); + }); + + el.querySelectorAll('.lumen-finish-btn').forEach((btn) => { + btn.addEventListener('mouseenter', () => hoverMetaball(btn)); + btn.addEventListener('click', () => { + setSkin(btn.dataset.skin); + leaveMetaball(); + }); + }); + const pills = el.querySelector('#lumen-finish-bar'); + pills?.addEventListener('mouseleave', leaveMetaball); + pills?.addEventListener( + 'wheel', + (e) => { + if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) { + pills.scrollLeft += e.deltaY; + e.preventDefault(); + } + }, + { passive: false } + ); + pills?.addEventListener('scroll', () => updatePillFade(pills), { passive: true }); + + el.querySelector('#lumen-clarity-slider')?.addEventListener('input', (e) => { + state.clarity = Number(e.target.value); + document.documentElement.style.setProperty('--lumen-glass-alpha', (state.clarity / 100).toFixed(2)); + persistState(); + }); + + el.querySelector('#lumen-orbs-btn')?.addEventListener('click', () => { + state.orbs = !state.orbs; + ensureGlassLayers(); + syncDeckUI(); + persistState(); + showToast(state.orbs ? 'Ambient orbs on' : 'Ambient orbs off'); + }); + + el.querySelector('#lumen-hide-btn')?.addEventListener('click', () => { + state.deckVisible = false; + applyLayout(true); + }); + + el.querySelector('#lumen-deck-play')?.addEventListener('click', () => { + LastWave?.player?.togglePlay?.(); + syncDeckUI(); + }); + el.querySelector('#lumen-deck-prev')?.addEventListener('click', () => LastWave?.player?.previous?.()); + el.querySelector('#lumen-deck-next')?.addEventListener('click', () => LastWave?.player?.next?.()); + el.querySelector('#lumen-deck-like')?.addEventListener('click', () => { + LastWave?.library?.toggleLike?.(); + syncDeckUI(); + }); + el.querySelector('#lumen-deck-mini')?.addEventListener('click', () => LastWave?.window?.toggleMiniPlayer?.()); + el.querySelector('#lumen-deck-stage')?.addEventListener('click', () => LastWave?.nav?.navigate?.('/now-playing')); + + const scrub = el.querySelector('#lumen-deck-scrub'); + scrub?.addEventListener('click', (e) => { + const rect = scrub.getBoundingClientRect(); + const ratio = Math.min(1, Math.max(0, (e.clientX - rect.left) / rect.width)); + const dur = LastWave?.player?.getDuration?.() || playerSnapshot().durationMs / 1000 || 0; + if (dur > 0) LastWave?.player?.seek?.(ratio * dur); + }); + + const resize = el.querySelector('#lumen-deck-resize'); + resize?.addEventListener('pointerdown', (e) => { + e.stopPropagation(); + const startX = e.clientX; + const startY = e.clientY; + const origW = state.deck.width; + const origH = state.deck.height; + resize.setPointerCapture(e.pointerId); + const onMove = (ev) => { + state.deck.width = Math.min(Math.max(340, origW + (ev.clientX - startX)), 720); + state.deck.height = Math.min( + Math.max(DECK_MIN_H, origH + (ev.clientY - startY)), + 520, + window.innerHeight - 132 + ); + el.style.width = state.deck.width + 'px'; + el.style.height = state.deck.height + 'px'; + syncDeckDensity(); + }; + const onUp = () => { + resize.removeEventListener('pointermove', onMove); + resize.removeEventListener('pointerup', onUp); + resize.removeEventListener('pointercancel', onUp); + persistState(); + }; + resize.addEventListener('pointermove', onMove); + resize.addEventListener('pointerup', onUp); + resize.addEventListener('pointercancel', onUp); + }); +} + +function ensureDeck() { + if (isMiniPlayerActive() || document.getElementById('lumen-mini-card')) { + destroyDeck(); + return; + } + if (deckEl && document.body.contains(deckEl)) return; + destroyDeck(); + + const el = document.createElement('aside'); + el.id = 'lumen-lens-deck'; + el.className = 'lumen-lens-deck'; + el.setAttribute('aria-label', 'Lumen Lens deck'); + el.innerHTML = ` +
+
+ Lumen Glass +
+
+ + +
+
+ +
+
+ + + ${SKINS.map( + (s) => `` + ).join('')} +
+ +
+
+ +
+
+
+
+
Lumen Glass Ready
+
LastWave Desktop
+
+ +
+ +
+ 0:00 +
+
+
+
+
+
+ --:-- +
+
+
+
+ +
+
+ + + +
+
+ + + + + + +
+
+
+ `; + + document.body.appendChild(el); + deckEl = el; + vizCanvas = el.querySelector('#lumen-viz-canvas'); + vizCtx = vizCanvas?.getContext('2d') || null; + wireDeckInteractions(el); + updatePillFade(el.querySelector('#lumen-finish-bar')); +} + +const MINI_ICONS = { + shuffle: + '', + prev: + '', + next: + '', + play: + '', + pause: + '', + repeat: + '', +}; + +let miniEl = null; +let miniEls = {}; +let miniCleanups = []; + +function destroyMiniCard() { + document.getElementById('lumen-mini-card')?.remove(); + for (const fn of miniCleanups) { try { fn(); } catch (_) {} } + miniCleanups = []; + miniEl = null; + miniEls = {}; + document.body.classList.remove('lumen-mini-custom'); + clearDesktopLens(); +} + +function ensureMiniCard() { + if (miniEl && document.body.contains(miniEl)) return; + destroyMiniCard(); + + miniCleanups = []; + const el = document.createElement('aside'); + el.id = 'lumen-mini-card'; + el.className = 'lumen-mini-card'; + el.setAttribute('aria-label', 'Lumen Glass Mini Player'); + el.innerHTML = ` +
+
+
+
+
Nothing playing
+
Pick a track to begin
+
+
+ 0:00 +
+
+
+
+
+
+ --:-- +
+
+ + + + + +
+
+
+
+ + +
+ `; + + document.body.appendChild(el); + miniEl = el; + document.body.classList.add('lumen-mini-custom'); + + miniEls = { + scrubFill: el.querySelector('#lumen-mini-scrub-fill'), + scrubThumb: el.querySelector('#lumen-mini-scrub-thumb'), + timeCur: el.querySelector('#lumen-mini-time-cur'), + timeTotal: el.querySelector('#lumen-mini-time-total'), + art: el.querySelector('#lumen-mini-art'), + title: el.querySelector('#lumen-mini-title'), + artist: el.querySelector('#lumen-mini-artist'), + playBtn: el.querySelector('#lumen-mini-play'), + shuffleBtn: el.querySelector('#lumen-mini-shuffle'), + repeatBtn: el.querySelector('#lumen-mini-repeat'), + }; + + miniEls.shuffleBtn?.addEventListener('click', () => { + try { LastWave?.player?.toggleShuffle?.(); } catch (_) {} + syncMiniCard(); + }); + miniEls.repeatBtn?.addEventListener('click', () => { + try { LastWave?.player?.toggleRepeat?.(); } catch (_) {} + syncMiniCard(); + }); + + el.querySelector('#lumen-mini-max')?.addEventListener('click', () => LastWave?.window?.toggleMiniPlayer?.()); + el.querySelector('#lumen-mini-close')?.addEventListener('click', () => { + if (clickNativeGlyph('Close mini player', 'Close')) return; + const danger = document.querySelector('[data-lw="mini-player"] button.mini-glyph.danger'); + if (danger) { try { danger.click(); return; } catch (_) {} } + LastWave?.window?.toggleMiniPlayer?.(); + }); + + el.querySelector('#lumen-mini-prev')?.addEventListener('click', () => LastWave?.player?.previous?.()); + el.querySelector('#lumen-mini-next')?.addEventListener('click', () => LastWave?.player?.next?.()); + miniEls.playBtn?.addEventListener('click', () => { + LastWave?.player?.togglePlay?.(); + syncMiniCard(); + }); + + el.querySelector('#lumen-mini-scrub')?.addEventListener('click', (e) => { + const rect = e.currentTarget.getBoundingClientRect(); + const ratio = Math.min(1, Math.max(0, (e.clientX - rect.left) / rect.width)); + const dur = LastWave?.player?.getDuration?.() || playerSnapshot().durationMs / 1000 || 0; + if (dur > 0) LastWave?.player?.seek?.(ratio * dur); + }); + + const interactive = 'button, input, select, textarea, a, .lumen-scrubber-group'; + el.setAttribute('data-tauri-drag-region', ''); + el.querySelectorAll('*').forEach((node) => { + if (node.closest(interactive)) return; + node.setAttribute('data-tauri-drag-region', ''); + }); + + el.addEventListener('mousedown', (e) => { if (e.detail > 1) e.stopPropagation(); }, true); + + el.addEventListener('pointerdown', (e) => { + if (e.button !== 0 || e.detail > 1) return; + if (e.target.closest(interactive)) return; + startWindowDrag(); + }); + + const partialCleanup = listenLyricsPartials(); + if (partialCleanup) miniCleanups.push(partialCleanup); + if (LastWave?.events?.on) { + miniCleanups.push( + LastWave.events.on('progress', (p) => { + if (p && typeof p === 'object') { + lastProgress.positionSec = Number(p.positionSec) || 0; + lastProgress.durationSec = Number(p.durationSec) || 0; + } + syncMiniCard(); + }) + ); + miniCleanups.push(LastWave.events.on('playState', () => syncMiniCard())); + miniCleanups.push(LastWave.events.on('trackChange', () => syncMiniCard())); + } + + syncMiniCard(); +} + +function syncMiniCard() { + if (!miniEl) return; + const snap = playerSnapshot(); + const t = snap.track; + miniEl.classList.toggle('is-playing', snap.isPlaying); + + if (t?.artworkUrl) { + updateArtworkSeed(t.artworkUrl); + if (miniEls.art && miniEls.art.src !== t.artworkUrl) miniEls.art.src = t.artworkUrl; + } else if (t?.accentColor) { + if (/^#[0-9a-f]{6}$/i.test(t.accentColor)) { + const hsl = rgbToHsl(parseInt(t.accentColor.slice(1, 3), 16), parseInt(t.accentColor.slice(3, 5), 16), parseInt(t.accentColor.slice(5, 7), 16)); + seedFrom(hsl.h, hsl.s); + } + if (miniEls.art && miniEls.art.src) miniEls.art.removeAttribute('src'); + } else if (miniEls.art && miniEls.art.src) { + miniEls.art.removeAttribute('src'); + } + + const setText = (node, text) => { + if (node && node.textContent !== text) node.textContent = text; + }; + setText(miniEls.title, t ? t.title : 'Nothing playing'); + setText(miniEls.artist, t ? t.artist : 'Pick a track to begin'); + if (miniEls.title) miniEls.title.title = t ? t.title : ''; + + if (miniEls.playBtn) { + const glyph = snap.isPlaying ? 'pause' : 'play'; + if (miniEls.playBtn.dataset.glyph !== glyph) { + miniEls.playBtn.dataset.glyph = glyph; + miniEls.playBtn.innerHTML = snap.isPlaying ? MINI_ICONS.pause : MINI_ICONS.play; + } + miniEls.playBtn.setAttribute('aria-label', snap.isPlaying ? 'Pause' : 'Play'); + } + if (miniEls.shuffleBtn) { + const on = Boolean(LastWave?.player?.isShuffling?.()); + miniEls.shuffleBtn.classList.toggle('active', on); + miniEls.shuffleBtn.setAttribute('aria-pressed', String(on)); + } + if (miniEls.repeatBtn) { + const on = Boolean(LastWave?.player?.isRepeating?.()); + miniEls.repeatBtn.classList.toggle('active', on); + miniEls.repeatBtn.setAttribute('aria-pressed', String(on)); + } + + updateScrubbers(snap); +} + +const BAR_COUNT = 28; +const levels = new Float32Array(BAR_COUNT); +let liveBins = null; +let liveRms = 0; +let idlePhase = 0; +let lastBass = ''; +let rafId = null; + +const unsubSpectrum = LastWave?.player?.onSpectrum + ? LastWave.player.onSpectrum((frame) => { + liveBins = frame?.bins || null; + liveRms = typeof frame?.rms === 'number' ? frame.rms : 0; + }) + : null; + +function drawViz() { + if (!vizCanvas || !vizCtx || !state.deckVisible || isMiniPlayerActive() || perfMode()) return; + const rect = vizCanvas.getBoundingClientRect(); + if (rect.width <= 0 || rect.height <= 0) return; + const dpr = window.devicePixelRatio || 1; + const w = Math.floor(rect.width * dpr); + const h = Math.floor(rect.height * dpr); + if (vizCanvas.width !== w || vizCanvas.height !== h) { + vizCanvas.width = w; + vizCanvas.height = h; + } + const ctx = vizCtx; + ctx.save(); + ctx.scale(dpr, dpr); + ctx.clearRect(0, 0, rect.width, rect.height); + + const cs = getComputedStyle(document.documentElement); + const accent = cs.getPropertyValue('--lumen-accent').trim() || '#f7a8c8'; + const grad = ctx.createLinearGradient(0, rect.height, rect.width, 0); + grad.addColorStop(0, accent); + grad.addColorStop(1, '#ffffff'); + ctx.fillStyle = grad; + ctx.shadowColor = accent; + ctx.shadowBlur = 8; + + const padX = 6; + const padY = 4; + const usableW = rect.width - padX * 2; + const usableH = rect.height - padY * 2; + const gap = 3; + const barW = Math.max(2, (usableW - gap * (BAR_COUNT - 1)) / BAR_COUNT); + for (let i = 0; i < BAR_COUNT; i++) { + const barH = levels[i] * usableH; + if (barH < 1.5) continue; + const x = padX + i * (barW + gap); + const y = rect.height - padY - barH; + ctx.beginPath(); + if (ctx.roundRect) ctx.roundRect(x, y, barW, barH, 2); + else ctx.rect(x, y, barW, barH); + ctx.fill(); + } + ctx.restore(); +} + +function vizFrame() { + rafId = requestAnimationFrame(vizFrame); + const perfModeActive = perfMode(); + const playing = !perfModeActive && Boolean(LastWave?.player?.isPlaying?.()); + let bassEnergy = 0; + + if (playing && liveBins && liveBins.length > 0) { + const binCount = liveBins.length; + for (let i = 0; i < BAR_COUNT; i++) { + const start = Math.floor((i * binCount) / BAR_COUNT); + const end = Math.max(start + 1, Math.floor(((i + 1) * binCount) / BAR_COUNT)); + let sum = 0; + for (let j = start; j < end; j++) sum += liveBins[Math.min(binCount - 1, j)] || 0; + const val = Math.max(0.05, Math.min(1, sum / (end - start))); + levels[i] = levels[i] * 0.45 + val * 0.55; + if (i < 5) bassEnergy += levels[i]; + } + bassEnergy = Math.max(bassEnergy / 5, Math.min(1, liveRms * 2.2)); + } else if (playing) { + idlePhase += 0.085; + for (let i = 0; i < BAR_COUNT; i++) { + const wave = + 0.40 + 0.34 * Math.sin(idlePhase + i * 0.42) + 0.22 * Math.cos(idlePhase * 1.65 - i * 0.28); + levels[i] = Math.max(0.08, Math.min(1, wave)); + if (i < 5) bassEnergy += levels[i]; + } + bassEnergy /= 5; + } else { + for (let i = 0; i < BAR_COUNT; i++) levels[i] = levels[i] * 0.82 + 0.05 * 0.18; + } + + const bass = bassEnergy.toFixed(2); + if (bass !== lastBass) { + lastBass = bass; + document.documentElement.style.setProperty('--lumen-bass-level', bass); + } + + drawViz(); +} + +let toastEl = null; +let toastTimer = null; + +function showToast(msg) { + if (!toastEl || !document.body.contains(toastEl)) { + toastEl = document.createElement('div'); + toastEl.id = 'lumen-toast'; + toastEl.setAttribute('role', 'status'); + toastEl.style.cssText = [ + 'position:fixed', 'top:18px', 'left:50%', 'transform:translateX(-50%)', + 'z-index:120', 'padding:9px 18px', 'border-radius:9999px', + 'font:600 12px/1.4 inherit', 'color:var(--lumen-text,#f5f5f7)', + 'background:linear-gradient(180deg,rgba(255,255,255,0.16),rgba(255,255,255,0.05))', + 'backdrop-filter:blur(18px) saturate(200%)', '-webkit-backdrop-filter:blur(18px) saturate(200%)', + 'border:1px solid rgba(255,255,255,0.24)', + 'box-shadow:0 14px 36px -6px rgba(0,0,0,0.56), inset 0 2px 1px rgba(255,255,255,0.45)', + 'opacity:0', 'transition:opacity 0.3s ease, translate 0.3s ease', 'pointer-events:none', + ].join(';'); + document.body.appendChild(toastEl); + } + toastEl.textContent = msg; + toastEl.style.opacity = '1'; + clearTimeout(toastTimer); + toastTimer = setTimeout(() => { toastEl.style.opacity = '0'; }, 2200); +} + +function applyLayout(shouldPersist = true) { + const miniActive = isMiniPlayerActive(); + document.documentElement.setAttribute('data-lumen-skin', state.skin); + document.body.classList.toggle('lumen-in-mini-player', miniActive); + + ensureGlassLayers(); + ensureMetaballDefs(); + + if (miniActive) { + ensureShellLayer(); + destroyDeck(); + ensureMiniCard(); + applyDesktopLens(); + document.body.classList.remove('lumen-compact-docked'); + if (shouldPersist) persistState(); + return; + } + + destroyMiniCard(); + ensureDeck(); + ensureShellLayer(); + + const compact = window.innerWidth < 620 || window.innerHeight < 460; + document.body.classList.toggle('lumen-compact-docked', compact); + + if (deckEl) { + deckEl.classList.toggle('is-hidden', !state.deckVisible); + if (!state.deckVisible) deckEl.setAttribute('aria-hidden', 'true'); + else deckEl.removeAttribute('aria-hidden'); + + const deckW = Math.min(state.deck.width, Math.max(340, window.innerWidth - 24)); + const deckH = Math.min(state.deck.height, Math.max(DECK_MIN_H, window.innerHeight - 132)); + const defaultX = Math.max(16, window.innerWidth - deckW - 24); + const defaultY = Math.max(56, window.innerHeight - deckH - 104); + const x = Math.min(Math.max(12, state.deck.x ?? defaultX), Math.max(12, window.innerWidth - deckW - 12)); + const y = Math.min(Math.max(52, state.deck.y ?? defaultY), Math.max(52, window.innerHeight - deckH - 104)); + deckEl.style.left = x + 'px'; + deckEl.style.top = y + 'px'; + deckEl.style.width = deckW + 'px'; + deckEl.style.height = deckH + 'px'; + syncDeckDensity(); + } + + syncDeckUI(); + if (shouldPersist) persistState(); +} + +function syncTrackUI() { + if (isMiniPlayerActive()) { + syncMiniCard(); + return; + } + const track = LastWave?.player?.getCurrentTrack?.() || null; + if (track?.artworkUrl) updateArtworkSeed(track.artworkUrl); + else if (track?.accentColor && /^#[0-9a-f]{6}$/i.test(track.accentColor)) { + const hsl = rgbToHsl(parseInt(track.accentColor.slice(1, 3), 16), parseInt(track.accentColor.slice(3, 5), 16), parseInt(track.accentColor.slice(5, 7), 16)); + seedFrom(hsl.h, hsl.s); + } + syncDeckUI(); + syncShell(); +} + +const SHELL_ICONS = { + wave: '', + play: '', + pause: '', + lyrics: '', +}; + +let hdrSlotEl = null; +let dacEl = null; +let clarityMiniEl = null; +let brandEl = null; +let railCardEl = null; +let heroWrapEl = null; +let ccEl = null; +let ccOpen = false; +let heroLastArt = null; + +function shellEl(tag, className, text) { + const el = document.createElement(tag); + if (className) el.className = className; + if (text != null) el.textContent = text; + return el; +} + +function setText(el, value) { + if (el && el.textContent !== value) el.textContent = value; +} + +function applyShellAttr() { + const root = document.documentElement; + if (state.shell && !isMiniPlayerActive()) root.dataset.lumenShell = 'canvas'; + else delete root.dataset.lumenShell; +} + +function partOfDay() { + const h = new Date().getHours(); + const part = h < 5 ? 'Night' : h < 12 ? 'Morning' : h < 18 ? 'Afternoon' : h < 22 ? 'Evening' : 'Night'; + let day = ''; + try { day = new Date().toLocaleDateString(undefined, { weekday: 'long' }); } catch (_) {} + return (day ? day + ' ' : '') + part; +} + +function trackSpec(track) { + if (!track) return { codec: '', depth: '', rate: '', line: 'Idle · nothing playing' }; + const codec = track.codec ? String(track.codec).toUpperCase() : ''; + const depth = track.bitDepth ? track.bitDepth + '-bit' : ''; + const rate = track.sampleRateHz ? +(track.sampleRateHz / 1000).toFixed(1) + ' kHz' : ''; + const line = [codec, [depth, rate].filter(Boolean).join(' / ')].filter(Boolean).join(' · ') || 'Playing'; + return { codec, depth, rate, line }; +} + +function buildClarityMini() { + const wrap = shellEl('div', 'lumen-capsule lumen-clarity-mini'); + wrap.title = 'Liquid Glass: Clear vs Frosted Tint'; + const input = document.createElement('input'); + input.type = 'range'; + input.min = '16'; + input.max = '74'; + input.value = String(state.clarity); + input.setAttribute('aria-label', 'Glass clarity'); + input.addEventListener('input', () => { + state.clarity = Number(input.value); + document.documentElement.style.setProperty('--lumen-glass-alpha', (state.clarity / 100).toFixed(2)); + syncDeckUI(); + persistState(); + }); + wrap.append(shellEl('span', '', 'Clear'), input, shellEl('span', '', 'Tint')); + return wrap; +} + +function ensureHeaderSlot() { + const bar = document.querySelector('[data-lw="title-bar"] .title-bar'); + if (!bar) return; + if (hdrSlotEl && bar.contains(hdrSlotEl)) return; + hdrSlotEl?.remove(); + hdrSlotEl = shellEl('div', 'lumen-hdr-slot'); + + dacEl = shellEl('button', 'lumen-capsule lumen-dac'); + dacEl.type = 'button'; + dacEl.title = 'Audio output path'; + dacEl.append( + shellEl('span', 'lumen-pulse'), + shellEl('span', 'lumen-dac-text'), + shellEl('span', 'lumen-chip') + ); + dacEl.addEventListener('click', () => LastWave?.window?.toggleRightPanel?.('output')); + + clarityMiniEl = buildClarityMini(); + hdrSlotEl.append(dacEl, clarityMiniEl); + bar.append(hdrSlotEl); +} + +function ensureBrandAndRailCard() { + const rail = document.querySelector('[data-lw="sidebar"].rail'); + const nav = rail?.querySelector('.rail-nav'); + if (!rail || !nav) return; + const parent = nav.parentElement || rail; + + if (!brandEl || !parent.contains(brandEl)) { + brandEl?.remove(); + brandEl = shellEl('div', 'lumen-brand'); + const mark = shellEl('div', 'lumen-brand-mark'); + mark.innerHTML = SHELL_ICONS.wave; + const text = shellEl('div', 'lumen-brand-text'); + text.append(shellEl('div', 'lumen-brand-name', 'LastWave'), shellEl('div', 'lumen-brand-sub', 'Lumen Glass')); + brandEl.append(mark, text); + parent.insertBefore(brandEl, nav); + } + + if (!railCardEl || !parent.contains(railCardEl)) { + railCardEl?.remove(); + railCardEl = shellEl('div', 'lumen-rail-card'); + const row = shellEl('div', 'lumen-rail-card-row'); + row.append(shellEl('span', 'lumen-rail-card-title', 'Up next'), shellEl('span', 'lumen-rail-card-state')); + railCardEl.append(row, shellEl('p')); + nav.after(railCardEl); + } +} + +function buildHero() { + const wrap = shellEl('div', 'lumen-hero-wrap'); + + const heroCard = shellEl('div', 'lumen-tonal lumen-hero'); + const art = shellEl('div', 'lumen-hero-art'); + art.setAttribute('role', 'button'); + art.setAttribute('aria-label', 'Play or pause'); + art.addEventListener('click', togglePlayFromShell); + const body = shellEl('div', 'lumen-hero-body'); + const eyebrow = shellEl('div', 'lumen-capsule lumen-eyebrow'); + const title = shellEl('h2', 'lumen-hero-title'); + const artist = shellEl('p', 'lumen-hero-artist'); + const actions = shellEl('div', 'lumen-hero-actions'); + const playBtn = shellEl('button', 'lumen-btn-primary'); + playBtn.type = 'button'; + playBtn.addEventListener('click', togglePlayFromShell); + const lyricsBtn = shellEl('button', 'lumen-capsule lumen-btn-glass'); + lyricsBtn.type = 'button'; + lyricsBtn.innerHTML = SHELL_ICONS.lyrics; + lyricsBtn.append(shellEl('span', '', 'Lyrics & Now Playing')); + lyricsBtn.addEventListener('click', () => LastWave?.nav?.navigate?.('/now-playing')); + actions.append(playBtn, lyricsBtn); + body.append(eyebrow, title, artist, actions); + heroCard.append(art, body); + + const engine = shellEl('div', 'lumen-tonal lumen-engine'); + const head = shellEl('div', 'lumen-engine-head'); + const bars = shellEl('span', 'lumen-bars'); + for (let i = 0; i < 4; i++) bars.append(document.createElement('i')); + head.append(shellEl('span', 'lumen-engine-title', 'Signal path'), bars); + const grid = shellEl('div', 'lumen-stat-grid'); + for (const key of ['format', 'rate', 'depth', 'queue']) { + const stat = shellEl('div', 'lumen-stat'); + stat.dataset.stat = key; + stat.append(shellEl('div', 'lumen-stat-label'), shellEl('div', 'lumen-stat-value')); + grid.append(stat); + } + engine.append(head, grid, shellEl('div', 'lumen-engine-foot')); + + wrap.append(heroCard, engine); + return wrap; +} + +function ensureHero() { + const home = document.querySelector('[data-lw="home-page"]'); + if (!home) { + heroWrapEl?.remove(); + heroWrapEl = null; + heroLastArt = null; + return; + } + if (heroWrapEl && home.contains(heroWrapEl)) return; + heroWrapEl?.remove(); + heroWrapEl = buildHero(); + heroLastArt = null; + const header = home.querySelector('header'); + if (header && header.parentElement) header.after(heroWrapEl); + else home.prepend(heroWrapEl); +} + +function togglePlayFromShell() { + const p = LastWave?.player; + if (!p) return; + if (p.getCurrentTrack?.()) p.togglePlay?.(); + else p.play?.(); +} + +function nextInQueue(track) { + const queue = LastWave?.player?.getQueue?.() || []; + if (!queue.length) return { queue, next: null }; + const idx = track ? queue.findIndex((q) => q && q.id === track.id) : -1; + return { queue, next: idx >= 0 ? queue[idx + 1] || null : queue[0] || null }; +} + +function syncShell() { + const root = document.documentElement; + if (!state.shell || isMiniPlayerActive()) { + delete root.dataset.lumenPlaying; + return; + } + const player = LastWave?.player; + const track = player?.getCurrentTrack?.() || null; + const playing = Boolean(player?.isPlaying?.()); + const spec = trackSpec(track); + const { queue, next } = nextInQueue(track); + + root.dataset.lumenPlaying = playing ? 'true' : 'false'; + + if (dacEl) { + dacEl.classList.toggle('is-live', playing); + setText(dacEl.querySelector('.lumen-dac-text'), spec.line); + const chip = dacEl.querySelector('.lumen-chip'); + if (chip) { + setText(chip, spec.codec); + chip.style.display = spec.codec ? '' : 'none'; + } + } + const slider = clarityMiniEl?.querySelector('input'); + if (slider && Number(slider.value) !== state.clarity) slider.value = String(state.clarity); + + if (railCardEl) { + setText(railCardEl.querySelector('.lumen-rail-card-state'), queue.length ? queue.length + ' queued' : 'Empty'); + railCardEl.querySelector('.lumen-rail-card-state')?.classList.toggle('is-idle', !queue.length); + setText( + railCardEl.querySelector('p'), + next ? [next.title, next.artist].filter(Boolean).join(' · ') : 'Nothing queued. Start something and it lands here.' + ); + } + + if (heroWrapEl) { + const hero = heroWrapEl.querySelector('.lumen-hero'); + hero?.classList.toggle('is-playing', playing); + heroWrapEl.querySelector('.lumen-engine')?.classList.toggle('is-playing', playing); + setText(heroWrapEl.querySelector('.lumen-eyebrow'), '✨ ' + partOfDay() + ' · ' + (track ? (playing ? 'Now playing' : 'Paused') : 'Ready')); + setText(heroWrapEl.querySelector('.lumen-hero-title'), track ? track.title || 'Untitled' : 'Nothing playing'); + setText( + heroWrapEl.querySelector('.lumen-hero-artist'), + track ? [track.artist, track.album].filter(Boolean).join(' · ') : 'Pick something to start' + ); + + const playBtn = heroWrapEl.querySelector('.lumen-btn-primary'); + if (playBtn) { + const label = playing ? 'Pause' : track ? 'Play' : 'Start playing'; + if (playBtn.dataset.label !== label) { + playBtn.dataset.label = label; + playBtn.innerHTML = playing ? SHELL_ICONS.pause : SHELL_ICONS.play; + playBtn.append(shellEl('span', '', label)); + } + } + + const artWrap = heroWrapEl.querySelector('.lumen-hero-art'); + const url = track?.artworkUrl || ''; + if (artWrap && url !== heroLastArt) { + heroLastArt = url; + artWrap.textContent = ''; + if (url) { + const img = document.createElement('img'); + img.alt = ''; + img.referrerPolicy = 'no-referrer'; + img.src = url; + artWrap.append(img); + } + } + + const vals = { + format: ['Format', spec.codec || '—'], + rate: ['Sample rate', spec.rate || '—'], + depth: ['Bit depth', spec.depth || '—'], + queue: ['In queue', String(queue.length)], + }; + for (const [key, [label, value]] of Object.entries(vals)) { + const stat = heroWrapEl.querySelector('[data-stat="' + key + '"]'); + if (!stat) continue; + setText(stat.children[0], label); + setText(stat.children[1], value); + stat.children[1].classList.toggle('is-accent', key === 'format' && Boolean(spec.codec)); + } + let vol = null; + try { vol = player?.getVolume?.(); } catch (_) {} + setText( + heroWrapEl.querySelector('.lumen-engine-foot'), + typeof vol === 'number' ? 'Volume ' + Math.round(vol * 100) + '%' + (player?.isMuted?.() ? ' · muted' : '') : '' + ); + } +} + +function destroyShellLayer() { + hdrSlotEl?.remove(); + brandEl?.remove(); + railCardEl?.remove(); + heroWrapEl?.remove(); + hdrSlotEl = dacEl = clarityMiniEl = brandEl = railCardEl = heroWrapEl = null; + heroLastArt = null; +} + +function ensureShellLayer() { + applyShellAttr(); + if (!state.shell || isMiniPlayerActive()) { + destroyShellLayer(); + return; + } + ensureHeaderSlot(); + ensureBrandAndRailCard(); + ensureHero(); + syncShell(); +} + +function makeCcRow(title, desc, key, onChange) { + const row = shellEl('div', 'lumen-cc-row'); + const copy = shellEl('div'); + copy.append(shellEl('b', '', title), shellEl('span', '', desc)); + const sw = shellEl('button', 'lumen-switch'); + sw.type = 'button'; + sw.setAttribute('role', 'switch'); + sw.setAttribute('aria-label', title); + sw.dataset.key = key; + sw.append(document.createElement('i')); + sw.addEventListener('click', () => { + state[key] = !state[key]; + onChange(); + syncCc(); + persistState(); + }); + row.append(copy, sw); + return row; +} + +function syncCc() { + if (!ccEl) return; + for (const sw of ccEl.querySelectorAll('.lumen-switch')) { + sw.setAttribute('aria-checked', state[sw.dataset.key] ? 'true' : 'false'); + } +} + +function ensureCc() { + if (ccEl && document.body.contains(ccEl)) return; + ccEl = shellEl('aside', 'lumen-cc'); + ccEl.setAttribute('role', 'dialog'); + ccEl.setAttribute('aria-label', 'Lumen Glass layout'); + ccEl.append(shellEl('h3', '', 'Lumen Glass'), shellEl('div', 'lumen-cc-sub', 'Canvas shell · Alt+K')); + ccEl.append( + makeCcRow('Canvas layout', 'Floating toolbar, capsule rail, hero and drawer', 'shell', () => { ensureShellLayer(); }), + makeCcRow('Ambient orbs', 'Drifting colour fields behind the window', 'orbs', () => { ensureGlassLayers(); syncDeckUI(); }), + makeCcRow('Lumen Lens deck', 'The draggable floating player', 'deckVisible', () => { applyLayout(false); }) + ); + document.body.append(ccEl); + syncCc(); +} + +function setCcOpen(open) { + ccOpen = open; + if (open) ensureCc(); + syncCc(); + ccEl?.classList.toggle('is-open', open); +} + +function destroyCc() { + ccEl?.remove(); + ccEl = null; + ccOpen = false; +} + +document.documentElement.style.setProperty('--lumen-glass-alpha', (state.clarity / 100).toFixed(2)); +pushSkinToApp(); +applyFinish(false); +applyLayout(false); +syncTrackUI(); +rafId = requestAnimationFrame(vizFrame); + +const cleanups = []; +let disposed = false; +let shellCheckQueued = false; + +function tagSearchPopover() { + const tagged = document.querySelectorAll('[data-lumen-popover]'); + const input = document.querySelector('[data-lw="title-search"]'); + if (!state.shell || !input) { + tagged.forEach((n) => n.removeAttribute('data-lumen-popover')); + return; + } + const ir = input.getBoundingClientRect(); + const pool = [ + ...document.querySelectorAll('[data-lw="title-bar"] *'), + ...document.body.children, + ]; + let found = null; + for (const node of pool) { + if (node === input || node.contains(input) || node.id === 'lumen-lens-deck') continue; + const pos = getComputedStyle(node).position; + if (pos !== 'absolute' && pos !== 'fixed') continue; + const r = node.getBoundingClientRect(); + if (r.width < 150 || r.height < 40) continue; + if (r.top < ir.bottom - 4 || r.top > ir.bottom + 48) continue; + if (r.left > ir.right || r.right < ir.left) continue; + found = node; + break; + } + tagged.forEach((n) => { if (n !== found) n.removeAttribute('data-lumen-popover'); }); + if (found && !found.hasAttribute('data-lumen-popover')) found.setAttribute('data-lumen-popover', ''); +} + +const shellObserver = new MutationObserver(() => { + if (shellCheckQueued) return; + shellCheckQueued = true; + requestAnimationFrame(() => { + shellCheckQueued = false; + if (disposed) return; + tagSearchPopover(); + const miniNow = isMiniPlayerActive(); + const wasMini = document.body.classList.contains('lumen-in-mini-player'); + const missingPiece = miniNow ? !miniEl : Boolean(state.deckVisible) && !deckEl; + const shellMissing = + !miniNow && + state.shell && + ((document.querySelector('[data-lw="title-bar"] .title-bar') && !(hdrSlotEl && hdrSlotEl.isConnected)) || + (document.querySelector('[data-lw="sidebar"].rail .rail-nav') && !(brandEl && brandEl.isConnected)) || + (document.querySelector('[data-lw="home-page"]') ? !(heroWrapEl && heroWrapEl.isConnected) : Boolean(heroWrapEl))); + if (shellMissing && miniNow === wasMini && !missingPiece) { + ensureShellLayer(); + return; + } + if (miniNow !== wasMini || missingPiece) { + applyLayout(false); + if (!miniNow) syncTrackUI(); + } + }); +}); +shellObserver.observe(document.body, { childList: true, subtree: true }); +cleanups.push(() => shellObserver.disconnect()); + +if (LastWave?.ui?.registerPlayerBarControl) { + cleanups.push( + LastWave.ui.registerPlayerBarControl( + { + id: 'lumen-lens-toggle', + label: 'Toggle Lumen Lens deck (Alt+L)', + icon: 'sparkles', + onClick: () => { + state.deckVisible = !state.deckVisible; + applyLayout(true); + }, + }, + pluginId || 'lumen-glass-theme' + ) + ); +} + +if (LastWave?.ui?.registerPlayerBarControl) { + cleanups.push( + LastWave.ui.registerPlayerBarControl( + { + id: 'lumen-layout-toggle', + label: 'Lumen Glass layout (Alt+K)', + icon: 'layers', + onClick: () => setCcOpen(!ccOpen), + }, + pluginId || 'lumen-glass-theme' + ) + ); +} + +if (LastWave?.events?.on) { + cleanups.push(LastWave.events.on('trackChange', syncTrackUI)); + cleanups.push(LastWave.events.on('playState', syncTrackUI)); + cleanups.push(LastWave.events.on('queueUpdate', syncTrackUI)); + cleanups.push( + LastWave.events.on('progress', (p) => { + if (p && typeof p === 'object') { + lastProgress.positionSec = Number(p.positionSec) || 0; + lastProgress.durationSec = Number(p.durationSec) || 0; + } + if (!isMiniPlayerActive()) updateScrubbers(playerSnapshot()); + }) + ); +} + +if (LastWave?.theme?.onVariantChange) { + cleanups.push( + LastWave.theme.onVariantChange((variant) => { + if (variant && SKINS.some((s) => s.id === variant) && state.skin !== variant) { + state.skin = variant; + applyFinish(false); + pushSkinToApp(); + applyLayout(true); + } + }) + ); +} + +const isTypingTarget = (t) => + t instanceof HTMLElement && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)); + +const onKeyDown = (e) => { + if (!e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.repeat || isTypingTarget(e.target)) return; + const key = { KeyL: 'l', KeyS: 's', KeyO: 'o', KeyK: 'k' }[e.code]; + if (!key) return; + if (key === 'l') { + e.preventDefault(); + state.deckVisible = !state.deckVisible; + applyLayout(true); + } else if (key === 's') { + e.preventDefault(); + const idx = SKINS.findIndex((s) => s.id === state.skin); + setSkin(SKINS[(idx + 1) % SKINS.length].id); + } else if (key === 'k') { + e.preventDefault(); + setCcOpen(!ccOpen); + } else if (key === 'o') { + e.preventDefault(); + state.orbs = !state.orbs; + ensureGlassLayers(); + syncDeckUI(); + persistState(); + } +}; +window.addEventListener('keydown', onKeyDown); +cleanups.push(() => window.removeEventListener('keydown', onKeyDown)); + +const onCcPointerDown = (e) => { + if (!ccOpen || !ccEl || !(e.target instanceof Element)) return; + if (ccEl.contains(e.target) || e.target.closest('[aria-label="Lumen Glass layout (Alt+K)"]')) return; + setCcOpen(false); +}; +const onCcEscape = (e) => { if (e.key === 'Escape' && ccOpen) setCcOpen(false); }; +window.addEventListener('pointerdown', onCcPointerDown, true); +window.addEventListener('keydown', onCcEscape); +cleanups.push(() => { + window.removeEventListener('pointerdown', onCcPointerDown, true); + window.removeEventListener('keydown', onCcEscape); +}); + +const onResize = () => applyLayout(false); +window.addEventListener('resize', onResize); +cleanups.push(() => window.removeEventListener('resize', onResize)); + +if (channel) { + const onChannelMsg = (ev) => { + if (ev.data?.type === 'LUMEN_STATE_SYNC' && ev.data.state) { + const next = sanitizeState(ev.data.state); + const skinChanged = next.skin !== state.skin; + Object.assign(state, next); + if (skinChanged) { pushSkinToApp(); applyFinish(false); } + document.documentElement.style.setProperty('--lumen-glass-alpha', (state.clarity / 100).toFixed(2)); + applyLayout(false); + } + }; + channel.addEventListener('message', onChannelMsg); + cleanups.push(() => { + channel.removeEventListener('message', onChannelMsg); + channel.close(); + }); +} + +return () => { + disposed = true; + clearDesktopLens(); + if (rafId !== null) cancelAnimationFrame(rafId); + if (typeof unsubSpectrum === 'function') unsubSpectrum(); + for (const fn of cleanups) { + try { + fn(); + } catch (_) {} + } + document.querySelectorAll('[data-lumen-popover]').forEach((n) => n.removeAttribute('data-lumen-popover')); + destroyDeck(); + destroyMiniCard(); + destroyShellLayer(); + destroyCc(); + delete document.documentElement.dataset.lumenShell; + delete document.documentElement.dataset.lumenPlaying; + document.getElementById('lumen-ambient-layer')?.remove(); + document.getElementById('lumen-specular-layer')?.remove(); + document.getElementById('lumen-metaball-defs')?.remove(); + document.getElementById('lumen-toast')?.remove(); + const rootStyle = document.documentElement.style; + for (const prop of [ + '--lumen-bass-level', + '--lumen-mouse-x', + '--lumen-mouse-y', + '--lumen-glass-alpha', + '--lumen-seed-hue', + '--lumen-seed-sat', + '--lumen-dynamic-hue', + '--lumen-dynamic-sat', + ]) { + rootStyle.removeProperty(prop); + } + document.documentElement.removeAttribute('data-lumen-skin'); + document.body.classList.remove( + 'lumen-in-mini-player', + 'lumen-mini-custom', + 'lumen-compact-docked' + ); +}; \ No newline at end of file