/* Now-playing bar — the off-screen fallback. Appears only when the active
   chapter's on-screen representation (list card / map popup) isn't visible.
   Same dark-glass chrome as the map; one shared inner layout for both surfaces. */

/* ── shared inner layout ─────────────────────────────────────────────────── */
.np-row { display: flex; align-items: center; gap: 11px; padding: 9px 11px; }
.np-play {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.14); color: var(--bright);
  border: 1px solid rgba(255, 255, 255, 0.24); cursor: pointer; transition: background 0.15s;
}
.np-play:hover { background: rgba(255, 255, 255, 0.26); }
.np-play.is-play svg { margin-left: 2px; }   /* optical-center the play triangle */
.np-title {
  flex: 1; min-width: 0; cursor: pointer;
  font-family: var(--serif); font-size: 13px; font-weight: 600; color: var(--bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: var(--glass-text-shadow);
}
.np-share, .np-add {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.22); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.np-share:hover, .np-add:hover { background: rgba(255, 255, 255, 0.2); color: var(--bright); }
.np-hair { height: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.np-hair-fill { height: 100%; width: 0%; background: rgba(255, 255, 255, 0.85); transition: width 0.15s linear; }

/* ── desktop: pinned to the bottom of the sidebar column ──────────────────── */
#player-bar {
  position: fixed; bottom: 16px; left: 16px; width: calc(var(--sidebar-w) - 32px); z-index: 30;
  background: var(--glass-bg); backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  border-radius: 14px; overflow: hidden; display: none; flex-direction: column;
}
#player-bar.active { display: flex; }
#player-bar .np-hair { border-radius: 0 0 14px 14px; }

/* paused: the bar recedes — present (so you can resume / jump back) but clearly at rest */
#player-bar.paused, .mobile-player.paused { opacity: 0.78; }
#player-bar.paused .np-hair-fill, .mobile-player.paused .np-hair-fill { background: rgba(255, 255, 255, 0.4); }

/* mobile: the now-playing surface is the unified bottom bar (see base.css .bottom-bar);
   the desktop sidebar-bottom bar is hidden there */
@media (max-width: 768px) { #player-bar { display: none !important; } }

/* loading pulse (popup) */
.loading-pulse { display: inline-flex; align-items: center; gap: 3px; height: 12px; }
.loading-pulse .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--amber); animation: pulse 1s ease-in-out infinite; }
.loading-pulse .dot:nth-child(2) { animation-delay: 0.15s; }
.loading-pulse .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1.1); } }

/* toast */
#pl-toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 130; padding: 9px 18px; border-radius: 10px; background: rgba(26,26,26,0.92); color: var(--bright); font-size: 13px; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
#pl-toast.on { opacity: 1; }
