:root {
  color-scheme: dark;
  --chrome: rgba(8, 12, 18, 0.72);
  --chrome-border: rgba(255, 255, 255, 0.18);
  --focus: #7dd3fc;
  --stage-max-height: calc(100dvh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  --return-size: 90px; /* Tamaño fijo según tu requerimiento */
  --return-inset-x: clamp(8px, 2.8%, 42px);
  --return-inset-y: clamp(8px, 3.2%, 34px);
}

* { box-sizing: border-box; }

html, body, #app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  background: #05070a;
  color: #fff;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

#app {
  display: grid;
  min-height: 100dvh;
  place-items: center;
}

.stage {
  position: relative;
  width: min(100vw, calc(var(--stage-max-height) * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: var(--stage-max-height);
  background: #000;
  overflow: hidden;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.45);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 650ms ease;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.slide-image, .video-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- CAPAS DE INTERACCIÓN (HOTSPOTS) --- */
.hotspot {
  position: absolute;
  left: var(--left);
  top: var(--top);
  width: var(--width);
  height: var(--height);
  border: 0;
  padding: 0;
  cursor: pointer !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
  display: block !important;
  background: rgba(255, 255, 255, 0.01);
}

/* --- BOTONES VOLVER Y MENÚ --- */
.slide-return, .back-return, .menu-return {
  position: absolute !important;
  top: var(--return-inset-y);
  width: 90px !important;
  height: 90px !important;
  z-index: 10000 !important;
  cursor: pointer !important;
  pointer-events: auto !important; /* IMPORTANTE: Ahora sí recibe clics */
  background-color: transparent !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  border: none !important;
  color: transparent !important;
  font-size: 0 !important;
}

.back-return { 
  background-image: url('images/boton_volver.png') !important; 
  left: var(--return-inset-x); 
}

.menu-return { 
  background-image: url('images/boton_menu.png') !important; 
  right: var(--return-inset-x); 
}

.back-return-stacked {
  top: calc(var(--return-inset-y) + 90px + 15px) !important;
  right: var(--return-inset-x);
  left: auto;
}

/* Diapositiva 26 específica */
[data-slide="25"] .back-return { left: 20px !important; top: 90px !important; }
[data-slide="25"] .menu-return { right: 20px !important; top: 90px !important; }

/* BARRA DE CONTROLES */
.controls {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--chrome);
  border-radius: 8px;
  transform: translateX(-50%);
  opacity: 0.3;
  transition: opacity 0.3s;
}
.controls:hover { opacity: 1; }

#counter { color: white; padding: 0 10px; font-size: 14px; }

/* TIERRA ARRASADA PARA TOOLTIPS */
body > div:not(#app):not(.stage) { display: none !important; }