*{
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #030304;
  font-family: 'Inter', sans-serif;
  color: #f3f1ec;
  user-select: none;
}

.atlas-tour {
  --red: #e30613;
  --cyan: #5bd8ff;
  --ivory: #f3f1ec;
  --muted: #96969e;
  --line: rgba(255, 255, 255, 0.14);
}

.tour-grain, .tour-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.tour-grain {
  z-index: 80;
  opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.tour-vignette {
  z-index: 30;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.85) 100%);
}

/* TOPBAR */
.tour-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 70px;
  padding: 0 clamp(16px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: linear-gradient(to bottom, rgba(3,3,4,0.92), rgba(3,3,4,0));
  pointer-events: none;
}

.tour-topbar > * { pointer-events: auto; }

.tour-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.tour-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(227,6,19,0.35));
}

.tour-brand span { display: flex; flex-direction: column; }
.tour-brand strong { font: 700 13px 'Space Grotesk', sans-serif; }
.tour-brand small { margin-top: 2px; color: var(--muted); font: 500 8px 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }

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

.btn-editor-toggle, .tour-exit-top {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5,5,6,0.6);
  backdrop-filter: blur(12px);
  color: #fff;
  text-decoration: none;
  font: 600 11px 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: .25s;
}

.btn-editor-toggle:hover, .tour-exit-top:hover {
  border-color: var(--red);
  background: rgba(227,6,19,0.18);
}

.btn-editor-toggle.active {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(227,6,19,0.6);
}

/* VIEWPORT & STAGE PANORAMIQUE DYNAMIQUE */
.tour-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  overflow: hidden;
  background: #000;
  cursor: grab;
  touch-action: none;
}

.tour-viewport:active {
  cursor: grabbing;
}

.tour-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  will-change: transform, filter, opacity;
}

/* STYLE PAYSAGE */
.tour-stage.is-landscape {
  height: 100vh;
  height: 100dvh;
  width: auto;
  min-width: 100vw;
}

.tour-stage.is-landscape img {
  height: 100dvh;
  width: auto;
  min-width: 100vw;
  object-fit: cover;
  display: block;
}

/* STYLE PORTRAIT (PHOTOS 7 & 8) */
.tour-stage.is-portrait {
  width: 100vw;
  height: auto;
  min-height: 100dvh;
}

.tour-stage.is-portrait img {
  width: 100vw;
  height: auto;
  min-height: 100dvh;
  object-fit: cover;
  display: block;
}

/* TRANSITIONS STREET VIEW */
.tour-stage.sv-zoom-out {
  transform: translate(-50%, -50%) scale(2.2) !important;
  opacity: 0;
  filter: blur(12px);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s, filter 0.4s;
}

.tour-stage.sv-zoom-in {
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  filter: blur(8px);
}

/* CALQUE HOTSPOTS */
.tour-hotspots-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

body.is-editor-mode .tour-hotspots-layer {
  pointer-events: auto !important;
  cursor: crosshair;
}

.tour-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

/* HOTSPOT NAVIGATION */
.tour-hotspot.nav .hotspot-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(227, 6, 19, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.95);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 25px rgba(227, 6, 19, 0.7);
  backdrop-filter: blur(6px);
  transition: transform 0.25s, background 0.25s;
  animation: pulseNav 2s infinite;
}

@keyframes pulseNav {
  0% { box-shadow: 0 0 0 0 rgba(227, 6, 19, 0.8); }
  70% { box-shadow: 0 0 0 16px rgba(227, 6, 19, 0); }
  100% { box-shadow: 0 0 0 0 rgba(227, 6, 19, 0); }
}

.tour-hotspot.nav:hover .hotspot-icon {
  transform: scale(1.22);
  background: #ff0022;
}

/* HOTSPOT INFO / MATÉRIEL */
.tour-hotspot.info .hotspot-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(3, 3, 6, 0.8);
  border: 1.5px solid rgba(91, 216, 255, 0.95);
  color: var(--cyan);
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px rgba(91, 216, 255, 0.45);
  backdrop-filter: blur(6px);
  transition: transform 0.25s, background 0.25s;
}

