/* =============================================================================
   BOOPETS — VISITE GUIDÉE  (v1.0.0)
   Projecteur d’Aura sur l’élément présenté + fiche de dialogue Eÿla / Harkas.
   Palette héritée du site : nuit #10203A, ambre #F7BE48, corail #EE744E.
   ========================================================================== */

.bvg{
  /* Au-dessus de tout l'existant : le panier du site monte à 12000,
     l'hôtesse d'accueil à 2000. */
  position:fixed; inset:0; z-index:999000;
  --bvg-aura:#f6bc47; --bvg-aura-2:#e9843d;
  --bvg-nuit-1:rgba(18,35,61,.98);
  --bvg-nuit-2:rgba(5,14,27,.99);
  --bvg-or:#e9c26a;
  --bvg-texte:#f4efe0;
  --bvg-doux:#aab1c9;
  font-family:inherit;
  animation:bvg-entree .35s ease both;
}
.bvg[hidden]{display:none !important}

/* ---- Voile ---------------------------------------------------------------- */
.bvg-voile{
  position:absolute; inset:0;
  background:transparent;              /* peint par le projecteur, voir plus bas */
}
.bvg[data-cible="non"] .bvg-voile{
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(24,44,80,.66), transparent 62%),
    rgba(3,7,16,.86);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
}

/* ---- Projecteur : le « trou » dans le voile -------------------------------- */
.bvg-projecteur{
  position:absolute; pointer-events:none;
  border-radius:18px;
  box-shadow:
    0 0 0 9999px rgba(3,7,16,.82),
    0 0 0 2px var(--bvg-aura),
    0 0 28px 6px color-mix(in srgb, var(--bvg-aura) 55%, transparent),
    inset 0 0 24px color-mix(in srgb, var(--bvg-aura) 22%, transparent);
  transition:top .38s cubic-bezier(.22,.9,.28,1), left .38s cubic-bezier(.22,.9,.28,1),
             width .38s cubic-bezier(.22,.9,.28,1), height .38s cubic-bezier(.22,.9,.28,1);
}
.bvg[data-cible="non"] .bvg-projecteur{display:none}

