/* Projet 12 « Entretien de recadrage » : repris du 07 (bleu nuit Ali Prod, or de la charte pour le sous-texte) ;
   ivoire pour Thierry, bleu pâle pour Lina et Hugo, cartons de temps et miroir ajoutés. */
@font-face {
  font-family: "Readex Pro";
  src: url("polices/readex-pro-latin-wght-normal.woff2") format("woff2");
  font-weight: 160 700;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("polices/caveat-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --nuit: #010c18;
  --nuit-2: #0b1826;
  --nuit-3: #132436;
  --trait: #22364a;
  --ivoire: #f3eee6;
  --encre: #17212b;
  --texte: #e6edf3;
  --doux: #9fb1c1;
  --bleu: #10a8fd;
  --or: #f0c058;
  --or-clair: #fbe3a0;
  --or-fonce: #c8922e;
  --rayon: 18px;
  --titre: "Readex Pro", system-ui, sans-serif;
  --corps: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --manuscrit: "Caveat", "Segoe Print", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }
html { background: var(--nuit); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(120% 70% at 70% 0%, #0d2136 0%, var(--nuit) 60%);
  color: var(--texte);
  font: 400 16px/1.5 var(--corps);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 12px; top: 12px; z-index: 10; background: var(--ivoire); color: var(--encre); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; }

/* ---------- Bande du haut ---------- */
.bande {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(1, 12, 24, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--trait);
}
.bande p { margin: 0; }
.bande-auteur { font-size: 0.8rem; color: var(--doux); flex: 1; }
.bande-fictif { display: inline-block; margin-left: 8px; padding: 2px 8px; border: 1px solid var(--trait); border-radius: 999px; font-size: 0.72rem; white-space: nowrap; }
@media (max-width: 420px) { .bande-auteur { font-size: 0.74rem; } .bande-fictif { margin-left: 4px; } }
[tabindex="-1"]:focus { outline: none; }
.bande-heure { font: 600 1.05rem/1 var(--titre); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.bande-son {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px;
  background: transparent; color: var(--texte);
  border: 1px solid var(--trait); border-radius: 999px; cursor: pointer;
}
.bande-son[aria-pressed="true"] { color: var(--doux); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Écrans ---------- */
.ecran[hidden] { display: none !important; }

.entree { min-height: calc(100svh - 61px); display: grid; place-items: center; padding: 32px 16px 48px; }
.entree-contenu { max-width: 560px; text-align: left; }
.probleme {
  margin: 0 0 36px; display: grid; gap: 6px;
  font: 600 clamp(1.9rem, 7.5vw, 3rem)/1.12 var(--titre); letter-spacing: -0.025em;
}
.probleme span:last-child {
  background: linear-gradient(180deg, var(--or-clair) 0%, var(--or) 46%, var(--or-fonce) 78%, #f8c850 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mention { margin: 18px 0 0; color: var(--doux); font-size: 0.92rem; }
.mention-son { margin-top: 6px; }

.bouton-principal {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 26px;
  background: linear-gradient(180deg, var(--or-clair), var(--or) 55%, var(--or-fonce));
  color: #1b1206; font-weight: 700; border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 0 22px rgba(240, 192, 88, 0.28);
}
.bouton-principal:hover { filter: brightness(1.05); }

/* ---------- Le jeu ---------- */
.jeu { display: grid; grid-template-rows: 40svh minmax(0, 1fr); height: calc(100svh - 61px); }
.scene { position: relative; margin: 0; height: 100%; overflow: hidden; background: var(--nuit-2); }
.scene img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; transition: opacity 0.22s ease; }
.scene img.change { opacity: 0; }
.scene::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(transparent, var(--nuit)); pointer-events: none; }
.lieu { position: absolute; left: 16px; bottom: 12px; z-index: 1; margin: 0; font-size: 0.82rem; color: var(--doux); }

.conversation { display: flex; flex-direction: column; min-height: 0; padding: 8px 16px 0; }
.fil { list-style: none; margin: 0; padding: 4px 0 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.fil > :first-child { margin-top: auto; }
.fil:focus { outline: none; }
.fil:focus-visible { outline: 2px solid var(--bleu); outline-offset: 4px; border-radius: 8px; }

.bulle {
  max-width: 86%; padding: 11px 15px; border-radius: var(--rayon);
  opacity: 0; transform: translateY(6px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.bulle.visible, .recit.visible, .carton.visible, .evenement.visible { opacity: 1; transform: none; }
.bulle.thierry { align-self: flex-start; background: var(--ivoire); color: var(--encre); border-bottom-left-radius: 6px; }
.bulle.lina, .bulle.hugo { align-self: flex-start; background: #d9ecf7; color: var(--encre); border-bottom-left-radius: 6px; }
.bulle-nom { display: block; margin-bottom: 2px; font: 600 0.74rem/1.2 var(--titre); letter-spacing: 0.02em; color: #4a5a68; }
.bulle.vous { align-self: flex-end; background: var(--nuit-3); border: 1px solid var(--trait); border-bottom-right-radius: 6px; }
.bulle.silence { font-style: italic; color: var(--doux); background: transparent; border-style: dashed; }
.evenement { list-style: none; align-self: center; max-width: 100%; padding: 4px 12px; font-size: 0.82rem; color: var(--doux); border: 1px solid var(--trait); border-radius: 999px; opacity: 0; transition: opacity 0.25s ease; }
.evenement.contexte, .evenement.geste { border: 0; padding: 2px 0; text-align: center; font-style: italic; }

.recit { list-style: none; margin: 4px 0; padding: 10px 14px; border-left: 2px solid var(--trait); color: var(--doux); opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; }
.carton { list-style: none; margin: 12px 0 4px; padding: 14px 16px; border-left: 2px solid var(--or); background: rgba(240, 192, 88, 0.06); border-radius: 0 12px 12px 0; font: 600 1rem/1.35 var(--titre); color: var(--or-clair); opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; }
.carton-acte { font-size: 1.15rem; color: var(--or); }
.pause { margin: 0 0 10px; color: var(--doux); font-size: 0.9rem; }

.choix {
  flex: none; max-height: 58%; overflow-y: auto;
  margin: 0 -16px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--trait); background: var(--nuit);
}
.choix:empty { display: none; }
.choix-titre { margin: 0 0 10px; font: 600 0.95rem/1.3 var(--titre); color: var(--doux); }
.choix-titre:focus { outline: none; }
.choix-liste { display: grid; gap: 8px; }
.option {
  width: 100%; min-height: 52px; padding: 12px 16px; text-align: left;
  background: var(--nuit-2); color: var(--texte);
  border: 1px solid var(--trait); border-radius: 14px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option:hover { border-color: var(--or); background: var(--nuit-3); }
.option-silence { font-style: italic; color: var(--doux); border-style: dashed; }
.bouton-suite { min-height: 48px; padding: 0 22px; background: transparent; color: var(--texte); border: 1px solid var(--or); border-radius: 999px; cursor: pointer; }

/* ---------- Écrans de texte ---------- */
.texte { padding: 40px 16px 64px; }
.colonne { max-width: 640px; margin: 0 auto; }
.ouverture, .titre-or {
  margin: 0 0 12px; font: 600 clamp(1.5rem, 5.5vw, 2.2rem)/1.18 var(--titre); letter-spacing: -0.02em;
}
.titre-or {
  background: linear-gradient(180deg, var(--or-clair) 0%, var(--or) 46%, var(--or-fonce) 78%, #f8c850 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.consigne { margin: 0 0 24px; color: var(--doux); }
.rejeu-liste { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 12px; }
.r-vous { justify-self: end; max-width: 86%; padding: 9px 14px; color: var(--doux); border: 1px solid var(--trait); border-radius: 14px; font-size: 0.95rem; }
.r-thierry { max-width: 92%; }
.r-autre { max-width: 86%; padding: 8px 14px; color: var(--encre); background: #d9ecf7; border-radius: 14px; font-size: 0.92rem; }
.r-dit { margin: 0; display: inline-block; padding: 10px 14px; background: var(--ivoire); color: var(--encre); border-radius: 16px 16px 16px 6px; }
.r-sous { margin: 8px 0 0 10px; font: 500 1.4rem/1.3 var(--manuscrit); color: var(--or); }
.fermeture { margin: 0 0 32px; font: 600 1.15rem/1.4 var(--titre); }

.gestes { margin: 20px 0; padding-left: 1.4em; display: grid; gap: 18px; }
.gestes strong { color: var(--or-clair); }
.geste-nom { margin: 0 0 4px; font: 600 1rem/1.35 var(--titre); }
.geste-pose { margin: 0; color: var(--or-clair); }
.geste-absent { margin: 0; color: var(--doux); }
.principe-texte { font-size: 1.08rem; }
.reperes { margin: 20px 0; padding-left: 1.2em; display: grid; gap: 12px; }
.reperes strong { color: var(--or-clair); }
.renvoi { margin: 26px 0 32px; padding: 14px 16px; border: 1px solid var(--trait); border-radius: 12px; background: var(--nuit-2); }
.sorties { display: grid; gap: 12px; justify-items: start; }
.bouton-second { min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; background: transparent; color: var(--texte); border: 1px solid var(--or); border-radius: 999px; cursor: pointer; text-decoration: none; }
#resume { display: none; }
.nuance { color: var(--doux); }
.place { margin: 22px 0; padding: 16px; border: 1px solid var(--trait); border-radius: 14px; background: var(--nuit-2); }
.recours { margin: 22px 0 32px; font-size: 0.92rem; color: var(--doux); }

.rh { margin: 36px 0 24px; padding: 20px; border: 1px solid var(--bleu); border-radius: 16px; background: rgba(16, 168, 253, 0.06); }
.rh h2 { margin: 0 0 8px; font: 600 1.25rem/1.25 var(--titre); color: var(--bleu); }
.rh p { margin: 0 0 14px; }
.rh-lien { color: var(--bleu); font-weight: 700; }
.credit { color: var(--doux); font-size: 0.82rem; }

/* ---------- Ordinateur : la photo à gauche, la conversation à droite ---------- */
@media (min-width: 900px) {
  .jeu { grid-template-rows: none; grid-template-columns: minmax(360px, 44vw) 1fr; height: calc(100vh - 61px); }
  .scene { height: 100%; }
  .scene::after { inset: 0 0 0 auto; width: 18%; height: auto; background: linear-gradient(90deg, transparent, var(--nuit)); }
  .conversation { padding: 24px 32px 0; }
  .fil { max-width: 640px; }
  .choix { margin: 0 -32px; padding: 16px 32px 24px; }
  .choix-liste { max-width: 640px; }
}

@media (prefers-reduced-motion: reduce) {
  .bulle, .recit, .carton, .evenement, .scene img { transition: none; }
}

/* ---------- Résumé imprimable : seule la section #resume s'imprime ---------- */
@media print {
  body { background: #fff; color: #000; font: 11pt/1.45 Georgia, serif; }
  body > *:not(main), main > *:not(#resume) { display: none !important; }
  #resume { display: block !important; max-width: 17cm; margin: 0 auto; }
  #resume h1 { font-size: 16pt; margin: 0 0 4pt; }
  #resume h2 { font-size: 12pt; margin: 14pt 0 4pt; }
  .resume-question { margin-top: 16pt; font-style: italic; }
}
