/* ==========================================================================
   Lecteur de musique de Noël (page Calendrier)
   Carte « verre » flottante en bas à droite sur PC, barre collée en bas de l'écran sur téléphone,
   réductible en bouton rond (avec égaliseur animé et anneau de progression).
   Balisage : src/views/partials/player.php ; logique : assets/js/audio.js.
   Valeurs dynamiques posées par le JS (pas de style en ligne, CSP) :
     --p (0..1 position), --b (0..1 mémoire tampon) sur .mp ; --v (0..1 volume) sur #mp-vol ;
     --mq-x / --mq-t (défilement du titre) sur .mp-title ; --mp-space (place réservée) sur <body>,
     recopiée en scroll-padding-bottom sur <html> (le focus clavier n'est jamais caché sous le lecteur).
   ========================================================================== */

.mp {
  --mp-red: #e63946;
  --mp-red-2: #ff5f6d;
  --mp-gold: var(--gold, #ffcc5c);
  --mp-green: var(--green, #34d399);
  --mp-glass: rgba(9, 14, 32, .8);
  --mp-rail: rgba(255, 255, 255, .13);
  --mp-buf: rgba(255, 255, 255, .24);
  --mp-pad: 16px;
  --p: 0;
  --b: 0;
  position: fixed; z-index: 45;
  /* zones sûres (iPhone en paysage : encoche sur le côté, barre d'accueil en bas ; viewport-fit=cover) */
  right: max(24px, calc(env(safe-area-inset-right, 0px) + 8px));
  bottom: max(24px, calc(var(--safe-b, 0px) + 8px));
  width: min(380px, calc(100vw - 32px));
  color: var(--text);
  pointer-events: none; /* seuls la carte et le bouton rond captent les clics */
}
.mp:not(.is-ready) { display: none; } /* affiché par le JS, une fois l'état (réduit / ouvert) connu */

/* Place réservée en bas de page : le lecteur ne cache jamais le contenu ni le pied de page */
body.has-mp { padding-bottom: var(--mp-space, 0px); }
body.has-mp .toasts { bottom: calc(var(--mp-space, 0px) + 8px); }
@media (min-width: 1250px) { body.has-mp .toasts { bottom: 22px; } } /* assez large : les toasts passent à gauche de la carte */

/* Texte réservé aux lecteurs d'écran : utilitaire global .sr-only (style.css) */

.mp-ico { width: 20px; height: 20px; flex: none; }

/* ---------- Carte ---------- */
.mp-card {
  position: relative; isolation: isolate; pointer-events: auto;
  display: grid; grid-template-columns: 60px minmax(0, 1fr); grid-template-areas: "art meta" "seek seek" "ctrl ctrl" "foot foot";
  align-items: center; gap: 12px 14px;
  padding: var(--mp-pad) var(--mp-pad) 12px;
  border-radius: var(--r-lg, 20px); border: 1px solid var(--line-2);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(230, 57, 70, .2), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(255, 204, 92, .07), transparent 60%),
    var(--mp-glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75), 0 10px 24px -12px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
  transform-origin: calc(100% - 29px) calc(100% - 29px); /* se replie vers le bouton rond */
  transition: opacity .3s var(--ease), transform .45s var(--ease), visibility 0s;
  animation: mp-in .6s var(--ease) .25s backwards;
}
/* Ruban de Noël en haut de la carte */
.mp-card::before { content: ""; position: absolute; z-index: -1; top: -1px; left: 26px; right: 26px; height: 2px; border-radius: 0 0 3px 3px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--mp-red-2) 18%, var(--mp-gold) 50%, var(--mp-green) 82%, transparent); opacity: .85; }
@keyframes mp-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
/* Écran tactile (téléphone, tablette) : pas de flou en direct au-dessus de la neige animée (coûteux pour la
   batterie et le GPU) ; fond opaque de la même teinte que le verre. */
