@font-face {
  font-family: 'Elkz Display';
  src: url(ElkzDisplay.woff) format('woff');
  font-display: block;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: transparent; }

/* Every size is a share of the card's own width, so it scales with the OBS source. */
.np {
  --accent: #E86200;
  --on-accent: #131518;
  --ink: #131518;
  --edge: rgba(238, 237, 233, 0.14);
  --light: #EEEDE9;
  --muted: #8C9196;
  position: relative;
  width: 100%;
  container-type: inline-size;
  font-family: 'Elkz Display', 'Arial Black', sans-serif;
  overflow: hidden;
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s ease;
}
.np-in { position: relative; }
.np.clear { --ink: transparent; --edge: transparent; }

/* ---------- card (wide): art left, text right ---------- */
.np.card {
  display: flex;
  align-items: center;
  gap: 4cqw;
  padding: 3.2cqw 4.4cqw 5cqw 3.2cqw;
  background: var(--ink);
  box-shadow: inset 0 0 0 2px var(--edge);
}
.np.card .np-art { width: 17cqw; }
.np.card .np-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1.5cqw; }
.np.card .np-label { font-size: 2.5cqw; }
.np.card .np-title { font-size: 5.4cqw; }
.np.card .np-artist { font-size: 3cqw; }
.np.card .np-time { position: absolute; right: 4.4cqw; top: 3.4cqw; font-size: 2.4cqw; }
.np.card .np-track { height: 1.8cqw; }

/* ---------- tall: art on top, text under ---------- */
.np.tall {
  display: flex;
  flex-direction: column;
  gap: 6cqw;
  padding: 6cqw 6cqw 11cqw;
  background: var(--ink);
  box-shadow: inset 0 0 0 2px var(--edge);
}
.np.tall .np-art { width: 100%; }
.np.tall .np-body { display: flex; flex-direction: column; gap: 3cqw; min-width: 0; }
.np.tall .np-label { font-size: 4.6cqw; }
.np.tall .np-title { font-size: 10cqw; }
.np.tall .np-artist { font-size: 5.6cqw; }
.np.tall .np-time { position: absolute; right: 6cqw; bottom: 6cqw; font-size: 4.4cqw; }
.np.tall .np-track { height: 3.2cqw; }

/* art on the right instead of the left */
.np.card.right { flex-direction: row-reverse; padding: 3.2cqw 3.2cqw 5cqw 4.4cqw; }
.np.card.right .np-time { right: auto; left: 4.4cqw; }

/* ---------- parts ---------- */
.np-art {
  position: relative;
  flex-shrink: 0;
  aspect-ratio: 1;
  background: #1f2328;
  box-shadow: 0 0 0 2px var(--edge);
}
.np-art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.5s ease;
}
.np-art img.on { opacity: 1; }

.np-label {
  display: flex; align-items: center; gap: 0.9em;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.np-title { color: var(--light); line-height: 1.12; white-space: nowrap; overflow: hidden; font-variant-ligatures: none; }
.np-title span { display: inline-block; will-change: transform; }
.np-artist { color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-ligatures: none; }
.np-time { color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.05em; }

.np-track {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(238, 237, 233, 0.08);
}
.np-prog {
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: background 0.6s ease;
}

/* equaliser: bounces while playing, flat while paused */
.eq { display: inline-flex; align-items: flex-end; gap: 0.16em; height: 0.95em; }
.eq i { display: block; width: 0.2em; height: 100%; background: var(--accent); transform-origin: 50% 100%;
  animation: eq 0.9s ease-in-out infinite alternate; transition: background 0.6s ease; }
.eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.6s; }
.eq i:nth-child(4) { animation-duration: 0.8s; animation-delay: -0.15s; }
@keyframes eq { 0% { transform: scaleY(0.2); } 100% { transform: scaleY(1); } }
.np.paused .eq i { animation-play-state: paused; transform: scaleY(0.2); }

/* track change: the accent wipes across the card */
.np-wipe {
  position: absolute; inset: 0; z-index: 3;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* hidden when nothing is playing */
.np.hidden { transform: translateY(115%); opacity: 0; }
.np.tall.hidden { transform: translateY(40%); }
.np.instant, .np.instant * { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .eq i { animation: none; transform: scaleY(0.6); }
}
