:root {
  --navy: #0b1b2b;
  --navy-2: #12283d;
  --glass: rgba(10, 24, 38, 0.72);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4efe6;
  --muted: #b9c3cc;
  --gold: #e8b04b;
  --gold-2: #f3cd7a;
  --terra: #d9734e;
  --sea: #36b3c9;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--navy); color: var(--text);
  font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { opacity: 0; pointer-events: none; }

/* ---------- Boutons ---------- */
.btn { border: 0; cursor: pointer; font: 600 15px Inter, sans-serif; color: var(--text);
  border-radius: 999px; padding: 12px 20px; display: inline-flex; align-items: center; gap: 10px;
  justify-content: center; text-decoration: none; transition: transform .15s, background .2s, opacity .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.gold { background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--terra)); color: #1c1305;
  box-shadow: 0 8px 28px rgba(232, 176, 75, .35); }
.btn.ghost { background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.btn.big { padding: 16px 28px; font-size: 17px; }
.btn.small { padding: 8px 16px; font-size: 14px; }

/* ---------- Accueil ---------- */
#intro { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 20;
  background: radial-gradient(ellipse at 50% 120%, rgba(11,27,43,.2), rgba(11,27,43,.85) 70%);
  transition: opacity .9s; }
.intro-card { max-width: 720px; text-align: center; }
.kicker { text-transform: uppercase; letter-spacing: .28em; font-size: 12px; color: var(--gold); font-weight: 600; }
#intro h1 { font-family: "Playfair Display", serif; font-weight: 800; font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05; margin: 14px 0 18px; text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.lead { color: var(--muted); font-size: clamp(15px, 2vw, 19px); line-height: 1.6; max-width: 580px; margin: 0 auto; }
.choose { margin: 30px 0 12px; font-size: 13px; color: var(--muted); }
.intro-langs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.intro-langs button, .lang-switch button { cursor: pointer; border: 1px solid var(--line); background: rgba(255,255,255,.06);
  color: var(--text); border-radius: 14px; padding: 10px 16px; font: 500 15px Inter, sans-serif; transition: all .2s; }
.intro-langs button.on, .lang-switch button.on { border-color: var(--gold); background: rgba(232,176,75,.18); color: var(--gold-2); }
.loader { width: 220px; height: 3px; background: rgba(255,255,255,.12); border-radius: 3px; margin: 24px auto 8px; overflow: hidden; }
#loadBar { height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.load-text { font-size: 12px; color: var(--muted); }

/* ---------- Barre du haut ---------- */
#topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-between;
  align-items: center; padding: 14px 20px; background: linear-gradient(rgba(11,27,43,.75), transparent); transition: opacity .6s; }
.brand { font-family: "Playfair Display", serif; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.lang-switch { display: flex; gap: 4px; background: rgba(0,0,0,.25); padding: 4px; border-radius: 14px; }
.lang-switch button { padding: 6px 10px; font-size: 13px; border-radius: 10px; border-color: transparent; }

/* ---------- Libellés 3D ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.pin { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; white-space: nowrap;
  font: 600 12px Inter, sans-serif; padding: 6px 10px 6px 6px; border-radius: 999px; background: var(--glass);
  border: 1px solid var(--line); backdrop-filter: blur(6px); display: flex; align-items: center; gap: 7px; transition: opacity .3s, background .3s; }
.pin b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #1c1305; font-size: 11px; }
.pin.active { background: rgba(232,176,75,.95); color: #1c1305; }
.pin.active b { background: #1c1305; color: var(--gold); }
.pin.visited b { background: var(--sea); }

/* ---------- Transition ---------- */
.transit { position: fixed; left: 50%; top: 84px; transform: translate(-50%, -20px); z-index: 8; opacity: 0;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); border-radius: 18px;
  padding: 12px 22px; text-align: center; transition: all .5s; display: flex; flex-direction: column; gap: 2px; }
.transit.show { opacity: 1; transform: translate(-50%, 0); }
.transit-label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.transit strong { font-family: "Playfair Display", serif; font-size: 22px; }
.transit span:last-child { font-size: 13px; color: var(--muted); }

/* ---------- Panneau ---------- */
.panel { position: fixed; right: 20px; top: 76px; bottom: 96px; width: min(420px, calc(100vw - 40px)); z-index: 9;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); border-radius: 24px;
  display: flex; flex-direction: column; overflow: hidden; transform: translateX(120%); transition: transform .7s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.panel.show { transform: translateX(0); }
.gallery { position: relative; height: 38%; min-height: 180px; overflow: hidden; background: #000; flex-shrink: 0; }
.gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s; }
.gallery img.on { opacity: 1; animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.14) translate(-2%, -2%); } }
.gallery::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(10,24,38,.95)); pointer-events: none; }
.gallery-count { position: absolute; top: 14px; left: 14px; z-index: 2; font: 600 12px Inter; letter-spacing: .12em;
  background: rgba(0,0,0,.5); padding: 6px 12px; border-radius: 999px; }
