/* ASVS - Borne IA du stand v2. Charte : nuit profonde, argent et chrome, rouge ASVS #e5252a.
   Regles : aucun flou derriere un texte (panneaux opaques), aucun texte sur le visage du robot.
   Les animations sont pilotees par le script (elles ne dependent pas du reglage Windows des effets d'animation). */

:root {
  --nuit: #04070f;
  --nuit-2: #0a1120;
  --marine: #12203d;
  --rouge: #e5252a;
  --rouge-sombre: #9d161a;
  --argent: #c9d0db;
  --argent-clair: #eef1f6;
  --argent-sombre: #7f8899;
  --texte: #eef2f8;
  --texte-doux: #9aa6ba;
  --bleu: #9cc2ff;
  --u: 1vmin;
  --og: 0.6;
  --vis: 0.2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--nuit);
  color: var(--texte);
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body.curseur-cache, body.curseur-cache * { cursor: none !important; }
p, h1, ol { margin: 0; }
img { display: block; }

/* ---------- Fond ---------- */
.fond {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(55% 40% at 50% 38%, rgba(38, 62, 118, 0.55) 0%, rgba(18, 32, 61, 0.22) 50%, rgba(4, 7, 15, 0) 78%),
    radial-gradient(80% 45% at 50% 105%, rgba(229, 37, 42, 0.09) 0%, rgba(229, 37, 42, 0) 60%),
    radial-gradient(120% 90% at 50% 50%, rgba(4, 7, 15, 0) 55%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, #070d1a 0%, #050912 55%, #03060c 100%);
}
.fond-canvas { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.vision-video { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; z-index: -1; }

/* ---------- Grille (vertical d'abord : ecran 1080 x 1920) ---------- */
.borne {
  position: relative; z-index: 2;
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "marque marque"
    "scene scene"
    "dialogue dialogue"
    "commande commande"
    "pied pied";
  padding: calc(var(--u) * 3) calc(var(--u) * 4.4) calc(var(--u) * 1.4);
  row-gap: calc(var(--u) * 1.4);
}
.marque { grid-area: marque; }
.scene { grid-area: scene; }
.dialogue { grid-area: dialogue; }
.commande { grid-area: commande; }
.suite { grid-area: commande; }
.pied { grid-area: pied; }

/* ---------- En-tete ---------- */
.marque {
  display: flex; align-items: center; gap: calc(var(--u) * 3);
  padding-bottom: calc(var(--u) * 1.8);
  position: relative;
}
.marque::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--rouge) 0%, rgba(229, 37, 42, 0.35) 16%, rgba(201, 208, 219, 0.22) 45%, rgba(201, 208, 219, 0) 100%);
}
.marque-bouclier { flex: none; height: calc(var(--u) * 15.5); aspect-ratio: 600 / 700; cursor: default; filter: drop-shadow(0 calc(var(--u) * .8) calc(var(--u) * 1.6) rgba(0, 0, 0, 0.55)); }
.bouclier-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.reflet-bouclier { animation: reflet 7s cubic-bezier(.45, 0, .25, 1) infinite; }
@keyframes reflet { 0% { transform: translateX(0); } 30%, 100% { transform: translateX(1100px); } }

