*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --ink: #0c0c0c;
  --paper: #e6e0d6;
  --paper-soft: #b9afa1;
  --muted: #746b61;
  --sand: #d4b483;
  --sand-dim: #8a7355;
  --line: rgba(212, 180, 131, 0.18);
  --panel: rgba(14, 13, 12, 0.74);
  --panel-strong: rgba(14, 13, 12, 0.9);
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
}

button,
a {
  font: inherit;
}

#map {
  position: fixed;
  inset: 0;
  background: #090909;
}

.atlas-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(212, 180, 131, 0.08), transparent 36%),
    linear-gradient(90deg, rgba(12, 12, 12, 0.82), rgba(12, 12, 12, 0.1) 34%, rgba(12, 12, 12, 0.18) 72%, rgba(12, 12, 12, 0.72)),
    linear-gradient(180deg, rgba(12, 12, 12, 0.56), transparent 28%, rgba(12, 12, 12, 0.78));
  z-index: 2;
}

.atlas-grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.11;
  background-image:
    repeating-radial-gradient(circle at 12% 18%, rgba(255,255,255,0.55) 0 1px, transparent 1px 7px),
    repeating-radial-gradient(circle at 70% 62%, rgba(255,255,255,0.35) 0 1px, transparent 1px 9px);
  mix-blend-mode: overlay;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */

.atlas-topbar {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 32px;
  pointer-events: none;
}

.brand,
.top-actions,
.atlas-footer,
.intro-panel,
.trace-panel {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--sand);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.76rem;
}

.brand strong {
  color: var(--paper);
  font-weight: normal;
  letter-spacing: 0.2em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.app-link,
.panel-close {
  border: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.56);
  color: var(--paper);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--sand);
  font-size: 1.05rem;
}

.app-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 4px;
  color: var(--sand);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

.icon-button:hover,
.app-link:hover,
.panel-close:hover {
  border-color: rgba(212, 180, 131, 0.55);
  background: rgba(24, 22, 19, 0.72);
}

/* ─── Shell / intro ──────────────────────────────────────────────────────── */

.atlas-shell {
  position: fixed;
  z-index: 6;
  inset: 0;
  pointer-events: none;
}

.intro-panel {
  position: absolute;
  left: 32px;
  bottom: 72px;
  width: min(390px, calc(100vw - 64px));
  padding: 0;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.75);
  transition: opacity 300ms ease;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--sand-dim);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.66rem;
}

.intro-panel h1 {
  margin: 0 0 10px;
  max-width: 440px;
  color: var(--paper);
  font-size: clamp(3rem, 7.5vw, 6rem);
  line-height: 0.96;
  font-weight: normal;
  letter-spacing: -0.01em;
}

.intro-tagline {
  max-width: 360px;
  margin: 0 0 18px;
  color: var(--sand);
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.3;
  font-style: italic;
  font-weight: normal;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}

.intro-panel p:not(.eyebrow):not(.intro-tagline) {
  max-width: 340px;
  margin: 0;
  color: var(--paper-soft);
  font-size: 0.98rem;
  line-height: 1.75;
  font-style: italic;
}

.atlas-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.atlas-stats span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(212, 180, 131, 0.16);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.42);
  color: var(--muted);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: none;
}

.atlas-stats strong {
  color: var(--sand);
  font-size: 0.82rem;
  font-weight: normal;
  letter-spacing: 0.04em;
}

/* ─── Trace panel ────────────────────────────────────────────────────────── */

.trace-panel {
  position: absolute;
  right: 28px;
  bottom: 68px;
  width: min(330px, calc(100vw - 56px));
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translateY(0);
  transition: opacity 260ms ease, transform 260ms ease;
}

.trace-panel.is-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.panel-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sand);
}

.trace-empty {
  padding: 28px;
}

.trace-empty p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

/* Photo dans le panneau — visible par défaut */
.trace-detail img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: saturate(0.85) contrast(0.96) sepia(0.08);
}

.trace-copy {
  padding: 22px 46px 22px 24px;
}

