/* ============================================================
   PERSISTENT PLAYER (site-wide dock + detached app window)
   Ported 1:1 from the 2026 design-system prototype
   (ontwerp/Simuze Design System/production/css/simuze-2026.css §53).
   Drives a real <audio>; artwork accepts a cover URL or a gradient.
   ============================================================ */
:root { --szp-bg: rgba(16,18,23,0.86); --szp-border: rgba(255,255,255,0.1); }
/* Accent fallbacks so the player is self-sufficient where simuze-2026.css is not
   loaded (the pop-out window). On the main page simuze-2026.css's :root (loaded
   later in the bundle, identical values) takes precedence. */
:root { --sz-accent: #a8d5ba; --sz-accent-hover: #c1e2c8; }
body.szp-popout { font-family: 'Inter Tight', system-ui, sans-serif; }

/* soft-navigation progress bar (top of viewport) */
#sz-spa-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 2000; background: var(--sz-accent, #a8d5ba); box-shadow: 0 0 8px var(--sz-accent, #a8d5ba); opacity: 0; pointer-events: none; }
#sz-spa-bar.is-loading { width: 80%; opacity: 1; transition: width 1.2s cubic-bezier(.1,.7,.3,1); }
#sz-spa-bar.is-done { width: 100%; opacity: 0; transition: width .2s ease, opacity .3s ease .15s; }
#szPlayer { position: fixed; inset: 0; z-index: 1090; pointer-events: none; color: #fff; font-family: 'Inter Tight', sans-serif; }
#szPlayer .szp-dock, #szPlayer .szp-win, #szPlayer .szp-launcher { pointer-events: auto; }
#szPlayer * { box-sizing: border-box; }
.szp-hidden { display: none !important; }
body.szp-pad-dock { padding-bottom: 92px; }
@media (max-width: 768px) { body.szp-pad-dock { padding-bottom: calc(66px + 104px); } }

/* shared bits */
.szp-art { flex: none; border-radius: 9px; background-size: cover; background-position: center; background-color: #232733; position: relative; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
.szp-art::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); border-radius: inherit; }
.szp-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.szp-eq span { width: 3px; height: 100%; background: var(--sz-accent); border-radius: 2px; transform-origin: bottom; animation: szpEq 0.9s ease-in-out infinite; }
.szp-eq span:nth-child(2) { animation-delay: 0.25s; } .szp-eq span:nth-child(3) { animation-delay: 0.5s; } .szp-eq span:nth-child(4) { animation-delay: 0.15s; }
.szp-paused .szp-eq span { animation-play-state: paused; height: 30%; }
@keyframes szpEq { 0%,100%{ transform: scaleY(0.3); } 50%{ transform: scaleY(1); } }

.szp-iconbtn { background: none; border: 0; color: rgba(255,255,255,0.7); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; transition: color .15s ease, background .15s ease; }
.szp-iconbtn:hover { color: #fff; background: rgba(255,255,255,0.07); }
.szp-iconbtn.is-on { color: var(--sz-accent); }
.szp-iconbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.szp-iconbtn--fill svg { fill: currentColor; stroke: none; }
.szp-play { flex: none; border-radius: 50%; background: var(--sz-accent); color: #0a0a0a; border: 0; cursor: pointer; display: grid; place-items: center; transition: background .15s ease, transform .1s ease; }
.szp-play:hover { background: var(--sz-accent-hover); } .szp-play:active { transform: scale(0.93); }
.szp-play svg { fill: currentColor; stroke: none; }

.szp-scrub { flex: 1; min-width: 0; height: 5px; border-radius: 99px; background: rgba(255,255,255,0.15); position: relative; cursor: pointer; }
.szp-scrub__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--sz-accent); border-radius: 99px; }
.szp-scrub__fill::after { content: ""; position: absolute; right: -6px; top: 50%; transform: translateY(-50%) scale(0); width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.5); transition: transform .12s ease; }
.szp-scrub:hover .szp-scrub__fill::after { transform: translateY(-50%) scale(1); }
.szp-time { font-family: ui-monospace, monospace; font-size: 11.5px; color: rgba(255,255,255,0.55); flex: none; font-variant-numeric: tabular-nums; }

