/* Mise en page : une salle obscure. Le marquis lumineux en haut, un billet de cinéma par film, qu'on composte d'un geste. Univers unique et sombre, assumé. */
:root {
  --salle: #1b1320;
  --salle-2: #271c2e;
  --salle-3: #36283e;
  --rideau: #a3304a;
  --ampoule: #f4c45a;
  --ampoule-doux: #f4c45a33;
  --papier: #f4ecdc;
  --papier-2: #e8dcc6;
  --encre: #2b211c;
  --encre-doux: #6e5f53;
  --brume: #cbbcc9;
  --brume-2: #9a8a99;
  --oui: #3f9a6a;
  --non: #a3304a;
  --coeur: #f4c45a;
  --f-titre: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-texte: "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;
  --f-chiffre: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 14px;
  color-scheme: dark;
}
html, body { height: 100%; }
body {
  background: var(--salle);
  color: var(--brume);
  font-family: var(--f-texte);
  font-size: 15px;
  line-height: 1.4;
  overflow: hidden;
}
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 460px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px 6px;
  box-sizing: border-box;
  gap: 10px;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ampoule); outline-offset: 3px; }

/* Marquis */
.marquis {
  position: relative;
  border-radius: 10px;
  padding: 9px 14px 8px;
  background: var(--salle-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.marquis::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 8px;
  pointer-events: none;
  background:
    radial-gradient(circle, var(--ampoule) 1.6px, transparent 2.2px) 6px 0 / 12px 6px repeat-x,
    radial-gradient(circle, var(--ampoule) 1.6px, transparent 2.2px) 6px 100% / 12px 6px repeat-x;
  opacity: .85;
  animation: clignote 3.2s steps(2, jump-none) infinite;
}
@keyframes clignote { 50% { opacity: .55; } }
.marquis h1 {
  margin: 4px 0 0;
  font-family: var(--f-titre);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ampoule);
  text-shadow: 0 0 14px #f4c45a55;
  line-height: 1;
}
.marquis .semaine {
  margin-top: 4px;
  font-family: var(--f-chiffre);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--brume-2);
}

#ecran { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }

/* Titres d'écran */
.surtitre {
  font-family: var(--f-chiffre);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brume-2);
}
.grand {
  margin: 0;
  font-family: var(--f-titre);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.02;
  color: var(--papier);
  text-wrap: balance;
}
.mince { color: var(--brume); margin: 0; }

/* Humeur */
.humeurs { display: grid; gap: 12px; margin-top: 4px; }
.humeur {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  text-align: left;
  padding: 18px 18px 16px;
  border-radius: var(--r);
  border: 1px solid var(--salle-3);
  background: var(--salle-2);
  transition: transform .15s, border-color .15s;
}
.humeur:active { transform: scale(.98); }
.humeur:hover { border-color: var(--ampoule); }
.humeur b {
  font-family: var(--f-titre);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--papier);
  line-height: 1;
}
.humeur span { grid-column: 1; color: var(--brume-2); font-size: 14px; }
.humeur i {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-style: normal;
  font-family: var(--f-chiffre);
  font-size: 12px;
  color: var(--salle);
  background: var(--ampoule);
  border-radius: 99px;
  padding: 4px 9px;
}
.humeur.emotion b { color: #f2a9b6; }
.qui {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--brume-2);
}
.qui button {
  border: 1px solid var(--salle-3);
  background: transparent;
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 13px;
}
.qui button[aria-pressed="true"] { background: var(--papier); color: var(--encre); border-color: var(--papier); }

