@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --fond: #1b1a17;
  --fond-2: #26241f;
  --texte: #f4efe6;
  --texte-2: #c9c1b3;
  --accent: #e8a33d;
  --accent-texte: #1b1a17;
  --verre: rgba(27, 26, 23, 0.82);
  --rayon: 14px;
  --gouttiere: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond);
  color: var(--texte);
  font-family: "Open Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2 { font-family: "Lora", Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
a { color: var(--accent); }

.ecran { min-height: 100%; }

/* ---------- Accueil ---------- */
#accueil { display: flex; align-items: center; justify-content: center; padding: 32px var(--gouttiere); }
.accueil-contenu { max-width: 26rem; width: 100%; }
.surtitre { color: var(--texte-2); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 1rem; }
#accueil h1 { font-size: clamp(2rem, 9vw, 2.75rem); }
.intro { color: var(--texte-2); margin: 0 0 1.75rem; }
.note { color: var(--texte-2); font-size: .82rem; margin: 1rem 0 1.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem; border-radius: 999px; border: 0;
  font: 600 1rem "Open Sans", system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.btn-principal { background: var(--accent); color: var(--accent-texte); width: 100%; font-size: 1.1rem; min-height: 56px; }
.btn-principal:disabled { opacity: .6; }
.btn-secondaire { background: transparent; color: var(--texte); border: 1.5px solid rgba(244,239,230,.35); }
.lien-discret { color: var(--texte-2); font-size: .95rem; }

/* ---------- Secours 2D ---------- */
#secours { padding: 24px var(--gouttiere) 40px; }
.secours-contenu { max-width: 40rem; margin: 0 auto; }
.avis { background: var(--fond-2); border-left: 4px solid var(--accent); padding: .8rem 1rem; border-radius: 8px; margin: 0 0 1.5rem; }
.carte { background: var(--fond-2); border-radius: var(--rayon); padding: 20px; margin-bottom: 24px; }
.carte h2 { font-size: 1.6rem; margin-bottom: .2rem; }
.carte .auteur { color: var(--texte-2); margin: 0 0 .8rem; }
.carte .resume { margin: 0 0 1rem; }
.carte .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1rem; }
.secours-retour { text-align: center; }

/* Pile d'étapes 2D (fondu en CSS) */
.pile { position: relative; width: 100%; border-radius: 8px; overflow: hidden; background: #0f0e0c; }
.pile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }

/* ---------- Curseur d'étapes (partagé RA et 2D) ---------- */
.etapes { margin-top: 14px; }
.etapes input[type=range] { width: 100%; margin: 0; accent-color: var(--accent); height: 32px; }
.etapes-labels { display: flex; justify-content: space-between; gap: 4px; }
.etapes-labels button {
  background: none; border: 0; color: var(--texte-2); font: 400 .82rem "Open Sans", sans-serif;
  padding: 6px 2px; cursor: pointer; flex: 1; text-align: center;
}
.etapes-labels button:first-child { text-align: left; }
.etapes-labels button:last-child { text-align: right; }
.etapes-labels button.actif { color: var(--texte); font-weight: 600; }

/* ---------- RA ---------- */
#ra { position: fixed; inset: 0; overflow: hidden; background: #000; }
#ra-scene { position: absolute; inset: 0; }
#ra-scene a-scene { position: absolute; inset: 0; }

.bulle {
  position: absolute; left: 50%; top: max(20px, env(safe-area-inset-top)); transform: translateX(-50%);
  background: var(--verre); padding: .6rem 1rem; border-radius: 999px; font-size: .95rem; z-index: 10;
  white-space: nowrap;
}
.viseur { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 5; }
.viseur-cadre { width: 62vw; max-width: 320px; aspect-ratio: 903 / 1242; border: 2px dashed rgba(255,255,255,.75); border-radius: 10px; }
.viseur p { background: var(--verre); padding: .5rem .9rem; border-radius: 999px; margin-top: 16px; font-size: .95rem; }

.panneau {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--verre); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 12px var(--gouttiere) max(10px, env(safe-area-inset-bottom));
  border-radius: var(--rayon) var(--rayon) 0 0;
}
.panneau .entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panneau h2 { font-size: 1.2rem; margin: 0; }
.panneau .auteur { color: var(--texte-2); font-size: .8rem; margin: 0; }
.panneau .btn { flex: none; min-height: 44px; padding: 0 1.1rem; background: var(--accent); color: var(--accent-texte); font-size: .95rem; }
.panneau .etapes { margin-top: 6px; }

.lien-coin { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 12px; z-index: 15; font-size: .8rem; color: var(--texte); background: var(--verre); padding: 6px 10px; border-radius: 999px; text-decoration: none; }

/* MindAR ajoute sa vidéo dans le conteneur; on masque ses propres écrans (on gère les nôtres) */
.mindar-ui-overlay { display: none !important; }

/* ---------- Debug ---------- */
#debug {
  position: fixed; left: 6px; top: 52px; z-index: 50; pointer-events: none;
  background: rgba(0,0,0,.55); color: #9ef59e; font: 10px/1.35 ui-monospace, Menlo, Consolas, monospace;
  padding: 6px 8px; border-radius: 6px; white-space: pre; max-width: calc(100vw - 12px); overflow: hidden;
}