.trace-copy h2 {
  margin: 0 0 6px;
  color: var(--paper);
  font-size: 1.32rem;
  font-weight: normal;
  line-height: 1.18;
}

.trace-meta {
  margin: 0 0 14px;
  color: var(--sand-dim);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.trace-caption {
  margin: 0 0 14px;
  color: var(--paper-soft);
  font-size: 0.84rem;
  line-height: 1.55;
  font-style: italic;
}

/* ─── Score FX ───────────────────────────────────────────────────────────── */

.trace-score {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.score-dots {
  display: flex;
  gap: 5px;
}

.score-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sand);
  opacity: 0.18;
  transform: scale(0.6);
  transition: opacity 350ms ease, transform 350ms ease;
}

.score-dot.is-visible {
  opacity: 0.18;
  transform: scale(1);
}

.score-dot.filled.is-visible {
  opacity: 1;
  transform: scale(1.1);
}

.score-dot.partial.is-visible {
  opacity: 0.52;
  transform: scale(1);
}

.score-value {
  color: var(--sand);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.82;
}

/* Hint double-clic */
.trace-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-style: normal;
  opacity: 0.7;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.atlas-footer {
  position: fixed;
  z-index: 10;
  left: 32px;
  right: 32px;
  bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

/* ─── Photo markers ─────────────────────────────────────────────────────── */

.photo-marker {
  position: relative;
  border-radius: 50%;
  /* PAS overflow:hidden — crop sur l'img, pas le conteneur
     => les ::before/::after peuvent dépasser pour les ondes */
  border: 2px solid rgba(230, 224, 214, 0.82);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  background: rgba(212, 180, 131, 0.55);
  cursor: pointer;
  transition: width 0.22s ease, height 0.22s ease;
  z-index: 1;
}

.photo-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%; /* crop circulaire sur l'img */
  filter: saturate(0.88) contrast(1.04);
  pointer-events: none;
  user-select: none;
  transition: opacity 0.2s ease;
}

.photo-marker.is-tiny img {
  opacity: 0;
}

.photo-marker:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75), 0 0 0 2px rgba(212, 180, 131, 0.45);
  z-index: 3;
}

.photo-marker.is-active {
  border-color: var(--sand);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.85), 0 0 0 3px rgba(212, 180, 131, 0.65);
  z-index: 5;
}

/* ── Photo gagnante non réclamée ─────────────────────────────────────────
   On NE touche PAS transform sur .photo-marker : MapLibre positionne
   ses markers via transform:translate(), une animation CSS sur transform
   écraserait ce translate et ferait disparaître le marker.
   Solution : deux ondes via ::before et ::after (pseudo-éléments
   indépendants) qui s'agrandissent et disparaissent en boucle.           */
.photo-marker.is-winner-unclaimed {
  border: 3px solid rgba(212, 180, 131, 0.9);
  z-index: 4;
}

.photo-marker.is-winner-unclaimed::before,
.photo-marker.is-winner-unclaimed::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid rgba(212, 180, 131, 0.85);
  pointer-events: none;
  animation: winnerWave 2.0s ease-out infinite;
}

.photo-marker.is-winner-unclaimed::after {
  animation-delay: 0.7s; /* 2e onde décalée → effet de propagation */
}

@keyframes winnerWave {
  0% {
    transform: scale(1.0);
    opacity: 1;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Badge couronne — photo gagnante */
.winner-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.winner-badge.is-claimed {
  background: rgba(212, 180, 131, 0.9);
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* Non réclamée : pulsation dorée pour attirer l'attention */
.winner-badge.is-unclaimed {
  background: var(--sand);
  color: var(--ink);
  box-shadow: 0 0 0 0 rgba(212, 180, 131, 0.7);
  animation: winnerPulse 2s ease-in-out infinite;
}

@keyframes winnerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 180, 131, 0.7); }
  50%       { box-shadow: 0 0 0 6px rgba(212, 180, 131, 0); }
}

/* ─── Panneau claim ──────────────────────────────────────────────────────── */

.trace-claim {
  margin: 14px 0 6px;
  padding: 14px;
  border-radius: 4px;
  border: 1px solid rgba(212, 180, 131, 0.28);
}