.credit { position: absolute; bottom: 6px; right: 10px; z-index: 2; font-size: 9px; color: rgba(255,255,255,.5); }
.panel-body { padding: 16px 26px 12px; overflow-y: auto; flex: 1; }
.tag { color: var(--gold); font-style: italic; font-family: "Playfair Display", serif; font-size: 16px; }
.panel h2 { font-family: "Playfair Display", serif; font-size: 30px; line-height: 1.1; margin: 4px 0 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chips span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(54,179,201,.15); color: #9fe3ef; border: 1px solid rgba(54,179,201,.3); }
.narration { font-size: 15.5px; line-height: 1.7; color: var(--muted); }
.narration .s { transition: color .3s, background .3s; border-radius: 4px; }
.narration .s.now { color: var(--text); background: rgba(232,176,75,.16); box-shadow: 0 0 0 3px rgba(232,176,75,.16); }
.panel-controls { display: flex; gap: 8px; padding: 14px 20px 6px; border-top: 1px solid var(--line); }
.panel-controls .btn { flex: 1; }
#prevBtn { flex: 0 0 48px; font-size: 22px; padding: 10px; }
.voice { background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; height: 4px; background: var(--gold); border-radius: 2px; }
.speaking .eq i { animation: eq .8s infinite ease-in-out; }
.speaking .eq i:nth-child(2) { animation-delay: .2s } .speaking .eq i:nth-child(3) { animation-delay: .4s } .speaking .eq i:nth-child(4) { animation-delay: .1s }
@keyframes eq { 0%,100% { height: 4px } 50% { height: 14px } }
.auto { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 22px 16px; cursor: pointer; }
.auto input { accent-color: var(--gold); width: 16px; height: 16px; }

/* ---------- Frise ---------- */
.timeline { position: fixed; left: 20px; right: 460px; bottom: 22px; z-index: 9; display: flex; gap: 6px; overflow-x: auto;
  padding: 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(10px);
  transition: opacity .6s; scrollbar-width: none; }
.timeline button { flex: 1 0 auto; cursor: pointer; background: transparent; border: 0; color: var(--muted); font: 500 12px Inter;
  padding: 8px 12px; border-radius: 12px; display: flex; align-items: center; gap: 6px; white-space: nowrap; transition: all .2s; }
.timeline button b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 11px; }
.timeline button.visited b { background: var(--sea); color: #04222a; }
.timeline button.on { background: rgba(232,176,75,.18); color: var(--gold-2); }
.timeline button.on b { background: var(--gold); color: #1c1305; }
.hint { position: fixed; left: 24px; bottom: 90px; font-size: 12px; color: rgba(255,255,255,.55); z-index: 6; transition: opacity .6s; }

/* ---------- Réservation ---------- */
.book { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  background: rgba(5,12,20,.6); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .6s; }
.book.show { opacity: 1; pointer-events: auto; }
.book-card { position: relative; max-width: 560px; text-align: center; background: var(--glass); border: 1px solid var(--line);
  border-radius: 28px; padding: 44px 32px 30px; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.book-card h2 { font-family: "Playfair Display", serif; font-size: clamp(28px, 4.5vw, 42px); line-height: 1.1; margin: 12px 0 14px; }
.book-card p { color: var(--muted); line-height: 1.6; }
.book-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px 0 16px; }
.close { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: var(--muted); font-size: 28px; cursor: pointer; }
.link { background: none; border: 0; color: var(--gold); cursor: pointer; font: 500 14px Inter; text-decoration: underline; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .panel { top: auto; bottom: 0; right: 0; left: 0; width: 100%; height: 58vh; border-radius: 24px 24px 0 0; transform: translateY(110%); }
  .panel.show { transform: translateY(0); }
  .gallery { height: 30%; min-height: 120px; }
  .panel h2 { font-size: 24px; }
  .timeline { display: none; }
  .hint { display: none; }
  .brand { font-size: 16px; }
  #bookTop { display: none; }
  .transit { top: 70px; }
}

/* ---------- Ajouts : marque, départs, voix, photos ---------- */
#scene { filter: saturate(1.12) contrast(1.06); }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(5,12,20,.45)); }
.intro-brand { font-family: "Playfair Display", serif; font-size: clamp(22px, 3.2vw, 30px); font-weight: 800;
  color: var(--gold-2); letter-spacing: .02em; margin-bottom: 14px; text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.intro-brand::before, .intro-brand::after { content: "✦"; font-size: .55em; margin: 0 12px; vertical-align: middle; color: var(--gold); }
.intro-departs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.intro-departs button { cursor: pointer; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text);
  border-radius: 16px; padding: 12px 16px; font: 500 15px Inter, sans-serif; display: flex; align-items: center; gap: 8px; transition: all .2s; }
.intro-departs button.on { border-color: var(--gold); background: rgba(232,176,75,.18); color: var(--gold-2); }
.intro-departs button span { font-size: 20px; }
.intro-langs { margin-bottom: 4px; }
.brand { font-weight: 800; letter-spacing: .01em; color: var(--gold-2); }
.voice-switch { display: flex; align-items: center; gap: 2px; background: rgba(0,0,0,.25); padding: 4px 4px 4px 10px; border-radius: 14px; font-size: 13px; }
.voice-switch button { cursor: pointer; border: 1px solid transparent; background: none; color: var(--text); border-radius: 10px; padding: 5px 10px; font-size: 14px; }
.voice-switch button.on { border-color: var(--gold); background: rgba(232,176,75,.18); color: var(--gold-2); }
.gallery { cursor: zoom-in; height: 42%; }
.gallery img { filter: saturate(1.1) contrast(1.05); }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; transition: all .3s; }
.dots i.on { width: 20px; border-radius: 4px; background: var(--gold); }
.narration .s { cursor: pointer; }
.lightbox { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.92); display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .4s; cursor: zoom-out; }
.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 20px 80px rgba(0,0,0,.6); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); border: 1px solid var(--line);
  color: #fff; font-size: 34px; width: 54px; height: 54px; border-radius: 50%; cursor: pointer; }