/* Repli si color-mix n’est pas connu du navigateur. */
@supports not (color: color-mix(in srgb, red 50%, blue)){
  .bvg-projecteur{ box-shadow:0 0 0 9999px rgba(3,7,16,.82), 0 0 0 2px #f6bc47, 0 0 28px 6px rgba(246,188,71,.5); }
}

.bvg-pulse{
  position:absolute; pointer-events:none; border-radius:22px;
  border:1px solid color-mix(in srgb, var(--bvg-aura) 70%, transparent);
  animation:bvg-pulse 2.4s ease-out infinite;
}
.bvg[data-cible="non"] .bvg-pulse{display:none}

/* ---- Fiche de dialogue ----------------------------------------------------- */
.bvg-fiche{
  position:fixed;
  width:min(520px, calc(100vw - 28px));
  border:1px solid rgba(229,177,70,.8); border-radius:22px;
  background:linear-gradient(150deg, var(--bvg-nuit-1), var(--bvg-nuit-2));
  box-shadow:0 26px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  color:var(--bvg-texte);
  padding:18px 20px 16px;
  animation:bvg-fiche-entree .34s cubic-bezier(.2,.9,.3,1) both;
}
.bvg-fiche::before{
  content:""; position:absolute; left:16%; right:16%; top:-1px; height:2px;
  background:linear-gradient(90deg, transparent, #f6e5b2, transparent);
  box-shadow:0 0 16px rgba(247,214,130,.6);
}

.bvg-fermer{
  position:absolute; top:10px; right:10px;
  width:34px; height:34px; border-radius:50%;
  display:grid; place-items:center;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14);
  color:var(--bvg-doux); font-size:15px; line-height:1; cursor:pointer;
}
.bvg-fermer:hover{ background:rgba(255,255,255,.12); color:#fff }

.bvg-corps{ display:grid; grid-template-columns:96px minmax(0,1fr); gap:16px; align-items:start }

.bvg-portrait{ position:relative; align-self:center }
.bvg-portrait img{
  position:relative; z-index:1;
  display:block; width:96px; height:auto; border-radius:16px;
  filter:drop-shadow(0 8px 20px rgba(0,0,0,.5));
}
.bvg-halo{
  position:absolute; inset:-10px -8px -6px; border-radius:20px; z-index:0;
  background:radial-gradient(60% 60% at 50% 45%,
             color-mix(in srgb, var(--bvg-aura) 40%, transparent), transparent 70%);
  animation:bvg-halo 3.6s ease-in-out infinite;
}

/* Portrait introuvable côté serveur : on bascule proprement en texte seul. */
.bvg[data-portrait="absent"] .bvg-portrait{ display:none }
.bvg[data-portrait="absent"] .bvg-corps{ grid-template-columns:minmax(0,1fr) }

.bvg-kicker{
  margin:0 0 2px; font-size:10px; font-weight:900; letter-spacing:.16em;
  text-transform:uppercase; color:var(--bvg-or);
}
.bvg-nom{ margin:0; font-size:20px; line-height:1.15 }
.bvg-role{ margin:2px 0 8px; font-size:11.5px; color:var(--bvg-doux) }
.bvg-texte{
  margin:0; font-size:15px; line-height:1.6; color:#e9e5d8;
  max-height:32vh; overflow:auto; overscroll-behavior:contain;
}

/* ---- Pied : progression + boutons ------------------------------------------ */
.bvg-pied{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  margin-top:14px; padding-top:12px; border-top:1px solid rgba(255,255,255,.08);
}
.bvg-progression{ display:flex; gap:5px; margin-right:auto }
.bvg-progression i{
  width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,.18);
  transition:background .25s, transform .25s;
}
.bvg-progression i.est-active{ background:var(--bvg-aura); transform:scale(1.5) }
.bvg-progression i.est-faite{ background:rgba(233,194,106,.5) }

.bvg-boutons{ display:flex; flex-wrap:wrap; gap:8px; align-items:center }
.bvg-btn{
  font:inherit; font-size:13.5px; font-weight:800; cursor:pointer;
  border-radius:999px; padding:10px 16px; min-height:42px;
  border:1px solid rgba(233,194,106,.55); background:transparent; color:#f3e6c4;
  text-decoration:none; display:inline-flex; align-items:center; gap:6px;
}
.bvg-btn:hover{ border-color:var(--bvg-or); background:rgba(233,194,106,.1) }
.bvg-btn.est-principal{
  border-color:transparent; color:#1a1206;
  background:linear-gradient(135deg,#fbe6b0,#e9c26a 45%,#d09b3d);
  box-shadow:0 8px 22px rgba(233,194,106,.28);
}
.bvg-btn.est-principal:hover{ filter:brightness(1.06) }
.bvg-btn.est-discret{ border-color:transparent; color:var(--bvg-doux); padding:10px 10px }
.bvg-btn.est-discret:hover{ color:#fff; background:rgba(255,255,255,.06) }
.bvg-btn:focus-visible, .bvg-fermer:focus-visible{
  outline:2px solid var(--bvg-aura); outline-offset:2px;
}

/* ---- Bouton discret de relance (pied de page du site) ---------------------- */
.bvg-relance{ display:block; cursor:pointer; background:none; border:0; font:inherit;
  padding:0; margin:0; text-align:left; color:inherit; }
.bvg-relance:hover{ color:var(--gold-2, #e9c26a) }

/* Texte réservé aux lecteurs d'écran. */
.bvg-sr{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0;
}

/* ---- Tablette --------------------------------------------------------------- */
@media (max-width:900px){
  .bvg-fiche{ width:min(460px, calc(100vw - 24px)); padding:16px 18px 14px }
  .bvg-corps{ grid-template-columns:78px minmax(0,1fr); gap:13px }
  .bvg-portrait img{ width:78px }
  .bvg-nom{ font-size:18px }
  .bvg-texte{ font-size:14.5px; max-height:30vh }
}

/* ---- Smartphone : la fiche est amarrée, jamais flottante -------------------- */
@media (max-width:640px){
  .bvg-fiche{
    left:8px !important; right:8px; width:auto;
    top:auto !important; bottom:calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius:20px; padding:14px 14px 12px;
    max-height:min(64vh, 460px); overflow:auto; overscroll-behavior:contain;
  }
  /* Si l’élément présenté est en bas de l’écran, la fiche remonte en haut. */
  .bvg[data-amarrage="haut"] .bvg-fiche{
    bottom:auto; top:calc(8px + env(safe-area-inset-top, 0px)) !important;
  }
  .bvg-corps{ grid-template-columns:62px minmax(0,1fr); gap:11px }
  .bvg-portrait img{ width:62px; border-radius:13px }
  .bvg-nom{ font-size:16.5px }
  .bvg-role{ font-size:11px; margin-bottom:6px }
  .bvg-texte{ font-size:14.5px; line-height:1.55; max-height:26vh }
  .bvg-pied{ margin-top:11px; padding-top:10px; gap:8px }
  .bvg-boutons{ width:100%; gap:7px }
  .bvg-btn{ flex:1 1 auto; justify-content:center; min-height:46px; padding:11px 12px }
  .bvg-btn.est-discret{ flex:0 0 auto }
  .bvg-progression{ width:100%; margin:0 0 2px; justify-content:center }
}

@media (max-width:360px){
  .bvg-corps{ grid-template-columns:52px minmax(0,1fr) }
  .bvg-portrait img{ width:52px }
  .bvg-texte{ font-size:14px }
}

/* ---- Animations ------------------------------------------------------------- */
@keyframes bvg-entree{ from{opacity:0} to{opacity:1} }
@keyframes bvg-fiche-entree{
  from{ opacity:0; transform:translateY(10px) scale(.985) }
  to{ opacity:1; transform:none }
}
@keyframes bvg-halo{
  0%,100%{ opacity:.55; transform:scale(1) }
  50%{ opacity:.9; transform:scale(1.05) }
}
@keyframes bvg-pulse{
  0%{ opacity:.55; transform:scale(1) }
  70%{ opacity:0; transform:scale(1.06) }
  100%{ opacity:0; transform:scale(1.06) }
}

/* ---- Confort : mouvement réduit --------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  .bvg, .bvg-fiche{ animation:none }
  .bvg-projecteur{ transition:none }
  .bvg-halo, .bvg-pulse{ animation:none }
  .bvg-pulse{ display:none }
}

/* ---- Impression -------------------------------------------------------------- */
@media print{ .bvg{ display:none !important } }
