/* =========================================================
   MOIRANS EXPLOREUR
   Interface dédiée — utilise l'identité visuelle de
   Moirans Pratique via les variables de app.css, avec une
   couche ludique et colorée pensée pour enfants + adultes.
   ========================================================= */


/* ── APP SHELL ───────────────────────────────── */

.exploreur-app {
  margin: 0;
  width: 100%;
  min-height: 100dvh;

  background: var(--bg);
  color: var(--text);
}

#exploreur-app {
  width: 100%;

  height: 100dvh;
  height: 100vh; /* fallback avant support de dvh / avant que le JS ne prenne le relais */

  display: flex;
  flex-direction: column;

  background: var(--bg);
}


/* ── INVITATION DESKTOP ──────────────────────────
   Masquée par défaut (mobile/tablette) ; affichée à la place de
   #exploreur-app uniquement ≥900px, voir plus bas. */

.exploreur-desktop-notice {
  display: none;
}

.exploreur-desktop-notice-box {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 32px;
  text-align: center;
}

.exploreur-desktop-notice-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.exploreur-desktop-notice-box h1 {
  font-family: var(--font-d);
  font-size: 21px;
  margin: 0 0 12px;
  color: var(--text);
}

.exploreur-desktop-notice-box p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text2);
  margin: 0 0 16px;
}

.exploreur-desktop-notice-qr {
  display: block;
  margin: 0 auto 20px;
  border-radius: var(--r-lg, 14px);
  background: #fff;
  padding: 10px;
}

.exploreur-desktop-notice-box .btn { margin-bottom: 12px; }

.exploreur-desktop-notice-bypass {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.exploreur-desktop-notice-bypass:hover { color: var(--text2); }

/* Bascule "voir quand même" : on force réaffichage de l'app normale */
body.exploreur-force-mobile-view #exploreur-desktop-notice { display: none !important; }
body.exploreur-force-mobile-view #exploreur-app { display: flex !important; }


/* ── HEADER ───────────────────────────────────── */

.exploreur-header {
  /* Même correctif que .mobile-app-bar dans app.css : sur les iPhone à
     Dynamic Island/encoche en portrait, la bande du haut (safe-area-inset-
     top) est une zone de gestes système où les taps n'atteignent pas la
     page. On pousse le contenu de l'en-tête (bouton retour inclus) en
     dessous plutôt que de le laisser démarrer à y=0. */
  height: calc(var(--mobile-header-h, 64px) + env(safe-area-inset-top, 0px));
  min-height: calc(var(--mobile-header-h, 64px) + env(safe-area-inset-top, 0px));

  flex-shrink: 0;

  display: flex;
  align-items: center;

  padding: env(safe-area-inset-top, 0px) 14px 0;
  gap: 10px;

  background: rgba(12,14,23,.94);
  border-bottom: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 4px 20px rgba(0,0,0,.18);

  position: relative;
  z-index: 100;

  box-sizing: border-box;
}

.exploreur-back {
  width: 40px;
  height: 40px;

  flex: 0 0 40px;

  border: 0;
  border-radius: 12px;

  background: var(--surface2);
  color: var(--text);

  display: flex;
  align-items: center;
  justify-content: center;

  font-family: inherit;
  font-size: 28px;
  line-height: 1;

  cursor: pointer;

  transition:
    background .18s ease,
    transform .18s ease;
}

.exploreur-back:hover {
  background: var(--surface3, var(--surface2));
}

.exploreur-back:active {
  transform: scale(.94);
}

.exploreur-header-brand {
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.exploreur-header-brand strong {
  color: var(--text);
  font-family: var(--font-d);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.exploreur-header-brand span {
  margin-top: 3px;

  color: var(--text3);
  font-size: 10px;
  line-height: 1.2;
}


/* ── CONTENU ──────────────────────────────────── */

#exploreur-pages {
  flex: 1 1 auto;

  min-height: 0;
  min-width: 0;

  overflow: hidden;

  position: relative;
}

.exploreur-page {
  display: none;

  position: absolute;
  inset: 0;

  overflow-y: auto;
  overflow-x: hidden;

  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;

  padding: 16px 14px
    calc(
      22px
      + var(--mobile-nav-h, 70px)
      + var(--mobile-safe-bottom, 0px)
    );

  box-sizing: border-box;
}

.exploreur-page.active {
  display: block;

  animation: exploreurPageIn .18s ease;
}

@keyframes exploreurPageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}


/* ── TITRES ───────────────────────────────────── */

.exploreur-page h1 {
  margin: 4px 2px 6px;

  color: var(--text);

  font-family: var(--font-d);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.exploreur-page > p {
  margin: 0 2px 18px;

  color: var(--text2);

  font-size: 12px;
  line-height: 1.5;
}


/* ── CARTES GÉNÉRIQUES ────────────────────────── */

.exploreur-placeholder {
  padding: 18px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;

  color: var(--text2);

  text-align: center;

  box-shadow: 0 3px 16px rgba(0,0,0,.12);
}


/* ── NAVIGATION BAS ──────────────────────────── */

.exploreur-bottom-nav {
  flex: 0 0 auto;

  width: 100%;

  height: calc(
    var(--mobile-nav-h, 70px)
    + var(--mobile-safe-bottom, 0px)
  );

  box-sizing: border-box;

  display: flex;
  align-items: stretch;

  padding:
    5px
    6px
    var(--mobile-safe-bottom, 0px);

  background: rgba(19,22,35,.96);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border-top: 1px solid rgba(255,255,255,.07);

  box-shadow: 0 -8px 25px rgba(0,0,0,.18);

  z-index: 200;
}

.exploreur-nav-btn {
  flex: 1;

  min-width: 0;

  border: 0;
  border-radius: 12px;

  padding: 7px 4px 5px;

  background: transparent;
  color: var(--text3);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4px;

  font-family: inherit;
  font-size: 9.5px;
  line-height: 1.1;

  cursor: pointer;

  transition:
    background .18s ease,
    color .18s ease;
}

.exploreur-nav-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.exploreur-nav-btn.active {
  background: var(--green-dim);
  color: var(--green);
}

.exploreur-nav-icon {
  width: 21px;
  height: 21px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 21px;
  line-height: 21px;
}


/* ── DESKTOP ──────────────────────────────────── */

@media (min-width: 900px) {

  /* Le jeu suppose de marcher en ville avec un téléphone (QR codes,
     géolocalisation, boussole) : sur desktop, on invite à jouer sur mobile
     plutôt que d'adapter tout le gameplay au clavier/souris (voir
     #exploreur-desktop-notice ci-dessus). Le lien "voir quand même" (classe
     posée sur <body>, voir exploreur.js) permet de revenir à l'app normale. */
  #exploreur-app { display: none; }
  .exploreur-desktop-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
  }

  .exploreur-header {
    height: 68px;
    min-height: 68px;

    padding: 0 24px;
  }

  .exploreur-page {
    position: static;

    max-width: 1080px;
    width: 100%;

    margin: 0 auto;

    padding:
      30px 36px
      40px;
  }

  #exploreur-pages {
    overflow-y: auto;
  }

  .exploreur-page h1 {
    margin: 0 0 8px;

    font-size: 28px;
  }

  .exploreur-page > p {
    font-size: 13px;
  }

  .exploreur-bottom-nav {
    height: 76px;

    max-width: 1080px;

    margin: 0 auto;

    border-top: 0;

    box-shadow: none;

    background: transparent;

    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    padding-bottom: 0;
  }

  .exploreur-nav-btn {
    max-width: 180px;
  }
}


