.np-widget {
    contain: content;
  /* background: linear-gradient(135deg, #1a1a2e, #16213e); */
  /* background: linear-gradient(135deg, #1a1a2e, #3b1364); */
  background: linear-gradient(135deg, #1a1a2e, rgba(var(--site-accent-rgb, 0, 255, 0), 0.10));
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  max-width: 500px;
  margin: 20px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(var(--site-accent-rgb), 0.3);
}

.np-widget.np-offline {
  background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
  border-color: transparent;
  text-align: center;
}

.np-widget.np-offline .np-status {
  color: #ff6b6b;
  font-size: 1.2rem;
  font-weight: bold;
}

.np-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.np-label::before {
  content: '● ';
  color: #00ff88;
  animation: pulse calc(var(--pulse-tempo, 4s) * 0.75) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.np-track-link {
  text-decoration: none;
  color: inherit;
  display: block;
  margin-bottom: 12px;
}

.np-track-link:hover {
  color: var(--site-accent, #00ff00);
}

.np-track-info {
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.15);
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
}

.np-title {
  font-size: 1.3rem;
  margin: 0 0 4px 0;
  color: #fff;
}

.np-artist {
  font-size: 1rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.np-mixtape {
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.18);
  color: var(--site-accent, #00ff00);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.np-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0;
}

/* OLD — layout-triggering */
.np-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--site-accent, #00ff00), rgba(var(--site-accent-rgb, 0, 255, 0), 0.4));
  transition: width 0.25s ease;
}

/* NEW — compositor-only, no reflow */
.np-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--site-accent, #00ff00), rgba(var(--site-accent-rgb, 0, 255, 0), 0.4));
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

.np-timer {
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
}

.np-remaining {
  color: #00ff88;
}

.np-reactions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.np-react-btn {
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.2);
  border: 1px solid rgba(var(--site-accent-rgb, 0, 255, 0), 0.4);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.np-react-btn:hover {
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.4);
  transform: scale(1.1);
}

.np-react-active {
  background: var(--site-accent, #00ff00);
  border-color: var(--site-accent, #00ff00);
  animation: pop 0.3s ease;
}

@keyframes pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.np-error {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.np-reaction-count {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.np-reaction {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.np-reaction sup {
  font-size: 0.7em;
  vertical-align: super;
  color: var(--site-accent, #00ff00);
}

.np-no-reactions {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

.np-timer,
.np-current,
.np-total,
.np-remaining {
  font-variant-numeric: tabular-nums;
}
.np-react-btn {
  transition: background-color 0.2s, transform 0.2s;  /* was: all 0.2s */
}


/* Lyric Button (inside now-playing-widget) */
.np-lyrics-btn {
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.2);
  border: 1px solid rgba(var(--site-accent-rgb, 0, 255, 0), 0.4);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 10px;
}

.np-lyrics-btn:hover:not(:disabled) {
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.4);
  transform: translateY(-1px);
}

.np-lyrics-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal Overlay */
.np-lyrics-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.np-lyrics-modal {
  /* background: linear-gradient(135deg, #1a1a2e, #16213e); */
  background: linear-gradient(135deg, #1a1a2e, rgba(var(--site-accent-rgb, 0, 255, 0), 0.10));
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(var(--site-accent-rgb, 0, 255, 0), 0.3);
}

.np-lyrics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(var(--site-accent-rgb, 0, 255, 0), 0.2);
}

.np-lyrics-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #fff;
}

.np-lyrics-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}

.np-lyrics-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.np-lyrics-content {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
}

.np-lyrics-content p {
  margin: 12px 0;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.np-lyrics-content p:hover {
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.2);
  border-left-color: var(--site-accent, #00ff00);
}

.np-lyrics-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(var(--site-accent-rgb, 0, 255, 0), 0.2);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.np-lyrics-loader {
  text-align: center;
  padding: 40px;
  color: #888;
  font-style: italic;
}


/* ---- Credit links row ---- */
.np-credit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--site-accent-rgb, 0, 255, 0), 0.2);
}

.np-credit-msg {
  display: block;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.np-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.np-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  text-decoration: none;
  color: #fff;
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.18);
  border: 1px solid rgba(var(--site-accent-rgb, 0, 255, 0), 0.35);
  transition: background-color 0.2s, transform 0.2s;
}

.np-link:hover {
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.42);
  transform: translateY(-1px);
}

