/* ==========================================================================
   Formations — page d’entrée (code) et présentations
   Complète styles.css : mêmes tokens, même police, mêmes boutons.
   Une présentation se lit en défilant (participants) ou en plein écran
   (bouton « Présenter », en séance). Sans JS : lecture en défilant.
   ========================================================================== */

:root {
  --pastel-1: #B9A7EE;
  --pastel-2: #8FB6EE;
  --pastel-3: #86CFA4;
  --pastel-4: #E9C95E;
  --pastel-5: #F4A3B4;
  --erreur: #b42318;
}

/* Lien actif dans la navigation */
.nav a[aria-current="page"] {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Page d’entrée : formulaire du code
   -------------------------------------------------------------------------- */

.titre-page {
  font-size: clamp(3.25rem, 15vw, 7.5rem);
}

.code-form {
  max-width: 30rem;
  margin-top: 2.75rem;
}

.code-label {
  display: block;
  margin-bottom: 0.625rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.code-input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.8125rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-family: var(--mono);
  font-size: 1rem; /* 16 px minimum : iOS ne zoome pas */
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.2s var(--ease);
}

.code-input::placeholder {
  color: #a3a3a3;
  text-transform: none; /* l’exemple garde « iPad », pas « IPAD » */
}

.code-input:focus {
  border-color: var(--ink);
  outline: none;
}

.code-form .btn {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.code-message {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.code-message.is-erreur {
  color: var(--erreur);
}

.code-aide {
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Présentation : en-tête
   -------------------------------------------------------------------------- */

.wordmark {
  white-space: nowrap;
  flex: none;
}

.deck-nom {
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.btn-presenter {
  flex: none;
  padding: 0.5rem 1rem;
  border: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

/* Sans JS, impossible de présenter : le bouton disparaît. */
html:not(.js) .btn-presenter {
  flex: none;
  display: none;
}

/* --------------------------------------------------------------------------
   Diapositives — mode lecture (par défaut)
   -------------------------------------------------------------------------- */

.deck {
  padding-block: 1rem 2rem;
}

.diapo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(34rem, 80vh);
  padding-block: clamp(3rem, 8vh, 5rem);
  border-top: 1px solid var(--line);
  font-size: clamp(0.9rem, 2.2vw, 1.0625rem);
}

.diapo:first-child {
  border-top: 0;
}

.diapo-num {
  position: absolute;
  top: 1.25rem;
  right: 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.diapo-kicker {
  font-family: var(--mono);
  font-size: 0.75em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.diapo h2 {
  margin-top: 0.75rem;
  font-size: 2.75em;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.diapo > p:not([class]) {
  max-width: 42ch;
  margin-top: 1.25em;
  font-size: 1.25em;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Diapo de titre */
.diapo-titre h2 {
  font-size: 4.5em;
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.diapo-titre .diapo-auteur {
  margin-top: 1.75em;
  font-family: var(--mono);
  font-size: 0.8em;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* Programme : liste numérotée */
.programme {
  margin-top: 1.75em;
  counter-reset: etape;
}

.programme li {
  display: flex;
  align-items: baseline;
  gap: 1em;
  padding-block: 0.75em;
  border-bottom: 1px solid var(--line);
  font-size: 1.25em;
  counter-increment: etape;
}

.programme li::before {
  content: counter(etape, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.6em;
  color: var(--muted);
}

/* Grille de cartes, chacune avec son point de couleur */
.cartes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1em;
  margin-top: 1.75em;
}

.carte {
  padding: 1.25em 1.25em 1.4em;
  border: 1px solid var(--line);
  border-radius: 1em;
}

.carte h3 {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.carte h3::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--point, var(--ink));
  flex: none;
}

.carte p {
  margin-top: 0.5em;
  font-size: 1em;
  color: var(--muted);
}

.carte:nth-child(5n + 1) { --point: var(--pastel-1); }
.carte:nth-child(5n + 2) { --point: var(--pastel-2); }
.carte:nth-child(5n + 3) { --point: var(--pastel-3); }
.carte:nth-child(5n + 4) { --point: var(--pastel-4); }
.carte:nth-child(5n + 5) { --point: var(--pastel-5); }

/* Grand chiffre */
.chiffre {
  margin-top: 0.5rem;
  font-size: 7em;
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.chiffre .period {
  color: var(--pastel-3);
}

/* Citation */
.citation {
  max-width: 24ch;
  font-size: 2.25em;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.citation-source {
  margin-top: 1.25em;
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--muted);
}

/* Consigne d’activité : encadré noir */
.consigne {
  margin-top: 1.75em;
  padding: 1.5em 1.75em;
  border-radius: 1.25em;
  background: var(--ink);
  color: #fff;
}

.consigne ol {
  margin: 0;
  padding-left: 1.25em;
  font-size: 1.2em;
  line-height: 1.6;
}

.consigne .duree {
  display: inline-block;
  margin-top: 1em;
  padding: 0.2em 0.75em;
  border-radius: 999px;
  background: var(--pastel-4);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75em;
  letter-spacing: 0.04em;
}

/* Ressources : liens */
.ressources {
  margin-top: 1.5em;
}

.ressources li {
  padding-block: 0.8em;
  border-bottom: 1px solid var(--line);
  font-size: 1.15em;
}

.ressources a {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.ressources span {
  display: block;
  font-size: 0.8em;
  color: var(--muted);
}

@media (min-width: 48rem), (orientation: landscape) and (max-height: 32rem) {
  .cartes {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Diapositives — mode présentation (plein écran, une à la fois)
   -------------------------------------------------------------------------- */

html.presentation,
html.presentation body {
  overflow: hidden;
  height: 100%;
}

html.presentation .site-header,
html.presentation .site-footer,
html.presentation .skip-link {
  display: none;
}

html.presentation .deck {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: auto;
  margin: 0;
  padding: 0;
  background: var(--bg);
}

html.presentation .diapo {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 7vh 8vw;
  border: 0;
  font-size: min(3.2vh, 1.9vw);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
}

html.presentation .diapo.is-active {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s var(--ease);
}

html.presentation .diapo-num {
  top: auto;
  right: 3vw;
  bottom: 3vh;
}

html.presentation .cartes {
  grid-template-columns: repeat(3, 1fr);
}

/* Barre de progression et commandes (créées par diapos.js) */
.deck-progression {
  display: none;
}

html.presentation .deck-progression {
  display: block;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 61;
  height: 3px;
  width: var(--progression, 0%);
  background: var(--ink);
  transition: width 0.35s var(--ease);
}

.deck-commandes {
  display: none;
}

html.presentation .deck-commandes {
  display: flex;
  gap: 0.375rem;
  position: fixed;
  left: 3vw;
  bottom: 2.25vh;
  z-index: 62;
}

/* Flèches et × discrètes ; le bouton du direct reste bien visible. */
html.presentation .deck-commandes button:not(.cmd-direct) {
  opacity: 0.35;
  transition: opacity 0.2s var(--ease);
}

html.presentation .deck-commandes:hover button,
html.presentation .deck-commandes:focus-within button {
  opacity: 1;
}

/* iPad : pas de survol, les boutons restent plus visibles */
@media (hover: none) {
  html.presentation .deck-commandes button:not(.cmd-direct) { opacity: 0.75; }
}

/* Direct en plein écran (participants) : rond avec le point qui bat
   quand on suit Ludo, pilule « Suivre Ludo » quand on lit seul. */
.deck-commandes .cmd-direct {
  display: inline-flex;
  gap: 0.5rem;
  width: auto;
  min-width: 2.5rem;
  margin-left: 0.375rem;
  padding: 0 0.95rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 0.75rem 1.5rem -1rem rgba(0, 0, 0, 0.45);
}
.deck-commandes .cmd-direct[hidden] { display: none; }
.deck-commandes .cmd-direct[aria-pressed="true"] {
  justify-content: center;
  padding: 0;
  border-color: var(--ink);
  background: var(--ink);
}
.deck-commandes .cmd-direct[aria-pressed="true"] .cmd-texte { display: none; }
.cmd-direct[aria-pressed="true"] .point-direct { animation: battement 1.6s ease-in-out infinite; }

.deck-commandes button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  html.presentation .diapo,
  html.presentation .diapo.is-active,
  html.presentation .deck-progression {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Outils des participants (créés par diapos.js) : Direct et Sommaire
   En bas de l’écran pendant la lecture, cachés en mode « Présenter ».
   -------------------------------------------------------------------------- */

.deck-outils {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  gap: 0.5rem;
  transform: translateX(-50%);
}

html:not(.js) .deck-outils,
html.presentation .deck-outils {
  display: none;
}

.deck-outils button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 0.75rem 1.5rem -1rem rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.deck-outils button[hidden] {
  display: none;
}

/* Bulle d’explication du direct, au-dessus des boutons */
.outil-info {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.625rem);
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 0.75rem 1.5rem -1rem rgba(0, 0, 0, 0.45);
}

.outil-info[hidden] {
  display: none;
}

.deck-outils .outil-direct[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.point-direct {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--pastel-5);
}

.outil-direct[aria-pressed="true"] .point-direct {
  animation: battement 1.6s ease-in-out infinite;
}

@keyframes battement {
  50% { opacity: 0.3; }
}

/* Laisser la place à l’en-tête collant quand on saute à une diapo */
.diapo {
  scroll-margin-top: 4.5rem;
}

/* Fenêtre du sommaire */
.sommaire {
  width: min(32rem, calc(100% - 2rem));
  max-height: min(40rem, calc(100% - 4rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 2rem 4rem -2rem rgba(0, 0, 0, 0.45);
}

.sommaire::backdrop {
  background: rgba(10, 10, 10, 0.25);
}

.sommaire-tete {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.75rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.sommaire-tete p {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sommaire-fermer {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

.sommaire ol {
  margin: 0;
  padding: 0.5rem;
  list-style: none;
}

.sommaire ol button {
  display: flex;
  gap: 0.875rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.625rem;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
}

.sommaire ol button > span:not(.mini) {
  flex: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6rem;
  color: var(--muted);
}

.sommaire ol button:hover,
.sommaire ol button[aria-current] {
  background: var(--line);
}

/* Page « Vos formations » (code maître) */
.liste-formations {
  margin-top: 2rem;
  padding: 0;
  list-style: none;
  font-size: 1.25rem;
}

.liste-formations li + li {
  margin-top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .outil-direct[aria-pressed="true"] .point-direct {
    animation: none;
  }
}

/* La barre du bas ne doit pas cacher la fin de la page */
html.js .deck {
  padding-bottom: 6rem;
}

/* --------------------------------------------------------------------------
   Guide d’accueil des participants (diapos.js)
   -------------------------------------------------------------------------- */
.guide-voile {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: transparent;
  transition: background 0.3s ease;
}
.guide-voile.sombre { background: rgba(10, 10, 10, 0.45); }

.guide-halo {
  position: fixed;
  z-index: 61;
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--pastel-4), 0 0 0 100vmax rgba(10, 10, 10, 0.45);
  pointer-events: none;
  transition: left 0.35s var(--ease), top 0.35s var(--ease), width 0.35s var(--ease), height 0.35s var(--ease);
  animation: guide-pulse 1.8s ease-in-out infinite;
}
.guide-halo[hidden] { display: none; }
@keyframes guide-pulse {
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--pastel-4) 55%, transparent), 0 0 0 100vmax rgba(10, 10, 10, 0.45); }
}

.guide-carte {
  position: fixed;
  z-index: 62;
  width: min(21rem, calc(100vw - 2rem));
  padding: 1.25rem 1.25rem 1rem;
  border-radius: 1.25rem;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1.5rem 3rem -1.25rem rgba(0, 0, 0, 0.5);
}
.guide-carte.au-centre { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.guide-carte.entre { animation: guide-entre 0.35s var(--ease) both; }
.guide-carte.au-centre.entre { animation-name: guide-entre-centre; }
@keyframes guide-entre { from { opacity: 0; translate: 0 0.5rem; } to { opacity: 1; translate: 0 0; } }
@keyframes guide-entre-centre { from { opacity: 0; translate: 0 0.5rem; } to { opacity: 1; translate: 0 0; } }

.guide-etape {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.guide-carte h2 {
  margin: 0.35rem 0 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.guide-texte {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.guide-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.125rem;
}
.guide-actions button {
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}
.guide-ignorer { border: 0; background: transparent; color: var(--muted); padding-left: 0 !important; }
.guide-suivant { border: 0; background: var(--ink); color: #fff; }
.guide-points { display: flex; gap: 0.35rem; }
.guide-points i { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--line-strong); transition: background 0.3s, transform 0.3s; }
.guide-points i.actif { background: var(--ink); transform: scale(1.3); }

@media (prefers-reduced-motion: reduce) {
  .guide-halo, .guide-carte.entre { animation: none; transition: none; }
}

/* --------------------------------------------------------------------------
   Liens ronds Instagram et TikTok (dernière diapo des formations)
   -------------------------------------------------------------------------- */
.diapo .reseaux-ludo { display: flex; align-items: center; gap: 0.5em; margin-top: 0.7em; }
.diapo .reseaux-ludo a { display: grid; place-items: center; width: 2.4em; height: 2.4em; margin: 0; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-size: 1em; text-decoration: none; transition: background 0.2s, transform 0.2s var(--ease); }
.diapo .reseaux-ludo a:hover, .diapo .reseaux-ludo a:focus-visible { background: var(--pastel-5); transform: translateY(-2px); }
.diapo .reseaux-ludo svg { width: 1.2em; height: 1.2em; }
.diapo .reseaux-ludo span { display: inline; margin: 0 0 0 0.2em; font-family: var(--mono); font-size: 0.75em; color: var(--muted); }

/* --------------------------------------------------------------------------
   Téléphone couché (paysage) : écran large mais très bas.
   La largeur seule donne la mise en page « ordinateur » : il faut aussi
   regarder la hauteur. Vaut pour toutes les formations (règle commune).
   -------------------------------------------------------------------------- */

@media (orientation: landscape) and (max-height: 32rem) {
  /* Lecture : l’en-tête ne reste plus collé en haut, diapos plus compactes. */
  html:not(.presentation) .site-header { position: static; }
  html:not(.presentation) .deck .diapo {
    min-height: 0;
    padding-block: 2.25rem;
    font-size: 0.8rem;
    scroll-margin-top: 0.5rem;
  }
  .deck-outils { bottom: max(0.5rem, env(safe-area-inset-bottom)); }
  .deck-outils button { min-height: 2.25rem; padding: 0.3rem 0.875rem; font-size: 0.8125rem; }

  /* Plein écran : texte lisible ; si une diapo est trop haute, elle défile. */
  html.presentation .deck .diapo {
    font-size: clamp(0.72rem, 3.3vh, 0.95rem);
    padding: 1.25rem max(5vw, env(safe-area-inset-right)) 3.75rem max(5vw, env(safe-area-inset-left));
    justify-content: safe center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  html.presentation .deck-commandes { bottom: max(0.5rem, env(safe-area-inset-bottom)); }
  html.presentation .deck-commandes button:not(.cmd-direct) { width: 2.25rem; height: 2.25rem; }
  html.presentation .diapo-num { bottom: 0.75rem; }
}

/* --------------------------------------------------------------------------
   Outils de Ludo en plein écran (diapos.js, code maître seulement) :
   QR en grand, Sommaire, menu Outils (On reprend ensemble, Projecteur,
   Pointeur), saut à une diapo par son numéro.
   -------------------------------------------------------------------------- */
.deck-commandes { position: fixed; }
.deck-commandes .cmd-sep {
  align-self: center;
  width: 1px;
  height: 1.5rem;
  margin: 0 0.25rem;
  background: var(--line-strong);
  opacity: 0.6;
}
.deck-commandes button[hidden] { display: none; }
.deck-commandes button[aria-expanded="true"],
.deck-commandes .cmd-qr[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  opacity: 1;
}

.cmd-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.625rem);
  display: grid;
  gap: 0.125rem;
  min-width: 15.5rem;
  padding: 0.375rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--bg);
  box-shadow: 0 1.5rem 3rem -1.5rem rgba(0, 0, 0, 0.5);
}
.cmd-menu[hidden] { display: none; }
html.presentation .deck-commandes .cmd-menu button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  height: auto;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.625rem;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  opacity: 1;
}
html.presentation .deck-commandes .cmd-menu button:hover,
html.presentation .deck-commandes .cmd-menu button:focus-visible { background: var(--line); }
html.presentation .deck-commandes .cmd-menu button[aria-checked="true"] {
  background: color-mix(in srgb, var(--pastel-3) 30%, transparent);
}
.cmd-menu kbd {
  margin-left: auto;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.35rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.menu-icone {
  position: relative;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
}
.menu-reprise i {
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}
.menu-reprise i:nth-child(1) { left: 0.2rem; bottom: 0.25rem; background: var(--pastel-1); }
.menu-reprise i:nth-child(2) { right: 0.2rem; bottom: 0.25rem; background: var(--pastel-3); }
.menu-reprise i:nth-child(3) { left: 0.5rem; top: 0.2rem; background: var(--pastel-5); }
.menu-projecteur { background: radial-gradient(circle, #fff 0 35%, var(--ink) 40%); box-shadow: 0 0 0 1px var(--line-strong); }
.menu-pointeur::after {
  content: "";
  position: absolute;
  inset: 0.45rem;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0.4rem 0.15rem rgba(255, 59, 48, 0.45);
}

/* « On reprend ensemble » : aussi sur les téléphones des participants */
.reprise {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(10, 10, 10, 0.94);
  color: #fff;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.reprise[hidden] { display: none; }
.reprise.ouverte { opacity: 1; }
.reprise-points {
  position: relative;
  width: 6rem;
  height: 5.5rem;
}
.reprise-points i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.875rem 0 0 -0.875rem;
  border-radius: 50%;
  transform: translate(var(--x0), var(--y0)) scale(0.6);
  opacity: 0;
}
.reprise-points i:nth-child(1) { background: var(--pastel-1); --x0: -42vw; --y0: -8vh;  --x1: -1.15rem; --y1: 0.75rem; }
.reprise-points i:nth-child(2) { background: var(--pastel-3); --x0: 40vw;  --y0: -30vh; --x1: 1.15rem;  --y1: 0.75rem; }
.reprise-points i:nth-child(3) { background: var(--pastel-5); --x0: 18vw;  --y0: 38vh;  --x1: 0;        --y1: -1.2rem; }
.reprise.ouverte .reprise-points i {
  animation:
    reprise-arrivee 1.5s cubic-bezier(0.22, 0.8, 0.3, 1) forwards,
    reprise-souffle 2.8s ease-in-out 1.6s infinite;
}
.reprise.ouverte .reprise-points i:nth-child(2) { animation-delay: 0.15s, 1.75s; }
.reprise.ouverte .reprise-points i:nth-child(3) { animation-delay: 0.3s, 1.9s; }
@keyframes reprise-arrivee {
  0%   { opacity: 0; transform: translate(var(--x0), var(--y0)) scale(0.6); }
  15%  { opacity: 1; }
  100% { opacity: 1; transform: translate(var(--x1), var(--y1)) scale(1); }
}
@keyframes reprise-souffle {
  0%, 100% { opacity: 1; transform: translate(var(--x1), var(--y1)) scale(1); }
  50%      { opacity: 1; transform: translate(calc(var(--x1) * 1.12), calc(var(--y1) * 1.12)) scale(0.92); }
}
.reprise-texte {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.8s var(--ease) 1.1s, transform 0.8s var(--ease) 1.1s;
}
.reprise-texte .period { color: var(--pastel-4); }
.reprise-aide {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0;
  transition: opacity 0.8s var(--ease) 2s;
}
.reprise.ouverte .reprise-texte { opacity: 1; transform: none; }
.reprise.ouverte .reprise-aide { opacity: 1; }
.reprise-son {
  position: absolute;
  right: max(1rem, env(safe-area-inset-right));
  top: max(1rem, env(safe-area-inset-top));
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: none;
  color: #fff;
  cursor: pointer;
}
.reprise-son[aria-pressed="false"] { opacity: 0.55; }

/* QR en grand */
.qr-grand {
  position: fixed;
  inset: 0;
  z-index: 290;
  display: grid;
  place-items: center;
  padding: 3vmin;
  background: #fff;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  cursor: pointer;
}
.qr-grand[hidden] { display: none; }
.qr-grand.ouvert { opacity: 1; }
.qr-grand-carte {
  display: flex;
  align-items: center;
  gap: 5vmin;
  transform: scale(0.96);
  transition: transform 0.35s var(--ease);
}
.qr-grand.ouvert .qr-grand-carte { transform: none; }
.qr-grand-image svg {
  display: block;
  width: min(68vmin, 46vw);
  height: auto;
  border-radius: 1.5rem;
  box-shadow: 0 0 0 1px var(--line), 0 2rem 4rem -2rem rgba(0, 0, 0, 0.45);
}
.qr-grand-texte { font-size: clamp(1rem, 2.4vmin, 1.6rem); }
.qr-grand-texte small {
  display: block;
  font-family: var(--mono);
  font-size: 0.8em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.qr-grand-texte b { display: block; margin: 0.4em 0 0.9em; font-size: 2em; line-height: 1.1; }
.qr-grand-texte p { margin: 0.3em 0; font-size: 1.15em; }
.qr-grand-code {
  font-family: var(--mono);
  font-weight: 600;
  padding: 0.1em 0.4em;
  border-radius: 0.3em;
  background: color-mix(in srgb, var(--pastel-4) 40%, transparent);
}
@media (max-aspect-ratio: 1/1) {
  .qr-grand-carte { flex-direction: column; text-align: center; }
  .qr-grand-image svg { width: min(70vw, 52vh); }
}

/* Projecteur : tout s’assombrit sauf un rond qui suit la souris */
.projecteur {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 50%),
    transparent 0, transparent 15vmin, rgba(10, 10, 10, 0.86) 17.5vmin);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.projecteur[hidden] { display: none; }
.projecteur.ouvert { opacity: 1; }

/* Pointeur : point rouge lumineux, bien visible au TVI */
.pointeur {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 280;
  width: 1.15rem;
  height: 1.15rem;
  margin: -0.575rem 0 0 -0.575rem;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 0.2rem rgba(255, 59, 48, 0.25), 0 0 1.4rem 0.4rem rgba(255, 59, 48, 0.55);
  transform: translate(var(--px, 50vw), var(--py, 50vh));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.pointeur[hidden] { display: none; }
.pointeur.ouvert { opacity: 1; }
html.avec-pointeur.presentation,
html.avec-pointeur.presentation * { cursor: none !important; }
html.avec-pointeur.presentation .deck-commandes,
html.avec-pointeur.presentation .deck-commandes * { cursor: pointer !important; }

/* Numéro tapé au clavier : « Aller à la diapo 23 » */
.saut-diapo {
  position: fixed;
  left: 50%;
  bottom: 2.25vh;
  z-index: 270;
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.9375rem;
  transform: translateX(-50%);
  box-shadow: 0 0.75rem 1.5rem -1rem rgba(0, 0, 0, 0.45);
}
.saut-diapo[hidden] { display: none; }
.saut-diapo b { font-family: var(--mono); font-size: 1.1em; }
.saut-diapo kbd {
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.3rem;
  font-family: var(--mono);
  font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .reprise.ouverte .reprise-points i {
    animation: none;
    opacity: 1;
    transform: translate(var(--x1), var(--y1));
  }
  .reprise-texte, .reprise-aide { transition: opacity 0.3s; transform: none; }
}

/* Sommaire de Ludo en plein écran : grille de miniatures (diapos.js) */
.sommaire.grille {
  width: min(78rem, calc(100% - 2rem));
  max-height: calc(100% - 3rem);
}
.sommaire .mini { display: none; }
.sommaire.grille ol {
  display: grid;
  grid-template-columns: repeat(auto-fill, 14rem);
  justify-content: center;
  gap: 1rem 0.75rem;
  padding: 1rem;
}
.sommaire.grille ol button {
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.4rem;
  border-radius: 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.3;
}
.sommaire.grille ol button > span:not(.mini) { line-height: 1; }
.sommaire.grille .mini {
  position: relative;
  display: block;
  width: 14rem;
  aspect-ratio: var(--mini-ratio, 16 / 9);
  overflow: hidden;
  border-radius: 0.5rem;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line-strong);
  pointer-events: none;
  font-family: var(--font);
  text-align: left;
}
.sommaire.grille .mini-scene {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: var(--mini-l);
  height: var(--mini-h);
  transform: scale(var(--mini-echelle));
  transform-origin: 0 0;
}
html.presentation .sommaire .mini-deck { position: absolute; z-index: auto; }
.mini-deck, .mini-deck *, .mini-deck *::before, .mini-deck *::after {
  animation-duration: 0.001s !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition: none !important;
}
.sommaire.grille ol button[aria-current] .mini { box-shadow: 0 0 0 3px var(--ink); }
.sommaire.grille ol button:hover .mini { box-shadow: 0 0 0 2px var(--muted); }

/* ── Image libre (posée avec l’éditeur de diapos, outils-perso/editeur-diapos) ──
   <figure class="image-libre" style="--x:55%; --y:20%; --w:35%"><img …></figure>
   En présentation : flotte à sa place (en % de la diapo), sans pousser le texte.
   En lecture (téléphone, ordinateur) : se range sous le contenu, centrée. */
.image-libre {
  margin: 1.5rem auto 0;
  width: min(var(--w, 40%), 100%);
}
.image-libre img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
}
html.presentation .image-libre {
  position: absolute;
  left: var(--x, 55%);
  top: var(--y, 20%);
  width: var(--w, 35%);
  margin: 0;
  z-index: 2;
}

/* Réservé à Ludo : masqué sauf si la page le reconnaît (classe « maitre »). */
html:not(.maitre) .btn-presenter:not(.btn-plein),
html:not(.maitre) .reserve-maitre {
  display: none !important;
}
