:root {
  --nuit: #1E1B4B;
  --fond: #0F0D24;
  --carte: #1A1740;
  --or: #F5B301;
  --texte: #FFFFFF;
  --doux: #C9C6E3;
  --rayon: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

.barre {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(15, 13, 36, 0.92); backdrop-filter: blur(8px);
}
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -0.5px; }
.marque b { color: var(--or); font-weight: 600; }
.actions { display: flex; gap: 8px; }
.bouton-secondaire {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid #4B4780; background: transparent; color: var(--texte); font-weight: 600;
}
.bouton {
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0;
  background: var(--or); color: #1C1917; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}

main { max-width: 960px; margin: 0 auto; padding: 8px 16px 48px; }
h1 { font-size: 28px; margin: 16px 0 4px; letter-spacing: -0.5px; }
.sous-titre { margin: 0 0 20px; color: var(--doux); }

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.affiche {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  aspect-ratio: 9 / 16; padding: 14px; border-radius: var(--rayon);
  text-decoration: none; position: relative; overflow: hidden;
}
.affiche::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,0.75)); }
.affiche > * { position: relative; z-index: 1; }
.affiche .etoile { position: absolute; top: 14px; right: 14px; width: 28px; opacity: 0.9; }
.affiche strong { font-size: 18px; line-height: 1.2; }
.etiquette { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,0.45); }

.mention-ia { margin-top: 32px; font-size: 13px; color: var(--doux); }

.serie-tete { display: grid; gap: 16px; grid-template-columns: 140px 1fr; align-items: end; margin: 16px 0 24px; }
.serie-tete .affiche { padding: 10px; }
.serie-tete p { color: var(--doux); line-height: 1.5; margin: 8px 0 16px; }
.episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.episode {
  min-height: 56px; border-radius: 12px; border: 1px solid #3A3670; background: var(--carte);
  color: var(--texte); font-weight: 700; font-size: 18px; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.episode.verrouille { color: var(--doux); }
.episode svg { width: 14px; height: 14px; }
.legende { color: var(--doux); font-size: 14px; margin: 12px 0 0; }

/* Lecteur vertical plein écran */
.lecteur {
  position: fixed; inset: 0; z-index: 20; background: #000;
  overflow-y: scroll; scroll-snap-type: y mandatory; overscroll-behavior: contain;
}
.diapo { position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; }
.diapo video { height: 100%; width: 100%; max-width: calc(100dvh * 9 / 16); object-fit: cover; background: #000; }
.cache {
  height: 100%; width: 100%; max-width: calc(100dvh * 9 / 16);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 32px; text-align: center;
}
.cache h2 { margin: 0; font-size: 22px; }
.cache p { margin: 0; color: var(--doux); }
.infos { position: absolute; left: 16px; right: 16px; bottom: max(24px, env(safe-area-inset-bottom)); text-align: left; pointer-events: none; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.infos strong { display: block; font-size: 17px; }
.infos span { font-size: 14px; color: #E7E5F4; }
.fermer {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 21;
  width: 48px; height: 48px; border-radius: 999px; border: 0; background: rgba(0,0,0,0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.fermer svg { width: 22px; height: 22px; }

@media (max-width: 420px) {
  .serie-tete { grid-template-columns: 110px 1fr; }
}

.solde {
  min-height: 44px; padding: 0 14px; border-radius: 999px; background: #2A2660;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none;
}
.solde svg, .piece { width: 20px; height: 20px; flex: none; }
.cache .bouton { margin-top: 8px; }
.cache .petit { font-size: 14px; }
.message { min-height: 1.4em; color: var(--or); margin: 0; }

.compte { max-width: 480px; }
.carte-compte { background: var(--carte); border-radius: var(--rayon); padding: 20px; margin: 16px 0; }
.carte-compte h2 { margin: 0 0 8px; font-size: 19px; }
.carte-compte p { color: var(--doux); margin: 0 0 12px; line-height: 1.5; }
.gros-solde { display: flex; align-items: center; gap: 10px; font-size: 36px; font-weight: 800; }
.gros-solde .piece { width: 36px; height: 36px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
input {
  min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid #4B4780;
  background: #0F0D24; color: var(--texte); font: inherit; font-size: 17px;
}

select {
  width: 100%; min-width: 0; text-overflow: ellipsis;
  min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid #4B4780;
  background: #0F0D24; color: var(--texte); font: inherit; font-size: 15px;
}
.packs { display: grid; gap: 10px; margin-top: 12px; }
.pack {
  min-height: 56px; padding: 0 16px; border-radius: 14px; border: 1px solid #4B4780; background: #0F0D24;
  color: var(--texte); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
}
.pack span { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pack b { color: var(--or); white-space: nowrap; }
.pack:disabled { opacity: 0.6; }

.telecharger {
  position: absolute; right: 16px; bottom: max(96px, calc(env(safe-area-inset-bottom) + 72px)); z-index: 2;
  width: 52px; height: 52px; border-radius: 999px; border: 0; color: #fff;
  background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center;
}
.telecharger svg { width: 24px; height: 24px; }
.telecharger.fait { color: #1C1917; background: var(--or); opacity: 1; }
.telecharger.en-cours { background: conic-gradient(var(--or) var(--avance, 0%), rgba(0,0,0,0.55) 0); }
.bulle {
  position: absolute; left: 16px; right: 16px; bottom: 160px; z-index: 3; margin: 0;
  padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,0.8); color: #fff; text-align: center;
}
.liste-dl { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.liste-dl li {
  background: var(--carte); border-radius: var(--rayon); padding: 14px;
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
}
.liste-dl strong { display: block; }
.liste-dl span { color: var(--doux); font-size: 14px; }
.liste-dl .bouton-secondaire { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 420px) { .liste-dl li { grid-template-columns: 1fr 1fr; } .liste-dl li > div { grid-column: 1 / -1; } }

.son {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 2;
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0;
  background: rgba(0,0,0,0.6); color: #fff; font-weight: 700;
}

.affiche .couverture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.affiche::after { z-index: 0; }
.affiche > :not(.couverture) { z-index: 1; }
.cache.apercu { background-size: cover; background-position: center; }

.contacts { display: grid; gap: 10px; }
.lien-bouton { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.faq summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.faq p { margin: 8px 0 0; }
