:root {
  /* Teintes modifiables plus tard (un seul endroit) */
  --bg: #3f3f3f;
  --frame-bg: #000000;
  --frame-border: rgba(255, 255, 255, 0.55);
  --frame-shadow: rgba(0, 0, 0, 0.55);

  --tab-text: #ffffff;
  --tab-hover-bg: rgba(255, 255, 255, 0.08);
  --tab-accent: #8f857a;

  /* Couleurs anaglyphes (référence lunettes) */
  --ana-red: #b00024;
  --ana-blue: #0052b3;

  --bubble-bg: rgba(255, 255, 255, 0.18);

  /* Layout vars (ajustables ultérieurement) */
  --frame-left-desktop: 16vw;
  --frame-top-desktop: 10vh;
  --frame-width-desktop: 82vw;
  --frame-height-desktop: 82vh;

  --frame-left-landscape: 18vw;
  --frame-top-landscape: 8vh;
  --frame-width-landscape: 80vw;
  --frame-height-landscape: 84vh;

  --frame-left-portrait: 50%;
  --frame-top-portrait: 52%;
  --frame-width-portrait: 94vw;
  --frame-height-portrait: 74vh;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tab-text);
  font-family: Georgia, "Times New Roman", serif;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* AVATAR */
.avatar {
  position: fixed;
  top: 14px;
  left: 14px;
  width: clamp(38px, 5.5vmin, 70px);
  height: auto;
  image-rendering: pixelated;
  border: none;
  outline: none;
  background: transparent;
}

/* === RETOUR-AVATAR : blink yeux (overlay) === */
.avatar-eye{
  position: fixed;
  background: #ffffff;
  pointer-events: none;
  z-index: 9999;
  image-rendering: pixelated;
  transform-origin: 50% 50%;
  transform: none;
}
.avatar-eye.blink{
  transform: scaleY(0.25);
}

/* ONGLET(S) */
.tabs {
  position: fixed;
  /* ancrage sur le bord gauche de la fenêtre (desktop) */
  right: calc(100vw - var(--frame-left-desktop));
  left: auto;
  top: 54%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 10;
}

@media (min-width: 981px) {
  /* B200 — Desktop : léger écart languette↔fenêtre (repos+actif) */
  .tabs .tab{ padding-right: 3px; }

  .tabs {
    top: var(--frame-top-desktop);
    transform: none;
    height: var(--frame-height-desktop);
    justify-content: space-between;
    padding-top: 22vh;
    padding-bottom: 6vh;
    gap: 0;
    align-items: flex-end;
  }


/* --- Desktop : onglets subtils (même esthétique que mobile) --- */
/* Supprime le rectangle + le scale du bloc onglet (desktop) */
.tabs .tab:hover,
.tabs .tab:active,
.tabs .tab.tab-click {
  background: transparent;
  transform: none;
}

/* Feedback : texte (surbrillance + ombre) */
.tabs .tab:hover,
.tab:active {
  text-shadow:
    0 0 12px rgba(255,255,255,0.26),
    0 2px 6px rgba(0,0,0,0.35);
}

/* Sélection : texte un peu plus grand */
.tabs .tab.tab-click {
  font-size: clamp(17px, 2.35vmin, 27px);
}

/* Languette : fine par défaut, collée à la fenêtre, tirage vers le texte */
.tabs .tab::before {
  border-radius: 10px 2px 2px 10px; /* arrondi côté texte */
  transform-origin: right center;   /* bord fenêtre = côté droit */
  transform: scaleX(0.55);          /* plus fine */
  transition: transform 160ms ease, filter 160ms ease;
}

.tabs .tab:hover::before,
.tabs .tab:active::before {
  transform: scaleX(1.10);          /* tirage vers le texte */
}

/* Sélection : languette un peu plus claire (sans rectangle) */
.tabs .tab.tab-click::before {
  transform: scaleX(1.10);
  filter: brightness(1.18);
}
}