.trace-claim.is-unclaimed {
  background: rgba(212, 180, 131, 0.07);
  border-color: rgba(212, 180, 131, 0.45);
  text-align: center;
}

.trace-claim.is-claimed {
  background: rgba(212, 180, 131, 0.04);
  opacity: 0.7;
}

.claim-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  text-align: left;
}

.claim-star {
  color: var(--sand);
  font-size: 0.88rem;
}

.claim-label {
  color: var(--sand);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.3;
}

.claim-sub {
  margin: 0 0 12px;
  color: var(--paper-soft);
  font-size: 0.78rem;
  line-height: 1.5;
  font-style: italic;
  text-align: left;
}

.claim-qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.claim-qr {
  width: 240px;
  height: 240px;
  border-radius: 4px;
  background: #fff;
  padding: 4px;
  flex-shrink: 0;
}

.claim-prize {
  margin: 8px 0 10px;
}

.claim-prize-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--paper-soft);
  margin-bottom: 4px;
  line-height: 1.4;
}

.claim-prize-row strong {
  color: var(--sand);
  font-weight: normal;
}

.claim-prize-sub {
  opacity: 0.65;
}

.claim-id {
  display: block;
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  font-family: monospace;
}

/* ─── Image viewer ───────────────────────────────────────────────────────── */

.image-viewer {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 5, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.image-viewer[hidden] {
  display: none;
}

.viewer-frame {
  width: min(98vw, 1480px);
  max-height: 96vh;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid rgba(212, 180, 131, 0.26);
  background: rgba(12, 12, 12, 0.72);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.72);
}

.viewer-frame img {
  width: 100%;
  max-height: calc(96vh - 78px);
  object-fit: contain;
  display: block;
  background: #080808;
}

.viewer-frame figcaption {
  min-height: 62px;
  display: grid;
  gap: 5px;
  padding: 12px 18px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
}

.viewer-frame strong {
  color: var(--paper);
  font-size: 1.05rem;
  font-weight: normal;
  letter-spacing: 0;
  text-transform: none;
}

.viewer-frame small {
  color: var(--sand-dim);
}

.viewer-close {
  position: fixed;
  z-index: 41;
  top: 24px;
  right: 28px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(212, 180, 131, 0.32);
  border-radius: 50%;
  background: rgba(12, 12, 12, 0.68);
  color: var(--sand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Guide popup ───────────────────────────────────────────────────────── */

.guide-popup {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.guide-popup[hidden] {
  display: none;
}

.guide-card {
  position: relative;
  width: min(520px, calc(100vw - 48px));
  padding: 34px 32px 30px;
  border: 1px solid rgba(212, 180, 131, 0.16);
  background: rgba(8, 7, 6, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

.guide-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(212, 180, 131, 0.18);
  border-radius: 50%;
  background: rgba(12, 12, 12, 0.56);
  color: rgba(212, 180, 131, 0.55);
  cursor: pointer;
}

.guide-close:hover {
  border-color: rgba(212, 180, 131, 0.40);
  color: rgba(212, 180, 131, 0.90);
}

.guide-eyebrow {
  margin: 0 0 12px;
  color: var(--sand-dim);
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.guide-card h2 {
  margin: 0 34px 18px 0;
  color: rgba(230, 224, 214, 0.94);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: normal;
  line-height: 1.12;
}

.guide-card p {
  max-width: 420px;
  margin: 0 0 14px;
  color: rgba(230, 224, 214, 0.72);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.65;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.guide-actions a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(212, 180, 131, 0.22);
  border-radius: 4px;
  background: rgba(212, 180, 131, 0.08);
  color: rgba(212, 180, 131, 0.82);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
}

.guide-actions a:hover {
  border-color: rgba(212, 180, 131, 0.44);
  background: rgba(212, 180, 131, 0.12);
  color: rgba(230, 224, 214, 0.9);
}

/* ─── Halos région ───────────────────────────────────────────────────────── */

.halo-marker {
  position: relative;
  width: var(--halo-size);
  height: var(--halo-size);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sand);
  cursor: pointer;
  opacity: 1;
  transition: opacity 220ms ease, transform 220ms ease;
}

body.is-trace-zoom .halo-marker {
  opacity: 0;
  pointer-events: none;
}

.halo-marker::before,
.halo-marker::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 180, 131, 0.25), rgba(212, 180, 131, 0.08) 42%, transparent 68%);
  animation: haloPulse 5.5s ease-in-out infinite;
}

.halo-marker::after {
  inset: 18%;
  border: 1px solid rgba(212, 180, 131, 0.32);
  background: rgba(12, 12, 12, 0.34);
  animation-delay: -1.8s;
}

.halo-count {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  min-width: 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 180, 131, 0.42);
  border-radius: 50%;
  background: rgba(12, 12, 12, 0.72);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38), 0 0 26px rgba(212, 180, 131, 0.12);
  color: var(--paper);
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.halo-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: calc(50% + 32px);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.66);
  color: var(--sand-dim);
  transform: translateX(-50%);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.58rem;
  white-space: nowrap;
}