/* buffered range (sits under the accent fill) */
.szp-scrub__buf { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: rgba(255,255,255,0.28); border-radius: 99px; }
/* draggable timeline + volume (also on touch) */
.szp-scrub, .szp-vol__track { touch-action: none; }
/* buffering spinner on the play button */
.szp-play { position: relative; }
#szPlayer.szp-loading .szp-play svg { opacity: 0; }
#szPlayer.szp-loading .szp-play::after { content: ""; position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; margin: -23% 0 0 -23%; border: 2px solid rgba(10,10,10,0.3); border-top-color: #0a0a0a; border-radius: 50%; animation: szpSpin .7s linear infinite; }
@keyframes szpSpin { to { transform: rotate(360deg); } }

/* ── DOCKED BAR ── */
.szp-dock { position: fixed; left: 0; right: 0; bottom: 0; background: var(--szp-bg); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); border-top: 1px solid var(--szp-border); box-shadow: 0 -8px 40px rgba(0,0,0,0.45); animation: szpUp .28s cubic-bezier(.2,.9,.2,1); }
@keyframes szpUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.szp-dock__inner { max-width: var(--container-max-width, 1280px); margin: 0 auto; padding: 12px 24px; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(280px, 1.6fr) minmax(120px, 1fr); align-items: center; gap: 20px; }
.szp-now { display: flex; align-items: center; gap: 13px; min-width: 0; }
.szp-now .szp-art { width: 48px; height: 48px; }
.szp-now__meta { min-width: 0; }
.szp-now__title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.szp-now__artist { font-size: 12.5px; color: rgba(255,255,255,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.szp-center { display: flex; flex-direction: column; gap: 7px; }
.szp-transport { display: flex; align-items: center; justify-content: center; gap: 6px; }
.szp-transport .szp-play { width: 38px; height: 38px; } .szp-transport .szp-play svg { width: 17px; height: 17px; }
.szp-bar { display: flex; align-items: center; gap: 11px; }
.szp-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.szp-vol { display: flex; align-items: center; gap: 7px; width: 92px; }
.szp-vol__track { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,0.15); position: relative; cursor: pointer; }
.szp-vol__fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,0.55); border-radius: 99px; }
.szp-divider { width: 1px; height: 26px; background: rgba(255,255,255,0.1); margin: 0 4px; }
@media (max-width: 860px) {
  .szp-dock__inner { grid-template-columns: 1fr auto; gap: 10px 14px; padding: 10px 16px; }
  .szp-center { grid-column: 1 / -1; order: 3; }
  .szp-right { gap: 2px; }
  .szp-vol { display: none; }
}
@media (max-width: 768px) { .szp-dock { bottom: 66px; } }
@media (max-width: 480px) { .szp-now__title { font-size: 13.5px; } .szp-right .szp-queuebtn { display: none; } }

