/* Mini-app du cine-bot : sombre, gros contrastes, une seule colonne pensée pour le téléphone. */
@font-face { font-family: Poppins; font-weight: 500; src: url(/polices/Poppins-Medium.ttf); font-display: swap; }
@font-face { font-family: Poppins; font-weight: 600; src: url(/polices/Poppins-SemiBold.ttf); font-display: swap; }
@font-face { font-family: Poppins; font-weight: 700; src: url(/polices/Poppins-Bold.ttf); font-display: swap; }

:root {
  --fond: #0d0b14; --carte: #1b1929; --carte2: #28253c; --trait: #343049;
  --texte: #ffffff; --doux: #a29dbd; --violet: #b9a8ff; --or: #ffc83c; --rose: #ff4d6d; --vert: #5bf0a5;
  --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
body { font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 500; font-size: 15px;
  line-height: 1.35; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { opacity: .5; }
img { display: block; }

#vue { max-width: 520px; margin: 0 auto; padding: 18px 16px calc(96px + var(--bas)); min-height: 100vh; }
.attente { color: var(--doux); text-align: center; padding-top: 38vh; }
.vide { color: var(--doux); text-align: center; padding: 28px 12px; }

/* Titres */
.sur { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--violet); margin: 0; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 2px 0 0; }
h2 { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--violet); margin: 26px 2px 10px; }
.entete { margin-bottom: 16px; }

/* Cartes */
.carte { background: var(--carte); border-radius: 22px; padding: 16px; }
.carte + .carte { margin-top: 10px; }
.halo { background: radial-gradient(120% 140% at 0% 0%, #4a3a9c 0%, #241f3d 45%, var(--carte) 100%); }

/* Niveau */
.niveau { display: flex; gap: 14px; align-items: center; }
.niveau img { width: 64px; height: 64px; }
.niveau h1 { font-size: 34px; }
.barre { height: 12px; border-radius: 6px; background: rgba(255,255,255,.12); margin-top: 16px; overflow: hidden; }
.barre i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--rose), var(--or)); min-width: 12px; }
.sous-barre { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--doux); }
.sous-barre b { color: var(--texte); font-weight: 700; }

/* Tuiles de chiffres */
.tuiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.tuile { background: var(--carte); border-radius: 20px; padding: 12px 14px; min-width: 0; }
.tuile b { display: block; font-size: 30px; font-weight: 700; line-height: 1.1; }
.tuile span { display: block; font-size: 12px; color: var(--doux); margin-top: 2px; }
.tuile em { display: block; font-style: normal; color: var(--or); font-weight: 600; font-size: 12px; }

/* Lignes (à noter, à finir, liste) */
.ligne { display: flex; gap: 12px; align-items: center; }
.ligne .affiche { width: 62px; flex: none; }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .titre { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .detail { font-size: 13px; color: var(--doux); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.trois .bouton { padding: 8px 6px; }
.avance { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); margin: 8px 0 2px; overflow: hidden; }
.avance i { display: block; height: 100%; background: var(--violet); border-radius: 3px; }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px;
  border-radius: 14px; background: var(--carte2); font-weight: 600; font-size: 14px; text-align: center; }
.bouton.fort { background: linear-gradient(90deg, var(--rose), #ff8a3c); color: #fff; }
.bouton.vert { background: var(--vert); color: #06281a; }
.bouton.large { display: flex; width: 100%; min-height: 48px; font-size: 15px; }
.bouton:active { transform: scale(.97); }

/* Affiches */
.affiche { position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--carte2);
  display: flex; align-items: center; justify-content: center; }
.affiche img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.affiche span { padding: 6px; font-size: 11px; line-height: 1.25; text-align: center; color: var(--doux); overflow-wrap: anywhere; }
.affiche .note { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 5px; font-size: 12px; font-weight: 700;
  color: var(--or); text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.85)); letter-spacing: .04em; }