.halo-marker:hover {
  transform: scale(1.04);
}

@keyframes haloPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.64; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* Masquer les contrôles MapLibre natifs (remplacés par bouton focus) */
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  display: none;
}

/* ─── Responsive 820px ───────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .atlas-topbar {
    padding: 18px;
  }

  .brand {
    letter-spacing: 0.22em;
  }

  .app-link {
    max-width: 142px;
    padding: 0 12px;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-align: center;
  }

  .intro-panel {
    left: 20px;
    right: 20px;
    bottom: 88px;
    width: auto;
  }

  .intro-panel h1 {
    font-size: clamp(2.2rem, 9vw, 3.6rem);
    max-width: 320px;
  }

  .intro-tagline {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem);
  }

  .intro-panel p:not(.eyebrow):not(.intro-tagline) {
    max-width: 300px;
    font-size: 0.88rem;
  }

  .atlas-stats {
    max-width: 280px;
  }

  .atlas-stats span {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.58rem;
  }

  .trace-panel {
    left: 16px;
    right: 16px;
    bottom: 52px;
    width: auto;
  }

  .trace-copy {
    padding: 18px 48px 18px 18px;
  }

  .trace-copy h2 {
    font-size: 1rem;
  }

  .trace-caption {
    font-size: 0.8rem;
  }

  .atlas-footer {
    left: 18px;
    right: 18px;
    bottom: 16px;
    font-size: 0.56rem;
  }

  .atlas-footer span:last-child {
    display: none;
  }

  .image-viewer {
    padding: 18px;
  }

  .viewer-close {
    top: 14px;
    right: 14px;
  }

  .guide-card {
    padding: 30px 24px 26px;
  }

  .guide-card p {
    font-size: 0.86rem;
  }
}

/* ─── Jalons-défis ───────────────────────────────────────────────────────── */

.jalon-marker {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: opacity 600ms ease;
  pointer-events: auto;
}

/* Halos via éléments DOM enfants (pas pseudo-éléments : incompatibles avec pitchAlignment map) */
.jalon-halo-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 180, 131, 0.45) 0%, rgba(212, 180, 131, 0.15) 45%, transparent 70%);
  animation: jalonBreath 7s ease-in-out infinite;
}

.jalon-halo-inner {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 180, 131, 0.80) 0%, rgba(212, 180, 131, 0.30) 40%, transparent 72%);
  animation: jalonBreath 7s ease-in-out infinite;
  animation-delay: -3.5s;
}

.jalon-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(212, 180, 131, 0.90);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.jalon-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: calc(50% + 14px);
  transform: translateX(-50%);
  color: rgba(212, 180, 131, 0.88);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-align: center;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  transition: opacity 400ms ease;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

@keyframes jalonBreath {
  0%, 100% { transform: scale(0.90); opacity: 0.55; }
  50%       { transform: scale(1.12); opacity: 1; }
}

/* Panneau — pointer-events explicite pour que la croix reçoive les clics */
.jalon-panel {
  pointer-events: all;
}