.tab {
  position: relative;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  /* texte à gauche, languette à droite */
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 14px;
  /* padding droite = 0 pour que la languette touche le bord de la fenêtre */
  padding: 10px 0 10px 14px;
  color: var(--tab-text);
  text-decoration: none;
  font-size: clamp(16px, 2.2vmin, 26px);
  font-weight: 600;
  border-radius: 10px;
  transform-origin: left center;
  transition: transform 160ms ease, background-color 160ms ease;
}

/* "languette" type classeur */
.tab::before {
  content: "";
  width: 16px;
  height: 54px;
  background: var(--tab-accent);
  border-radius: 2px;
  opacity: 0.95;
}

/* Languettes colorées (Collection=bleu, Contact=rouge) */
.tabs .tab.tab-click:nth-child(2)::before{ background: var(--ana-blue); }
.tabs .tab.tab-click:nth-child(3)::before{ background: var(--ana-red); }

.tab:hover {
  background: var(--tab-hover-bg);
  transform: scale(1.05);
}

/* Feedback de sélection (clic) : petite variation de taille */
.tab.tab-click {
  transform: scale(1.08);
}



/* B191 — Entrevue : conserver la forme d’origine (tirage léger) + voile jaune + ombres calibrées */
.tab.tab-click[data-i18n="tabs.entrevue"]{
  /* on conserve le scale global d’origine (.tab.tab-click) */
  text-shadow:
    2px 3px 0 rgba(0,0,0,0.85),
    4px 6px 0 rgba(0,0,0,0.45);
}

/* Languette : forme d’origine + tirage léger (sans changer la géométrie) */
.tab.tab-click[data-i18n="tabs.entrevue"]::before{
  background:
    linear-gradient(rgba(255, 226, 122, 0.50), rgba(255, 226, 122, 0.50)),
    var(--tab-accent);
  /* on garde la largeur d’origine (16px) et on tire via scaleX */  /* séparation/ombre : légèrement plus marquée pour égaler les autres */
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.10);
}


/* B196 — Mobile : conserver l’écart languette↔fenêtre en état actif
   (le scale de .tab-click ne doit pas “monter” vers la fenêtre) */
@media (max-width: 980px){
  .tab{ transform-origin: center top; }
}



/* B197 — Mobile : l’écart fenêtre↔languette doit rester strictement identique
   => on neutralise le scale de sélection (qui “mange” l’espace) */
@media (max-width: 980px){
  .tab.tab-click{ transform: none !important; }
}


/* ZONE BULLE (reservee) */
#bubbleSlot {
  white-space: pre-line;
  line-height: 1.4;
  overflow-wrap: anywhere;
  position: fixed;
  left: 90px;
  top: 100px;
  width: min(58vw, 980px);

  background: var(--bubble-bg);
  z-index: 40;
  pointer-events: none;
  border-radius: 22px;
  overflow: hidden;
  max-height: 0px;
  transition: max-height 650ms ease, padding 650ms ease;
  padding: 0;

  /* PATCH Glass UI : voile sombre local + flou léger du fond */
  backdrop-filter: blur(8px) brightness(0.55);
  -webkit-backdrop-filter: blur(8px) brightness(0.55);
  isolation: isolate;
}


#bubbleSlot[aria-hidden="false"]{ padding: 18px 22px; }
#bubbleSlot[aria-hidden="true"]{ padding: 0; }
/* FENETRE DE VISUALISATION */
.frame {
  position: fixed;
  left: var(--frame-left-desktop);
  top: var(--frame-top-desktop);
  transform: none;
  width: var(--frame-width-desktop);
  height: var(--frame-height-desktop);
  background: var(--frame-bg);
  border: 2px solid var(--frame-border);
  border-radius: 10px;
  box-shadow: 0 18px 40px var(--frame-shadow);
}

