/* =====================================================================
   LECTEUR NOVA SPHERE — habillage sur mesure (page Music)
   Inspiré de « Corpo Rave 2007 » et des skins de Windows Media Player,
   aux couleurs de Nova Sphere.
   Tout est placé en pixels sur une coque de 680 × 420 ; js/lecteur.js
   agrandit ou rétrécit tout le lecteur d'un bloc selon la place disponible.
   ===================================================================== */

.lecteur {
  width: 680px;
  margin: 0 auto 28px;
  --cyan: #3fc6d9;
  --lcd: #9fe8ff;
  /* Ombre qui suit la forme de la coque (et pas un rectangle) */
  filter: drop-shadow(6px 12px 14px rgb(10 11 46 / 0.45));
}

.coque {
  position: relative;
  z-index: 1; /* au-dessus du tiroir */
  width: 680px;
  height: 420px;
}

.coque-dessin {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Tous les éléments posés sur la coque */
.coque > :not(.coque-dessin) { position: absolute; }

/* ---------- Écran ---------- */
.ecran {
  left: 70px;
  top: 72px;
  width: 370px;
  height: 240px;
  border-radius: 20px;
  overflow: hidden;
  background: #03051a;
}
/* La pochette de l'album en cours, floue, derrière l'animation */
.ecran::before {
  content: "";
  position: absolute;
  inset: -24px;
  background: var(--pochette, none) center / cover;
  filter: blur(16px) saturate(1.5);
  opacity: 0.35;
  transition: opacity 0.6s ease;
}
/* Reflet de vitre en diagonale (écran bombé des années 2000) */
.ecran::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(155deg, rgb(255 255 255 / 0.16) 0 28%, transparent 29%);
}
#visu { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Afficheur : titre, temps, album, messages */
.lcd {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto 1fr;
  column-gap: 12px;
  color: var(--lcd);
  text-shadow: 0 0 8px rgb(63 198 217 / 0.85);
  pointer-events: none;
}
.lcd p { margin: 0; }
.lcd-titre {
  font-family: Michroma, sans-serif;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lcd-temps {
  grid-row: span 2;
  font-family: "Share Tech Mono", monospace;
  font-size: 30px;
  line-height: 1;
}
.lcd-album { font-family: Tahoma, sans-serif; font-size: 11px; opacity: 0.85; }
.lcd-statut {
  grid-column: 1 / -1;
  align-self: end;
  font-family: "Share Tech Mono", monospace;
  font-size: 13px;
}

/* ---------- Glissières (progression et volume) ---------- */
.glissiere {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  height: 14px;
  border-radius: 7px;
  cursor: var(--curseur-main);
  /* Partie déjà jouée en cyan → bleu ; --rempli est mis à jour par js/lecteur.js */
  background:
    linear-gradient(90deg, var(--cyan), #3b3fd8) 0 0 / var(--rempli, 0%) 100% no-repeat,
    linear-gradient(180deg, #05071c, #262c58);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.7);
}
.glissiere::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 16px;
  border-radius: 8px;
  border: 1px solid #0a0d33;
  background: radial-gradient(ellipse at 40% 30%, #fff 0 15%, #9fd0ff 35%, #2f45c9 80%);
  box-shadow: 0 0 8px rgb(63 198 217 / 0.8);
}
.glissiere::-moz-range-thumb {
  width: 28px;
  height: 16px;
  border-radius: 8px;
  border: 1px solid #0a0d33;
  background: radial-gradient(ellipse at 40% 30%, #fff 0 15%, #9fd0ff 35%, #2f45c9 80%);
  box-shadow: 0 0 8px rgb(63 198 217 / 0.8);
}
.glissiere:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.avance { left: 86px; top: 337px; width: 340px; }
.volume { left: 582px; top: 326px; width: 56px; height: 12px; }

/* ---------- Petit oscilloscope ---------- */
.mini-oscillo {
  left: 456px;
  top: 324px;
  width: 72px;
  height: 32px;
  border-radius: 16px;
  pointer-events: none;
}

/* ---------- Boutons : style commun ---------- */
.coque button {
  padding: 0;
  border-radius: 50%;
  cursor: var(--curseur-main);
  display: grid;
  place-items: center;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.coque button:hover { filter: brightness(1.2); }
.coque button:active { transform: scale(0.94); }
.coque button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.coque button svg { width: 55%; height: 55%; }

/* Deux voyants sur la bosse du haut : ils s'allument en cyan pendant la lecture */
.voyant {
  top: 44px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #14172b;
  background: radial-gradient(circle at 35% 30%, #fff 0 10%, #8a90b0 50%, #3a4170 100%);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.voyant-gauche { left: 506px; }
.voyant-droite { left: 602px; }
.coque.joue .voyant {
  background: radial-gradient(circle at 35% 30%, #fff 0 15%, var(--cyan) 50%, #1638c8 100%);
  box-shadow: 0 0 8px var(--cyan);
}
/* Bouton bleu central (liste), qui luit quand la musique joue */
.bt-tete-bleu {
  left: 545px;
  top: 27px;
  width: 30px;
  height: 30px;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, #6f8cff 30%, #1638c8 70%, #0b1a6e 100%);
  box-shadow: 0 0 10px rgb(63 124 255 / 0.7);
}
.coque.joue .bt-tete-bleu { animation: pulse 1.2s ease-in-out infinite; }

/* Onglet à flèche, à gauche */
.onglet {
  left: 22px;
  top: 112px;
  width: 34px;
  height: 166px;
  border-radius: 16px !important;
  color: var(--lcd);
  border: 0;
  background: linear-gradient(90deg, #262c58, #4b5385);
}
.onglet svg { width: 60%; height: auto; }
.coque.liste-ouverte .onglet svg { transform: scaleX(-1); }

/* ---------- Molette ---------- */
/* Balayage lumineux qui tourne (plus vite pendant la lecture) */
.balayage {
  left: 468px;
  top: 104px;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 70%, rgb(159 208 255 / 0.05) 80%, rgb(159 232 255 / 0.55) 99%, transparent 100%);
  mix-blend-mode: screen;
  animation: tourne 6s linear infinite;
}
.coque.joue .balayage { animation-duration: 1.6s; }

.bt-molette {
  width: 30px;
  height: 30px;
  color: #cfe9ff;
  border: 1px solid rgb(159 208 255 / 0.6);
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / 0.5) 0 10%, rgb(63 124 255 / 0.5) 45%, rgb(11 26 110 / 0.8) 100%);
  text-shadow: 0 0 6px var(--cyan);
}
.bt-visu { left: 545px; top: 117px; }
.bt-prec { left: 481px; top: 181px; }
.bt-suiv { left: 609px; top: 181px; }
.bt-stop { left: 545px; top: 245px; }

/* Gros bouton lecture : une sphère de verre bleue (la « Nova Sphere ») */
.bt-lecture {
  left: 526px;
  top: 162px;
  width: 68px;
  height: 68px;
  color: #fff;
  border: 2px solid rgb(255 255 255 / 0.75);
  background: radial-gradient(circle at 35% 28%, #fff 0 7%, #9fd4ff 20%, #3b3fd8 58%, #14185a 100%);
  box-shadow: 0 0 18px rgb(63 124 255 / 0.8), inset 0 -8px 14px rgb(63 198 217 / 0.6);
}
.bt-lecture svg { width: 46%; height: 46%; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.5)); }
.bt-lecture .icone-pause { display: none; }
.coque.joue .bt-lecture .icone-play { display: none; }
.coque.joue .bt-lecture .icone-pause { display: block; }

/* Bouton son coupé (bosse du bas) */
.bt-muet {
  left: 548px;
  top: 319px;
  width: 26px;
  height: 26px;
  color: #fff;
  border: 1px solid #0a0d33;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, #6f8cff 30%, #1638c8 70%, #0b1a6e 100%);
}
.bt-muet[aria-pressed="true"] .ondes { display: none; }
.bt-muet[aria-pressed="true"] { filter: grayscale(0.7); }

/* ---------- Tiroir : liste des albums et des morceaux ---------- */
/* Il sort de sous la coque, vers le bas, et pousse le reste de la page */
.tiroir {
  position: relative;
  z-index: 0;
  width: 560px;
  height: 300px;
  margin: -64px 0 0 60px; /* le haut du tiroir reste caché sous la coque */
  padding: 70px 12px 12px;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(180deg, #3a4170, #9aa1c6);
  border: 2px solid #14172b;
  animation: sort-du-tiroir 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.tiroir[hidden] { display: none; }
@keyframes sort-du-tiroir {
  from { transform: translateY(-160px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.tiroir-ecran {
  height: 100%;
  overflow: auto;
  border-radius: 14px;
  padding: 10px 12px;
  background: #03051a;
  color: var(--lcd);
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  scrollbar-color: #3f7cff #03051a;
}
.tiroir-titre {
  margin: 0 0 8px;
  font-family: Michroma, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px rgb(63 198 217 / 0.8);
}
.liste-albums,
.liste-albums ol { list-style: none; margin: 0; padding: 0; }
.tiroir button {
  cursor: var(--curseur-main);
  width: 100%;
  border-radius: 6px;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tiroir button:hover,
.tiroir button[aria-current="true"] { background: rgb(63 124 255 / 0.3); }
.tiroir button:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.album-bouton { padding: 5px; }
.album-bouton img { width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; }
.album-bouton span { font-family: Michroma, sans-serif; font-size: 10px; line-height: 1.3; }
.album-bouton small { display: block; font-family: Tahoma, sans-serif; opacity: 0.7; }
.piste-bouton { padding: 4px 6px 4px 46px; }
.piste-bouton .duree { margin-left: auto; font-family: "Share Tech Mono", monospace; opacity: 0.8; }
.piste-vide { padding: 4px 6px 6px 46px; opacity: 0.6; font-style: italic; }

/* ---------- Animations ---------- */
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes pulse {
  50% { box-shadow: 0 0 22px rgb(63 198 217 / 1); }
}

/* ---------- Téléphone : le lecteur est réduit, on grossit le texte de la liste ---------- */
@media (max-width: 600px) {
  .tiroir { height: 380px; }
  .tiroir-ecran { font-size: 18px; }
  .tiroir-titre, .album-bouton span { font-size: 16px; }
  .album-bouton img { width: 48px; height: 48px; }
  .piste-bouton { padding: 8px 8px 8px 62px; }
}

/* =====================================================================
   PLATEFORMES (sous le lecteur) : logos officiels avec leur nom dessous
   ===================================================================== */
.plateformes ul {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 22px;
}
.plateformes a {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 92px;
  color: #f4f3f8;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 6px rgb(10 11 46 / 0.7);
}
/* Le logo est posé sur une pastille blanche brillante, pour rester lisible sur le fond bleu */
.plateformes img {
  box-sizing: content-box;
  width: 40px;
  height: 40px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgb(255 255 255 / 0.8);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.9) 0 45%, rgb(255 255 255 / 0) 55%),
    linear-gradient(180deg, #f4f3f8, #c9ccf0);
  box-shadow: 0 10px 24px rgb(10 11 46 / 0.3);
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.plateformes a:hover img,
.plateformes a:focus-visible img { transform: translateY(-4px) scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  .balayage, .coque.joue .bt-tete-bleu, .tiroir { animation: none; }
  .plateformes img { transition: none; }
}

/* Version compacte, sur la page d'un album (sous les morceaux, sur la fenêtre claire) */
.album-liens ul { justify-content: flex-start; gap: 12px 10px; margin: 24px 0 0; }
.album-liens a { width: auto; min-width: 58px; white-space: nowrap; gap: 6px; font-size: 12px; color: rgb(10 11 46 / 0.75); text-shadow: none; }
.album-liens img { width: 26px; height: 26px; padding: 11px; border-radius: 15px; box-shadow: 0 6px 14px rgb(10 11 46 / 0.18); }
