/* Recap · index · guide — la visite guidée du premier lancement (le garçon sur sa branche + bulle « papier collé ») */
.gd { position: fixed; inset: 0; z-index: 10100; pointer-events: none; font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; }
.gd[hidden] { display: none; }
/* l'accueil est masqué tant que le code d'accès n'est pas saisi (html.id-wait) : le guide, lui, doit rester visible sur la carte de bienvenue */
html.id-wait body > .gd { opacity: 1 !important; }
.gd.on .gd-catch { pointer-events: auto; }

/* un voile léger quand rien n'est mis en lumière */
.gd-dim { position: absolute; inset: 0; background: rgba(6, 9, 20, .42); opacity: 0; transition: opacity .45s ease; }
.gd.dim .gd-dim { opacity: 1; }

/* projecteur : le trou lumineux sur le bouton expliqué (l'ombre géante assombrit tout le reste) */
.gd-spot { position: fixed; left: 0; top: 0; width: 0; height: 0; border-radius: 16px; opacity: 0; pointer-events: none;
  box-shadow: 0 0 0 100vmax rgba(6, 9, 20, .68); transition: opacity .35s ease; }
.gd-spot.glide { transition: opacity .35s ease, left .55s cubic-bezier(.4, 0, .2, 1), top .55s cubic-bezier(.4, 0, .2, 1),
  width .55s cubic-bezier(.4, 0, .2, 1), height .55s cubic-bezier(.4, 0, .2, 1); }
.gd-spot::after { content: ""; position: absolute; inset: -5px; border-radius: 21px; border: 2.5px dashed var(--gold); animation: gd-ring 1.9s ease-in-out infinite; }
@keyframes gd-ring { 0%, 100% { transform: scale(1); opacity: .95; } 50% { transform: scale(1.045); opacity: .55; } }

.gd-catch { position: absolute; inset: 0; -webkit-tap-highlight-color: transparent; }

/* ---------- la scène : bulle + garçon, collés au bord de l'écran (la branche sort de l'écran) ---------- */
.gd-stage { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: flex-start; pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.gd-stage[data-side="r"] { align-items: flex-end; }
.gd-stage[data-pos="top"] { bottom: auto; top: 0; flex-direction: column-reverse; padding: env(safe-area-inset-top, 0px) 0 0; }

.gd-boy { position: relative; width: min(54vw, 214px); transform: translateX(-128%); will-change: transform;
  transition: transform .58s cubic-bezier(.2, .8, .25, 1), width .4s ease; }              /* entrée : il glisse hors du bord de l'écran, le long de sa branche (sans rebond latéral : la branche ne doit jamais se détacher du bord) */
.gd-stage[data-side="r"] .gd-boy { transform: translateX(128%); }
.gd-stage.show .gd-boy { transform: none; }
.gd-stage:not(.show) .gd-boy { transition: transform .36s cubic-bezier(.5, 0, .85, .4), width .4s ease; }   /* sortie : il rentre, un peu plus vite */
.gd-stage[data-side="l"] .gd-boy { margin-left: -2px; }
.gd-stage[data-side="r"] .gd-boy { margin-right: -2px; }
.gd-stage.nt .gd-boy, .gd-stage.nt .gd-bubble { transition: none !important; }          /* changement de côté / de pose pendant qu'il est dehors : aucune transition visible */
.gd-fl { transform-origin: 50% 100%; transition: opacity .19s ease, scale .19s ease; animation: gd-float 3.6s ease-in-out .8s infinite; }
.gd-fl.pose-out { opacity: 0; scale: .95; }                                              /* changement de pose sur place : fondu */
.gd-fl.hop { animation: gd-hop .5s cubic-bezier(.34, 1.6, .64, 1), gd-float 3.6s ease-in-out .5s infinite; }
.gd-boy img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 3px 2px rgba(20, 24, 50, .3)) drop-shadow(0 12px 10px rgba(20, 24, 50, .22)); }
.gd-stage[data-side="r"] .gd-boy img { transform: scaleX(-1); }
@keyframes gd-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes gd-hop { 0% { transform: translateY(0) scale(1, 1); } 35% { transform: translateY(-11px) scale(.98, 1.03); } 100% { transform: translateY(0) scale(1, 1); } }