.rangee { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.rangee::-webkit-scrollbar { display: none; }
.rangee .affiche { width: 104px; flex: none; }
.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mois { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 2px 10px; }
.mois b { font-size: 18px; font-weight: 700; text-transform: capitalize; }
.mois span { font-size: 13px; color: var(--doux); }

/* Défi */
.defi { display: flex; gap: 12px; align-items: center; }
.defi img { width: 40px; height: 40px; flex: none; }
.defi .sur { color: var(--or); }
.defi.fait .sur { color: var(--vert); }
.defi p { margin: 2px 0 0; font-weight: 600; font-size: 16px; }

/* Trophées */
.trophees { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trophee { background: var(--carte); border-radius: 20px; padding: 14px 8px 12px; text-align: center; }
.trophee .rond { width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center;
  justify-content: center; background: var(--carte2); }
.trophee .rond img { width: 40px; height: 40px; }
.trophee .rond svg { width: 26px; height: 26px; color: #6a6588; }
.trophee b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.trophee span { display: block; font-size: 11px; color: var(--doux); margin-top: 4px; line-height: 1.25; }
.trophee.obtenu { background: linear-gradient(160deg, #4a3a12, var(--carte) 70%); }
.trophee.obtenu .rond { background: #5a4513; box-shadow: 0 0 0 2px var(--or) inset; }
.trophee:not(.obtenu) b { color: var(--doux); }
.palier { display: flex; justify-content: space-between; padding: 10px 2px; border-top: 1px solid var(--trait); color: var(--doux); }
.palier:first-child { border-top: 0; }
.palier.atteint { color: var(--texte); }
.palier.actuel b { color: var(--or); }
.palier b { font-weight: 600; }

/* Idée */
.idee .affiche { width: 62%; margin: 0 auto 14px; border-radius: 18px; }
.idee h1 { font-size: 24px; text-align: center; }
.idee .infos { text-align: center; color: var(--doux); font-size: 13px; margin: 6px 0 0; }
.idee .raison { text-align: center; color: var(--or); font-size: 13px; font-weight: 600; margin: 10px 0 0; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.idee .bouton.large { margin-top: 14px; }

/* Réglages */
.reglage { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--trait); }
.reglage:first-child { border-top: 0; padding-top: 2px; }
.reglage:last-child { padding-bottom: 2px; }
.reglage .corps { flex: 1; min-width: 0; }
.reglage b { display: block; font-weight: 600; }
.reglage span { display: block; font-size: 13px; color: var(--doux); }
.bascule { width: 52px; height: 32px; border-radius: 16px; background: var(--carte2); position: relative; flex: none; transition: background .15s; }
.bascule::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: transform .15s; }
.bascule.oui { background: var(--vert); }
.bascule.oui::after { transform: translateX(20px); }
.etat-bot { font-size: 13px; color: var(--doux); margin: 14px 2px 0; }
.etat-bot b { color: var(--vert); font-weight: 600; }
.etat-bot b.alerte { color: var(--rose); }

/* Barre d'onglets */
#onglets { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  padding: 8px 8px calc(8px + var(--bas)); background: var(--fond); border-top: 1px solid var(--trait); z-index: 5; }
#onglets button { flex: 1; max-width: 104px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; font-size: 11px; font-weight: 600; color: #7d789a; border-radius: 12px; }
#onglets svg { width: 24px; height: 24px; }
#onglets button.actif { color: var(--texte); }
#onglets button.actif svg { color: var(--or); }

/* Feuille de détail d'un film */
#voile { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 8; }
#feuille { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; max-width: 520px; margin: 0 auto; background: var(--carte);
  border-radius: 26px 26px 0 0; padding: 18px 16px calc(18px + var(--bas)); max-height: 88vh; overflow-y: auto; }
#feuille .haut { display: flex; gap: 14px; }
#feuille .affiche { width: 112px; flex: none; border-radius: 14px; }
#feuille h1 { font-size: 22px; }
#feuille .infos { color: var(--doux); font-size: 13px; margin: 6px 0 0; }
#feuille .grande-note { color: var(--or); font-size: 22px; font-weight: 700; margin: 8px 0 0; letter-spacing: .04em; }
#feuille .deux { margin-top: 16px; }
#feuille .fermer { margin-top: 8px; }

/* Petit message en bas */
#bulle { position: fixed; left: 50%; bottom: calc(104px + var(--bas)); transform: translateX(-50%); z-index: 12;
  background: #fff; color: #14121f; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 14px;
  max-width: 86vw; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