/* PAYSAGE (smartphone/tablette) */
@media (max-width: 980px) and (orientation: landscape) {
  .tabs {
    right: calc(100vw - var(--frame-left-landscape));
    left: auto;
    top: 54%;
    align-items: flex-end;
  }

  #bubbleSlot {
    left: 91px;
    top: 37px;
    width: 581px;
    transform: none;
}

  .frame {
    left: var(--frame-left-landscape);
    top: var(--frame-top-landscape);
    width: var(--frame-width-landscape);
    height: var(--frame-height-landscape);
  }
  .tab {
    font-size: clamp(14px, 1.9vmin, 20px);
    padding: 10px 0 10px 14px;
  }

  .tab::before {
    width: 12px;
    height: 42px;
  }


  /* --- Smartphone (paysage) : onglets subtils (sans rectangle) --- */
  /* Supprime le rectangle + le scale du bloc onglet (mobile) */
  .tab:hover,
  .tab:active,
  .tab.tab-click {
    background: transparent;
    transform: none;
  }

  /* Feedback : texte (taille + surbrillance + ombre) */
  .tab:hover,
  .tab:active {
    font-size: clamp(15px, 2.1vmin, 21px);
    text-shadow:
      0 0 12px rgba(255,255,255,0.26),
      0 2px 6px rgba(0,0,0,0.35);
  }

  /* Sélection : texte un peu plus grand */
  .tab.tab-click {
    font-size: clamp(15px, 2.1vmin, 21px);
  }

  /* Languette : fine par défaut, collée à la fenêtre, tirage vers le texte */
  .tab::before {
    border-radius: 10px 2px 2px 10px; /* arrondi côté texte */
    transform-origin: right center; /* bord fenêtre = côté droit */
    transform: scaleX(0.55);        /* plus fine */
    transition: transform 160ms ease, filter 160ms ease;
  }

  .tab:hover::before,
  .tab:active::before {
    transform: scaleX(1.10);        /* tirage vers le texte (à gauche) */
  }

  /* Sélection : languette un peu plus claire (sans rectangle) */
  .tab.tab-click::before {
    transform: scaleX(1.10);
    filter: brightness(1.18);
  }

  .avatar-dots{ left: 52px; top: 59px; }

  /* B199 — Paysage : même écart au repos/actif (comme portrait) */
  .tab{ padding-right: 2px !important; } /* crée l’écart visible au repos */
  .tab.tab-click{ padding-right: 2px !important; } /* garde l’écart identique en actif */

  /* En actif : languette légèrement plus "tirée" (plus longue vers l'arrière) */
  .tab::before{ transform-origin: right center; }
  .tab.tab-click::before{ transform: scaleX(1.12) !important; }

}

