/* SIPA — page « Le pays de Sipo » (/monde) : héros sur l'affiche du pays, visite en 3D (js/monde3d.js),
   ligne du Sept, lieux illustrés par la scène, habitants et appel au maquis. */

/* ---------- Héros : l'affiche du pays, bord à bord, la 3D se charge à sa place ---------- */
.monde-hero {
  position: relative;
}

.monde-scene {
  position: relative;
  height: min(calc(100svh - 72px), 880px);
  min-height: 560px;
  overflow: hidden;
  background: #2a1f2e;
}

.monde-affiche {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 55%;
}

.monde-hero__voile {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(32, 29, 29, 0.82) 0%, rgba(32, 29, 29, 0.55) 34%, rgba(32, 29, 29, 0) 62%);
}

/* L'affiche se fond dans le fond de la page, sans ligne de coupe (pas la 3D, qui garde ses bords) */
.monde-scene:not(.is-3d) {
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
}

.monde-hero__contenu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 72px;
}

.monde-hero__contenu > * {
  max-width: 540px;
}

.monde-hero__surtitre {
  margin: 0 0 4px;
  font-family: var(--titre);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--or);
}

.monde-hero h1 {
  margin: 0;
  font-family: var(--titre);
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  font-weight: 800;
  line-height: 0.95;
  color: var(--beige);
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
}

.monde-hero__texte {
  margin: 18px 0 28px;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--texte);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.monde-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.monde-lancer {
  min-height: 54px;
  font-size: 1.15rem;
  gap: 10px;
  white-space: nowrap;
}

.monde-lancer svg {
  width: 22px;
  height: 22px;
}

.monde-lancer.is-chargement {
  opacity: 0.85;
  cursor: progress;
}

.monde-hero__actions .btn-ghost {
  min-height: 54px;
  background: rgba(32, 29, 29, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Sipo, debout sur l'image, en bas à droite */
.monde-hero__sipo {
  position: absolute;
  right: max(16px, calc(50% - 600px));
  bottom: 70px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.monde-hero__sipo img {
  width: clamp(170px, 19vw, 260px);
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
}

.monde-hero__sipo .bubble {
  max-width: 220px;
  margin-right: clamp(110px, 13vw, 180px);
  margin-bottom: -18px;
  border-radius: 16px 16px 4px 16px;
}

.monde-scene.is-3d .monde-affiche,
.monde-scene.is-3d .monde-hero__voile,
.monde-scene.is-3d .monde-hero__contenu,
.monde-scene.is-3d .monde-hero__sipo {
  display: none;
}

/* Le pays en chiffres, posé à cheval sur le bas de l'affiche */
.monde-chiffres {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: -48px auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.monde-chiffres li {
  display: grid;
  gap: 2px;
  padding: 16px 20px;
  border-radius: var(--rayon);
  background: rgba(46, 36, 43, 0.86);
  border: 1px solid var(--bordure);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--ombre);
}

.monde-chiffres b {
  font-family: var(--titre);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--or);
}

.monde-chiffres span {
  font-size: 0.92rem;
  color: var(--texte-doux);
}

/* La 3D garde toute sa hauteur : sa barre des lieux ne passe pas sous les chiffres */
.monde-scene.is-3d + .monde-chiffres {
  margin-top: 16px;
}

@media (max-width: 760px) {
  .monde-scene {
    height: min(calc(100svh - 64px), 760px);
    min-height: 600px;
  }

  .monde-affiche {
    object-position: 46% 50%;
  }

  .monde-hero__voile {
    background: linear-gradient(180deg, rgba(32, 29, 29, 0.1) 0%, rgba(32, 29, 29, 0.3) 38%, rgba(32, 29, 29, 0.9) 74%);
  }

  .monde-hero__contenu {
    justify-content: flex-end;
    padding-bottom: 76px;
  }

  .monde-hero__texte {
    margin: 12px 0 20px;
  }

  .monde-hero__actions .btn {
    flex: 1 1 100%;
  }

  .monde-hero__sipo {
    top: 18px;
    bottom: auto;
    right: 12px;
  }

  .monde-hero__sipo img {
    width: 120px;
  }

  .monde-hero__sipo .bubble {
    display: none;
  }

  .monde-chiffres {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: -40px;
  }

  .monde-chiffres li {
    padding: 12px 14px;
  }

  .monde-chiffres b {
    font-size: 1.3rem;
  }
}

/* Titres de section sur une ligne quand la place le permet, coupés en deux parts égales sinon */
.monde .section-head {
  max-width: 980px;
}

.monde .section-head .lead {
  max-width: 680px;
}

.monde .section-title {
  text-wrap: balance;
}

/* ---------- La ligne du Sept : un plan de ligne, un rond par arrêt ---------- */
.ligne-sept {
  --rond: 84px;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.ligne-sept::before {
  content: '';
  position: absolute;
  left: calc(100% / 14);
  right: calc(100% / 14);
  top: calc(var(--rond) / 2 - 4px);
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--or-fonce), var(--or), var(--or-clair), var(--or));
  box-shadow: 0 0 18px rgba(226, 166, 85, 0.35);
}

.ligne-sept__visite {
  margin: 36px 0 0;
  text-align: center;
}

.ligne-sept__visite .btn {
  gap: 10px;
}

.ligne-sept a {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.arret__rond {
  position: relative;
  width: var(--rond);
  height: var(--rond);
  margin-bottom: 8px;
  border-radius: 50%;
  border: 3px solid var(--or);
  background: var(--fond-1);
  box-shadow: 0 0 0 6px var(--fond-2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.arret__rond img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
}

.arret__rond b {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fond-1);
  border: 2px solid var(--or);
  color: var(--or);
  font-family: var(--titre);
  font-size: 1rem;
  font-weight: 800;
}

.arret__nom {
  font-family: var(--titre);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--beige);
}

.arret__jeu {
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--texte-doux);
}