/* =========================================================
   BOUTONS D'ACTION GÉNÉRIQUES
   ========================================================= */

.exploreur-action-btn {
  width: 100%;

  border: 0;
  border-radius: 12px;

  padding: 11px 14px;

  background: var(--green);
  color: #08110d;

  font-family: inherit;
  font-size: 13px;
  font-weight: 700;

  cursor: pointer;

  transition:
    transform .15s ease,
    filter .15s ease;
}

.exploreur-action-btn:hover {
  filter: brightness(1.05);
}

.exploreur-action-btn:active {
  transform: scale(.98);
}

.exploreur-adventure-intro-actions,
.exploreur-step-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}


/* =========================================================
   ONBOARDING (popup 1ère visite)
   ========================================================= */

.exploreur-modal-overlay {
  display: none;

  position: fixed;
  inset: 0;

  z-index: 1000;

  background: rgba(6,7,12,.72);
  backdrop-filter: blur(4px);

  align-items: center;
  justify-content: center;

  padding: 20px;
  box-sizing: border-box;
}

.exploreur-modal-overlay.open {
  display: flex;
  animation: exploreurFadeIn .2s ease;
}

@keyframes exploreurFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.exploreur-modal-box {
  width: min(420px, 100%);
  max-height: 86vh;
  overflow-y: auto;

  padding: 26px 22px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;

  box-shadow: 0 20px 50px rgba(0,0,0,.4);

  text-align: center;
}

.exploreur-onboarding-icon {
  font-size: 46px;
  margin-bottom: 6px;
}

.exploreur-modal-box h2 {
  font-family: var(--font-d);
  font-size: 21px;
  margin: 6px 0 14px;
  color: var(--text);
}

.exploreur-modal-box p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
  text-align: left;
  margin: 0 0 14px;
}

.exploreur-modal-box .btn {
  margin-top: 8px;
}

.exploreur-code-erreur {
  margin: -6px 0 10px;
  font-size: 12px;
  color: var(--red, #f87171);
  text-align: left;
}


/* =========================================================
   ACCÈS PAR CODE (aventures privées)
   ========================================================= */

.exploreur-adventure-verrouillee-msg {
  margin: 2px 0 12px;
  font-size: 12.5px;
  color: var(--text2);
  text-align: center;
}


/* =========================================================
   CARTES AVENTURE (liste)
   ========================================================= */

.exploreur-adventure-card {
  position: relative;

  margin-bottom: 16px;
  padding: 18px;

  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--exploreur-card-couleur, var(--green));
  border-radius: 18px;

  box-shadow: 0 3px 16px rgba(0,0,0,.12);
}

.exploreur-adventure-card-content {
  display: flex;
  gap: 14px;
}

.exploreur-adventure-card-icon {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 28px;
  border-radius: 16px;

  background: color-mix(in srgb, var(--exploreur-card-couleur, var(--green)) 18%, var(--surface2));
}