/* PORTRAIT (smartphone) */
/* PORTRAIT (smartphone) */
@media (max-width: 780px) and (orientation: portrait) {
  .tabs {
    left: 12px;
    right: 12px;
    top: calc(var(--frame-top-portrait) + (var(--frame-height-portrait) / 2) + 10px);
    bottom: auto;
    transform: none;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
  }

  .tab {
    font-size: clamp(16px, 3.0vmin, 22px);
    padding: 10px 8px;
    transform-origin: center;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    gap: 0;
    justify-content: center;
  }

  .tab::before {
    width: 56px;
    height: 10px;
    border-radius: 2px;
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
  }

  #bubbleSlot {
        left: calc((100vw - (var(--frame-width-portrait) - 24px)) / 2);
    top: 70px;
    width: calc(var(--frame-width-portrait) - 24px);

    padding: 22px 24px;}

  .frame {
    left: 50%;
    top: var(--frame-top-portrait);
    transform: translate(-50%, -50%);
    width: var(--frame-width-portrait);
    height: var(--frame-height-portrait);
  }

  /* --- Smartphone (portrait) : onglets subtils (sans rectangle) --- */
  /* Supprime le rectangle + le scale du bloc onglet (mobile) */
  .tab:hover,
  .tab:active,
  .tab.tab-click {
    background: transparent;
    transform: none;
  }

  /* Feedback : texte (taille + surbrillance + ombre) */
  .tab:hover,
  .tab:active {
    font-size: clamp(17px, 3.25vmin, 23.5px);
    text-shadow:
      0 0 12px rgba(255,255,255,0.26),
      0 2px 6px rgba(0,0,0,0.35);
  }

  /* Sélection : texte un peu plus grand */
  .tab.tab-click {
    font-size: clamp(17px, 3.25vmin, 23.5px);
  }

  /* Languette : fine par défaut, collée à la fenêtre, tirage vers le texte (vers le bas) */
  .tab::before {
    border-radius: 2px 2px 12px 12px; /* arrondi côté texte */
    transform-origin: 50% 0%;                 /* bord fenêtre = en haut */
    transform: translateX(-50%) scaleY(0.55); /* conserve centrage + amincit */
    transition: transform 160ms ease, filter 160ms ease;
  }

  .tab:hover::before,
  .tab:active::before {
    transform: translateX(-50%) scaleY(1.15); /* tirage vers le texte */
  }

  /* Sélection : languette un peu plus claire (sans rectangle) */
  .tab.tab-click::before {
    transform: translateX(-50%) scaleY(1.15);
    filter: brightness(1.18);
  }

  .avatar-dots{ left: 52px; top: 59px; }
}


/* Indicateur "3 points" (alternative à la queue de phylactère) */
.avatar-dots{
  position: fixed;
  left: 58px;
  top: 46px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  z-index: 6;            /* au-dessus de la bulle */
  pointer-events: none;
  animation: dotsPulse 1.2s infinite ease-in-out;
}

.avatar-dots::before,
.avatar-dots::after{
  content:"";
  position:absolute;
  top:0;
  width:6px;
  height:6px;
  border-radius:50%;
  background: rgba(255,255,255,0.55);
  animation: dotsPulse 1.2s infinite ease-in-out;
}

.avatar-dots::before{ left: 10px; animation-delay: 0.15s; }
.avatar-dots::after{  left: 20px; animation-delay: 0.30s; }

@keyframes dotsPulse{
  0%, 80%, 100%{ opacity: 0.25; transform: translateY(0); }
  40%{ opacity: 0.95; transform: translateY(-2px); }
}

/* Ajustements mobiles */
@media (max-width: 980px) and (orientation: landscape){
  .avatar-dots{ left: 56px; top: 44px; }
}
@media (max-width: 780px) and (orientation: portrait){
  .avatar-dots{ left: 56px; top: 44px; }
}


/* BULLE — affichage du texte externe */
#bubbleSlot {
  white-space: pre-line;
  line-height: 1.4;
}

/* B129 micro-patch: contrôle du wrapping selon mode */
#bubbleSlot.bubble-compact {
  white-space: pre;          /* empêche les retours automatiques dans les 2 lignes desktop/paysage */
}

#bubbleSlot.bubble-portrait {
  white-space: pre-line;     /* respecte les retours du .txt en portrait */
}
/* PATCH DevGrid / reprise coordonnées SAS — Accueil smartphone paysage */
@media (orientation: landscape) and (max-height: 520px) {
  #bubbleSlot {
    left: 91px !important;
    top: 37px !important;
    width: 669px !important;
    transform: none !important;
  }
}

/* --- PATCH FINAL: positions figées --- */

/* Desktop (figé) */
@media (min-width: 981px) {
  .avatar-dots{ left: 58px !important; top: 66px !important; }
  #bubbleSlot{ left: 140px !important; }
}

/* Mobile paysage (figé) */
@media (max-width: 980px) and (orientation: landscape) {
  .avatar-dots{ left: 44px !important; top: 48px !important; }
}