/* queue popover */
.szp-queue { position: absolute; bottom: calc(100% + 10px); right: 16px; width: 320px; max-height: 50vh; overflow: auto; background: #15181f; border: 1px solid var(--szp-border); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,0.55); padding: 8px; }
.szp-queue[hidden] { display: none; }
.szp-queue__h { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.4); font-family: 'Rules', sans-serif; padding: 8px 10px 6px; }
.szp-qrow { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.szp-qrow:hover { background: rgba(255,255,255,0.05); }
.szp-qrow.is-current { background: rgba(168,213,186,0.1); }
.szp-qrow .szp-art { width: 34px; height: 34px; }
.szp-qrow__main { flex: 1; min-width: 0; }
.szp-qrow__title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.szp-qrow.is-current .szp-qrow__title { color: var(--sz-accent); }
.szp-qrow__artist { font-size: 11.5px; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.szp-qrow__dur { font-size: 11.5px; color: rgba(255,255,255,0.4); font-variant-numeric: tabular-nums; }

/* ── DETACHED APP WINDOW ── */
.szp-win { position: fixed; width: 300px; bottom: 24px; right: 24px; background: var(--szp-bg); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); border: 1px solid var(--szp-border); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); overflow: hidden; animation: szpPop .28s cubic-bezier(.2,.9,.2,1); }
@keyframes szpPop { from { transform: scale(.92) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.szp-win__bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: grab; user-select: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
.szp-win__bar:active { cursor: grabbing; }
.szp-win__dots { display: flex; gap: 6px; }
.szp-win__dot { width: 11px; height: 11px; border-radius: 50%; border: 0; cursor: pointer; padding: 0; }
.szp-win__dot--close { background: #ff5f57; } .szp-win__dot--close:hover { filter: brightness(1.15); }
.szp-win__dot--min { background: rgba(255,255,255,0.2); }
.szp-win__label { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255,255,255,0.4); font-family: 'Rules', sans-serif; margin-left: 2px; }
.szp-win__attach { margin-left: auto; }
.szp-win__body { padding: 18px; }
.szp-win__art { width: 100%; aspect-ratio: 1; border-radius: 13px; margin-bottom: 16px; }
.szp-win__art .szp-eq { position: absolute; left: 12px; bottom: 12px; height: 18px; }
.szp-win__title { font-weight: 700; font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.szp-win__artist { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.szp-win__bar2 { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; }
.szp-win__transport { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.szp-win__transport .szp-play { width: 52px; height: 52px; } .szp-win__transport .szp-play svg { width: 22px; height: 22px; }
.szp-win__transport .szp-iconbtn svg { width: 20px; height: 20px; }
/* The detached card / popout clips overflow, so the queue flows inline in the body
   instead of as an upward popover (which would be hidden). */
.szp-win .szp-queue { position: static; width: auto !important; left: auto; right: auto; bottom: auto; margin-top: 12px; box-shadow: none; max-height: 38vh; }

/* popout window mode: the window IS the whole browser tab */
body.szp-popout { margin: 0; background: #0c0e13; }
body.szp-popout #szPlayer { position: static; pointer-events: auto; }
body.szp-popout .szp-win { position: static; width: 100%; min-height: 100vh; bottom: auto; right: auto; border: 0; border-radius: 0; box-shadow: none; animation: none; overflow: visible; }
body.szp-popout .szp-win__body { padding: 18px; }
/* queue inside the pop-out scrolls instead of being clipped */
body.szp-popout .szp-win .szp-queue { max-height: 46vh; }

/* ── LAUNCHER BUBBLE (when dock closed) ── */
.szp-launcher { position: fixed; bottom: 24px; right: 24px; display: flex; align-items: center; gap: 0; background: var(--szp-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--szp-border); border-radius: 99px; padding: 6px 6px 6px 6px; box-shadow: 0 14px 40px rgba(0,0,0,0.5); cursor: pointer; transition: gap .2s ease, padding .2s ease; overflow: hidden; max-width: 56px; animation: szpPop .28s cubic-bezier(.2,.9,.2,1); }
.szp-launcher:hover { max-width: 280px; gap: 11px; padding-right: 18px; }
.szp-launcher .szp-art { width: 42px; height: 42px; border-radius: 50%; }
.szp-launcher__meta { min-width: 0; white-space: nowrap; opacity: 0; transition: opacity .2s ease; }
.szp-launcher:hover .szp-launcher__meta { opacity: 1; }
.szp-launcher__title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.szp-launcher__artist { font-size: 11.5px; color: rgba(255,255,255,0.55); overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
@media (max-width: 768px) { .szp-launcher { bottom: 78px; } .szp-win { bottom: 78px; } }