/* Pile de billets */
.barre {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.barre .qui-vote { color: var(--papier); font-weight: 700; }
.barre-droite { display: inline-flex; align-items: baseline; gap: 14px; }
.annuler {
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--brume-2);
  font-size: 13px;
  justify-self: start;
}
.annuler:hover { color: var(--papier); }
.annuler:disabled { opacity: .35; }
.compteur { font-family: var(--f-chiffre); font-size: 12px; color: var(--brume-2); }
.pile { position: relative; flex: 1; min-height: 0; }
.billet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--papier);
  color: var(--encre);
  box-shadow: 0 18px 40px #00000066;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: 50% 90%;
  will-change: transform;
}
.billet.dessous { transform: scale(.95) translateY(10px); filter: brightness(.7); }
.billet.envol { transition: transform .32s ease-in, opacity .32s ease-in; }
.billet.retour { transition: transform .25s ease-out, opacity .25s ease-out; }
.billet.pause { transition: transform .28s cubic-bezier(.2, .8, .3, 1.15); }
.affiche {
  position: relative;
  flex: 1;
  min-height: 150px;
  background: var(--salle-3);
}
.affiche img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  pointer-events: none;
}
.affiche::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #00000055 0%, transparent 26%, transparent 52%, #1b1320ee 100%);
  pointer-events: none;
}
.puces {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  right: 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.puce {
  font-family: var(--f-chiffre);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 4px 8px;
  border-radius: 6px;
  background: #1b1320d9;
  color: var(--papier);
  white-space: nowrap;
}
.puce.canal { background: var(--papier); color: #000; }
.puce.replay { background: #3d6bd9; color: #fff; }
.puce.urgence { background: var(--rideau); color: #fff; }
.puce.prix { background: var(--ampoule); color: var(--encre); }
.puce.revoir { background: #9fc2ff; color: var(--encre); white-space: normal; }
.info {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #1b1320d9;
  color: var(--papier);
  font-family: var(--f-chiffre);
  font-weight: 600;
  font-size: 16px;
}
.titre-affiche {
  position: absolute;
  z-index: 2;
  left: 14px;
  right: 14px;
  bottom: 10px;
  color: var(--papier);
}
.titre-affiche .famille {
  font-family: var(--f-chiffre);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ampoule);
}
.titre-affiche h2 {
  margin: 2px 0 2px;
  font-family: var(--f-titre);
  font-weight: 900;
  font-size: 34px;
  line-height: .95;
  text-transform: uppercase;
  letter-spacing: .01em;
  text-wrap: balance;
}
.titre-affiche .meta { font-size: 13px; color: #eadfd0; }

/* Talon du billet */
.talon {
  position: relative;
  padding: 14px 16px 12px;
  display: grid;
  gap: 9px;
  background: var(--papier);
  border-top: 2px dashed var(--papier-2);
}
.talon::before, .talon::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--salle);
}
.talon::before { left: -10px; }
.talon::after { right: -10px; }
.accroche { margin: 0; font-size: 15.5px; line-height: 1.38; color: var(--encre); }
.notes { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--f-chiffre); font-size: 12px; color: var(--encre); }
.notes .n { display: inline-flex; align-items: baseline; gap: 5px; }
.notes .n small { color: var(--encre-doux); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; }
.notes .n b { font-weight: 600; font-size: 14px; }
.notes .fragile { color: var(--rideau); font-size: 10.5px; }
.avec { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--encre-doux); }
.avec span:first-child { min-width: 0; }
.numero {
  flex: none;
  font-family: var(--f-chiffre);
  font-size: 10px;
  color: var(--encre-doux);
  letter-spacing: .08em;
}

/* Tampons de compostage */
.tampon {
  position: absolute;
  z-index: 4;
  top: 38%;
  padding: 6px 12px;
  border: 4px solid currentColor;
  border-radius: 8px;
  font-family: var(--f-titre);
  font-weight: 900;
  font-size: 34px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  background: #1b132099;
}
.tampon.oui { left: 18px; color: #7fd9a4; transform: rotate(-14deg); }
.tampon.non { right: 18px; color: #ff8fa3; transform: rotate(14deg); }
.tampon.coeur { left: 50%; top: 20%; color: var(--ampoule); transform: translateX(-50%) rotate(-4deg); font-size: 28px; white-space: nowrap; }
.tampon.vu { left: 50%; top: 20%; color: #9fc2ff; transform: translateX(-50%) rotate(3deg); font-size: 30px; white-space: nowrap; }

/* Boutons de vote */
.votes { display: flex; justify-content: center; align-items: center; gap: 14px; padding-bottom: 4px; }
.rond {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--salle-3);
  background: var(--salle-2);
  transition: transform .12s;
}
.rond:active { transform: scale(.92); }
.rond:disabled { opacity: .45; }
.rond svg { width: 24px; height: 24px; flex: none; }
/* La flèche du geste, collée au pictogramme, dans le sens du glisser. */
.fleche { font-family: var(--f-chiffre); font-size: 13px; font-weight: 600; line-height: 1; opacity: .7; }
.rond.haut, .rond.bas { flex-direction: column; gap: 1px; }
.rond.non { color: #ff8fa3; }
.rond.vu { color: #9fc2ff; width: 54px; height: 54px; }
.rond.vu svg, .rond.coeur svg { width: 21px; height: 21px; }
.rond.coeur { color: var(--ampoule); width: 54px; height: 54px; }
.rond.oui { color: #7fd9a4; width: 68px; height: 68px; }
.rond.oui svg { width: 28px; height: 28px; }
.bulle {
  position: absolute;
  z-index: 6;
  left: 8px;
  right: 8px;
  bottom: 10px;
  display: grid;
  gap: 9px;
  padding: 13px 14px 10px;
  border-radius: 16px;
  background: var(--papier);
  color: var(--encre);
  box-shadow: 0 14px 34px #000000a6;
  animation: bulle-entre .24s cubic-bezier(.2, .8, .3, 1.2) both;
}
.bulle::before {
  content: "";
  position: absolute;
  top: -9px;
  width: 18px;
  height: 18px;
  background: var(--papier);
  transform: rotate(45deg);
  border-radius: 3px;
}
.bulle.non::before { left: 26%; }
.bulle.vu::before, .bulle.coeur::before { left: calc(50% - 9px); }
.bulle.oui::before { left: 66%; }
.bulle.sortie { animation: bulle-sort .2s ease-in forwards; }
@keyframes bulle-entre { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes bulle-sort { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.bulle-titre { font-family: var(--f-titre); font-weight: 800; font-size: 21px; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.rangee { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rangee small { width: 100%; font-family: var(--f-chiffre); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-doux); }
.choix {
  border: 1px solid #d8c9ae;
  background: #fffaf0;
  color: var(--encre);
  border-radius: 99px;
  padding: 8px 13px;
  font-size: 14.5px;
}
.choix:hover { border-color: var(--encre-doux); }
.bulle.vu .choix { flex: 1; padding-block: 11px; font-weight: 700; }
.passer { justify-self: end; background: none; border: 0; padding: 2px 0; color: var(--encre-doux); text-decoration: underline; font-size: 13px; }
.note-vol {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 48px);
  padding: 10px 16px;
  border-radius: 99px;
  background: var(--papier);
  color: var(--encre);
  font-size: 14px;
  box-shadow: 0 8px 24px #00000080;
  animation: apparait 1.9s ease forwards;
  pointer-events: none;
}
@keyframes apparait { 0% { opacity: 0; transform: translate(-50%, 8px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* Feuilles (motif du non, fiche détaillée) */
.voile {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #0b070dcc;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.feuille {
  width: 100%;
  max-width: 460px;
  max-height: 86%;
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--salle-2);
  border-radius: 18px 18px 0 0;
  padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  display: grid;
  gap: 12px;
}
.feuille h3 { margin: 0; font-family: var(--f-titre); font-weight: 800; font-size: 26px; color: var(--papier); text-transform: uppercase; letter-spacing: .02em; }
.motifs { display: flex; flex-wrap: wrap; gap: 8px; }
.motifs button, .bouton-2 {
  border: 1px solid var(--salle-3);
  background: var(--salle);
  border-radius: 99px;
  padding: 10px 15px;
  font-size: 15px;
}
.motifs button:hover, .bouton-2:hover { border-color: var(--brume-2); }
.bouton {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  background: var(--ampoule);
  color: var(--encre);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  text-align: center;
}
.lien { color: var(--ampoule); }
.fiche dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.fiche dt { color: var(--brume-2); }
.fiche dd { margin: 0; color: var(--papier); min-width: 0; }
.source { font-size: 12px; color: var(--brume-2); }

/* Match */
.match { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 14px; }
.vainqueur {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--papier);
  color: var(--encre);
  position: relative;
}
.vainqueur img { width: 112px; height: 149px; object-fit: cover; border-radius: 8px; }
.vainqueur h2 { margin: 0; font-family: var(--f-titre); font-weight: 900; font-size: 28px; line-height: .95; text-transform: uppercase; }
.vainqueur p { margin: 6px 0 0; font-size: 14px; color: var(--encre-doux); }
.vainqueur .pourquoi { color: var(--rideau); font-weight: 700; font-size: 13px; }
.autres { display: grid; gap: 8px; }
.autre { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.autre img { width: 44px; height: 59px; object-fit: cover; border-radius: 5px; }
.autre b { color: var(--papier); }
.autre small { color: var(--brume-2); display: block; }
.choix-qui { font-family: var(--f-chiffre); font-size: 11px; color: var(--brume-2); text-align: right; }
.actions { display: grid; gap: 8px; }
.note-demo { font-size: 12px; color: var(--brume-2); margin: 0; }
.lendemain { display: grid; gap: 10px; }
.lendemain .bouton-2 { border-radius: 12px; text-align: left; padding: 14px 16px; font-size: 16px; }

/* Pied de page */
@media (max-height: 700px) {
  .titre-affiche h2 { font-size: 28px; }
  .accroche { font-size: 14.5px; }
  .rond { width: 52px; height: 52px; }
  .rond.oui { width: 60px; height: 60px; }
  .marquis h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquis::before { animation: none; }
  .billet.envol, .billet.retour, .billet.pause { transition: none; }
  .bulle, .bulle.sortie { animation: none; }
  .note-vol { animation-duration: 2.4s; }
}

/* ---------- Appli : en-tête, réglages, calibrage, activation ---------- */
.marquis { align-items: center; flex-wrap: nowrap; }
.marquis .titres { min-width: 0; }
.engrenage {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--brume);
}
.engrenage svg { width: 22px; height: 22px; }
.engrenage:hover { color: var(--ampoule); }
.defile { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 14px; padding-bottom: 12px; }
.reglage { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--salle-3); }
.reglage:last-child { border-bottom: 0; }
.reglage label, .reglage .nom { color: var(--papier); font-weight: 700; }
.reglage p { margin: 0; font-size: 13px; color: var(--brume-2); }
.segments { display: flex; flex-wrap: wrap; gap: 6px; }
.segments button {
  border: 1px solid var(--salle-3);
  background: var(--salle-2);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 14px;
}
.segments button[aria-pressed="true"] { background: var(--papier); color: var(--encre); border-color: var(--papier); }
.reglage input[type="range"] { width: 100%; accent-color: var(--ampoule); }
.lecture-seule { color: var(--papier); }
.version { font-family: var(--f-chiffre); font-size: 12px; color: var(--brume-2); }
.champ {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--salle-3);
  background: var(--salle-2);
  color: var(--papier);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
}
.erreur { color: #ff8fa3; font-size: 14px; margin: 0; }
.attente-points { display: inline-flex; gap: 5px; }
.attente-points i { width: 7px; height: 7px; border-radius: 50%; background: var(--ampoule); animation: clignote 1.2s infinite; }
.attente-points i:nth-child(2) { animation-delay: .2s; }
.attente-points i:nth-child(3) { animation-delay: .4s; }
.jauge { height: 6px; border-radius: 99px; background: var(--salle-3); overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--ampoule); border-radius: 99px; transition: width .3s; }

/* Billet sans affiche (calibrage) */
.billet.texte .affiche {
  display: grid;
  align-content: end;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, #ffffff08 14px 15px),
    linear-gradient(160deg, var(--salle-3), var(--salle));
}
.billet.texte .affiche::after { display: none; }
/* Sans affiche, le titre devient l'image : grand, centré dans le billet. */
.billet.texte .affiche { display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; }
.billet.texte .titre-affiche { position: static; }
.billet.texte .titre-affiche .famille { font-size: 13px; }
.billet.texte .titre-affiche h2 { font-size: clamp(42px, 12.5vw, 64px); line-height: .92; margin: 6px 0 10px; }
.billet.texte .titre-affiche .meta { font-size: 15px; color: var(--brume); }
.billet.texte .grande-note { position: absolute; top: 18px; left: 18px; font-family: var(--f-chiffre); color: var(--brume); font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .attente-points i { animation: none; }
}

/* Bulle à choix multiples (raisons du calibrage) */
.choix[aria-pressed="true"] { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.bulle-pied { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.valider { border: 0; border-radius: 99px; padding: 8px 18px; background: var(--encre); color: var(--papier); font-weight: 700; font-size: 14.5px; }

/* Six humeurs : boutons plus compacts, Séries grisé en attendant */
.humeurs { gap: 9px; }
.humeur { padding: 12px 16px 11px; }
.humeur b { font-size: 22px; }
.humeur span { font-size: 13px; }
.humeur:disabled { opacity: .45; cursor: default; }
.humeur.bientot { border-style: dashed; }
.humeur.aventure b { color: #f6c98b; }
.humeur.evasion b { color: #9fd3c7; }
/* Composition de la sélection */
.compo { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; color: var(--papier); }
.compteur-compo { display: inline-flex; align-items: center; gap: 14px; }
.compteur-compo b { min-width: 1.2em; text-align: center; font-family: var(--f-chiffre); font-size: 17px; }
.compteur-compo button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--salle-3); background: var(--salle-2); font-size: 20px; line-height: 1; }
