/* Cinématiques des quêtes histoire (7/11/2026, client/js/cinematique.js) : décor de la ROM en plein écran, bandes noires
   de cinéma qui glissent, dialogue avec portrait (comme la scène de Spinda), « Passer » en bas à droite avec le compte. */
.cine { position: fixed; inset: 0; z-index: 48; background: #000; overflow: hidden; touch-action: none; user-select: none; }
.cine-toile { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.cine.sort { animation: logOut .25s forwards; }

/* Bandes noires : elles entrent en glissant (en pas, comme des sprites) */
.cine-bande { position: absolute; left: 0; right: 0; height: 11vh; background: #000; transition: transform .5s steps(6, end); pointer-events: none; }
.cine-bande.haut { top: 0; transform: translateY(-100%); box-shadow: 0 2px 0 rgba(127,166,239,.25); }
.cine-bande.bas { bottom: 0; transform: translateY(100%); box-shadow: 0 -2px 0 rgba(127,166,239,.25); }
.cine.on .cine-bande { transform: none; }

.cine-titre { position: absolute; left: 50%; top: calc(11vh + 14px); translate: -50% 0; pointer-events: none; animation: spdTitre 3s steps(26, end) .9s both; }
.cine-titre span { display: block; padding: 6px 28px; font-size: 30px; color: var(--gold); background: rgba(7,13,36,.85);
  box-shadow: inset 0 0 0 2px var(--gold-line), 0 3px 0 #000; letter-spacing: 1px; white-space: nowrap; }

/* Dialogue : même cadre que Spinda, posé sur la bande du bas */
.btn.cine-dial { position: absolute; left: 50%; bottom: 3vh; translate: -50% 0; display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; width: min(860px, calc(100vw - 210px)); min-height: 118px;
  margin: 0; padding: 8px 16px; text-align: left; cursor: pointer; font: inherit; color: var(--txt); background: none; border: 12px solid transparent;
  border-image: url('assets/ui/cadres/cadre1_blue_translucide.png') 8 fill / 12px stretch; image-rendering: pixelated; }
.btn.cine-dial::before { display: none; }
.btn.cine-dial[hidden] { display: none; }
.btn.cine-dial.pop { animation: cineDial .22s steps(4, end); }
@keyframes cineDial { 0% { transform: translateY(10px); opacity: .3; } 100% { transform: none; opacity: 1; } }
.btn.cine-dial:hover, .btn.cine-dial:focus-visible { outline: none; border-image-source: url('assets/ui/cadres/cadre1_yellow_translucide.png'); }
.cine-portrait { flex: none; width: 80px; height: 80px; image-rendering: pixelated; box-shadow: 0 0 0 3px #0c1430, 0 0 0 5px #7fa6ef; }
.cine-portrait[hidden] { display: none; }
/* (11/11) réplique de tout le groupe : portraits côte à côte, qui se chevauchent un peu */
.cine-pors { flex: none; display: flex; }
.cine-pors[hidden] { display: none; }
.cine-pors .cine-portrait.petit { width: 56px; height: 56px; margin-right: -6px; animation: cinePor .3s steps(3, end) both; }
.cine-pors .cine-portrait.petit:nth-child(2) { animation-delay: .08s; } .cine-pors .cine-portrait.petit:nth-child(3) { animation-delay: .16s; } .cine-pors .cine-portrait.petit:nth-child(4) { animation-delay: .24s; }
@keyframes cinePor { from { translate: 0 10px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
.cine-corps { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cine-nom { color: #ffd65a; font-weight: normal; font-size: 22px; }
.cine-texte { font-size: 24px; line-height: 30px; white-space: pre-wrap; }
.cine-suite { position: absolute; right: 8px; bottom: 2px; color: var(--gold); opacity: 0; }
.cine-dial.fini .cine-suite { opacity: 1; animation: float .8s steps(2, end) infinite; }

/* « Passer » en bas à droite : appuyé, il reste enfoncé et montre combien de joueurs ont appuyé */
.btn.cine-passer { position: absolute; right: 14px; bottom: 3vh; z-index: 2; min-width: 150px; font-size: 22px; }
.btn.cine-passer.appuye { filter: brightness(.75) saturate(.6); transform: translateY(2px); border-image-source: url('assets/ui/cadres/cadre1_yellow_fin.png'); }
.cine-compte { color: var(--gold); }
.cine-compte.saute { display: inline-block; animation: cfSaute .4s steps(4, end); }

/* Le reste de l'écran (menus du camp, boutons du téléphone) s'efface pendant une cinématique */
body.cine-en-cours .hub-mini, body.cine-en-cours .touch-menu-btn, body.cine-en-cours #tel-menu, body.cine-en-cours #chat { opacity: 0; pointer-events: none; }

/* Téléphone couché (ou fenêtre basse) : dialogue plus bas et plus serré, « Passer » à sa droite */
@media (max-height: 520px) {
  .btn.cine-dial { min-height: 84px; width: calc(100vw - 150px); left: 8px; translate: 0 0; bottom: 6px; padding: 2px 8px; border-width: 8px; gap: 8px; }
  .cine-portrait { width: 52px; height: 52px; }
  .cine-nom { font-size: 16px; }
  .cine-texte { font-size: 16px; line-height: 20px; }
  .btn.cine-passer { right: 6px; bottom: 6px; min-width: 120px; font-size: 18px; }
  .cine-titre span { font-size: 20px; }
}
body.is-touch .btn.cine-dial { min-height: 84px; width: calc(100vw - 150px); left: 8px; translate: 0 0; bottom: 6px; padding: 2px 8px; border-width: 8px; gap: 8px; }
body.is-touch .cine-portrait { width: 52px; height: 52px; }
body.is-touch .cine-pors .cine-portrait.petit { width: 38px; height: 38px; }
body.is-touch .cine-nom { font-size: 16px; }
body.is-touch .cine-texte { font-size: 16px; line-height: 20px; }
body.is-touch .btn.cine-passer { right: 6px; bottom: 6px; min-width: 120px; font-size: 18px; }
body.is-touch .cine-titre span { font-size: 20px; }

/* Téléphone debout : bandes plus hautes, dialogue sur toute la largeur, « Passer » au-dessus à droite */
@media (orientation: portrait) and (max-width: 600px) {
  .cine-bande { height: 18vh; }
  .btn.cine-dial, body.is-touch .btn.cine-dial { left: 6px; right: 6px; width: auto; translate: 0 0; bottom: 8px; min-height: 104px; }
  .btn.cine-passer, body.is-touch .btn.cine-passer { bottom: calc(18vh + 6px); right: 8px; }
  .cine-titre { top: calc(18vh + 10px); }
}

/* (E, 7/11) Scène dans le donjon (salle du chef) : le jeu figé se voit dessous, sans le HUD ni les boutons tactiles. */
.cine.donjon { background: transparent; }
body.cine-donjon #hud, body.cine-donjon #touch { opacity: 0; pointer-events: none; transition: opacity .3s steps(3, end); }

/* (E, 7/11) Traits blancs du début d'un combat de chef (comme la ROM) : client/js/traits-chef.js */
.traits-chef { position: fixed; inset: 0; z-index: 47; pointer-events: none; image-rendering: pixelated; width: 100%; height: 100%; }