@media (pointer: coarse) {
  .mp-card { --mp-glass: #080d1e; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Pochette ---------- */
.mp-art {
  --t1: #ffd978; --t2: #c27a0e; --t-glow: rgba(255, 204, 92, .55);
  grid-area: art; position: relative; width: 60px; height: 60px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--t1), var(--t2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -10px 18px rgba(0, 0, 0, .18), 0 10px 22px -10px var(--t-glow);
  transition: filter .3s, box-shadow .4s;
}
.mp-art[data-tone="green"] { --t1: #4ade9b; --t2: #0b6b4a; --t-glow: rgba(52, 211, 153, .55); }
.mp-art[data-tone="red"] { --t1: #ff7a86; --t2: #b5172f; --t-glow: rgba(230, 57, 70, .7); }
.mp-art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(80% 60% at 28% 12%, rgba(255, 255, 255, .38), transparent 62%); }
.mp-art-ico { position: relative; z-index: 1; width: 30px; height: 30px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); transform-origin: 50% 15%; }
.mp.is-playing .mp-art { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -10px 18px rgba(0, 0, 0, .18), 0 12px 30px -8px var(--t-glow); }
.mp.is-playing:not(.is-loading) .mp-art-ico { animation: mp-sway 2.6s ease-in-out infinite; }
@keyframes mp-sway { 25% { transform: rotate(7deg); } 75% { transform: rotate(-7deg); } }
.mp.is-error .mp-art { filter: grayscale(.85) brightness(.75); }
.mp-art-eq { position: absolute; z-index: 2; right: -6px; bottom: -6px; height: 20px; padding: 4px 5px; border-radius: 8px; color: var(--mp-gold);
  background: rgba(5, 8, 22, .9); border: 1px solid var(--line-2); opacity: 0; transform: scale(.6); transition: opacity .25s, transform .35s var(--ease); }
.mp.is-playing:not(.is-loading) .mp-art-eq { opacity: 1; transform: none; }

/* Égaliseur (pochette et bouton rond) */
.mp-eq { display: inline-flex; align-items: flex-end; gap: 2px; }
.mp-eq i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: 50% 100%; transform: scaleY(.35);
  animation: mp-eq 1s ease-in-out infinite; animation-play-state: paused; }
.mp-eq i:nth-child(2) { animation-duration: .8s; animation-delay: -.35s; }
.mp-eq i:nth-child(3) { animation-duration: 1.15s; animation-delay: -.6s; }
.mp-eq i:nth-child(4) { animation-duration: .9s; animation-delay: -.15s; }
.mp.is-playing:not(.is-loading) .mp-eq i { animation-play-state: running; }
@keyframes mp-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---------- Titre, artiste, état ---------- */
.mp-meta { grid-area: meta; min-width: 0; padding-right: 30px; /* place du bouton « réduire » */ }
.mp-kicker { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0 0 2px; color: var(--mp-gold); font-size: .68rem; font-weight: 700; letter-spacing: .1em; line-height: 1.35; text-transform: uppercase; white-space: nowrap; }
.mp-state { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mp-pos { flex: none; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); /* contraste AA sur le verre */ letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.mp-pos::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.mp.is-error .mp-kicker { color: var(--bad); }
.mp-title { height: 1.3em; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 1rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; }
.mp-title-txt { display: inline; }
.mp-title.is-marquee { text-overflow: clip; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); }
.mp-title.is-marquee .mp-title-txt { display: inline-block; vertical-align: top; }
.mp.is-playing .mp-title.is-marquee .mp-title-txt { animation: mp-marquee var(--mq-t, 8s) ease-in-out infinite alternate; }
@keyframes mp-marquee { 0%, 16% { transform: translateX(0); } 84%, 100% { transform: translateX(var(--mq-x, 0)); } }
.mp-artist { margin: 1px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: .86rem; line-height: 1.35; }
.mp.is-error .mp-title { color: var(--muted); }

/* ---------- Boutons ---------- */
.mp-btn, .mp-ibtn, .mp-play, .mp-fab { -webkit-appearance: none; appearance: none; margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.mp-btn, .mp-ibtn { display: inline-grid; place-items: center; flex: none; background: transparent; transition: color .2s, background .2s, transform .15s var(--ease); }
.mp-btn { width: 44px; height: 44px; color: var(--text); }
.mp-btn .mp-ico { width: 22px; height: 22px; }
.mp-ibtn { width: 36px; height: 36px; color: var(--muted); }
.mp-btn:active, .mp-ibtn:active { transform: scale(.88); }
@media (hover: hover) {
  .mp-btn:hover, .mp-ibtn:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
}

/* Anneaux de focus bien visibles (les boutons sont déjà ronds : le contour suit leur forme) */
.mp :focus-visible { outline: 2px solid var(--mp-gold); outline-offset: 3px; }
.mp .mp-range:focus-visible { outline-offset: 2px; }

/* Lecture / pause : gros bouton rouge Noël */
.mp-ctrl { grid-area: ctrl; display: flex; align-items: center; justify-content: center; gap: 18px; }
.mp-play {
  position: relative; display: grid; place-items: center; flex: none; width: 56px; height: 56px; color: #fff;
  background: radial-gradient(120% 120% at 30% 18%, #ff8d97 0%, var(--mp-red-2) 38%, #c41d33 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -6px 14px rgba(110, 0, 18, .35), 0 12px 28px -10px rgba(230, 57, 70, .9), 0 0 0 0 rgba(230, 57, 70, .2);
  transition: transform .18s var(--ease), box-shadow .35s var(--ease), filter .2s;
}
.mp-play > * { grid-area: 1 / 1; }
.mp-play .mp-ico { width: 24px; height: 24px; }
.mp-play .mp-i-play { transform: translateX(1.5px); } /* centre optique du triangle */
.mp-i-pause, .mp.is-playing .mp-i-play { display: none; }
.mp.is-playing .mp-i-pause { display: block; }
.mp.is-playing .mp-play { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -6px 14px rgba(110, 0, 18, .35), 0 12px 28px -10px rgba(230, 57, 70, .9), 0 0 0 6px rgba(230, 57, 70, .16); }
.mp-play:active { transform: scale(.93); }
@media (hover: hover) { .mp-play:hover { filter: brightness(1.08); } }
.mp-spin { display: none; width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: mp-spin .8s linear infinite; }
.mp.is-loading .mp-play .mp-ico { display: none; }
.mp.is-loading .mp-spin { display: block; }
@keyframes mp-spin { to { transform: rotate(1turn); } }

/* ---------- Curseurs (progression et volume) ---------- */
.mp-range {
  --track: var(--mp-rail);
  display: block; flex: 1 1 auto; width: 100%; min-width: 0; height: 22px; margin: 0; padding: 0; border-radius: 8px; /* forme du contour de focus */
  background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.mp-range::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: var(--track); }
.mp-range::-moz-range-track { height: 5px; border-radius: 999px; background: var(--track); }
.mp-range::-moz-range-progress { background: transparent; }
.mp-range::-moz-focus-outer { border: 0; }
.mp-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .5); transition: transform .18s var(--ease), box-shadow .2s; }
.mp-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); transition: transform .18s var(--ease), box-shadow .2s; }
.mp-range:active::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(255, 255, 255, .14), 0 1px 6px rgba(0, 0, 0, .5); }
.mp-range:active::-moz-range-thumb { box-shadow: 0 0 0 6px rgba(255, 255, 255, .14), 0 1px 6px rgba(0, 0, 0, .5); }