.lb-nav.prev { left: 20px; } .lb-nav.next { right: 20px; }
@media (max-width: 820px) { .voice-switch span { display: none; } .gallery { height: 34%; } }

/* ---------- Sélecteur de langues ---------- */
.lang-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 auto 8px; max-width: 700px; }
.lang-card { position: relative; cursor: pointer; text-align: center; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.02)); color: var(--text);
  padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .2s, border-color .2s, background .2s, box-shadow .2s; }
.lang-card:hover { transform: translateY(-2px); border-color: rgba(232,176,75,.5); }
.lang-card.on { border-color: var(--gold); background: linear-gradient(160deg, rgba(232,176,75,.28), rgba(232,176,75,.06)); box-shadow: 0 8px 30px rgba(232,176,75,.25); }
.lang-card.on::after { content: "✓"; position: absolute; top: 8px; left: 10px; font-size: 12px; color: var(--gold-2); font-weight: 700; }
.lang-card .flag { font-size: 30px; line-height: 1.1; }
.lang-card .native { font: 600 15px Inter, system-ui, sans-serif; }
.lang-card .hello { font-family: "Playfair Display", serif; font-style: italic; font-size: 13px; color: var(--gold-2); opacity: .9; }
.lang-card .play { position: absolute; top: 7px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; background: rgba(255,255,255,.12); color: var(--text); transition: all .2s; }
.lang-card .play:hover { background: var(--gold); color: #1c1305; }
.lang-card .play.playing { background: var(--gold); color: #1c1305; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,176,75,.6); } 50% { box-shadow: 0 0 0 7px rgba(232,176,75,0); } }
#intro { overflow-y: auto; }
.intro-card { padding: 24px 0; }
.lang-btn { cursor: pointer; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.3);
  color: var(--text); border-radius: 14px; padding: 7px 12px; font: 500 14px Inter, system-ui, sans-serif; }
.lang-btn span { font-size: 18px; } .lang-btn i { font-style: normal; opacity: .6; font-size: 11px; }
.lang-modal { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 16px; background: rgba(5,12,20,.6);
  backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .35s; }
.lang-modal.show { opacity: 1; pointer-events: auto; }
.lang-modal-card { position: relative; width: min(760px, 100%); max-height: 90vh; overflow-y: auto; background: var(--glass); border: 1px solid var(--line);
  border-radius: 26px; padding: 30px 22px 22px; text-align: center; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.lang-modal-card .kicker { margin-bottom: 18px; }

/* ---------- Pause ---------- */
.pause-btn { cursor: pointer; display: flex; align-items: center; gap: 8px; border: 1px solid var(--gold); background: rgba(232,176,75,.12);
  color: var(--gold-2); border-radius: 14px; padding: 7px 14px; font: 600 14px Inter, system-ui, sans-serif; transition: all .2s; }
.pause-btn.on { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1c1305; }
.paused-badge { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); z-index: 25; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 40px; border-radius: 26px;
  background: var(--glass); border: 1px solid var(--gold); backdrop-filter: blur(12px); opacity: 0; pointer-events: none; transition: all .35s; }
.paused-badge b { font-size: 40px; color: var(--gold-2); }
.paused-badge span { font-family: "Playfair Display", serif; font-size: 22px; }
.paused-badge small { color: var(--muted); font-size: 13px; }
.is-paused .paused-badge { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.is-paused #scene { filter: saturate(.7) brightness(.75); transition: filter .4s; }

@media (max-width: 820px) {
  .lang-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lang-card { padding: 10px 4px; } .lang-card .flag { font-size: 24px; } .lang-card .native { font-size: 13px; } .lang-card .hello { font-size: 11px; }
  .lang-btn { padding: 6px 9px; font-size: 0; } .lang-btn span { font-size: 18px; } .lang-btn i { font-size: 10px; }
  .pause-btn #pauseLabel { display: none; }
}
@media (max-width: 420px) { .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lang-card { background: linear-gradient(160deg, rgba(22,40,58,.92), rgba(10,24,38,.88)); }
.lang-card.on { background: linear-gradient(160deg, rgba(92,70,30,.95), rgba(40,32,18,.92)); }
body:not(.started) #labels { opacity: 0; }
.attribution { position: fixed; left: 8px; bottom: 4px; z-index: 4; font-size: 9px; color: rgba(255,255,255,.45); pointer-events: none; }