.ligne-sept a:hover .arret__rond,
.ligne-sept a:focus-visible .arret__rond {
  transform: translateY(-4px);
  box-shadow: 0 0 0 6px var(--fond-2), var(--ombre-or);
}

@media (max-width: 900px) {
  .ligne-sept {
    --rond: 64px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ligne-sept::before {
    left: calc(var(--rond) / 2 - 4px);
    right: auto;
    top: calc(var(--rond) / 2);
    bottom: calc(var(--rond) / 2);
    width: 8px;
    height: auto;
    background: linear-gradient(180deg, var(--or-fonce), var(--or), var(--or-clair), var(--or));
  }

  .ligne-sept a {
    grid-template-columns: var(--rond) 1fr;
    grid-template-rows: auto auto;
    justify-items: start;
    align-items: center;
    column-gap: 16px;
    row-gap: 0;
    text-align: left;
  }

  .arret__rond {
    grid-row: 1 / 3;
    margin-bottom: 0;
  }

  .arret__nom {
    align-self: end;
  }

  .arret__jeu {
    align-self: start;
  }
}

/* ---------- Les lieux : une rangée par arrêt, image de la scène et texte en alternance ---------- */
.monde-lieux {
  display: grid;
  gap: clamp(48px, 7vw, 96px);
  padding-bottom: clamp(56px, 8vw, 100px);
}

.lieu {
  margin: 0;
}

.lieu--rang {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.lieu--rang:nth-child(even) .lieu__vue {
  order: 2;
}

.lieu__vue {
  position: relative;
  margin: 0;
  border-radius: var(--rayon-l);
  overflow: hidden;
  border: 1px solid var(--bordure);
  background: #2a1f2e;
  box-shadow: var(--ombre);
}

.lieu__vue img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.lieu__vue figcaption {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--or);
  background: rgba(59, 44, 55, 0.88);
  color: var(--or);
  font-family: var(--titre);
  font-size: 0.95rem;
  font-weight: 700;
}

.lieu__corps {
  display: grid;
  gap: 10px;
}

.lieu__tag {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--or);
}

.lieu h3 {
  margin: 0;
  font-family: var(--titre);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--beige);
}

.lieu__texte {
  margin: 0;
  font-size: 1.05rem;
  color: var(--texte);
}

.lieu__jeu {
  margin: 4px 0 0;
  padding: 12px 16px;
  border-radius: var(--rayon-s);
  background: var(--surface);
  border-left: 3px solid var(--or);
  color: var(--texte-doux);
}

.lieu__jeu span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-faible);
}

.lieu__jeu b {
  color: var(--beige);
  font-weight: 600;
}

.lieu__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

.lieu__lien {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--or);
  text-decoration: none;
}

.lieu__lien::after {
  content: '→';
  margin-left: 6px;
}

.lieu__voir {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--bordure-forte);
  background: var(--surface);
  color: var(--beige);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.lieu__voir svg {
  width: 18px;
  height: 18px;
  color: var(--or);
}