/* Progression : écoulé (dégradé rouge → or), mémoire tampon, rail */
.mp-seek { grid-area: seek; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 2px 0 -4px; }
.mp-range-seek {
  --track:
    linear-gradient(90deg, var(--mp-red-2), var(--mp-gold)) 0 0 / calc(var(--p) * 100%) 100% no-repeat,
    linear-gradient(var(--mp-buf), var(--mp-buf)) 0 0 / calc(var(--b) * 100%) 100% no-repeat,
    var(--mp-rail);
}
.mp.no-dur .mp-range-seek { cursor: default; }
.mp.no-dur .mp-range-seek::-webkit-slider-thumb { opacity: 0; }
.mp.no-dur .mp-range-seek::-moz-range-thumb { opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  /* Souris : le curseur n'apparaît qu'au survol, comme sur les lecteurs de musique */
  .mp-range-seek::-webkit-slider-thumb { transform: scale(0); }
  .mp-range-seek::-moz-range-thumb { transform: scale(0); }
  .mp-seek:hover .mp-range-seek::-webkit-slider-thumb, .mp-range-seek:focus-visible::-webkit-slider-thumb, .mp-range-seek.is-scrub::-webkit-slider-thumb { transform: scale(1); }
  .mp-seek:hover .mp-range-seek::-moz-range-thumb, .mp-range-seek:focus-visible::-moz-range-thumb, .mp-range-seek.is-scrub::-moz-range-thumb { transform: scale(1); }
}
.mp-time { flex: none; min-width: 2.7em; color: var(--muted); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.mp-time-end { text-align: right; }

/* ---------- Bas de carte : volume, bruitages, réduire ---------- */
.mp-foot { grid-area: foot; display: flex; align-items: center; gap: 12px; min-width: 0; margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.mp-vol { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; max-width: 200px; margin-left: -8px; }
.mp-mute > .mp-ico { grid-area: 1 / 1; }
.mp-i-vol-lo, .mp-i-vol-off, .mp[data-vol="lo"] .mp-i-vol-hi, .mp[data-vol="off"] .mp-i-vol-hi { display: none; }
.mp[data-vol="lo"] .mp-i-vol-lo, .mp[data-vol="off"] .mp-i-vol-off { display: block; }
.mp.is-muted .mp-mute { color: var(--bad); }
.mp-range-vol { --v: .25; --vol-fill: rgba(255, 255, 255, .9); --track: linear-gradient(var(--vol-fill), var(--vol-fill)) 0 0 / calc(var(--v) * 100%) 100% no-repeat, var(--mp-rail); }
.mp-vol:hover .mp-range-vol, .mp-range-vol:focus-visible { --vol-fill: var(--mp-gold); }
.mp.is-muted .mp-range-vol { --vol-fill: rgba(255, 255, 255, .28); }

/* Interrupteur « Bruitages » (la case #btn-sfx est pilotée par calendar.js) */
.mp-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 36px; margin-left: auto; cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 650; user-select: none; -webkit-user-select: none; }
.mp-switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.mp-switch-txt { order: -1; }
.mp-switch-track { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid var(--line-2); transition: background .25s, border-color .25s; }
.mp-switch-track i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .3s var(--ease); }
.mp-switch input:checked + .mp-switch-track { background: var(--mp-green); border-color: var(--mp-green); }
.mp-switch input:checked + .mp-switch-track i { transform: translateX(14px); }
.mp-switch input:checked ~ .mp-switch-txt { color: var(--text); }
.mp-switch input:focus-visible + .mp-switch-track { outline: 2px solid var(--mp-gold); outline-offset: 3px; }
@media (hover: hover) { .mp-switch:hover { color: var(--text); } }

