/* Now Playing — overlay panes and the #player-bar mini bar. --np-accent is set per song by js/now-playing.js. */

:root { --np-accent: #e0e0e0; --np-bar-h: 64px; }

/* ── Mini / desktop bar ─────────────────────────────────────────── */
.player-bar {
    position: fixed; left: 0; right: 0; z-index: 900;
    bottom: var(--bottom-nav-height, 0px);
    height: var(--np-bar-h);
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    padding: 0 12px 0 8px;
    background: rgba(16, 16, 16, .92);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    color: #fff; user-select: none; touch-action: pan-x;
    transition: opacity .25s ease, transform .25s ease;
}
.player-bar.np-hidden { opacity: 0; pointer-events: none; }
.pb-song { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-art { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #282828; flex: none; }
.pb-text { display: flex; flex-direction: column; min-width: 0; }
.pb-title { font-size: 14px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-artist { font-size: 12px; color: rgba(255,255,255,.62); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-artist .artist-link { cursor: pointer; }
.pb-album { display: none; }
.pb-btn {
    width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}
.pb-btn svg { width: 24px; height: 24px; fill: currentColor; }
.pb-btn:hover { background: rgba(255,255,255,.08); transform: scale(1.05); }
.pb-btn:active { transform: scale(.92); }
.pb-btn:focus-visible { outline: 2px solid var(--np-accent); outline-offset: 2px; }
.pb-btn.disabled { opacity: .35; pointer-events: none; }
.pb-like.active, .pb-like.liked { color: var(--np-accent); }
.pb-buttons { display: flex; align-items: center; gap: 4px; }
.pb-play { background: #fff; color: #000; }
.pb-play:hover { background: #fff; }
/* Mobile: only play + next visible; thin progress along the bottom edge. */
.pb-controls { display: contents; }
.pb-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.pb-time { display: none; }
.pb-track { position: absolute; inset: 0; background: rgba(255,255,255,.15); }
.pb-fill { height: 100%; width: 0; background: var(--np-accent); transition: width .25s linear; }
.pb-extras, .pb-like, #prev-btn { display: none; }
.player-bar.buffering .pb-play { position: relative; }
.player-bar.buffering .pb-play::after {
    content: ''; position: absolute; inset: -3px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: np-spin .8s linear infinite;
}
@keyframes np-spin { to { transform: rotate(360deg); } }

@media (min-width: 1024px) {
    .player-bar {
        grid-template-columns: minmax(200px, 1fr) minmax(320px, 2fr) minmax(200px, 1fr);
        height: 88px; padding: 0 24px; bottom: 0;
    }
    .pb-controls { display: flex; flex-direction: column; align-items: center; gap: 6px; }
    .pb-buttons { gap: 12px; }
    .pb-play { width: 40px; height: 40px; }
    .pb-progress { position: static; display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; height: auto; }
    .pb-time { display: inline; font-size: 12px; color: rgba(255,255,255,.55); min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
    .pb-track { position: relative; flex: 1; height: 4px; border-radius: 2px; cursor: pointer; overflow: hidden; }
    .pb-fill { border-radius: 2px; }
    .pb-extras { display: flex; align-items: center; justify-content: flex-end; gap: 4px; position: relative; }
    .pb-like, #prev-btn { display: inline-flex; }
    .pb-quality { width: auto; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
    .pb-volume { display: flex; align-items: center; gap: 4px; }
    .pb-volume-slider { width: 90px; accent-color: var(--np-accent); }
    .pb-art { width: 56px; height: 56px; }
    .pb-title { font-size: 15px; }
}

/* Quality modal (desktop bar and overlay More menu share it). */
.np-modal { position: fixed; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.6); }
.np-modal.open { display: flex; }
.np-modal-card { background: #181818; border-radius: 20px; padding: 24px; width: min(92vw, 360px); }
.np-modal-card h3 { margin: 0 0 16px; font-size: 18px; }
.quality-options-list { display: flex; flex-direction: column; gap: 8px; }
.quality-option-mobile { display: flex; justify-content: space-between; padding: 14px 16px; border: 0; border-radius: 12px; background: rgba(255,255,255,.06); color: #fff; font-size: 15px; cursor: pointer; }
.quality-option-mobile span { color: rgba(255,255,255,.55); }
.quality-option-mobile.active { background: color-mix(in srgb, var(--np-accent) 25%, transparent); }
.modal-close-btn { margin-top: 16px; width: 100%; padding: 12px; border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.7); cursor: pointer; }

/* ── Overlay shell ──────────────────────────────────────────────── */
.np {
    position: fixed; inset: 0; z-index: 1000; background: #0a0a0a; color: #fff;
    display: flex; flex-direction: column; overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif; will-change: transform;
}
.np[hidden] { display: none; }
.np-bg { position: absolute; inset: 0; overflow: hidden; }
.np-bg img { position: absolute; inset: -20%; width: 140%; height: 140%; object-fit: cover; filter: blur(80px); opacity: 0; transition: opacity .6s ease; }
.np-bg img.is-ready { opacity: .25; }
.np-bg-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.85)); }

.np-header { position: relative; z-index: 2; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: max(12px, env(safe-area-inset-top)) 12px 4px; }
.np-tabs { display: none; }
.np-dots { display: flex; justify-content: center; gap: 8px; }
.np-dot { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; }
.np-dot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(255,255,255,.35); transition: background .2s, transform .2s; }
.np-dot.is-active::after { background: #fff; transform: scale(1.3); }
.np-icon-btn { width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .12s ease, background .12s ease, color .2s ease; }
.np-icon-btn svg { width: 26px; height: 26px; fill: currentColor; }
.np-icon-btn:hover { background: rgba(255,255,255,.08); transform: scale(1.05); }
.np-icon-btn:active { transform: scale(.92); }
.np-icon-btn:focus-visible, .np-play:focus-visible, .np-pill:focus-visible, .np-seek:focus-visible, .np-dot:focus-visible, .np-tab:focus-visible, .np-menu-item:focus-visible { outline: 2px solid var(--np-accent); outline-offset: 3px; }
.np-icon-btn.np-sm { width: 44px; height: 44px; } .np-icon-btn.np-sm svg { width: 22px; height: 22px; }
.np-icon-btn.np-md svg { width: 32px; height: 32px; }
.np-icon-btn[aria-pressed="true"] { color: var(--np-accent); }
.np-more-wrap { position: relative; }
.np-menu { position: absolute; right: 0; top: 52px; min-width: 200px; padding: 8px; border-radius: 16px; background: rgba(28,28,28,.96); box-shadow: 0 16px 48px rgba(0,0,0,.6); z-index: 5; }
.np-menu-item { display: block; width: 100%; padding: 12px 14px; border: 0; border-radius: 10px; background: transparent; color: #fff; text-align: left; font-size: 15px; cursor: pointer; }
.np-menu-item:hover { background: rgba(255,255,255,.08); }

/* ── Pager ──────────────────────────────────────────────────────── */
.np-pager { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; width: 300vw; transform: translate3d(0,0,0); touch-action: none; }
.np-pane { width: 100vw; flex: none; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.np-pane[inert] { visibility: hidden; }
.np-pane-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Player pane ────────────────────────────────────────────────── */
.np-player { align-items: center; justify-content: space-between; padding: 8px 24px calc(24px + env(safe-area-inset-bottom)); gap: 20px; }
.np-art-wrap { position: relative; width: calc(100vw - 48px); max-width: 420px; aspect-ratio: 1; flex: none; }
.np-art { width: 100%; height: 100%; border-radius: 20px; object-fit: cover; background: #282828; box-shadow: 0 24px 64px rgba(0,0,0,.6), 0 0 80px color-mix(in srgb, var(--np-accent) 25%, transparent); opacity: 0; transition: opacity .4s ease, box-shadow .6s ease; }
.np-art.is-ready { opacity: 1; }
.np-skeleton { position: absolute; inset: 0; }
.np-sk-art, .np-sk-line { background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.12), rgba(255,255,255,.06)); background-size: 200% 100%; animation: np-shimmer 1.4s ease infinite; border-radius: 20px; }
.np-sk-art { width: 100%; height: 100%; }
.np-sk-line { position: absolute; height: 18px; border-radius: 9px; top: calc(100% + 28px); left: 15%; }
.np-sk-line.w70 { width: 70%; } .np-sk-line.w40 { width: 40%; top: calc(100% + 56px); left: 30%; }
@keyframes np-shimmer { to { background-position: -200% 0; } }
.np-meta { width: 100%; max-width: 420px; text-align: center; }
.np-title { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.np-artists { margin: 6px 0 0; font-size: 17px; font-weight: 500; color: rgba(255,255,255,.72); }
.np-album { margin: 2px 0 0; font-size: 15px; color: rgba(255,255,255,.5); }
.np-starring { margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,.55); }
.np-starring .np-sep { color: rgba(255,255,255,.35); margin-right: 4px; }
.np-link { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.np-link:hover { color: #fff; text-decoration: underline; }
.np-artists .np-sep { color: rgba(255,255,255,.4); }
.np-controls { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 420px; }
.np-play { position: relative; width: 72px; height: 72px; border: 0; border-radius: 50%; background: #fff; color: #000; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .12s ease; margin: 0 8px; }
.np-play svg { width: 36px; height: 36px; fill: currentColor; transition: transform .15s ease, opacity .15s ease; }
.np-play:hover { transform: scale(1.05); } .np-play:active { transform: scale(.92); }
.np-play .np-ic-pause, .np-play .np-spinner { display: none; }
.np-play.is-playing .np-ic-play { display: none; } .np-play.is-playing .np-ic-pause { display: block; }
.np-play.is-buffering svg { opacity: .3; }
.np-play.is-buffering .np-spinner { display: block; position: absolute; inset: 6px; border-radius: 50%; border: 3px solid rgba(0,0,0,.15); border-top-color: #000; animation: np-spin .8s linear infinite; }
.np-actions { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 420px; }
.np-pill { height: 40px; padding: 0 20px; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; background: rgba(255,255,255,.06); color: #fff; font: 600 14px/1 'Inter', system-ui, sans-serif; cursor: pointer; transition: transform .12s, background .2s, border-color .2s; }
.np-pill.has-lyrics { background: color-mix(in srgb, var(--np-accent) 22%, transparent); border-color: color-mix(in srgb, var(--np-accent) 60%, transparent); }
.np-pill:active { transform: scale(.94); }
.np-volume { display: none; }

@media (prefers-reduced-motion: reduce) {
    .np *, .player-bar * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.np-progress { width: 100%; max-width: 420px; }
.np-seek { position: relative; height: 44px; cursor: pointer; touch-action: none; }
.np-seek-track { position: absolute; left: 0; right: 0; top: 20px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); overflow: hidden; }
.np-seek-fill { height: 100%; width: 0; background: var(--np-accent); }
.np-seek-thumb { position: absolute; top: 22px; left: 0; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5); transition: transform .15s ease; }
.np-seek.is-dragging .np-seek-thumb, .np-seek:focus-visible .np-seek-thumb { transform: scale(1.45); }
.np-times { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,.55); font-variant-numeric: tabular-nums; margin-top: -6px; }

/* ── Lyrics pane ────────────────────────────────────────────────── */
.np-lyrics-source { position: absolute; top: 8px; left: 28px; z-index: 1; padding: 4px 10px; width: max-content; border-radius: 10px; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.np-lyrics { position: relative; }
.np-lyrics-body { flex: 1; overflow-y: auto; padding: 30vh 28px 40vh; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.np-lyrics-body .lyric-line { font-size: 22px; font-weight: 600; line-height: 1.35; opacity: .45; margin: 0 0 22px; cursor: pointer; transition: opacity .3s ease, font-size .3s ease, color .3s ease, transform .2s ease; border-radius: 10px; padding: 4px 8px; }
.np-lyrics-body .lyric-line:hover { opacity: .8; }
.np-lyrics-body .lyric-line:active { transform: scale(.985); }
.np-lyrics-body .lyric-line.active { font-size: 26px; font-weight: 700; opacity: 1; color: var(--np-accent); background: transparent; border-left: 0; }
.np-lyrics-body .lyric-line.previous { opacity: .45; }
.np-lyrics-body .lyric-line:focus-visible { outline: 2px solid var(--np-accent); }
.np-jump { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); height: 40px; padding: 0 18px; border: 0; border-radius: 20px; background: #fff; color: #000; font: 600 14px/1 'Inter', system-ui, sans-serif; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.np-empty { margin: auto; text-align: center; padding: 24px; color: rgba(255,255,255,.7); }
.np-empty .np-empty-glyph { font-size: 44px; color: var(--np-accent); margin-bottom: 14px; }
.np-empty h3 { margin: 0 0 8px; font-size: 20px; color: #fff; }
.np-empty p { margin: 0 0 20px; font-size: 15px; }
.np-loading-lines { padding: 30vh 28px 0; }
.np-loading-lines div { height: 22px; border-radius: 11px; margin-bottom: 24px; background: rgba(255,255,255,.08); animation: np-pulse 1.2s ease-in-out infinite; }
.np-loading-lines div:nth-child(2) { width: 70%; animation-delay: .15s; } .np-loading-lines div:nth-child(3) { width: 85%; animation-delay: .3s; }
@keyframes np-pulse { 50% { opacity: .4; } }

/* ── Song Info pane ─────────────────────────────────────────────── */
.np-info-body { flex: 1; overflow-y: auto; padding: 8px 24px calc(32px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.np-info-summary { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 28px; }
.np-info-summary img { width: 120px; height: 120px; border-radius: 16px; object-fit: cover; background: #282828; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.np-info-summary h3 { margin: 6px 0 0; font-size: 20px; font-weight: 700; }
.np-info-summary p { margin: 0; color: rgba(255,255,255,.65); font-size: 15px; }
.np-section { margin: 0 0 26px; }
.np-section h3 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.np-section dl { margin: 0; display: grid; grid-template-columns: minmax(110px, 36%) 1fr; row-gap: 12px; column-gap: 16px; }
.np-section dt { color: rgba(255,255,255,.55); font-size: 14px; padding-top: 2px; }
.np-section dd { margin: 0; font-size: 15px; line-height: 1.5; }
.np-section dd.np-stack .np-link { display: block; margin-bottom: 6px; }
.np-section dd .np-link { color: #fff; }
.np-copy { width: 32px; height: 32px; margin-left: 6px; border: 0; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.np-copy svg { width: 16px; height: 16px; fill: currentColor; }
.np-copyright { color: rgba(255,255,255,.4); font-size: 13px; margin: 0; }
.np-toast { position: fixed; left: 50%; bottom: calc(var(--np-bar-h) + 24px); transform: translate(-50%, 8px); padding: 10px 16px; border-radius: 12px; background: #fff; color: #000; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; z-index: 1300; pointer-events: none; }
.np-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 1024px) {
    .np-header { padding: 20px 32px 0; max-width: 1400px; margin: 0 auto; width: 100%; }
    .np-dots { display: none; }
    .np-tabs { display: flex; justify-content: center; gap: 6px; }
    .np-tab { height: 40px; padding: 0 20px; border: 0; border-radius: 20px; background: transparent; color: rgba(255,255,255,.6); font: 600 14px/1 'Inter', system-ui, sans-serif; cursor: pointer; }
    .np-tab.is-active { background: rgba(255,255,255,.1); color: #fff; }
    .np-pager { width: 100%; max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: 0 32px 32px; transform: none !important; touch-action: auto; }
    .np-pane { width: auto; }
    .np-pane[inert] { visibility: visible; }
    .np-pane.np-hidden-tab { display: none; }
    .np-player { justify-content: center; gap: 24px; padding: 0; }
    /* The pane must never scroll: on a short window the art gives way first. */
    .np-art-wrap { width: max(240px, min(42vw, 520px, 100vh - 460px)); max-width: none; }
    .np-meta, .np-progress, .np-controls, .np-actions { max-width: min(42vw, 520px); }
    .np-volume { display: flex; align-items: center; gap: 4px; }
    .np-volume input { width: 100px; accent-color: var(--np-accent); }
    .np-lyrics, .np-info { border-left: 1px solid rgba(255,255,255,.08); padding-left: 32px; }
    .np-lyrics-body { padding: 20vh 24px 30vh; }
    .np-info-body { padding: 8px 24px 32px; }
    .np-jump { bottom: 48px; }
}