.lieu__voir:hover {
  color: var(--or-clair);
  background: rgba(226, 166, 85, 0.1);
}

/* « Voir en 3D » seulement si le navigateur sait faire de la 3D (classe posée par js/monde.js) */
html:not(.monde-webgl) .lieu__voir {
  display: none;
}

.monde-detours .section-head {
  margin-bottom: 28px;
}

.detours {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.lieu--carte {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--rayon-l);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(242, 230, 201, 0.08);
}

.lieu--carte .lieu__vue {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.lieu--carte .lieu__vue img {
  aspect-ratio: 16 / 9;
}

.lieu--carte .lieu__corps {
  padding: 22px 24px 18px;
  align-content: start;
}

.lieu--carte h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.7rem);
}

@media (max-width: 860px) {
  .lieu--rang {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .lieu--rang:nth-child(even) .lieu__vue {
    order: 0;
  }

  .detours {
    grid-template-columns: 1fr;
  }
}

/* ---------- Le pays grandit : les nouveautés, construites ou à venir ---------- */
.chantier {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.chantier__etape {
  position: relative;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px 16px 14px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: 1px dashed rgba(242, 230, 201, 0.18);
  color: var(--texte-doux);
}

.chantier__num {
  font-family: var(--titre);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--texte-faible);
}

.chantier__etape b {
  font-family: var(--titre);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--beige);
}

.chantier__texte {
  font-size: 0.9rem;
  line-height: 1.35;
}

.chantier__etat {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texte-faible);
}

.chantier__etape.is-construit {
  border-style: solid;
  border-color: var(--bordure-forte);
  background: rgba(226, 166, 85, 0.08);
}

.chantier__etape.is-construit .chantier__etat,
.chantier__etape.is-construit .chantier__num {
  color: var(--or);
}

.chantier__etape.is-construit .chantier__etat::before {
  content: '✓ ';
}

.chantier__etape.is-prochaine {
  border-style: solid;
  border-color: var(--or);
  box-shadow: var(--ombre-or);
}

.chantier__etape.is-prochaine .chantier__etat {
  color: var(--or-clair);
}

.chantier__etape.is-a-venir b {
  color: var(--texte-doux);
}

@media (max-width: 900px) {
  .chantier {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Les habitants : une rangée ---------- */
.habitants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.habitant {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
  gap: 2px;
  padding: 16px 8px;
  border-radius: var(--rayon-l);
  background: var(--surface);
  border: 1px solid rgba(242, 230, 201, 0.08);
}

.habitant img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  background: var(--fond-1);
  border: 2px solid var(--bordure-forte);
  margin-bottom: 8px;
}

.habitant b {
  font-family: var(--titre);
  font-size: 1.1rem;
  color: var(--beige);
}

.habitant span {
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--texte-doux);
}

.habitant small {
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--or);
}