/* Bouton « réduire » : en haut à droite de la carte sur PC */
.mp-collapse { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; }

/* ---------- Lecteur réduit : bouton rond ---------- */
.mp-fab {
  position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 58px; height: 58px; color: #fff; pointer-events: auto;
  background: radial-gradient(120% 120% at 30% 18%, #ff8d97, var(--mp-red) 45%, #a3122a);
  box-shadow: 0 16px 34px -12px rgba(230, 57, 70, .85), 0 8px 20px -8px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .35);
  opacity: 0; visibility: hidden; transform: scale(.4) rotate(-40deg);
  transition: opacity .2s, transform .3s var(--ease), visibility 0s .3s;
}
.mp-fab > * { grid-area: 1 / 1; }
.mp-fab-ring { position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--mp-gold) calc(var(--p) * 1turn), rgba(255, 255, 255, .16) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); }
.mp-fab-ico { width: 26px; height: 26px; }
.mp-fab-eq { display: none; height: 20px; gap: 3px; }
.mp-fab-eq i { width: 3.5px; }
.mp.is-playing .mp-fab-ico { display: none; }
.mp.is-playing .mp-fab-eq { display: inline-flex; }
@media (hover: hover) { .mp.is-collapsed .mp-fab:hover { filter: brightness(1.08); transform: scale(1.05); transition-delay: 0s; } }