.exploreur-adventure-card-main {
  flex: 1;
  min-width: 0;
}

.exploreur-adventure-card-main h2 {
  margin: 0 0 4px;
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.exploreur-adventure-card-main p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text2);
}

.exploreur-adventure-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Bannière (photo recadrée côté admin, contient déjà le titre) : remplace
   l'icône + le titre + le texte de la carte. Seuls les badges restent,
   juste en dessous. */
.exploreur-adventure-card-banniere {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md, 12px);
  overflow: hidden;
  margin-bottom: 12px;
}

.exploreur-adventure-card-banniere img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exploreur-adventure-badges--banniere {
  margin-bottom: 4px;
}

.exploreur-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;

  padding: 3px 9px;
  border-radius: 100px;

  background: var(--surface2);
  color: var(--text2);

  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.exploreur-chip-defi {
  background: var(--yellow-dim);
  color: var(--yellow);
}

.exploreur-chip-orange {
  background: var(--orange-dim);
  color: var(--orange);
}

.exploreur-chip-dim {
  background: var(--surface2);
  color: var(--text3);
}

.exploreur-chip-test {
  background: var(--purple-dim);
  color: var(--purple);
}

.exploreur-defi-box {
  margin-top: 12px;
  padding: 10px 12px;

  background: var(--yellow-dim);
  border-radius: 12px;

  font-size: 11.5px;
  color: var(--text);
}

.exploreur-defi-recompense {
  font-weight: 700;
  margin-bottom: 4px;
}

.exploreur-defi-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.exploreur-adventure-progress {
  margin-top: 14px;
}

.exploreur-adventure-progress-bar {
  height: 8px;
  border-radius: 100px;
  background: var(--surface2);
  overflow: hidden;
}

.exploreur-adventure-progress-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--exploreur-card-couleur, var(--green)), var(--green));
  transition: width .3s ease;
}

.exploreur-adventure-progress-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text3);
}

.exploreur-adventure-start {
  margin-top: 14px;
}


/* =========================================================
   INTRO D'AVENTURE
   ========================================================= */

.exploreur-adventure-intro,
.exploreur-step,
.exploreur-congrats,
.exploreur-scan-success,
.exploreur-scan-error {
  padding: 20px 18px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;

  box-shadow: 0 3px 16px rgba(0,0,0,.12);

  text-align: center;
}

.exploreur-adventure-intro-icon,
.exploreur-congrats-icon,
.exploreur-scan-success-icon,
.exploreur-scan-error-icon {
  font-size: 46px;
  margin-bottom: 8px;
}

.exploreur-adventure-intro h2,
.exploreur-step h2,
.exploreur-congrats h2,
.exploreur-scan-success h2,
.exploreur-scan-error h2 {
  font-family: var(--font-d);
  font-size: 19px;
  margin: 0 0 10px;
  color: var(--text);
}

.exploreur-adventure-histoire {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
  text-align: left;
  margin: 0 0 4px;
  white-space: pre-line;
}

/* Bannière d'intro (photo recadrée côté admin, contient déjà le titre) :
   remplace l'icône ET le titre <h2>. Bord-à-bord en haut du popup, coins
   arrondis assortis à celui-ci (voir .exploreur-adventure-intro). */
.exploreur-adventure-intro-banniere {
  display: block;
  width: calc(100% + 36px);
  max-width: none; /* sans ça, le reset global `img{max-width:100%}` de
    app.css plafonne cette largeur à 100% du conteneur et empêche le
    débordement voulu par la marge négative ci-dessous : l'image ne
    bleedait plus jusqu'au bord droit de la carte (~37px de vide). */
  margin: -20px -18px 14px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}

.exploreur-guide-portrait {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 8px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.18));
}

.exploreur-step-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.exploreur-step-title-row h2 {
  margin: 0;
}

.exploreur-guide-thumb {
  flex: 0 0 auto;
  font-size: 2rem;
  line-height: 1;
}


/* =========================================================
   ÉTAPE EN COURS
   ========================================================= */

.exploreur-step {
  text-align: left;
}

.exploreur-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.exploreur-step-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 100px;

  background: var(--green-dim);
  color: var(--green);

  font-size: 11px;
  font-weight: 700;
}

.exploreur-step-points {
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
}

.exploreur-step h2 {
  text-align: left;
}

.exploreur-step-texte {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
  margin: 0 0 14px;
  white-space: pre-line;
}

.exploreur-step-audio {
  width: 100%;
  margin-bottom: 14px;
  border-radius: 12px;
}

.exploreur-step-photo {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 14px;
  display: block;
  object-fit: cover;
  max-height: 220px;
}

.exploreur-step-gif {
  /* Un GIF anime déjà l'image : on évite le recadrage "cover" qui
     couperait parfois une partie de l'animation. */
  object-fit: contain;
  background: var(--surface2);
}

.exploreur-step-video {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 14px;
  display: block;
  max-height: 320px;
  background: #000;
}


/* ── QUESTION / QCM (bonus) ───────────────────── */