/* Panneau révélation jalon */
.jalon-panel {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 28px 40px;
  background: rgba(10, 9, 7, 0.94);
  border-top: 1px solid rgba(212, 180, 131, 0.14);
  backdrop-filter: blur(12px);
  transform: translateY(100%);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.jalon-panel.is-visible {
  transform: translateY(0);
}

.jalon-panel-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(212, 180, 131, 0.4);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.jalon-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(212, 180, 131, 0.45);
  margin: 0 0 10px;
}

.jalon-title {
  font-size: 1.18rem;
  font-weight: 400;
  color: rgba(212, 180, 131, 0.92);
  line-height: 1.5;
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}

.jalon-sponsor {
  font-size: 0.65rem;
  color: rgba(138, 122, 96, 0.65);
  font-style: italic;
  margin: 0 0 10px;
  letter-spacing: 0.06em;
}

.jalon-hint {
  font-size: 0.65rem;
  color: rgba(212, 180, 131, 0.30);
  margin: 0 0 12px;
  letter-spacing: 0.05em;
}

.jalon-learn-more {
  background: none;
  border: none;
  border-bottom: 1px solid rgba(212, 180, 131, 0.22);
  color: rgba(212, 180, 131, 0.45);
  font-size: 0.60rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: 0 0 1px;
  text-transform: uppercase;
  transition: color 200ms ease;
}
.jalon-learn-more:hover { color: rgba(212, 180, 131, 0.75); }

.jalon-rules {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(212, 180, 131, 0.10);
}
.jalon-rules p {
  font-size: 0.62rem;
  color: rgba(212, 180, 131, 0.40);
  line-height: 1.6;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.jalon-rules p:last-child { margin-bottom: 0; }

/* ─── Responsive 560px ───────────────────────────────────────────────────── */

@media (max-width: 560px) {
  .intro-panel.is-hidden-mobile {
    opacity: 0;
    pointer-events: none;
  }
}

/* ─── Responsive 480px (mobile portrait) ────────────────────────────────── */

@media (max-width: 480px) {
  /* Topbar compacte */
  .atlas-topbar {
    padding: 10px 14px;
    gap: 8px;
  }

  /* "Découvrir l'app" pas prioritaire sur mobile */
  .app-link {
    display: none;
  }

  /* Intro panel — marges réduites, titre plus petit */
  .intro-panel {
    left: 16px;
    right: 16px;
    bottom: 64px;
    width: auto;
  }

  .intro-panel h1 {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    max-width: 100%;
  }

  .intro-tagline {
    font-size: 0.85rem;
    max-width: 100%;
  }

  .intro-panel p:not(.eyebrow):not(.intro-tagline) {
    display: none;
  }

  .atlas-stats {
    gap: 5px;
    margin-top: 14px;
  }

  .atlas-stats span {
    min-height: 26px;
    padding: 0 8px;
    font-size: 0.54rem;
  }

  /* Trace panel — bottom sheet plein largeur, scroll tactile */
  .trace-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 65vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: 12px 12px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  /* Slide vers le bas plutôt que fade+décalage */
  .trace-panel.is-collapsed {
    transform: translateY(110%);
    opacity: 1;
  }

  /* Photo moins envahissante — on voit juste l'image, pas un plein écran */
  .trace-detail img {
    max-height: 180px;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .trace-copy {
    padding: 16px 44px 20px 16px;
  }

  /* QR code adapté mobile */
  .claim-qr {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
  }

  /* Jalon panel — padding réduit */
  .jalon-panel {
    padding: 24px 18px 32px;
  }

  .jalon-title {
    font-size: 1.05rem;
  }

  /* Footer masqué sur mobile — trop chargé */
  .atlas-footer {
    display: none;
  }

  /* Image viewer — padding minimal */
  .image-viewer {
    padding: 8px;
  }

  .viewer-close {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
  }

  /* Guide popup */
  .guide-card {
    padding: 24px 18px 22px;
  }

  .guide-card h2 {
    font-size: 1.6rem;
  }
}