.tour-hotspot.info:hover .hotspot-icon {
  transform: scale(1.2);
  background: rgba(91, 216, 255, 0.3);
  border-color: #fff;
}

.tour-hotspot span {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(3, 3, 5, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font: 600 10px 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  color: #f3f1ec;
}

.btn-delete-hp {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff003c;
  color: #fff;
  border: 1px solid #fff;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 20;
}

/* TOGGLE BOUTON MENU INFÉRIEUR */
.btn-toggle-menu {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 55;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: rgba(7, 7, 10, 0.85);
  backdrop-filter: blur(14px);
  color: #fff;
  font: 600 11px 'Space Grotesk', sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: .25s;
}

.btn-toggle-menu:hover {
  border-color: var(--red);
  background: rgba(227,6,19,0.2);
}

/* BANDEAU INFÉRIEUR */
.tour-info-panel {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 50;
  width: min(840px, calc(100% - 24px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  background: rgba(7, 7, 10, 0.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s;
}

/* ÉTAT MASQUÉ */
.tour-info-panel.is-hidden {
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
}

.tour-info-index {
  font: 700 26px 'Space Grotesk', sans-serif;
  color: var(--red);
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,0.12);
}

.tour-info-copy span {
  color: var(--red);
  font: 600 9px 'JetBrains Mono', monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tour-info-copy h1 {
  margin: 2px 0;
  font: 700 clamp(16px, 2.2vw, 24px)/1.1 'Space Grotesk', sans-serif;
}

.tour-info-copy p {
  margin: 0;
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

.tour-quick-nav {
  display: flex;
  gap: 6px;
  max-width: 240px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tour-quick-nav button {
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  font: 600 9px 'JetBrains Mono', monospace;
  cursor: pointer;
  white-space: nowrap;
  transition: .2s;
}

.tour-quick-nav button.active, .tour-quick-nav button:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* MODALES */
.tour-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.tour-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.tour-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
}

.tour-modal-card {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  border: 1px solid rgba(91, 216, 255, 0.35);
  border-radius: 22px;
  background: #0b0b0f;
  box-shadow: 0 30px 90px rgba(0,0,0,0.8);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-modal.is-open .tour-modal-card {
  transform: translateY(0) scale(1);
}

.tour-modal-media {
  width: 100%;
  height: 220px;
  background: #050507;
}

.tour-modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tour-modal-content { padding: 24px; }
.tour-modal-content span { color: var(--cyan); font: 600 9px 'JetBrains Mono', monospace; letter-spacing: .14em; text-transform: uppercase; }
.tour-modal-content h2 { margin: 6px 0 10px; font: 700 22px 'Space Grotesk', sans-serif; color: #fff; }
.tour-modal-content p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 13px; }

.tour-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  background: rgba(3,3,4,0.7);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 15px;
}

.editor-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font: 600 11px 'JetBrains Mono', monospace;
  color: #bbb;
}

.editor-form input, .editor-form select, .editor-form textarea {
  width: 100%;
  padding: 10px 12px;
  background: #050508;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font: 500 13px 'Inter', sans-serif;
  outline: none;
}

.editor-form input:focus, .editor-form select:focus, .editor-form textarea:focus {
  border-color: var(--red);
}

.btn-editor-submit {
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font: 700 13px 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: .2s;
  margin-top: 10px;
}

.btn-editor-submit:hover {
  background: #ff0022;
  box-shadow: 0 0 20px rgba(227,6,19,0.5);
}

.editor-toolbar {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(227, 6, 19, 0.92);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  font: 600 11px 'JetBrains Mono', monospace;
  color: #fff;
}

.editor-toolbar button {
  padding: 5px 12px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: rgba(0,0,0,0.3);
  color: #fff;
  font: 600 10px 'JetBrains Mono', monospace;
  cursor: pointer;
}

@media (max-width: 768px) {
  .tour-info-panel {
    bottom: 10px;
    width: calc(100% - 16px);
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 14px;
  }
  .tour-info-index { display: none; }
  .tour-quick-nav { max-width: 100%; }
}