.exploreur-question-box {
  margin: 4px 0 14px;
  padding: 14px;

  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.exploreur-question-titre {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.exploreur-question-input-row {
  display: flex;
  gap: 8px;
}

.exploreur-input {
  flex: 1;
  min-width: 0;

  padding: 10px 12px;
  border-radius: 10px;

  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);

  font-family: inherit;
  font-size: 13px;
}

.exploreur-question-choix {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exploreur-question-feedback {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  min-height: 16px;
}

.exploreur-feedback-ok {
  color: var(--green);
}

.exploreur-feedback-ko {
  color: var(--red);
}

.exploreur-question-done {
  color: var(--green);
  font-size: 12.5px;
  font-weight: 700;
}


/* ── INDICE ────────────────────────────────────── */

.exploreur-indice {
  margin: 0 0 14px;
  padding: 10px 14px;

  background: var(--purple-dim);
  border-radius: 12px;

  font-size: 12.5px;
  color: var(--text);
}

.exploreur-indice summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--purple);
  list-style: none;
}

.exploreur-indice summary::-webkit-details-marker {
  display: none;
}

.exploreur-indice p {
  margin: 8px 0 0;
  color: var(--text2);
  line-height: 1.5;
}


/* ── INDICES MULTIPLES / PAYANTS ─────────────── */

.exploreur-indice-titre {
  font-weight: 700;
  color: var(--purple);
}

.exploreur-indice-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 10px;
  margin-top: 8px;
  background: rgba(0, 0, 0, .15);
}

.exploreur-indice-audio {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.exploreur-indice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px dashed var(--purple);
  border-radius: 12px;
  background: var(--purple-dim);
  color: var(--purple);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.exploreur-indice-btn span {
  font-weight: 500;
  font-size: 11.5px;
  color: var(--text3);
}

.exploreur-step-points small,
.exploreur-congrats-stat small {
  font-size: .78em;
  font-weight: 600;
  color: var(--text3);
}

/* ── BONUS DE TEMPS / SCORES OFFICIELS ─────────── */

.exploreur-bonus-temps {
  font-weight: 700;
  font-size: 14px;
}

.exploreur-bonus-temps.positif { color: var(--green); }
.exploreur-bonus-temps.negatif { color: var(--orange); }

.exploreur-scores-officiels {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: left;
}

.exploreur-scores-officiels div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
  font-size: 13.5px;
}

.exploreur-scores-officiels p,
.exploreur-mes-scores-note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--text3);
}

.exploreur-mes-scores-titre {
  margin: 0 0 8px;
  font-size: 15px;
}

.exploreur-mes-scores {
  list-style: none;
  margin: 0;
  padding: 0;
}

.exploreur-mes-scores li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.exploreur-mes-scores li:last-child { border-bottom: 0; }

.exploreur-mes-scores li > span:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  white-space: nowrap;
}

.exploreur-mes-scores small {
  font-size: 11px;
  color: var(--text3);
}


/* =========================================================
   TÉLÉCHARGEMENT HORS-LIGNE (aventure)
   ========================================================= */

.exploreur-offline-panel {
  margin: 6px 0 16px;
  padding: 14px 16px;

  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;

  text-align: left;
}

.exploreur-offline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;

  margin-bottom: 8px;
}

.exploreur-offline-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.exploreur-offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 3px 9px;
  border-radius: 100px;

  background: var(--green-dim);
  color: var(--green);

  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.exploreur-offline-desc {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text3);
}

.exploreur-offline-progress-bar {
  height: 7px;
  border-radius: 100px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 6px;
}

.exploreur-offline-progress-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--green);
  transition: width .2s ease;
}

.exploreur-offline-progress-label {
  font-size: 11px;
  color: var(--text3);
}

.exploreur-offline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exploreur-offline-actions .btn {
  flex: 1;
  min-width: 140px;
}

.exploreur-offline-error {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--red);
}

.exploreur-offline-error:empty {
  display: none;
}


/* =========================================================
   BOUSSOLE
   ========================================================= */

.exploreur-compass {
  margin: 6px 0 16px;
  padding: 16px;

  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;

  text-align: center;
}

.exploreur-compass-dial-wrap {
  width: 168px;
  height: 168px;
  margin: 0 auto 10px;
}

.exploreur-compass-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.exploreur-compass-bezel {
  fill: var(--surface);
  stroke: var(--border2);
  stroke-width: 3;
}

.exploreur-compass-bezel-inner {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.exploreur-compass-label {
  font-size: 22px;
  font-weight: 700;
  fill: var(--text2);
  font-family: inherit;
  user-select: none;
}

.exploreur-compass-label-n {
  fill: var(--red);
}

.exploreur-compass-arrow {
  /* Pivot au centre RÉEL du cadran (100,100 dans le repère du viewBox
     SVG, 0..200) — jamais "transform-box: fill-box" ici : ça pivoterait
     autour du centre de la boîte englobante de la flèche elle-même,
     qui n'est pas au milieu du disque (la flèche n'est pas symétrique
     verticalement par rapport à son centre), ce qui la fait glisser
     hors du centre au lieu de pivoter sur place. */
  transform-origin: 100px 100px;
  transition: transform .25s ease;
  transform: rotate(0deg);
}

.exploreur-compass-arrow polygon {
  fill: var(--green);
  stroke: color-mix(in srgb, var(--green) 60%, black);
  stroke-width: 1;
  stroke-linejoin: round;
}

.exploreur-compass-hub {
  fill: var(--card);
  stroke: var(--border2);
  stroke-width: 2;
}

.exploreur-compass-distance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 4px 0 10px;
}

