/* ---------- Écran « en cours de lecture » ---------- */

.transport.big { gap: var(--sp-6); justify-content: center; }
.transport.big .play-btn { width: 68px; height: 68px; }
.nowplaying .play-btn { background: var(--white); color: #08090b; }
.transport.big .btn-icon { width: 48px; height: 48px; color: var(--text); }
.transport.big .mode-btn { color: var(--text-2); }
.transport.big .mode-btn[aria-pressed="true"] { color: var(--accent); }

.nowplaying {
  --text: var(--white); --text-2: rgba(255, 255, 255, 0.76); --text-3: rgba(255, 255, 255, 0.48);
  --hover: rgba(255, 255, 255, 0.1); --active: rgba(255, 255, 255, 0.16); --line: rgba(255, 255, 255, 0.14);
  --track: rgba(255, 255, 255, 0.25); --buffer: rgba(255, 255, 255, 0.4); --bg-2: transparent;
  --np-tint: 30, 34, 44;
  position: fixed; inset: 0; z-index: var(--z-panel);
  color: var(--white); background: #050608;
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  overflow: hidden;
}
.nowplaying.open { opacity: 1; transform: none; }
/* Fond flouté sur une couche réduite (25 %) agrandie : flou bon marché, sans repaint pendant les gestes */
.aura { display: none; }
.np-bg { position: absolute; left: 50%; top: 50%; width: 25%; height: 25%; background-size: cover; background-position: center; filter: blur(18px) saturate(1.5); transform: translate(-50%, -50%) scale(4.6); transform-origin: center; opacity: 0.85; will-change: transform; }
/* Zones de glisser gérées en JS : le navigateur ne doit pas défiler */
.np-art, .np-head { touch-action: none; }
.nowplaying::before { content: ""; position: absolute; inset: 0; z-index: var(--z-raised); background: linear-gradient(180deg, rgba(var(--np-tint), 0.55) 0%, rgba(0, 0, 0, 0.72) 100%); transition: background 0.6s; }
.np-shell { --np-fixed: 440px; --np-cover: min(100%, max(96px, calc(100dvh - var(--np-fixed)))); position: relative; z-index: var(--z-raised); height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); padding: max(var(--sp-4), var(--safe-top)) clamp(16px, 4vw, 48px) max(var(--sp-4), var(--safe-bottom)); }
/* Une seule colonne qui ne s'élargit jamais : un nom de liste très long ne doit pas pousser la page hors de l'écran */
.np-head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.np-head .btn-icon { flex: none; color: var(--white); background: rgba(0, 0, 0, 0.25); }
.np-from { flex: 1; min-width: 0; text-align: center; font-size: var(--fs-caption); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-from small { display: block; font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.np-from a:hover { text-decoration: underline; }
.np-head-space { width: 44px; flex: none; }
/* Rangée du bas : minuteur et appareils dans les coins, onglets au centre (leur largeur ne dépend jamais des coins) */
.np-bottom { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: var(--sp-2); min-width: 0; }
.np-bottom .btn-icon { flex: none; color: var(--white); background: rgba(0, 0, 0, 0.25); width: 44px; height: 44px; }
.np-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center; width: 100%; max-width: 1320px; margin: 0 auto; min-height: 0; }
.np-main { display: flex; flex-direction: column; gap: var(--sp-5); width: 100%; max-width: 520px; justify-self: center; align-self: center; }
/* Pochette : limitée par la largeur ET par la hauteur restante (--np-fixed = tout ce qui l'entoure) */
.np-art { align-self: center; width: var(--np-cover); }
.np-art .cover { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--r-md); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.np-meta { display: flex; align-items: center; gap: var(--sp-4); }
.np-text { flex: 1; min-width: 0; }
.np-title { font-family: var(--font-display); font-size: var(--fs-title); font-weight: 850; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artists { font-size: var(--fs-body); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artists a:hover { text-decoration: underline; color: var(--white); }
.np-meta .like-btn { width: 44px; height: 44px; }
.nowplaying .seek .time { color: var(--text-2); }
.np-side { height: 100%; min-height: 0; overflow-y: auto; -webkit-mask-image: linear-gradient(transparent 0, #000 8%, #000 82%, transparent 100%); mask-image: linear-gradient(transparent 0, #000 8%, #000 82%, transparent 100%); }
.np-pane { min-height: 100%; }
.lyrics.big .ly-lines { padding: 30vh 0 40vh; }
.lyrics.big .ly-line { font-size: clamp(22px, 2.5vw, 34px); line-height: 1.3; color: rgba(255, 255, 255, 0.34); padding: var(--sp-1) 0; }
.lyrics.big .ly-line.past { color: rgba(255, 255, 255, 0.6); }
.lyrics.big .ly-line.current { color: var(--white); }
.lyrics.big .ly-plain { font-size: var(--fs-section); color: rgba(255, 255, 255, 0.85); padding: var(--sp-5) 0 30vh; }
.lyrics.big .panel-empty { min-height: 60vh; justify-content: center; }
.np-queue { padding: var(--sp-5) 0 30vh; }
.np-queue .q-row { background: transparent; }
.np-queue .q-row.dragging { background: rgba(40, 44, 56, 0.95); }
.np-tabs { display: flex; justify-content: center; gap: var(--sp-2); }
.np-tab { height: 36px; padding: 0 var(--sp-4); border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.08); color: var(--text-2); font-weight: 700; font-size: var(--fs-caption); }
.np-tab[aria-selected="true"] { background: var(--white); color: #000; }
@media (max-width: 400px) { .np-tabs { gap: var(--sp-1); } .np-tab { padding: 0 var(--sp-4); } }
@media (max-width: 340px) { .np-tabs { gap: var(--sp-1); } .np-tab { padding: 0 var(--sp-3); font-size: var(--fs-caption); } }
body.np-lock .app { visibility: hidden; }
.np-disc { display: none; }
.np-stage { display: flex; justify-content: center; }
.np-controls { display: flex; flex-direction: column; gap: var(--sp-3); }
.np-volume { display: flex; align-items: center; gap: var(--sp-2); color: rgba(255, 255, 255, 0.7); }
.np-volume svg { flex: none; }
.np-volume .range { --fill: var(--white); --track: rgba(255, 255, 255, 0.25); --buffer: transparent; flex: 1; min-width: 0; height: 16px; }
.np-volume .range::-webkit-slider-runnable-track { height: 3px; }
.np-volume .range::-moz-range-track { height: 3px; }
/* Pouce de 12 px centré sur une piste de 3 px : décalage exact, non arrondi aux jetons */
.np-volume .range::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; opacity: 1; }
.np-volume .range::-moz-range-thumb { width: 12px; height: 12px; opacity: 1; }
.np-more { justify-self: end; }
.np-devices { color: var(--white); justify-self: start; }

@media (max-width: 767px) {
  .np-grid { grid-template-columns: minmax(0, 1fr); }
  .nowplaying[data-pane="play"] .np-side { display: none; }
  .nowplaying[data-pane="lyrics"] .np-main, .nowplaying[data-pane="queue"] .np-main { display: none; }
  .np-main { gap: var(--sp-4); }
  .np-tab[data-tab="play"] { display: inline-block; }
  .nowplaying[data-side] .np-tab[data-tab] { background: rgba(255, 255, 255, 0.08); color: var(--text-2); }
  .nowplaying .np-tab[aria-selected="true"] { background: var(--white) !important; color: #000 !important; }
  .transport.big { gap: var(--sp-4); }
  .lyrics.big .ly-lines { padding-top: 10vh; }
  .lyrics.big .ly-line { font-size: var(--fs-section); }
  .np-head { position: relative; }
  .np-head::before { content: ""; position: absolute; left: 50%; top: -8px; width: 36px; height: 4px; margin-left: calc(var(--sp-4) * -1); border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
  .nowplaying { transform: translateY(100%); transition: opacity 0.2s, transform 0.38s var(--ease); }
  .nowplaying.open { transform: none; }
}
@media (max-width: 899px) {
  .np-shell { grid-template-rows: auto 1fr auto; gap: var(--sp-3); }
  .np-grid { align-items: start; align-content: center; }
  .np-stage .np-art { margin: 0 auto; }
}
@media (min-width: 900px) {
  .np-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .np-main { max-width: 480px; justify-self: end; }
  .np-side { align-self: center; height: min(100%, 70vh); max-width: 520px; justify-self: start; width: 100%; }
}
@media (min-width: 768px) {
  /* Onglet Lecture : pochette et commandes centrées, sans volet à côté */
  .nowplaying[data-pane="play"] .np-side { display: none; }
  .nowplaying[data-pane="play"] .np-grid { grid-template-columns: minmax(0, 1fr); }
  .nowplaying[data-pane="play"] .np-main { justify-self: center; }
}

/* Écrans peu hauts (télés, paysage) : tout se resserre pour que rien ne dépasse, sans détection d'appareil */
@media (max-height: 700px) {
  .np-shell { --np-fixed: 380px; gap: var(--sp-2); padding-top: max(var(--sp-2), var(--safe-top)); padding-bottom: max(var(--sp-2), var(--safe-bottom)); }
  .np-main { gap: var(--sp-3); }
  .np-controls { gap: var(--sp-2); }
  .np-artists { font-size: var(--fs-caption); }
  .transport.big { gap: var(--sp-4); }
  .transport.big .play-btn { width: 56px; height: 56px; }
  .transport.big .btn-icon { width: 44px; height: 44px; }
  .np-meta .like-btn, .np-bottom .btn-icon { width: 40px; height: 40px; }
  .np-bottom { grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .np-tab { height: 32px; }
}
@media (max-height: 560px) {
  .np-shell { --np-fixed: 330px; gap: var(--sp-1); }
  .np-main { gap: var(--sp-2); }
  .np-controls { gap: 2px; }
  .np-meta { gap: var(--sp-2); }
  .transport.big .play-btn { width: 48px; height: 48px; }
  .transport.big .btn-icon { width: 40px; height: 40px; }
  .np-head .btn-icon, .np-meta .like-btn { width: 36px; height: 36px; }
  .np-head-space { width: 36px; }
  .np-volume { display: none; }
}