@media (max-width: 1100px) {
  .habitants {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .habitants {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Appel : une table t'attend au maquis, la nuit, Sipo en fête qui déborde de la carte ---------- */
.monde-cta {
  position: relative;
  margin: clamp(40px, 5vw, 72px) 0 clamp(56px, 8vw, 100px);
  min-height: 420px;
  display: flex;
  align-items: center;
  border-radius: var(--rayon-l);
  border: 1px solid var(--bordure-forte);
  box-shadow: var(--ombre);
}

.monde-cta__fond,
.monde-cta::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.monde-cta__fond {
  object-fit: cover;
  object-position: 50% 55%;
}

.monde-cta::before {
  content: '';
  z-index: 1;
  background: linear-gradient(90deg, rgba(32, 29, 29, 0.94) 0%, rgba(32, 29, 29, 0.78) 42%, rgba(32, 29, 29, 0.1) 75%);
}

.monde-cta__texte {
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: clamp(32px, 5vw, 64px);
}

.monde-cta__texte h2 {
  margin: 0 0 12px;
  font-family: var(--titre);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--beige);
}

.monde-cta__texte p {
  margin: 0 0 24px;
  font-size: 1.08rem;
  color: var(--texte-doux);
}

.monde-cta__sipo {
  position: absolute;
  z-index: 3;
  right: clamp(8px, 5vw, 64px);
  bottom: 0;
  width: clamp(260px, 34vw, 470px);
  height: auto;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

@media (max-width: 860px) {
  .monde-cta {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding-top: 150px;
  }

  .monde-cta::before {
    background: linear-gradient(180deg, rgba(32, 29, 29, 0.2) 0%, rgba(32, 29, 29, 0.85) 40%, rgba(32, 29, 29, 0.96) 100%);
  }

  .monde-cta__sipo {
    top: -70px;
    bottom: auto;
    right: 50%;
    transform: translateX(50%);
    width: 200px;
  }

  .monde-cta__texte {
    padding: 8px 22px 28px;
    text-align: center;
  }

  .monde-cta__texte .stores {
    justify-content: center;
  }
}

/* La scène 3D */
.m3d {
  position: absolute;
  inset: 0;
  outline: none;
  color: var(--beige);
  font-family: var(--titre);
}

.m3d:fullscreen {
  background: #2a1f2e;
}

.m3d-rendu {
  position: absolute;
  inset: 0;
}

.m3d-rendu canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.m3d-etiquettes {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.m3d .repere {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transform: translateY(-14px);
}

.m3d .pin {
  pointer-events: auto;
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--or);
  background: #2b2229 center 15% / cover no-repeat;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s;
}

.m3d .pin span {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: #2b2229;
  border: 1.5px solid var(--or);
  color: var(--or);
  font: 800 11px/14px var(--titre);
  text-align: center;
}

.m3d .pin.hors span {
  width: 12px;
  min-width: 12px;
  height: 12px;
  border-radius: 2px;
  transform: rotate(45deg);
  right: -4px;
  top: -4px;
}

.m3d .nom {
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  background: rgba(32, 26, 30, 0.8);
  border: 1px solid rgba(242, 230, 201, 0.12);
  border-radius: 10px;
  padding: 0 8px;
  font: 600 12px/18px var(--titre);
  color: var(--beige);
}

.m3d .repere.choisi .pin {
  transform: scale(1.35);
  border-color: var(--beige);
}

.m3d .repere.choisi .nom {
  background: #4a3540;
  border-color: rgba(226, 166, 85, 0.6);
  font-size: 14px;
  line-height: 22px;
}

.m3d-fiche {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 340px;
  max-height: calc(100% - 100px);
  overflow: auto;
  background: linear-gradient(180deg, #4a3540, #2c2229);
  border: 1px solid rgba(226, 166, 85, 0.55);
  border-top: 3px solid var(--or);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  font-family: var(--corps);
}

.m3d-fiche.ouverte {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.m3d-haut {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-right: 30px;
}

.m3d-haut img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  border: 2px solid rgba(226, 166, 85, 0.5);
  background: #3b2c37;
  flex: none;
}

.m3d-tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--texte-doux);
}

.m3d-fiche h3 {
  margin: 0;
  font-family: var(--titre);
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: 800;
  color: var(--or);
}

.m3d-fiche p {
  margin: 12px 0 0;
  line-height: 1.45;
}

.m3d-jeu {
  color: var(--texte-doux);
  font-size: 0.95rem;
}

.m3d-jeu b {
  color: var(--beige);
  font-weight: 600;
}

.m3d-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.m3d-actions .btn {
  justify-content: center;
}

.m3d-fermer {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--texte-doux);
  font-size: 24px;
  cursor: pointer;
}

.m3d-barre {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  background: linear-gradient(0deg, rgba(30, 22, 32, 0.92), rgba(30, 22, 32, 0));
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.m3d .chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 14px 4px 4px;
  border-radius: 24px;
  border: 2px solid rgba(226, 166, 85, 0.25);
  background: rgba(44, 34, 41, 0.92);
  color: var(--beige);
  font: 600 15px var(--titre);
  cursor: pointer;
  white-space: nowrap;
}

.m3d .chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  background: #3b2c37;
}

.m3d .chip.choisi {
  border-color: var(--or);
  background: #4a3540;
}

.m3d .chip.texte {
  padding: 4px 16px;
  color: var(--or);
}

.m3d .chip svg {
  width: 20px;
  height: 20px;
}

.m3d-zoom {
  position: absolute;
  left: 16px;
  top: 68px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(226, 166, 85, 0.45);
  background: rgba(44, 34, 41, 0.85);
}

.m3d-zoom button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--or);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.m3d-zoom button + button {
  border-top: 1px solid rgba(226, 166, 85, 0.25);
}

.m3d-zoom svg {
  width: 20px;
  height: 20px;
}