.mp.is-collapsed .mp-card { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(14px) scale(.86); transition: opacity .22s, transform .35s var(--ease), visibility 0s .35s; }
.mp.is-collapsed .mp-fab { opacity: 1; visibility: visible; transform: none; transition: opacity .25s .12s, transform .45s .12s var(--ease), filter .2s, visibility 0s; }
.mp.is-collapsed .mp-fab:active { transform: scale(.93); transition-delay: 0s; }

/* ==========================================================================
   Téléphone : barre pleine largeur collée en bas (zone sûre de l'iPhone respectée)
   ========================================================================== */
@media (max-width: 760px) {
  .mp { --mp-pad: 14px; left: 0; right: 0; bottom: 0; width: auto; }
  .mp-card {
    grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "art meta ctrl" "seek seek seek" "foot foot foot";
    gap: 8px 10px;
    padding: 12px max(var(--mp-pad), env(safe-area-inset-right, 0px)) calc(6px + var(--safe-b, 0px)) max(var(--mp-pad), env(safe-area-inset-left, 0px));
    border-width: 1px 0 0; border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 50px -18px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
    transform-origin: 50% 100%;
  }
  .mp-card::before { left: 18%; right: 18%; }
  .mp-art { width: 46px; height: 46px; border-radius: 12px; }
  .mp-art-ico { width: 24px; height: 24px; }
  .mp-art-eq { right: -4px; bottom: -4px; height: 16px; padding: 3px 4px; border-radius: 6px; }
  .mp-art-eq i { width: 2.5px; }
  .mp-meta { padding-right: 0; }
  .mp-kicker { gap: 6px; font-size: .72rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
  .mp-pos { gap: 6px; }
  /* laisse toute la place à « Morceau indisponible » / « Touche pour reprendre » */
  .mp.is-error .mp-pos, .mp.is-hint .mp-pos { display: none; }
  .mp-title { font-size: .95rem; }
  .mp-artist { font-size: .8rem; margin-top: 0; }
  .mp-ctrl { gap: 0; }
  .mp-btn { width: 38px; height: 38px; }
  .mp-btn .mp-ico { width: 20px; height: 20px; }
  .mp-play { width: 46px; height: 46px; margin: 0 2px; }
  .mp-play .mp-ico { width: 20px; height: 20px; }
  .mp-spin { width: 22px; height: 22px; }
  .mp.is-playing .mp-play { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -6px 14px rgba(110, 0, 18, .35), 0 10px 22px -10px rgba(230, 57, 70, .9), 0 0 0 4px rgba(230, 57, 70, .16); }
  .mp-seek { gap: 8px; margin: -2px 0 -6px; }
  .mp-range { height: 28px; } /* zone tactile plus haute, la barre reste fine */
  .mp-foot { gap: 8px; margin-top: 0; padding-top: 0; border-top: 0; }
  .mp-vol { max-width: none; }
  .mp-switch { min-height: 40px; }
  .mp-collapse { position: static; width: 40px; height: 40px; margin-right: -8px; }
  .mp.is-collapsed .mp-card { transform: translateY(calc(100% + 12px)); opacity: 0; }
  .mp-fab { right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + var(--safe-b, 0px)); width: 54px; height: 54px; }
}
@media (max-width: 380px) {
  .mp { --mp-pad: 12px; }
  .mp-card { grid-template-columns: 42px minmax(0, 1fr) auto; column-gap: 8px; }
  .mp-art { width: 42px; height: 42px; }
  .mp-switch { gap: 6px; font-size: .76rem; }
}
@media (max-width: 340px) { .mp-prev { display: none; } }

/* ==========================================================================
   Écran peu haut (téléphone en paysage, petite fenêtre) : vraie barre compacte sur UNE ligne
   (pochette · titre · progression · lecture · son), flottante en bas à droite, ~58 px de haut.
   Placé APRÈS le bloc « téléphone » pour l'emporter aussi sur les téléphones en paysage (< 761 px).
   Sous 560 px de large une ligne ne tient pas : la barre « téléphone » reste alors.
   ========================================================================== */