/* Mobile portrait (figé) */
@media (max-width: 780px) and (orientation: portrait) {
  .avatar-dots{ left: 44px !important; top: 48px !important; }
}

/* --- PATCH B135: fin de parole (bulle -> points) --- */
/* À la fin de la disparition de la bulle : point 3 disparaît, puis point 2. Le point 1 reste, puis devient un tiret. */
@keyframes dotsFadeOut {
  from { opacity: 0.95; }
  to   { opacity: 0; }
}

.avatar-dots.dots-ending,
.avatar-dots.dots-ending::before,
.avatar-dots.dots-ending::after{
  animation: none !important; /* stop pulse */
}

/* Point 3 (droite) */
.avatar-dots.dots-ending::after{
  animation: dotsFadeOut 520ms ease forwards !important;
  animation-delay: 0ms !important;
}

/* Point 2 (milieu) */
.avatar-dots.dots-ending::before{
  animation: dotsFadeOut 520ms ease forwards !important;
  animation-delay: 420ms !important;
}

/* Point 1 -> tiret (même position) */
.avatar-dots.dots-dash{
  background: transparent !important; /* on remplace par un tiret */
}

.avatar-dots.dots-dash::after{
  opacity: 0 !important;
  animation: none !important;
}

.avatar-dots.dots-dash::before{
  /* tiret centré sur l'ancien point */
  opacity: 1 !important;
  animation: none !important;
  left: -2px !important;
  top: 2px !important;
  width: 10px !important;
  height: 2px !important;
  border-radius: 2px !important;
  background: rgba(255,255,255,0.55) !important;
}

/* Tiret avatar : 3s visible, puis rétrécit des deux côtés -> carré, puis disparaît */
@keyframes dashSequence{
  0%, 78% { transform: scaleX(1); opacity: 1; }
  88% { transform: scaleX(0.2); opacity: 1; } /* 10px -> ~2px (carré) */
  100% { transform: scale(0); opacity: 0; }
}
.avatar-dots.dots-dash::before{
  transform-origin: center center !important;
  animation: dashSequence 3.8s ease forwards !important;
}


/* --- ENTREVUE NAV (B141) --- */
.frame{
  overflow: hidden; /* principe: pas de scroll visible */
}

.frame .entrevue-nav{
  position: absolute;
  inset: 0;
  pointer-events: none; /* seuls les boutons reçoivent les clics */
  z-index: 20;
}

.frame .entrevue-nav button{
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.85);
  font: 600 34px/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
  user-select: none;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.frame .entrevue-nav button:hover{
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.95);
  transform: translateY(-50%) scale(1.06);
}

.frame .entrevue-nav button:active{
  transform: translateY(-50%) scale(0.98);
}

.frame .entrevue-nav .nav-prev{ left: 14px; }
.frame .entrevue-nav .nav-next{ right: 14px; }

.frame .entrevue-nav button[disabled]{
  opacity: 0;
  pointer-events: none;
}


/* B198 — Mobile (portrait+paysage) : conserver l’écart languette↔fenêtre en actif
   (on ajoute un micro "retrait" à droite uniquement en état actif) */
@media (max-width: 980px) and (orientation: portrait){
  .tab.tab-click{ padding-right: 4px !important; }
}


/* B207 — Tous les onglets : ombre 3D sur l’intitulé quand l’onglet est actif (tab-click) */
.tab.tab-click,
.tabs .tab.tab-click{
  text-shadow:
    2px 3px 0 rgba(0,0,0,0.85),
    4px 6px 0 rgba(0,0,0,0.45) !important;
}


/* PATCH: supprimer flash bleu (tap highlight) sur mobile */
@media (hover: none) and (pointer: coarse) {
  a, button, .tab, .nav-arrow, .nav-btn, .arrow, .btn {
    -webkit-tap-highlight-color: transparent;
  }
  a:focus, button:focus { outline: none; }
}