.m3d-aide {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 76px;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(32, 26, 30, 0.82);
  color: var(--beige);
  font: 500 13px var(--titre);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.6s;
}

.m3d-aide.cachee {
  opacity: 0;
}

.m3d-plein {
  position: absolute;
  left: 16px;
  top: 16px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(226, 166, 85, 0.45);
  background: rgba(44, 34, 41, 0.85);
  color: var(--or);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.m3d-plein svg {
  width: 22px;
  height: 22px;
}

.m3d .pin:focus-visible,
.m3d .chip:focus-visible,
.m3d button:focus-visible,
.m3d a:focus-visible {
  outline: 3px solid var(--beige);
  outline-offset: 2px;
}

.m3d.etroit .m3d-fiche {
  left: 12px;
  right: 12px;
  width: auto;
  top: auto;
  bottom: 72px;
  max-height: 52%;
  transform: translateY(12px);
}

.m3d.etroit .m3d-fiche.ouverte {
  transform: none;
}

.m3d.etroit .m3d-haut img {
  width: 60px;
  height: 60px;
}

.m3d.etroit .m3d-actions {
  flex-direction: row;
}

/* Le texte entier du lieu est plus bas dans la page : trois lignes suffisent ici */
.m3d.etroit #m3d-f-histoire {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 0.95rem;
}

.m3d.etroit .m3d-fiche p {
  margin-top: 8px;
}

.m3d.etroit .m3d-actions .btn {
  flex: 1;
  padding-inline: 10px;
  font-size: 1rem;
}

.m3d.etroit .nom {
  font-size: 11px;
}

/* Les noms des lieux passent sous les cartes, la barre et les boutons */
.m3d > :not(.m3d-rendu):not(.m3d-etiquettes) {
  z-index: 2;
}

.m3d > .m3d-fiche,
.m3d > .m3d-visite {
  z-index: 3;
}

/* Visite guidée en Sept : même carte que la fiche d'un lieu, Sipo qui parle et les sept arrêts */
.m3d-visite {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 340px;
  max-height: calc(100% - 100px);
  overflow: auto;
  background: linear-gradient(180deg, #4a3540, #2c2229);
  border: 1px solid rgba(226, 166, 85, 0.55);
  border-top: 3px solid var(--or);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  font-family: var(--corps);
  z-index: 3;
  animation: m3d-visite-entre 0.3s ease-out;
}

.m3d-visite[hidden],
.m3d-visite [hidden] {
  display: none;
}

@keyframes m3d-visite-entre {
  from { opacity: 0; transform: translateY(-12px); }
}

.m3d-visite h3 {
  margin: 0;
  font-family: var(--titre);
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: 800;
  color: var(--or);
}

.m3d-v-dit {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  background: var(--beige);
  color: var(--gris);
  font-family: var(--titre);
  font-weight: 600;
  line-height: 1.3;
}

.m3d-v-points {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.m3d-v-points li {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: rgba(242, 230, 201, 0.16);
}

.m3d-v-points li.fait {
  background: rgba(226, 166, 85, 0.55);
}

.m3d-v-points li.ici {
  background: var(--or);
  box-shadow: 0 0 10px rgba(226, 166, 85, 0.6);
}

.m3d .chip.visite {
  border-color: var(--or);
  color: var(--or);
}

.m3d.etroit .m3d-visite {
  left: 12px;
  right: 12px;
  width: auto;
  top: auto;
  bottom: 72px;
  max-height: 52%;
  padding: 14px;
}

.m3d.etroit .m3d-visite .m3d-haut img {
  width: 52px;
  height: 52px;
}

.m3d.etroit .m3d-visite h3 {
  font-size: 1.25rem;
}

.m3d.etroit .m3d-visite .m3d-actions {
  flex-direction: row;
}

.m3d.etroit .m3d-visite .m3d-actions .btn {
  flex: 1;
  padding-inline: 10px;
  font-size: 1rem;
}

.m3d--affiche .m3d-visite {
  display: none;
}

.m3d--affiche .m3d-etiquettes,
.m3d--affiche .m3d-barre,
.m3d--affiche .m3d-plein,
.m3d--affiche .m3d-fiche,
.m3d--affiche .m3d-zoom,
.m3d--affiche .m3d-aide {
  display: none;
}

html.affiche .monde-scene {
  position: fixed;
  inset: 0;
  height: 100vh;
  z-index: 1000;
  border-radius: 0;
  border: 0;
}