.exploreur-compass-distance[hidden] {
  display: none;
}

.exploreur-compass-distance strong {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}

.exploreur-compass-distance span {
  font-size: 12px;
  color: var(--text2);
}

.exploreur-compass-distance-proche strong {
  color: var(--green);
}

.exploreur-compass-info {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 10px;
  line-height: 1.4;
}

.exploreur-compass-hint {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text3);
}


/* =========================================================
   SCANNER QR
   ========================================================= */

.exploreur-scanner-screen {
  padding: 20px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-align: center;
}

.exploreur-scanner {
  width: min(290px, 100%);
  margin: 0 auto 16px;
}

.exploreur-scanner video {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;

  display: block;

  object-fit: cover;

  border-radius: 16px;

  background: #000;

  border: 1px solid var(--border);

  box-shadow: 0 8px 25px rgba(0,0,0,.22);
}

.exploreur-scanner-vue {
  position: relative;
  border-radius: 16px;
}

/* iOS : force un calque de composition propre pour la vidéo de la
   caméra (évite une vidéo noire sous un calque superposé arrondi). */
.exploreur-scanner-vue video {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.exploreur-scan-planb {
  margin: 0 0 10px;
}

.exploreur-scan-planb[hidden] {
  display: none;
}

.exploreur-scan-planb .btn {
  cursor: pointer;
}

/* Champ fichier invisible mais toujours "cliquable" via son <label>
   (display:none bloque l'ouverture de l'appareil photo sur certains iOS). */
.exploreur-visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.exploreur-scan-version {
  font-size: 10px;
  opacity: .5;
}

.exploreur-scan-status {
  margin-top: 10px;

  text-align: center;

  color: var(--text2);

  font-size: 12px;
  line-height: 1.4;
}


/* =========================================================
   RÉSULTATS DE SCAN
   ========================================================= */

.exploreur-scan-success .exploreur-scan-success-icon {
  color: var(--green);
}

.exploreur-scan-error .exploreur-scan-error-icon {
  color: var(--orange);
}


/* =========================================================
   FÉLICITATIONS (fin d'aventure)
   ========================================================= */

.exploreur-congrats-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 14px 0;
}

.exploreur-congrats-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.exploreur-congrats-stat strong {
  font-family: var(--font-d);
  font-size: 24px;
  color: var(--yellow);
}

.exploreur-congrats-stat span {
  font-size: 11px;
  color: var(--text3);
}

.exploreur-congrats-note {
  margin: 14px 0 4px;
  padding: 12px;

  background: var(--blue-dim);
  border-radius: 12px;

  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
}

.exploreur-congrats-mot {
  margin: 12px 0 4px;
  text-align: left;
}

.exploreur-congrats-mot p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
  white-space: pre-line;
  margin: 0;
}


/* =========================================================
   PROFIL
   ========================================================= */

.exploreur-profil-card {
  margin-bottom: 16px;
  padding: 18px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;

  box-shadow: 0 3px 16px rgba(0,0,0,.12);
}

.exploreur-avatar-preview {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 34px;
  border-radius: 50%;

  background: var(--surface2);
  border: 2px solid var(--border2);
}

.exploreur-profil-field {
  margin-bottom: 14px;
}

.exploreur-profil-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text3);
  font-weight: 600;
}

.exploreur-avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.exploreur-avatar-btn {
  aspect-ratio: 1 / 1;

  border: 2px solid transparent;
  border-radius: 12px;

  background: var(--surface2);

  font-size: 20px;

  cursor: pointer;

  transition: border-color .15s ease, transform .15s ease;
}

.exploreur-avatar-btn:active {
  transform: scale(.92);
}

.exploreur-avatar-btn.active {
  border-color: var(--green);
  background: var(--green-dim);
}

.exploreur-profil-stats {
  display: flex;
  justify-content: space-around;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.exploreur-profil-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.exploreur-profil-stat strong {
  font-family: var(--font-d);
  font-size: 20px;
  color: var(--text);
}

.exploreur-profil-stat span {
  font-size: 10.5px;
  color: var(--text3);
}

.exploreur-profil-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text2);
}

.exploreur-sync-msg {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-height: 16px;
}


/* =========================================================
   CLASSEMENT
   ========================================================= */

.exploreur-rank-section {
  margin-bottom: 22px;
}

.exploreur-rank-section-title {
  font-family: var(--font-d);
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--text);
}

.exploreur-rank-section-note {
  margin: -4px 0 10px;
  font-size: 11px;
  color: var(--text3);
}

