* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none; /* Evita el menú contextual al mantener presionado en iOS */
}

body, html {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000000;
  touch-action: none; /* Bloquea pull-to-refresh y scroll */
  overscroll-behavior: none; 
}

#fondo-revelado {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050507;
  color: #e2e8f0;
  font-family: monospace;
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

#texto-central {
  padding: 20px;
  text-align: center;
  pointer-events: none;
}

#contenedor-collage {
  position: absolute;
  inset: 0;
  z-index: 2;
  touch-action: none;
}

.pieza-movil {
  position: absolute;
  top: 0;
  left: 0;
  /* Escalado orgánico: mínimo 65px para touch target, escala fluido hasta 130px */
  width: clamp(65px, 15vw, 130px);
  height: auto;
  touch-action: none;
  -webkit-user-drag: none; /* Bloquea el "ghost drag" nativo de imágenes */
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.85));
  border-radius: 2px;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

#lienzo-entramado {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  touch-action: none;
  filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.4)) contrast(110%);
}

#cortina-transicion {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#cortina-transicion.activa {
  opacity: 1;
  pointer-events: auto;
}