/* The player: now-playing bar, full-screen player, queue, Play on, your devices, speaker volume. */

/* ---------- now playing bar ---------- */
.np-bar { grid-area: bar; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 1.3fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 0 20px; background: #050506; border-top: 1px solid #16161b; }
.np-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.np-art-btn { position: relative; flex: none; border-radius: var(--radius-sm); overflow: hidden; }
.np-art { width: 58px; height: 58px; border-radius: var(--radius-sm); }
.np-art.placeholder { background: var(--raised); flex: none; }
.np-expand { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.65); display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.np-art-btn:hover .np-expand { opacity: 1; }
.np-info { min-width: 0; }
.np-title { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-center { display: grid; gap: 4px; justify-items: center; }
.np-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.controls { display: flex; align-items: center; gap: 10px; }
.controls.big { gap: 22px; justify-content: center; }
.play-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; transition: transform .15s var(--ease); }
.play-btn:hover { transform: scale(1.06); }
.controls.big .play-btn { width: 68px; height: 68px; }
.rep1 { position: absolute; font-size: 9px; font-weight: 800; bottom: 4px; right: 5px; }
.scrubber { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; width: 100%; max-width: 620px; }
.scrubber .time { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; text-align: center; }
.scrubber.big { max-width: none; grid-template-columns: 1fr 1fr; gap: 4px 0; }
.scrubber.big .range { grid-column: 1 / -1; grid-row: 1; height: 20px; }
.scrubber.big .range::-webkit-slider-runnable-track { height: 6px; }
.scrubber.big .time:first-of-type { text-align: left; } .scrubber.big .time:last-of-type { text-align: right; }
.volume { display: flex; align-items: center; gap: 4px; width: 140px; }
.volume.big { width: 100%; gap: 10px; }
.volume.big .range { flex: 1; height: 20px; }
.volume-pct { width: 3ch; text-align: right; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.stream-tag { display: inline-flex; }

/* ---------- Play on: one mark everywhere (grey: here · accent: elsewhere · badge: casting · amber: offline) ---------- */
.speaker-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; max-width: 240px; border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: border-color .15s; }
.speaker-pill > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speaker-pill:hover { border-color: #3a3a44; }
.speaker-pill.remote, .speaker-pill.cast { color: var(--accent); border-color: rgba(255,107,74,.35); }
.speaker-pill.offline { color: var(--warn); border-color: rgba(245,165,36,.35); }
.speaker-pill.pending { color: var(--text-2); }
.playon-mark { position: relative; display: inline-grid; place-items: center; flex: none; color: var(--text-2); }
.playon-mark.remote, .playon-mark.cast { color: var(--accent); }
.playon-mark.offline { color: var(--warn); }
.playon-badge { position: absolute; right: -4px; top: -4px; display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); color: #111; box-shadow: 0 0 0 2px var(--bg, #0b0b0d); }
.playon-badge .icon { stroke-width: 3; }
.playon-btn { flex: none; }


/* ---------- full-screen now playing ---------- */
.np-full { position: fixed; inset: 0; height: 100dvh; z-index: 70; display: flex; flex-direction: column; background: #070708; isolation: isolate; animation: rise .25s var(--ease); overflow: hidden; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.np-full-bg { position: absolute; inset: -10%; pointer-events: none; z-index: -1; background-size: cover; background-position: center; filter: blur(80px) saturate(1.4) brightness(.45); }
/* In the full-screen player the bleed past the edges must not widen it (a sideways wobble on iPhones): pinned to the screen. */
.np-full > .np-full-bg { position: fixed; }
.np-full-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.np-full-body { flex: 1; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 440px); justify-content: center; align-items: center; gap: 64px; padding: 0 32px 32px; min-height: 0; }
.np-full-main { display: grid; gap: 18px; }
.np-full-art { width: 100%; max-width: min(480px, 46vh); justify-self: center; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.np-full-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.np-full-row > div:first-child { flex: 1; min-width: 0; }
.np-full-row .np-title { font-size: 24px; font-weight: 800; letter-spacing: -.015em; }
.np-full-row .np-artist { font-size: 16px; }
.np-full-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stream-line { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; margin: 0; }
.stream-line.big { font-size: 15px; }
.np-error { color: var(--warn); font-size: 13px; margin: 0; text-align: center; }
.added-by { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: var(--text-2); font-size: 13px; }
.np-full-queue { max-height: 70vh; overflow-y: auto; background: rgba(0,0,0,.25); border-radius: 16px; padding: 8px 12px; backdrop-filter: blur(10px); }
.np-queue-btn { margin: 0; }
/* the full player's bottom row: Play on (left), Up next (right, phones) */
.np-full-dock { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 32px 24px; flex: none; }
.np-full-dock .playon { left: 0; right: auto; }

/* ---------- queue ---------- */
.queue { display: grid; align-content: start; }
.q-head { font-size: 15px; font-weight: 700; margin: 18px 8px 8px; }
.q-head-row { display: flex; align-items: center; gap: 8px; }
.q-head-row .q-head { flex: 1; }
.q-autoplay { margin: 16px 0 6px; padding: 10px 8px; border-top: 1px solid var(--line); }
.q-row { display: grid; grid-template-columns: 20px 44px minmax(0, 1fr) auto 40px 32px; align-items: center; gap: 10px; padding: 6px 6px 6px 2px; border-radius: 8px; transition: background .12s; }
.q-row:hover { background: rgba(255,255,255,.06); }
.q-row.is-current { background: rgba(255,107,74,.08); }
.q-row.is-current .q-title { color: var(--accent); }
.q-row.faded { opacity: .55; }
.q-row.dragging { background: var(--raised-2); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.grip { color: var(--text-3); cursor: grab; touch-action: none; display: grid; place-items: center; height: 44px; }
.grip:active { cursor: grabbing; }
.q-art { position: relative; width: 44px; height: 44px; border-radius: 4px; overflow: hidden; }
.q-art .art { border-radius: 4px; }
.q-art-play, .q-art-eq { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.72); opacity: 0; transition: opacity .12s; }
.q-art-eq { opacity: 1; }
.q-row:hover .q-art-play { opacity: 1; }
.q-main { min-width: 0; }
.q-title { font-weight: 550; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-sub { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-dur { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.q-remove { width: 30px; height: 30px; opacity: 0; }
.q-row:hover .q-remove { opacity: 1; }
.q-history-toggle { display: flex; align-items: center; gap: 6px; margin: 16px 8px 4px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.pad { padding: 4px 8px; margin: 0; }
.queue.compact .q-row { grid-template-columns: 20px 40px minmax(0, 1fr) auto 36px 28px; }

.drawer-backdrop { position: fixed; inset: 0 0 var(--bar-h) var(--side-w); z-index: 50; background: rgba(0,0,0,.35); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; padding: 8px 12px 24px; animation: slide .22s var(--ease); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 0; position: sticky; top: -8px; background: var(--surface); z-index: 1; }
.drawer-head h2 { margin: 0; font-size: 20px; }

/* play on picker */
.playon-wrap { position: relative; }
.playon { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 70; width: 320px; max-height: 70vh; overflow-y: auto; padding: 8px;
  background: var(--raised-2); border: 1px solid #34343e; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: pop .14s var(--ease); }
.playon-title { font-size: 13px; font-weight: 650; color: var(--text-2); padding: 8px 10px 6px; }
.playon-home { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 12px 10px 4px; }
.playon-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 10px; text-align: left; }
.playon-item:hover { background: rgba(255,255,255,.06); }
.playon-item.on { color: var(--accent); }
.playon-item.on .playon-main b { color: var(--accent); }
.playon-item.off { opacity: .55; }
.playon-icon { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--surface); color: var(--text-2); flex: none; }
.playon-item.on .playon-icon { color: var(--accent); }
.playon-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.playon-main { flex: 1; min-width: 0; display: grid; }
.playon-main b { font-weight: 600; font-size: 14px; color: var(--text); }
.playon-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playon-ask { display: grid; gap: 8px; padding: 6px; }
.playon-ask .playon-title { padding: 2px 0; color: var(--text); font-size: 15px; }
.playon-ask p { margin: 0 0 6px; }
.btn-block { width: 100%; justify-content: center; }
.playon-loading { display: grid; place-items: center; padding: 12px; }

/* Your devices (Play on) and "Playing on … · Play here" */
/* "This device" leads the second line (as in Tidal), so the device's name keeps the first line to itself */
.playon-here { color: var(--text-2); }
.playon-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playon-action { color: var(--accent); font-weight: 600; }
.play-here { white-space: nowrap; }
.device-name { display: flex; gap: 8px; align-items: center; }
.device-name .input { max-width: 260px; }

/* ---------- a speaker's volume (Play on, Settings › Homes) ---------- */
.spk-volume { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--text-2); }
.spk-volume .range { flex: 1; }
.auto-mark { display: inline-grid; place-items: center; border-radius: 50%; background: var(--raised-2); color: var(--text-2); flex: none; }

/* Casting (Play on): the way in, and the cast device while this device casts to it */
.playon-cast .playon-icon { color: var(--text-2); }
.playon-row > .playon-stop { flex: none; margin-right: 4px; color: var(--text-2); }

/* Playback settings (Settings › This device / Homes): crossfade and loudness */
.playback { display: grid; gap: 10px; }
.playback p { margin: 0; }
.playback-fades { grid-template-columns: repeat(5, 1fr); margin: 0; max-width: 460px; }
.playback-fades button { font-size: 13px; height: 32px; }

/* Play on on phones: a drawer from the bottom of the screen */
.playon-backdrop { position: fixed; inset: 0; z-index: 79; background: rgba(0,0,0,.55); animation: fade .15s; }
.playon { text-align: left; font-size: 14px; font-weight: 400; cursor: default; }
.playon.playon-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 80vh; max-height: 80dvh; z-index: 80; transform: none;
  border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding: 6px 10px max(14px, env(safe-area-inset-bottom)); animation: sheet-up .22s var(--ease); }
.playon.playon-sheet::before { content: ""; display: block; width: 36px; height: 4px; margin: 4px auto 6px; border-radius: 2px; background: #4a4a55; }
.playon.playon-sheet .playon-title { font-size: 16px; color: var(--text); padding: 4px 10px 8px; }
.playon.playon-sheet .playon-item { padding: 12px 10px; }

/* sleep timer (views/player/sleep.js) */
.sleep-btn { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 0 8px; border-radius: 999px; }
.sleep-on .sleep-btn { color: var(--accent); }
.sleep-left { font-size: 12px; font-weight: 700; white-space: nowrap; }
.sleep-time { width: 100%; height: 54px; font-size: 22px; text-align: center; margin-top: 8px; }
.np-full-foot .menu-wrap .menu { bottom: calc(100% + 6px); top: auto; }

/* equaliser (views/player/playback.js); not ".eq": that's the playing bars in song lists */
.tone { display: grid; gap: 8px; margin-top: 6px; }
.tone-head { display: flex; align-items: center; justify-content: space-between; min-height: 30px; }
.tone-band { display: grid; grid-template-columns: 64px 1fr 56px; align-items: center; gap: 12px; }
.tone-name { font-size: 14px; color: var(--text-2); }
.tone-db { font-size: 13px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