@media (max-width: 420px) {
  .np-link { padding: 5px 10px; font-size: 0.76rem; }
}

/* Smooth fade for source switching */
.np-widget.np-fading-out {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 300ms ease, transform 300ms ease;
}

.np-widget.np-fading-in {
  opacity: 1;
  transform: scale(1);
  transition: opacity 400ms ease, transform 400ms ease;
}

/* Prevent layout jump while transitioning */
.np-widget {
  min-height: 200px;
  transition: min-height 300ms ease;
}

/* Loading state keeps same height */
.np-widget.np-loading {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.1);
}

.np-widget.np-loading .np-status {
  color: var(--site-accent, #00ff00);
  font-size: 1rem;
  letter-spacing: 1px;
}

/* =====================================================================
   SOURCE-SWITCH TRANSITION
   Targets the #now-playing-widget CONTAINER, not the inner .np-widget,
   so the whole box fades as one unit and can't collapse mid-swap.
   ===================================================================== */

#now-playing-widget {
  transition: opacity 480ms ease, transform 480ms ease;
  will-change: opacity, transform;
}

/* playerfade-001-css - one-shot entrance via the container's own 480ms transition */
#now-playing-widget.np-enter {
  opacity: 0;
  transform: translateY(8px);
}

#now-playing-widget.np-fading-out {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
}

/* TUNING plate — inherits the frozen height, so no layout jump */
#now-playing-widget .np-widget.np-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  margin: 20px auto;
  padding: 16px;
  border-radius: 12px;
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.12);
  border: 1px solid rgba(var(--site-accent-rgb, 0, 255, 0), 0.3);
  color: #fff;
}

#now-playing-widget .np-widget.np-loading .np-status {
  color: var(--site-accent, #00ff00);
  font-size: 1rem;
  letter-spacing: 2px;
  animation: np-tuning-pulse calc(var(--pulse-tempo, 4s) * 0.5) ease-in-out infinite;
}

@keyframes np-tuning-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* =====================================================================
   CROSSFADE STYLES (optional)
   Enable by setting CFG.CROSSFADE_ENABLED = true in widget JS
   ===================================================================== */

 .np-crossfade-outgoing {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
  } 
 .np-crossfade-incoming {
    position: relative;
    z-index: 2;
  } 

  /* ---- "play from here" deep link ------------------------------------- */