@media (max-height: 540px) and (min-width: 560px) {
  .mp {
    left: auto;
    right: max(12px, calc(env(safe-area-inset-right, 0px) + 6px));
    bottom: max(8px, calc(var(--safe-b, 0px) + 6px));
    width: min(620px, calc(100vw - 24px));
  }
  .mp-card {
    grid-template-columns: 40px minmax(0, 1fr) minmax(96px, 1fr) auto auto;
    grid-template-areas: "art meta seek ctrl foot";
    gap: 0 10px;
    padding: 8px 8px 8px 10px;
    border-width: 1px; border-radius: 16px;
    box-shadow: 0 22px 50px -18px rgba(0, 0, 0, .75), 0 8px 20px -10px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
    transform-origin: calc(100% - 25px) calc(100% - 25px); /* se replie vers le bouton rond */
  }
  .mp-card::before { left: 20px; right: 20px; }
  .mp-art { width: 40px; height: 40px; border-radius: 11px; }
  .mp-art-ico { width: 22px; height: 22px; }
  .mp-art-eq { right: -4px; bottom: -4px; height: 14px; padding: 3px 4px; border-radius: 6px; }
  .mp-art-eq i { width: 2px; }
  .mp-meta { padding-right: 0; }
  .mp-kicker { gap: 6px; margin: 0; font-size: .7rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
  .mp-pos { display: none; } /* la place va à l'état ; la position reste lue par les lecteurs d'écran */
  .mp-title { font-size: .9rem; }
  .mp-artist, .mp-time, .mp-range-vol { display: none; }
  .mp-seek { gap: 8px; margin: 0; }
  .mp-range { height: 32px; } /* zone tactile haute, la barre reste fine */
  .mp-ctrl { gap: 0; }
  .mp-btn { width: 36px; height: 36px; }
  .mp-btn .mp-ico { width: 20px; height: 20px; }
  .mp-play { width: 40px; height: 40px; margin: 0 2px; }
  .mp-play .mp-ico { width: 20px; height: 20px; }
  .mp-spin { width: 20px; height: 20px; }
  .mp.is-playing .mp-play { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -6px 14px rgba(110, 0, 18, .35), 0 10px 22px -10px rgba(230, 57, 70, .9), 0 0 0 4px rgba(230, 57, 70, .16); }
  .mp-foot { gap: 0; margin: 0; padding: 0; border: 0; }
  .mp-vol { flex: none; gap: 2px; max-width: none; margin: 0; }
  .mp-switch { gap: 0; min-height: 36px; margin: 0; padding: 0 5px; }
  .mp-switch-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* nom accessible conservé */
  .mp-collapse { position: static; width: 34px; height: 34px; margin: 0; }
  .mp.is-collapsed .mp-card { transform: translateY(14px) scale(.86); }
  .mp-fab { right: 0; bottom: 0; width: 50px; height: 50px; }
}
/* Écran peu haut mais large (petite fenêtre de PC) : le volume et les durées reviennent */
@media (max-height: 540px) and (min-width: 860px) {
  .mp { width: min(760px, calc(100vw - 24px)); }
  .mp-card { grid-template-columns: 40px minmax(0, 1fr) minmax(150px, 1.4fr) auto auto; }
  .mp-time { display: block; }
  .mp-range-vol { display: block; flex: none; width: 76px; }
}

/* Mouvement réduit : pas de défilement du titre ni d'égaliseur animé */
@media (prefers-reduced-motion: reduce) {
  .mp-card { animation: none; }
  .mp-title.is-marquee { text-overflow: ellipsis; -webkit-mask-image: none; mask-image: none; }
  .mp-title.is-marquee .mp-title-txt, .mp.is-playing .mp-title.is-marquee .mp-title-txt { display: inline; animation: none; }
  .mp-eq i, .mp.is-playing:not(.is-loading) .mp-eq i, .mp.is-playing:not(.is-loading) .mp-art-ico { animation: none; }
  .mp-eq i:nth-child(1) { transform: scaleY(.55); }
  .mp-eq i:nth-child(2) { transform: scaleY(1); }
  .mp-eq i:nth-child(3) { transform: scaleY(.4); }
  .mp-eq i:nth-child(4) { transform: scaleY(.75); }
  .mp-spin { animation: none; border-color: rgba(255, 255, 255, .6); border-top-color: rgba(255, 255, 255, .6); border-style: dotted; }
}

@media print { .mp { display: none !important; } body.has-mp { padding-bottom: 0; } }
