/* ===== Lecteur (page Music) ===== */
.player {
  --s: min(16.4vw, 29.2vh);              /* taille d'une pochette */
  position: absolute; left: 0; right: 0; top: 3.9vh; z-index: 5;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none; opacity: 0; transition: opacity 0.5s ease; color: var(--ink);
}
.scene.on .player { opacity: 1; transition: opacity 1.6s ease 1.8s; }   /* apparaît après la lumière */

/* --- pochettes en arc 3D --- */
.cf { position: relative; width: 100%; height: var(--s); perspective: calc(var(--s) * 4.3); touch-action: pan-y; pointer-events: auto; }
.cover {
  position: absolute; left: 50%; top: 0; width: var(--s); height: var(--s); margin-left: calc(var(--s) / -2); padding: 0;
  border: 1px solid rgba(220, 225, 255, 0.22); border-radius: calc(var(--s) * 0.02); background: #0a0c20; overflow: hidden; cursor: pointer;
  transform: translateX(calc(var(--s) * var(--tx, 0))) rotateY(calc(var(--ry, 0) * 1deg)) scale(var(--sc, 1));
  filter: brightness(var(--br, 1)); opacity: var(--op, 1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.7s ease, opacity 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
  -webkit-tap-highlight-color: transparent;
}
.cover.is-far { pointer-events: none; }
.cover.is-active {
  border-color: rgba(205, 185, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(160, 130, 255, 0.55), 0 0 24px rgba(140, 100, 255, 0.75), 0 0 70px rgba(110, 70, 255, 0.4);
}
.cover:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.cover .sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.08)); }
.cover.is-empty { background: linear-gradient(160deg, #1b1752, #0b0d2c 60%, #160b32); }
.cover .ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 0.7rem; padding: 10%; text-align: center; color: var(--moon); }
.cover .ph svg { width: 34%; height: auto; opacity: 0.55; }
.cover .ph b { font-weight: 500; font-size: clamp(0.8rem, 1.2vw, 1.15rem); letter-spacing: 0.04em; }

.cf-arrow {
  position: absolute; top: calc(var(--s) / 2); transform: translateY(-50%); z-index: 200; width: 56px; height: 56px; padding: 0;
  display: grid; place-items: center; border: 0; background: none; color: #fff; opacity: 0.85; cursor: pointer; pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.3s ease; -webkit-tap-highlight-color: transparent;
}
.cf-arrow svg { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.7)); }
.cf-arrow.prev { left: calc(7vw - 28px); }
.cf-arrow.next { right: calc(7vw - 28px); }
.cf-arrow:hover { opacity: 1; transform: translateY(-50%) scale(1.12); }
.cf-arrow:disabled { opacity: 0.18; cursor: default; transform: translateY(-50%); }
.cf-arrow:focus-visible, .ic:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 50%; }

/* --- titre / artiste --- */
.meta { margin-top: 2.2vh; text-align: center; padding: 0 16px; pointer-events: none; }
.meta.swap { animation: metaIn 0.5s ease both; }
@keyframes metaIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.meta h3 { margin: 0; font-weight: 600; font-size: clamp(1.05rem, 1.45vw, 1.6rem); color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65); }
.meta p { margin: 0.35em 0 0; font-size: clamp(0.92rem, 1.2vw, 1.3rem); color: #bcc3f0; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 2px 16px rgba(0, 0, 0, 0.85); }

/* --- barre de progression --- */
.bar { margin-top: 2.4vh; width: min(34.9vw, 86vw); pointer-events: auto; }
.bar input[type=range] { --p: 0%; display: block; width: 100%; height: 18px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.bar input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, #a98cff var(--p), rgba(255, 255, 255, 0.22) var(--p)); }
.bar input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px rgba(170, 140, 255, 0.9); }
.bar input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); }
.bar input[type=range]::-moz-range-progress { height: 3px; border-radius: 3px; background: #a98cff; }
.bar input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 10px rgba(170, 140, 255, 0.9); }
.bar input[type=range]:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; border-radius: 4px; }
.times { display: flex; justify-content: space-between; margin-top: 0.15rem; font-size: 0.8rem; color: #d8dcff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }

/* --- boutons --- */
.ctrls { margin-top: 1.4vh; display: flex; align-items: center; gap: clamp(1.2rem, 4vw, 4.6rem); pointer-events: auto; }
.ic { position: relative; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; background: none; color: #e9ecff; opacity: 0.85; cursor: pointer; transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease; -webkit-tap-highlight-color: transparent; }
.ic svg { width: 24px; height: 24px; }
.ic:hover { opacity: 1; transform: scale(1.08); }
.ic:disabled { opacity: 0.3; cursor: default; transform: none; }
.ic[aria-pressed=true] { color: #b9a2ff; opacity: 1; filter: drop-shadow(0 0 8px rgba(150, 110, 255, 0.85)); }
.ic.repeat[data-mode="2"]::after { content: "1"; position: absolute; font-size: 0.6rem; font-weight: 700; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.ic.play { width: clamp(58px, 7.65vh, 78px); height: clamp(58px, 7.65vh, 78px); border-radius: 50%; border: 2px solid #c9b6ff; background: rgba(12, 10, 44, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 0 20px rgba(150, 110, 255, 0.5), inset 0 0 16px rgba(150, 110, 255, 0.25); opacity: 1; }
.ic.play svg { width: 36%; height: 36%; }
.ic.play .i-pause { display: none; }
.player.is-playing .ic.play .i-pause { display: block; }
.player.is-playing .ic.play .i-play { display: none; }

.msg { margin-top: 1.4vh; min-height: 1.3em; padding: 0 16px; text-align: center; font-size: 0.82rem; letter-spacing: 0.04em; color: #ffd6a8; opacity: 0; transition: opacity 0.4s ease; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
.msg.on { opacity: 1; }

@media (max-width: 700px) {
  .player { --s: min(46vw, 28vh); }
  .cf-arrow.prev { left: 4px; } .cf-arrow.next { right: 4px; }
  .ctrls { gap: 0.6rem; }
}