.exploreur-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 14px;
  margin-bottom: 8px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.exploreur-rank-pos {
  flex: 0 0 30px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.exploreur-rank-avatar {
  font-size: 18px;
}

.exploreur-rank-pseudo {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exploreur-rank-temps {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}

.exploreur-rank-points {
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
  white-space: nowrap;
}

.exploreur-defi-classement-card {
  margin-bottom: 14px;
  padding: 14px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.exploreur-defi-classement-titre {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.exploreur-gagnants-list {
  margin-top: 10px;
}

.exploreur-defi-classement-participants {
  font-size: 11px;
  color: var(--text3);
  margin: -2px 0 10px;
}

/* ── Nombre de participants (bloc stats en haut du classement) ── */

.exploreur-participants-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.exploreur-participants-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;

  padding: 12px 6px;

  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
}

.exploreur-participants-stat-valeur {
  font-size: 18px;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
}

.exploreur-participants-stat-label {
  font-size: 10px;
  color: var(--text3);
  line-height: 1.3;
}

/* ── Classement général tronqué : ligne "moi" et marqueur d'écart ── */

.exploreur-rank-row-moi {
  border-color: var(--green);
  background: var(--green-dim);
}

.exploreur-rank-row-moi .exploreur-rank-pseudo {
  color: var(--green);
}

.exploreur-rank-ecart {
  text-align: center;
  padding: 4px 0 10px;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text3);
}


/* =========================================================
   ÉPREUVES — COURSE / REPLACER / DESSIN
   ========================================================= */

/* ── Course chronométrée ──────────────────────── */

.exploreur-course-brief {
  margin: 0 0 10px;
  padding: 10px 14px;

  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;

  font-size: 12.5px;
  color: var(--text2);
  text-align: center;
}

.exploreur-course-chrono {
  margin: 0 0 10px;
  padding: 14px;

  background: var(--green-dim);
  border-radius: 14px;

  font-size: 28px;
  font-weight: 800;
  color: var(--green);
  text-align: center;
  letter-spacing: 0.5px;

  font-variant-numeric: tabular-nums;
}

.exploreur-epreuve-detail {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text3);
}


/* ── Replacer un élément sur une photo ────────── */

.exploreur-replacer-consigne {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text3);
}

.exploreur-replacer-photo {
  position: relative;

  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;

  border: 1px solid var(--border);
  background: var(--surface);

  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.exploreur-replacer-photo img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* Avec objet à glisser : le débordement est géré par
   exploreur-replacer.js (rogné au repos, libre pendant le glisser). */
.exploreur-replacer-photo.avec-objet {
  cursor: default;
}

.exploreur-replacer-photo.avec-objet.xr-zone-glisse {
  overflow: visible;
}

.exploreur-replacer-photo.avec-objet img.xr-fond {
  border-radius: 11px;
}

.exploreur-replacer-bac {
  background: var(--surface);
}

.exploreur-replacer-marker {
  position: absolute;
  width: 26px;
  height: 26px;

  transform: translate(-50%, -50%);

  border-radius: 50%;
  border: 3px solid var(--green);
  background: color-mix(in srgb, var(--green) 30%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent);

  pointer-events: none;
}


/* ── Dessin (100% local, jamais envoyé) ───────── */

.exploreur-dessin-note {
  margin: 0 0 10px;
  padding: 8px 12px;

  background: var(--purple-dim);
  border-radius: 10px;

  font-size: 11px;
  color: var(--purple);
  font-weight: 600;
}

.exploreur-dessin-canvas {
  display: block;
  width: 100%;
  height: auto;

  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--border2);

  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}

.exploreur-dessin-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.exploreur-dessin-actions .btn {
  flex: 1;
}


/* ── ACCESSIBILITÉ ───────────────────────────── */

@media (prefers-reduced-motion: reduce) {

  .exploreur-page.active,
  .exploreur-back,
  .exploreur-nav-btn,
  .exploreur-compass-arrow {
    animation: none;
    transition: none;
  }
}


/* ── FICHE DE LOT GAGNÉ (défis) ─────────────────── */

.exploreur-lot-fiche {
  --av-color: #fb923c;
  margin-top: 14px;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  color: #111;
  text-align: center;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
}

.exploreur-lot-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--av-color);
  color: #fff;
  text-align: left;
}

.exploreur-lot-head-icon { font-size: 30px; }

.exploreur-lot-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .9;
}

.exploreur-lot-aventure {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.exploreur-lot-recompense {
  padding: 16px 16px 4px;
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}

.exploreur-lot-partenaire {
  font-size: 13px;
  color: #555;
  padding: 0 16px;
}

.exploreur-lot-qr {
  padding: 12px;
  display: flex;
  justify-content: center;
}

.exploreur-lot-qr canvas {
  width: 220px !important;
  height: 220px !important;
}

.exploreur-lot-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  color: #444;
  padding: 0 16px;
}

.exploreur-lot-num {
  font-family: var(--font-m);
  color: #777;
}

.exploreur-lot-statut {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff4e6;
  color: #7a3d00;
  font-size: 12.5px;
  line-height: 1.45;
}

.exploreur-lot-statut.remis {
  background: #e8f8ee;
  color: #146c34;
  font-weight: 600;
}

.exploreur-lot-fiche.is-remis .exploreur-lot-qr { opacity: .35; }

.exploreur-lot-actions { padding: 14px 16px 16px; }

.exploreur-lots-titre {
  font-family: var(--font-d);
  font-size: 16px;
  margin-bottom: 10px;
}

.exploreur-lot-ligne {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  font-size: 20px;
}

.exploreur-lot-ligne-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.exploreur-lot-ligne-txt small { color: var(--text3); font-size: 12px; }