.marque-texte { display: flex; flex-direction: column; gap: calc(var(--u) * 1); min-width: 0; }
.surtitre {
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 500;
  font-size: calc(var(--u) * 1.65); letter-spacing: .28em; text-transform: uppercase;
  color: var(--argent);
}
.titre {
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 250;
  font-size: calc(var(--u) * 5.3); line-height: 1.04; letter-spacing: -.012em;
  color: var(--argent-clair);
}
.titre-asvs {
  font-weight: 600;
  background: linear-gradient(180deg, #ffffff 0%, #e6eaf0 46%, #a8b0be 52%, #e9edf3 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.infos {
  display: flex; align-items: center; flex-wrap: wrap; gap: calc(var(--u) * 1.3);
  font-size: calc(var(--u) * 2); color: var(--texte-doux); font-weight: 500;
}
.infos strong { color: var(--texte); font-weight: 700; }
.infos .sep { width: calc(var(--u) * .5); height: calc(var(--u) * .5); border-radius: 50%; background: var(--rouge); }
.etapes { display: none; }
.infos .long { display: none; }

/* ---------- Scene ---------- */
.scene { position: relative; min-height: 0; }
.scene-centre { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 1; }
.mascotte { position: absolute; inset: 0; }
.robot-gl { position: absolute; display: block; pointer-events: none; }
.avant-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

/* Repli sans WebGL : images de la v1 animees par le script */
.repli { position: absolute; inset: 0; transform: var(--repli-tf, none); transform-origin: 50% 100%; will-change: transform; }
body.robot-webgl .repli { display: none; }
body:not(.robot-repli) .repli { visibility: hidden; }
.pose { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s ease; -webkit-user-drag: none; }
body[data-pose="accueil"] .pose-accueil,
body[data-pose="index"] .pose-index { opacity: 1; }
.visiere {
  position: absolute; left: 33.3%; top: 19.8%; width: 30.6%; height: 7.5%;
  border-radius: 50%; overflow: hidden; pointer-events: none;
}
.visiere-lueur {
  position: absolute; inset: 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(130, 175, 255, 0.55) 0%, rgba(90, 140, 255, 0.16) 55%, rgba(60, 110, 255, 0) 80%);
  mix-blend-mode: screen; opacity: var(--vis);
}
.oeil {
  position: absolute; width: 11.5%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 252, 255, 0.95) 0%, rgba(200, 222, 255, 0.85) 9%, rgba(150, 192, 255, 0.55) 22%, rgba(95, 150, 255, 0.2) 42%, rgba(70, 120, 255, 0) 66%);
  mix-blend-mode: screen; pointer-events: none; opacity: var(--og);
}
.oeil-g { left: 42.35%; top: 23.7%; transform: translate(-50%, -50%); }
.oeil-d { left: 54.97%; top: 23.13%; transform: translate(-50%, -50%); }