/* ---------- la bulle : même carte « papier » que À propos / Bienvenue ---------- */
.gd-bubble { position: relative; width: min(calc(100vw - 28px), 332px); box-sizing: border-box; margin: 0 14px 12px; padding: 13px 17px 11px;
  background: var(--card); color: var(--text); border: 2.5px solid var(--ink);
  border-radius: 20px 36px 22px 32px / 32px 20px 36px 22px;
  box-shadow: 4px 6px 0 color-mix(in srgb, var(--ink) 28%, transparent), 0 18px 36px rgba(0, 0, 0, .32);
  opacity: 0; transform: translateY(12px) scale(.72); transform-origin: 22% 100%; pointer-events: none;
  transition: opacity .28s ease, transform .5s cubic-bezier(.34, 1.5, .64, 1); }
.gd-stage[data-side="r"] .gd-bubble { transform-origin: 78% 100%; }
.gd-stage[data-pos="top"] .gd-bubble { margin: 12px 14px 0; transform-origin: 22% 0; }
.gd-stage[data-pos="top"][data-side="r"] .gd-bubble { transform-origin: 78% 0; }
.gd-stage.show .gd-bubble { opacity: 1; transform: none; transition-delay: .3s; }
.gd-stage.show .gd-bubble.swap { opacity: 0; transform: translateY(5px) scale(.97); transition-delay: 0s; transition-duration: .16s; }
.gd-stage:not(.show) .gd-bubble { transition-duration: .2s; transition-delay: 0s; }
.gd-bubble.nudge { animation: gd-nudge .42s ease; }
@keyframes gd-nudge { 0%, 100% { translate: 0; } 25% { translate: -6px; } 55% { translate: 5px; } 80% { translate: -3px; } }

/* la queue de la bulle, pointée vers la tête du garçon */
.gd-bubble::after { content: ""; position: absolute; bottom: -11px; left: 50px; width: 17px; height: 17px; background: var(--card);
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); border-bottom-right-radius: 5px; transform: rotate(45deg); }
.gd-stage[data-side="r"] .gd-bubble::after { left: auto; right: 50px; }
.gd-stage[data-pos="top"] .gd-bubble::after { bottom: auto; top: -11px; border: 0; border-left: 2.5px solid var(--ink); border-top: 2.5px solid var(--ink); border-radius: 5px 0 0 0; }

.gd-t { margin: 0; font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive; font-weight: 700; font-size: 1.75rem; line-height: 1.05; color: var(--ink); overflow-wrap: anywhere; }
.gd-p { margin: 6px 0 0; font-size: .87rem; font-weight: 500; line-height: 1.6; color: var(--text); }
.gd-p b { color: var(--ink); background: linear-gradient(transparent 58%, color-mix(in srgb, var(--gold) 42%, transparent) 58% 92%, transparent 92%); padding: 0 2px; }
.gd-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; min-height: 22px; }
.gd-hint { font-size: .72rem; font-weight: 600; color: var(--muted); }
.gd-dots { display: flex; gap: 5px; margin-top: 8px; }
.gd-dots:empty { display: none; }
.gd-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 24%, transparent); transition: background .3s, transform .3s; }
.gd-dots i.on { background: var(--ink); transform: scale(1.35); }
.gd-skip { pointer-events: auto; flex: none; font: inherit; font-size: .72rem; font-weight: 700; color: var(--muted); background: none; border: 0; padding: 6px 2px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; -webkit-tap-highlight-color: transparent; }
.gd-skip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.gd-skip[hidden] { display: none; }
.gd-stage.show .gd-skip { pointer-events: auto; }
.gd-stage:not(.show) .gd-skip { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .gd-fl, .gd-fl.hop, .gd-spot::after, .gd-bubble.nudge { animation: none !important; }
  .gd-boy, .gd-bubble, .gd-spot, .gd-spot.glide, .gd-dim { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* pose « repos » (garçon allongé sur sa branche) : plus large qu'assis */
.gd-stage[data-pose="rest"] .gd-boy, .gd-stage[data-pose="sleep"] .gd-boy { width: min(72vw, 296px); }
/* emploi du temps : la flèche d'aide du bouton + disparaît pendant la visite */
body.gd-tour .afab-hint { display: none; }

/* pendant le guide : la loupe « Chercher », la chouette et le menu se rangent (le bouton + de l'emploi du temps reste, c'est une cible) */
.sfab, .sfab-owl, .navdial { transition: opacity .3s ease, visibility .3s ease; }
body.gd-live .sfab, body.gd-live .sfab-owl, body.gd-live .navdial { opacity: 0 !important; visibility: hidden; pointer-events: none; }