.exploreur-lot-ligne-etat {
  font-size: 12px;
  color: var(--orange);
  font-weight: 600;
  white-space: nowrap;
}


/* ── AVENTURE DÉBLOQUÉE (suite de l'histoire) ───── */

.exploreur-deblocage-card {
  --av-color: #fb923c;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--av-color) 55%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--av-color) 28%, transparent), color-mix(in srgb, var(--av-color) 6%, transparent));
}

.exploreur-deblocage-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text2);
}

.exploreur-deblocage-titre {
  font-family: var(--font-d);
  font-size: 19px;
  font-weight: 700;
  margin: 4px 0 6px;
}

.exploreur-deblocage-card p {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 12px;
}


/* ═══════════════════════════════════════════════
   ÉTAPE « 📸 PHOTO » : consigne, caméra + calque, jauge chaud/froid,
   déclencheur, résultat (score + étoiles)
   ═══════════════════════════════════════════════ */

.exploreur-photo-annonce {
  text-align: left;
  padding: 12px 14px;
  margin: 0 0 10px;
  border-radius: 14px;
  background: var(--blue-dim);
  border: 1px solid rgba(96, 165, 250, .35);
}

.exploreur-photo-annonce-titre {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 4px;
}

.exploreur-photo-annonce-consigne {
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}