/* Etiquettes du cadre HUD (dans les coins, jamais sur le robot) */
.hud {
  position: absolute; z-index: 3;
  display: flex; align-items: center; gap: calc(var(--u) * .9);
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 500;
  font-size: calc(var(--u) * 1.3); letter-spacing: .28em; text-transform: uppercase;
  color: rgba(201, 208, 219, 0.82);
  white-space: nowrap;
}
.hud strong { font-weight: 600; color: var(--argent-clair); letter-spacing: .24em; }
.hud .hud-fin { color: rgba(154, 166, 186, 0.75); }
.hud-hg { left: calc(var(--u) * 2.6); top: calc(var(--u) * 2.2); flex-direction: column; align-items: flex-start; gap: calc(var(--u) * .9); }
.hud-ligne { display: flex; align-items: center; gap: calc(var(--u) * .9); }
.hud-mode { padding-left: calc(var(--u) * 1.7); }
.hud-hd { right: calc(var(--u) * 2.6); top: calc(var(--u) * 2.2); }
.hud-carre { width: calc(var(--u) * .8); height: calc(var(--u) * .8); background: var(--rouge); }
body[data-etat="ecoute"] .hud-mode strong { color: #ff7a7e; }
body[data-etat="reflexion"] .hud-mode strong,
body[data-etat="reponse"] .hud-mode strong { color: #cfe0ff; }

/* Indicateur « l'agent voit » (visible seulement si la camera est active) */
.vision-indicateur { opacity: 0; transition: opacity .6s ease; }
body.vision-active .vision-indicateur { opacity: 1; }
.vision-oeil { width: calc(var(--u) * 3.6); height: calc(var(--u) * 2.25); overflow: visible; }
.vo-contour { fill: rgba(156, 194, 255, 0.08); stroke: rgba(201, 208, 219, 0.9); stroke-width: 1.6; }
.vo-iris { fill: none; stroke: #9cc2ff; stroke-width: 1.8; transform-box: fill-box; transform-origin: center; animation: iris 3.2s ease-in-out infinite; }
.vo-pupille { fill: #eaf2ff; animation: pupille 3.2s ease-in-out infinite; }
.vo-scan { stroke: rgba(229, 37, 42, 0.85); stroke-width: 1.2; stroke-dasharray: 4 40; animation: scanOeil 1.6s linear infinite; }
@keyframes iris { 0%, 100% { transform: translateX(-3px) scale(1); } 50% { transform: translateX(3px) scale(.92); } }
@keyframes pupille { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@keyframes scanOeil { to { stroke-dashoffset: -44; } }
.vision-presence {
  width: calc(var(--u) * .8); height: calc(var(--u) * .8); border-radius: 50%;
  background: rgba(201, 208, 219, 0.25); box-shadow: 0 0 0 calc(var(--u) * .3) rgba(201, 208, 219, 0.08);
  transition: background .3s ease, box-shadow .3s ease;
}
.vision-presence.on { background: #63e6a6; box-shadow: 0 0 0 calc(var(--u) * .35) rgba(99, 230, 166, 0.2); }

/* ---------- Dialogue ---------- */
.dialogue {
  display: flex; flex-direction: column; gap: calc(var(--u) * 1.3);
  height: calc(var(--u) * 31); min-height: 0;
}
.etat-libelle {
  display: flex; align-items: center; gap: calc(var(--u) * 1.2);
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 500;
  font-size: calc(var(--u) * 1.65); letter-spacing: .26em; text-transform: uppercase;
  color: var(--argent);
}
.etat-point {
  width: calc(var(--u) * 1.1); height: calc(var(--u) * 1.1); border-radius: 50%;
  background: var(--argent); box-shadow: 0 0 0 calc(var(--u) * .45) rgba(201, 208, 219, 0.14);
  animation: point 2.4s ease-in-out infinite;
}
@keyframes point { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
body[data-etat="ecoute"] .etat-point { background: var(--rouge); box-shadow: 0 0 0 calc(var(--u) * .5) rgba(229, 37, 42, 0.25); animation-duration: .9s; }
body[data-etat="reflexion"] .etat-point,
body[data-etat="reponse"] .etat-point { background: var(--bleu); box-shadow: 0 0 0 calc(var(--u) * .5) rgba(156, 194, 255, 0.22); animation-duration: 1.1s; }
body[data-etat="erreur"] .etat-point { background: #e0a43a; box-shadow: 0 0 0 calc(var(--u) * .5) rgba(224, 164, 58, 0.2); }

.panneau {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  padding: calc(var(--u) * 2.8) calc(var(--u) * 3.4);
  border-radius: calc(var(--u) * 1.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, #111b30 0%, #0a1222 100%);
  border: 1px solid rgba(201, 208, 219, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 calc(var(--u) * 2) calc(var(--u) * 5) rgba(0, 0, 0, 0.5);
}
.panneau::before {
  content: ""; position: absolute; left: calc(var(--u) * 3.4); top: 0; width: calc(var(--u) * 7); height: 2px;
  background: var(--rouge);
}
.panneau::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(214, 228, 255, 0.55) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-100%); animation: lisere 6s cubic-bezier(.45, 0, .25, 1) infinite;
}
@keyframes lisere { 0% { transform: translateX(-100%); } 45%, 100% { transform: translateX(100%); } }
.panneau-coin { position: absolute; width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); pointer-events: none; }
.panneau-coin-hg { right: calc(var(--u) * 1.2); top: calc(var(--u) * 1.2); border-top: 1px solid rgba(201, 208, 219, 0.45); border-right: 1px solid rgba(201, 208, 219, 0.45); }
.panneau-coin-bd { left: calc(var(--u) * 1.2); bottom: calc(var(--u) * 1.2); border-bottom: 1px solid rgba(201, 208, 219, 0.3); border-left: 1px solid rgba(201, 208, 219, 0.3); }
.accueil-texte, .echange {
  position: absolute; inset: calc(var(--u) * 2.8) calc(var(--u) * 3.4);
  display: flex; flex-direction: column; justify-content: center; gap: calc(var(--u) * 1.5);
  transition: opacity .45s ease, transform .45s ease;
}
.echange { justify-content: flex-start; overflow: hidden; opacity: 0; transform: translateY(calc(var(--u) * 1)); }
body:not([data-etat="attente"]) .accueil-texte { opacity: 0; transform: translateY(calc(var(--u) * -1)); pointer-events: none; }
body:not([data-etat="attente"]) .echange { opacity: 1; transform: none; }
.accueil-titre {
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 300;
  font-size: calc(var(--u) * 4.1); line-height: 1.18; color: var(--texte);
  transition: color .4s ease;
}
.insecable { white-space: nowrap; }
body.invitation .accueil-titre { color: #ffffff; animation: invitation 1.6s ease-in-out infinite; }
@keyframes invitation { 0%, 100% { text-shadow: 0 0 0 rgba(156, 194, 255, 0); } 50% { text-shadow: 0 0 calc(var(--u) * 2) rgba(156, 194, 255, 0.35); } }
.accueil-sous { font-size: calc(var(--u) * 2.7); line-height: 1.4; color: var(--texte-doux); font-weight: 500; transition: opacity .5s ease; }
.accueil-sous.change { opacity: 0; }
.accueil-langues {
  font-family: 'Sora', 'Segoe UI', sans-serif; font-size: calc(var(--u) * 1.55);
  letter-spacing: .3em; text-transform: uppercase; color: var(--argent-sombre);
}
.echange > * { flex-shrink: 0; }
.question {
  font-size: calc(var(--u) * 2.2); line-height: 1.4; color: var(--texte-doux); font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.question:empty { display: none; }
.reponse {
  font-size: calc(var(--u) * 3.3); line-height: 1.4; font-weight: 500; color: var(--texte);
}
.reponse .mot { color: rgba(226, 232, 242, 0.32); transition: color .16s ease; }
.reponse .mot.dit { color: var(--texte); }
.reponse.attente-points::after {
  content: ""; display: inline-block; width: 1.4em; text-align: left;
  animation: points 1.2s steps(4, end) infinite;
}
@keyframes points { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.reponse.message { color: var(--texte); }
.reponse.message .mot { color: var(--texte); }

/* Etapes de reflexion : rendent l'attente vivante */
.etapes-reflexion {
  display: none; list-style: none; padding: 0; margin-top: calc(var(--u) * .4);
  gap: calc(var(--u) * 2.2); flex-wrap: wrap;
  font-family: 'Sora', 'Segoe UI', sans-serif; font-size: calc(var(--u) * 1.55); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(154, 166, 186, 0.55);
}
body[data-etat="reflexion"] .etapes-reflexion { display: flex; }
.etapes-reflexion li { display: flex; align-items: center; gap: calc(var(--u) * .9); transition: color .4s ease; }
.etapes-reflexion li::before {
  content: ""; width: calc(var(--u) * 1); height: calc(var(--u) * 1); border-radius: 50%;
  border: 1px solid rgba(154, 166, 186, 0.5); transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.etapes-reflexion[data-etape="1"] li:nth-child(1),
.etapes-reflexion[data-etape="2"] li:nth-child(-n+2),
.etapes-reflexion[data-etape="3"] li:nth-child(-n+3) { color: var(--argent-clair); }
.etapes-reflexion[data-etape="1"] li:nth-child(1)::before,
.etapes-reflexion[data-etape="2"] li:nth-child(-n+2)::before,
.etapes-reflexion[data-etape="3"] li:nth-child(-n+3)::before { background: var(--bleu); border-color: var(--bleu); box-shadow: 0 0 0 calc(var(--u) * .35) rgba(156, 194, 255, 0.18); }
.etapes-reflexion[data-etape="1"] li:nth-child(1)::before,
.etapes-reflexion[data-etape="2"] li:nth-child(2)::before,
.etapes-reflexion[data-etape="3"] li:nth-child(3)::before { animation: point .9s ease-in-out infinite; }

/* ---------- Suite : QR code WhatsApp ---------- */
.suite {
  justify-self: start; align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1.2);
  width: calc(var(--u) * 26);
  opacity: 0; transform: translateX(calc(var(--u) * -3));
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
  z-index: 3;
}
body[data-etat="suite"] .suite,
body[data-etat="erreur"] .suite { opacity: 1; transform: none; pointer-events: auto; }
.qr-cadre {
  position: relative; padding: calc(var(--u) * .9);
  border-radius: calc(var(--u) * 1.8);
  background: linear-gradient(135deg, #f5f7fa 0%, #8a93a3 30%, #eef1f5 52%, #59616f 76%, #dfe3ea 100%);
  box-shadow: 0 calc(var(--u) * 1.5) calc(var(--u) * 4) rgba(0, 0, 0, 0.55);
}
.qr {
  width: calc(var(--u) * 19); aspect-ratio: 1;
  padding: calc(var(--u) * 1.1); border-radius: calc(var(--u) * 1.1);
  background: #ffffff;
}
.qr svg { width: 100%; height: 100%; display: block; }
.suite-titre {
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 500;
  font-size: calc(var(--u) * 2); line-height: 1.3; text-align: center; color: var(--texte);
}

/* ---------- Commande : bouton pour parler ---------- */
.commande { position: relative; display: flex; justify-content: center; }
.commande-contenu {
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .8);
  transition: transform .6s cubic-bezier(.3, .7, .2, 1);
}
body[data-etat="suite"] .commande-contenu,
body[data-etat="erreur"] .commande-contenu { transform: translateX(calc(var(--u) * 24)); }
.parler-cadre {
  position: relative; width: calc(var(--u) * 20); height: calc(var(--u) * 20);
  display: grid; place-items: center;
}
.anneau { position: absolute; left: 50%; top: 50%; width: 160%; height: 160%; transform: translate(-50%, -50%); pointer-events: none; }
.bouton-parler {
  position: relative; z-index: 1; width: 82%; height: 82%; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer; outline: none;
  display: grid; place-items: center;
  color: var(--argent-clair);
  background: radial-gradient(circle at 50% 30%, #2c3a5a 0%, #151e33 55%, #0a0f1b 100%);
  box-shadow:
    0 0 0 calc(var(--u) * .5) #070b14,
    0 calc(var(--u) * 2) calc(var(--u) * 4.5) rgba(0, 0, 0, 0.6),
    inset 0 calc(var(--u) * .4) calc(var(--u) * .8) rgba(255, 255, 255, 0.09);
  transition: transform .18s ease, background .25s ease, box-shadow .25s ease;
  touch-action: none;
}
.parler-cadre::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: calc(82% + var(--u) * 2.3); height: calc(82% + var(--u) * 2.3);
  transform: translate(-50%, -50%); border-radius: 50%;
  background: conic-gradient(from var(--angle-chrome, 200deg), #f5f7fa, #8a93a3, #eef1f5, #59616f, #dfe3ea, #7a8393, #f5f7fa);
  animation: chrome 9s linear infinite;
}
@property --angle-chrome { syntax: '<angle>'; inherits: false; initial-value: 200deg; }
@keyframes chrome { to { --angle-chrome: 560deg; } }
body[data-etat="ecoute"] .parler-cadre::before { background: conic-gradient(from var(--angle-chrome, 200deg), #ffd6d7, #b3262a, #ffe9ea, #7d1316, #ffc2c4, #a51f23, #ffd6d7); animation-duration: 2.2s; }
.bouton-parler:focus-visible { box-shadow: 0 0 0 calc(var(--u) * .5) #070b14, 0 0 0 calc(var(--u) * 1.1) var(--bleu); }
.icone-micro { width: 36%; height: 36%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
body[data-etat="ecoute"] .bouton-parler {
  transform: scale(.96);
  background: radial-gradient(circle at 50% 30%, #ff4a4f 0%, var(--rouge) 45%, var(--rouge-sombre) 100%);
  color: #ffffff;
}
body[data-etat="reflexion"] .bouton-parler { color: var(--bleu); }
.consigne {
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 500;
  font-size: calc(var(--u) * 2.1); letter-spacing: .16em; text-transform: uppercase; color: var(--argent-clair);
  margin-top: calc(var(--u) * .5);
}
.consigne-touche { font-size: calc(var(--u) * 1.55); color: var(--argent-sombre); display: none; }

/* ---------- Pied ---------- */
.pied { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .5); }
.pied p { font-size: calc(var(--u) * 1.4); line-height: 1.4; color: var(--argent-sombre); text-align: center; }
.pied-camera { display: none; align-items: center; gap: calc(var(--u) * .8); color: var(--argent) !important; }
.pied-camera svg { width: calc(var(--u) * 2.4); height: calc(var(--u) * 1.5); flex: none; fill: none; stroke: #9cc2ff; stroke-width: 2.2; }
body.vision-active .pied-camera { display: flex; }

/* ---------- Saisie cachee, avis, mesure ---------- */
.saisie {
  position: fixed; left: 50%; bottom: calc(var(--u) * 3); transform: translateX(-50%);
  width: min(92vw, calc(var(--u) * 90)); z-index: 20;
  padding: calc(var(--u) * 1.6) calc(var(--u) * 2);
  border-radius: calc(var(--u) * 1.6);
  background: #0e1626; border: 1px solid rgba(201, 208, 219, 0.3);
  box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 5) rgba(0, 0, 0, 0.6);
}
.saisie[hidden] { display: none; }
.saisie-label { display: block; font-size: calc(var(--u) * 1.4); letter-spacing: .2em; text-transform: uppercase; color: var(--argent-sombre); margin-bottom: calc(var(--u) * .8); }
.saisie input {
  width: 100%; border: 0; outline: none; background: transparent; color: var(--texte);
  font: 500 calc(var(--u) * 2.4) 'Manrope', 'Segoe UI', sans-serif; -webkit-user-select: text; user-select: text;
}
.saisie input::placeholder { color: rgba(154, 166, 186, 0.6); }
.avis {
  position: fixed; left: 50%; top: calc(var(--u) * 3); transform: translate(-50%, -150%);
  z-index: 21; max-width: 90vw;
  padding: calc(var(--u) * 1.2) calc(var(--u) * 2.4); border-radius: 999px;
  background: #101a2c; border: 1px solid rgba(201, 208, 219, 0.25); color: var(--texte);
  font-size: calc(var(--u) * 1.8); font-weight: 600;
  opacity: 0; transition: transform .4s ease, opacity .4s ease; pointer-events: none;
}
.avis.visible { transform: translate(-50%, 0); opacity: 1; }
.perf {
  position: fixed; left: 8px; bottom: 8px; z-index: 30; padding: 4px 8px; border-radius: 6px;
  background: #0e1626; color: #cfe0ff; font: 600 12px/1.3 'Manrope', 'Segoe UI', sans-serif; border: 1px solid rgba(201, 208, 219, 0.3);
}
.perf[hidden] { display: none; }
/* Reglages discrets (coin haut droit) : voix (V), effet (Maj + V), plein ecran (F) */
.reglages {
  position: fixed; right: calc(var(--u) * 1.2); top: calc(var(--u) * 1.2); z-index: 22;
  display: flex; gap: calc(var(--u) * .7); opacity: .38; transition: opacity .3s ease;
}
.reglages:hover { opacity: 1; }
.reglages[hidden] { display: none; }
body.curseur-cache .reglages { opacity: .14; }
body.entree-sequence .reglages { opacity: 0; pointer-events: none; }
.reglage {
  width: calc(var(--u) * 4.2); height: calc(var(--u) * 4.2); min-width: 30px; min-height: 30px; padding: 0;
  border-radius: 50%; border: 1px solid rgba(201, 208, 219, 0.35); background: #0b1322; color: var(--argent);
  display: grid; place-items: center; cursor: pointer;
}
.reglage svg { width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reglage:active { transform: scale(.94); }
.reglage .ic-sortir { display: none; }
body.plein-ecran .reglage .ic-entrer { display: none; }
body.plein-ecran .reglage .ic-sortir { display: inline; }

/* Veille (camera : personne devant la borne depuis un moment) */
body.veille .accueil-titre { color: var(--texte-doux); }

/* ---------- Paysage (1920 x 1080 ou portable 1440 x 900) ---------- */
@media (min-aspect-ratio: 1/1) {
  .borne {
    grid-template-columns: minmax(0, 23fr) minmax(0, 43fr) minmax(0, 34fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "marque scene dialogue"
      "pied   scene commande";
    column-gap: calc(var(--u) * 3.6);
    row-gap: calc(var(--u) * 2.2);
    padding: calc(var(--u) * 4.6) calc(var(--u) * 5) calc(var(--u) * 3.6);
  }
  .suite { grid-area: commande; }
  .marque {
    flex-direction: column; align-items: flex-start; justify-content: flex-start;
    gap: calc(var(--u) * 3.2); padding-bottom: 0;
  }
  .marque::after { display: none; }
  .marque-bouclier { height: calc(var(--u) * 24); }
  .titre { font-size: calc(var(--u) * 4.6); }
  .infos { flex-direction: column; align-items: flex-start; gap: calc(var(--u) * .7); }
  .infos .sep, .infos .court { display: none; }
  .infos .long { display: inline; }
  .marque-texte { gap: calc(var(--u) * 1.4); padding-bottom: calc(var(--u) * 2.8); position: relative; }
  .marque-texte::after {
    content: ""; position: absolute; left: 0; bottom: 0; width: 70%; height: 1px;
    background: linear-gradient(90deg, var(--rouge) 0%, rgba(229, 37, 42, 0.3) 25%, rgba(201, 208, 219, 0) 100%);
  }
  .etapes {
    display: flex; flex-direction: column; gap: calc(var(--u) * 1.5);
    list-style: none; padding: 0;
    font-size: calc(var(--u) * 2); color: var(--texte-doux); font-weight: 500;
  }
  .etapes li { display: flex; align-items: center; gap: calc(var(--u) * 1.5); }
  .etape-num {
    flex: none; width: calc(var(--u) * 3.5); height: calc(var(--u) * 3.5); border-radius: 50%;
    display: grid; place-items: center;
    font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 600; font-size: calc(var(--u) * 1.55); color: var(--argent-clair);
    border: 1px solid rgba(201, 208, 219, 0.35);
  }
  .pied { align-self: end; align-items: flex-start; }
  .pied p { text-align: left; }
  .dialogue { height: auto; }
  .accueil-titre { font-size: calc(var(--u) * 3.8); }
  .accueil-sous { font-size: calc(var(--u) * 2.4); }
  .reponse { font-size: calc(var(--u) * 2.9); }
  .suite { width: calc(var(--u) * 21); justify-self: start; }
  .qr { width: calc(var(--u) * 15.5); }
  .suite-titre { font-size: calc(var(--u) * 1.75); }
  body[data-etat="suite"] .commande-contenu,
  body[data-etat="erreur"] .commande-contenu { transform: translateX(calc(var(--u) * 12)); }
  .parler-cadre { width: calc(var(--u) * 17); height: calc(var(--u) * 17); }
  .consigne-touche { display: block; }
  .hud { font-size: calc(var(--u) * 1.15); }
}

/* Seulement si config.js demande de respecter le reglage Windows (respecterAnimationsReduites: true) */
body.animations-reduites .reflet-bouclier,
body.animations-reduites .panneau::after,
body.animations-reduites .parler-cadre::before { animation-duration: 30s; }

/* ---------- Entree spectaculaire (?entree=1) ---------- */
.robot-plein { position: fixed !important; z-index: 6; pointer-events: none; }
.avant-plein { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 7; pointer-events: none; display: none; }
body.entree-sequence .avant-plein { display: block; }
.repli { transition: opacity .4s ease; }
body.robot-cache .repli { opacity: 0; }
.dialogue, .commande, .pied, .hud-hg { transition: opacity .9s ease; }
body.entree-appel .dialogue, body.entree-appel .commande, body.entree-appel .suite,
body.entree-sequence:not(.entree-posee) .dialogue, body.entree-sequence:not(.entree-posee) .commande { opacity: 0; pointer-events: none; }
body.entree-appel .hud, body.entree-sequence:not(.entree-posee) .hud-hg { opacity: .22; }
body.entree-appel .pied { opacity: .45; }
body.entree-posee .commande { transition-delay: .45s; }
body.entree-voix .accueil-texte { opacity: 0; }
body.entree-voix .echange { opacity: 1; transform: none; }

.appel {
  position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%);
  display: none; flex-direction: column; align-items: center; gap: calc(var(--u) * 1.6);
  z-index: 3; pointer-events: none; text-align: center; --niv: 0; width: max-content; max-width: 92%;
}
body.entree-appel .appel { display: flex; animation: appelArrive 1.4s cubic-bezier(.2, .7, .2, 1) both; }
body.entree-sequence .appel { display: flex; animation: appelPart .55s ease forwards; }
@keyframes appelArrive { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes appelPart { to { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
.appel-anneau { position: relative; width: calc(var(--u) * 15); height: calc(var(--u) * 15); margin-bottom: calc(var(--u) * 1.4); }
.appel-anneau::before, .appel-anneau::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(201, 208, 219, 0.4);
}
.appel-anneau::after { border-color: rgba(229, 37, 42, 0.55); animation: appelOnde 2.6s cubic-bezier(.2, .6, .3, 1) infinite; }
@keyframes appelOnde { from { transform: scale(.55); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
.appel-niveau {
  position: absolute; inset: 14%; border-radius: 50%;
  border: 2px solid rgba(156, 194, 255, calc(0.25 + var(--niv) * 0.75));
  transform: scale(calc(0.8 + var(--niv) * 0.55));
  transition: transform .08s linear;
}
.appel-coeur {
  position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 1.2); height: calc(var(--u) * 1.2);
  margin: calc(var(--u) * -0.6) 0 0 calc(var(--u) * -0.6); border-radius: 50%;
  background: #cfe0ff; animation: point 1.6s ease-in-out infinite;
}
.appel-titre {
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 300;
  font-size: calc(var(--u) * 4); letter-spacing: .06em; color: var(--argent-clair);
}
.appel-aide {
  font-family: 'Sora', 'Segoe UI', sans-serif; font-weight: 500;
  font-size: calc(var(--u) * 1.3); letter-spacing: .3em; text-transform: uppercase; color: rgba(154, 166, 186, 0.7);
}
.appel-son {
  font-size: calc(var(--u) * 1.3); letter-spacing: .2em; text-transform: uppercase; color: #9cc2ff;
  opacity: 0; transition: opacity .4s ease;
}
.appel-son.visible { opacity: 1; }