.np-jump {
  display: inline-block;
  margin: 0.35rem 0 0.5rem;
  padding: 0.3rem 0.75rem;
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--site-accent, #00ff00);
  background: rgba(var(--site-accent-rgb, 0, 255, 0), 0.08);
  border: 1px solid var(--border-medium, rgba(0, 255, 0, 0.78));
  border-radius: 3px;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.np-jump:hover,
.np-jump:focus-visible {
  background: var(--site-accent, #00ff00);
  color: #000;
  outline: none;
  box-shadow: 0 0 14px rgba(var(--site-accent-rgb, 0, 255, 0), 0.6);
}

/* ---- mixtape chip doubles as the jump-to-here link ------------------ */
.np-mixtape-link {
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dotted currentColor;
  transition: color 0.18s ease, border-color 0.18s ease, text-shadow 0.18s ease;
}

/* small play glyph so the chip reads as clickable */
.np-mixtape-link::after {
  content: ' ▶';
  font-size: 0.82em;
  opacity: 0.6;
  transition: opacity 0.18s ease;
}

.np-mixtape-link:hover,
.np-mixtape-link:focus-visible {
  color: var(--site-accent, #00ff00);
  border-bottom-color: var(--site-accent, #00ff00);
  text-shadow: 0 0 10px rgba(var(--site-accent-rgb, 0, 255, 0), 0.55);
  outline: none;
}

.np-mixtape-link:hover::after,
.np-mixtape-link:focus-visible::after {
  opacity: 1;
}


/* ==== CASEFILE 158b — accent-token skin (cyan-aware) ==== */
#now-playing-widget { border: none; }
#now-playing-widget .np-label { color: var(--site-accent); letter-spacing: 2px; }
#now-playing-widget .np-mixtape { color: var(--site-accent); }
#now-playing-widget .np-progress-fill { background: linear-gradient(90deg, var(--site-accent), rgba(var(--site-accent-rgb), 0.4)); }
#now-playing-widget .np-react-btn { background: rgba(var(--site-accent-rgb), 0.14); border: 1px solid rgba(var(--site-accent-rgb), 0.35); }
#now-playing-widget .np-react-btn:hover { background: var(--site-accent); color: #000; }
#now-playing-widget .np-lyrics-btn { background: rgba(var(--site-accent-rgb), 0.14); }
#now-playing-widget .np-custody .np-title { color: var(--site-accent); text-shadow: 0 0 10px rgba(var(--site-accent-rgb), 0.4); }
#now-playing-widget .np-custody .np-artist { color: rgba(255,255,255,0.75); }

/* ==== [COUNT-IN-BTN] per-button reaction count (Rule 28 append) ==== */
#now-playing-widget .np-react-btn .np-rx-cnt {
  font-size: 0.55em;
  margin-left: 2px;
  vertical-align: super;
  font-family: inherit;
}


/* ===== vibe-cue offline state (2026-11-15) — Rule 42: the hole gets dressed =====
   Alarm red retired. Avantida purple + magenta, calm breath, DJ note demoted. */
.np-widget.np-offline {
  background: linear-gradient(135deg, #14161c, #0e1114);
  border-color: rgba(var(--site-accent-rgb, 0, 255, 0), 0.35);
}
.np-widget.np-offline .np-status {
  color: var(--site-accent, #b9a5ff);
  text-shadow: 0 0 8px rgba(var(--site-accent-rgb, 0, 255, 0), 0.45);
  animation: np-chill 4s ease-in-out infinite;
}
.np-widget.np-offline .np-dj-note {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: normal;
  letter-spacing: 1px;
  color: #ff2fa0;
  opacity: 0.65;
}
@keyframes np-chill {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* ===== np-accent-sweep (2026-11-15): widget follows --site-accent ===== */


/* ==================== NOWPLAY-IFRAME-06 ====================
   Focus-mode overlay: 3s cinematic curtain, same speed in and
   out — wall and backdrop fade as ONE on exit. Iframe canvas
   pinned dark (no white frame flash on navigation). */
.np-artist-wall { cursor: pointer; }
.np-artist-wall:hover { text-decoration: underline; }
.np-track-plain { cursor: default; }

#np-wall-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 3s ease;
  display: flex;
  flex-direction: column;
}
#np-wall-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
#np-wall-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #000;
  color-scheme: dark;
  opacity: 0;
  transition: opacity 2.5s ease;
}
#np-wall-frame.loaded { opacity: 1; }

/* ==================== FLASHFIX-08 (2026-11-23) ====================
   FLASHFIX-07 injected style lost in the 21:42 snapshot restore;
   the JS half (classList add/remove np-off) survived alone.
   Law restored file-owned: hidden overlay leaves the render tree,
   so it is never composited — nothing paints between transitions. */
#np-wall-overlay.np-off {
  display: none !important;
}

/* ==================== FABSUPPRESS-01 (2026-11-23) ====================
   MOBILEWALL-01 cure: parent FAB crew leaks over the np-wall curtain.
   responsive.css boosts #bg-slideshow-toggle to z-index 10005 !important
   on narrow screens — five points over the overlay's 10000. Instead of
   escalating the arms race, the whole parent crew stands down while
   the popup is open (:has watches for .open on the overlay). */
body:has(#np-wall-overlay.open) .nb-fab,
body:has(#np-wall-overlay.open) #bg-slideshow-toggle,
body:has(#np-wall-overlay.open) .bg-slideshow-toggle,
body:has(#np-wall-overlay.open) .chat-fab,
body:has(#np-wall-overlay.open) .fab-chat,
body:has(#np-wall-overlay.open) .chat-toggle-btn,
body:has(#np-wall-overlay.open) #chat-toggle {
  display: none !important;
}