.exploreur-photo-bilan {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exploreur-etoiles {
  color: var(--yellow);
  letter-spacing: 2px;
}

.exploreur-etoile-vide {
  color: var(--text3);
}

.exploreur-photo-succes {
  font-weight: 600;
}

.exploreur-photo-screen {
  padding: 16px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-align: center;
}

.exploreur-photo-consigne {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.exploreur-photo-vue {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 10px;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

.exploreur-photo-vue video,
.exploreur-photo-figee {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* L'image figée est en 4/3 ou 3/4 : on la recadre comme la vidéo. */
canvas.exploreur-photo-figee {
  object-fit: cover;
  z-index: 2;
}

/* ── Calques choisis dans l'admin ── */

.exploreur-calque {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

/* Le carré central = la zone réellement analysée. */
.exploreur-calque-coins i {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 0 solid rgba(255, 255, 255, .92);
  animation: exploreur-calque-respire 1.8s ease-in-out infinite;
}

.exploreur-calque-coins i:nth-child(1) { top: 14%; left: 8%; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 10px; }
.exploreur-calque-coins i:nth-child(2) { top: 14%; right: 8%; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 10px; }
.exploreur-calque-coins i:nth-child(3) { bottom: 14%; left: 8%; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 10px; }
.exploreur-calque-coins i:nth-child(4) { bottom: 14%; right: 8%; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 10px; }

@keyframes exploreur-calque-respire {
  0%, 100% { transform: scale(1); opacity: .95; }
  50% { transform: scale(.88); opacity: .6; }
}

.exploreur-calque-cadre {
  top: 13%;
  bottom: 13%;
  left: 6%;
  right: 6%;
  border-radius: 14px;
  border: 3px solid rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .28), 0 0 18px rgba(96, 165, 250, .7) inset;
  animation: exploreur-calque-lueur 2.2s ease-in-out infinite;
}

@keyframes exploreur-calque-lueur {
  0%, 100% { box-shadow: 0 0 0 999px rgba(0, 0, 0, .28), 0 0 10px rgba(96, 165, 250, .5) inset; }
  50% { box-shadow: 0 0 0 999px rgba(0, 0, 0, .28), 0 0 26px rgba(96, 165, 250, .95) inset; }
}

.exploreur-calque-viseur span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
}

.exploreur-calque-viseur span::before,
.exploreur-calque-viseur span::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, .85);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.exploreur-calque-viseur span::before { width: 160%; height: 2px; }
.exploreur-calque-viseur span::after { width: 2px; height: 160%; }

.exploreur-calque-tiers i {
  position: absolute;
  background: rgba(255, 255, 255, .45);
}

.exploreur-calque-tiers i:nth-child(1) { left: 33.33%; top: 0; bottom: 0; width: 1px; }
.exploreur-calque-tiers i:nth-child(2) { left: 66.66%; top: 0; bottom: 0; width: 1px; }
.exploreur-calque-tiers i:nth-child(3) { top: 33.33%; left: 0; right: 0; height: 1px; }
.exploreur-calque-tiers i:nth-child(4) { top: 66.66%; left: 0; right: 0; height: 1px; }

.exploreur-photo-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.exploreur-photo-flash.actif {
  animation: exploreur-flash .45s ease-out;
}

@keyframes exploreur-flash {
  0% { opacity: .9; }
  100% { opacity: 0; }
}

/* ── Jauge chaud / froid ── */

.exploreur-chaud-froid {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(10, 12, 20, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.exploreur-chaud-froid[hidden] {
  display: none;
}

.exploreur-cf-emoji {
  font-size: 22px;
  line-height: 1;
  transition: transform .25s;
}

.exploreur-cf-barre {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}

.exploreur-cf-niveau {
  height: 100%;
  width: 4%;
  border-radius: 6px;
  background: #60a5fa;
  transition: width .45s ease-out, background-color .45s;
}

.exploreur-cf-froid .exploreur-cf-niveau { background: #2dd4bf; }
.exploreur-cf-tiede .exploreur-cf-niveau { background: #fbbf24; }
.exploreur-cf-chaud .exploreur-cf-niveau { background: #fb923c; }
.exploreur-cf-brulant .exploreur-cf-niveau { background: #ef4444; }

.exploreur-cf-texte {
  min-width: 74px;
  text-align: right;
  white-space: nowrap;
}

.exploreur-cf-brulant {
  background: rgba(127, 29, 29, .72);
  animation: exploreur-cf-pulse .9s ease-in-out infinite;
}

.exploreur-cf-brulant .exploreur-cf-emoji {
  transform: scale(1.2);
}

.exploreur-cf-chaud {
  background: rgba(124, 45, 18, .62);
}

@keyframes exploreur-cf-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ── Position, déclencheur, résultat ── */

.exploreur-photo-gps {
  font-size: 13px;
  font-weight: 600;
  margin: 2px 0 4px;
  color: var(--text2);
}

.exploreur-photo-gps[hidden] {
  display: none;
}

.exploreur-photo-gps-ok {
  color: var(--green);
}

.exploreur-photo-gps-loin {
  color: var(--orange);
}

.exploreur-photo-actions {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}

.exploreur-photo-actions[hidden] {
  display: none;
}

.exploreur-photo-declencheur {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: transparent;
  padding: 5px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
}

.exploreur-photo-declencheur span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--green);
  transition: transform .12s;
}

.exploreur-photo-declencheur:active span {
  transform: scale(.88);
}

.exploreur-photo-declencheur:disabled {
  opacity: .4;
  cursor: default;
}

.exploreur-photo-declencheur:disabled span {
  background: var(--text3);
}

.exploreur-photo-resultat {
  margin: 4px 0 12px;
}

.exploreur-photo-resultat[hidden] {
  display: none;
}

.exploreur-photo-resultat p {
  margin: 6px 0;
  line-height: 1.45;
}

.exploreur-photo-score {
  font-family: var(--font-d);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.exploreur-photo-score-ko {
  color: var(--orange);
}

.exploreur-etoiles-grandes {
  font-size: 30px;
  letter-spacing: 6px;
}

.exploreur-photo-note {
  font-size: 13px;
  color: var(--text2);
}

.exploreur-photo-boutons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.exploreur-photo-confidentialite {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text2);
  margin: 0 0 12px;
}

@media (prefers-reduced-motion: reduce) {
  .exploreur-calque-coins i,
  .exploreur-calque-cadre,
  .exploreur-cf-brulant,
  .exploreur-photo-flash.actif {
    animation: none;
  }
}


/* Lien « J'ai un code » sous la liste des aventures (aventures en test
   ou privées, qui ne s'ouvrent qu'avec un code). */
.exploreur-code-lien {
  display: block;
  margin: 18px auto 8px;
  padding: 10px 18px;
  border: 1px dashed var(--border2);
  border-radius: 999px;
  background: transparent;
  color: var(--text2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.exploreur-code-lien:hover,
.exploreur-code-lien:focus-visible {
  color: var(--text);
  border-color: var(--text2);
}


/* Étape validée par la position GPS */
.exploreur-gps-statut {
  margin: 8px 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text2);
  text-align: center;
}

.exploreur-gps-statut.ok { color: var(--green); }
.exploreur-gps-statut.ko { color: var(--orange); }


/* ═══════════════════════════════════════════════
   DESSIN « Reproduis ce modèle » : modèle, jeu de mémoire, jauge, score
   ═══════════════════════════════════════════════ */

.exploreur-dessin-bonus-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--yellow);
  margin: 2px 0 10px;
}

.exploreur-dessin-modele {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  margin: 0 0 12px;
  text-align: center;
}

.exploreur-dessin-modele[hidden] {
  display: none;
}

.exploreur-dessin-modele img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  margin: 0 auto;
  object-fit: contain;
}

.exploreur-dessin-modele-flash img {
  max-height: 260px;
}

.exploreur-dessin-modele-label {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  background: rgba(255, 255, 255, .9);
  border-radius: 999px;
  padding: 2px 8px;
}

.exploreur-dessin-compte {
  position: absolute;
  top: 8px;
  right: 10px;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exploreur-dessin-memoire p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.exploreur-dessin-zone[hidden] {
  display: none;
}

.exploreur-dessin-jauge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.exploreur-dessin-jauge[hidden] {
  display: none;
}

.exploreur-dessin-jauge .exploreur-cf-barre {
  background: var(--surface2);
}

.exploreur-dessin-jauge .exploreur-cf-niveau {
  background: linear-gradient(90deg, #60a5fa, #fbbf24, #4ade80);
}

.exploreur-dessin-jauge-emoji {
  font-size: 20px;
}

.exploreur-dessin-jauge-texte {
  min-width: 110px;
  text-align: right;
}

.exploreur-dessin-score {
  text-align: center;
  line-height: 1.5;
}

.exploreur-dessin-score-valeur {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 800;
}

/* Question bonus (étape QR, info, dessin, photo…) */
.exploreur-qbonus { margin-top: 14px; }
.exploreur-qbonus-etiquette {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: #fff4cc;
  color: #7a5a00;
}
