/* ====== Base ====== */
body {
  margin: 0;
  overflow: hidden;
  background-color: black;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  color: white;
}

/* Contenedor raíz (pantallas de consentimiento / UI general) */
#app-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-color: black;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 5; /* Muy por debajo del overlay/calibración */
}

/* ====== Capa de calibración ====== */
/* Overlay para encuadre + calibración */
#overlay {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  z-index: 1000;             /* Por encima del video/canvas */
  pointer-events: none;      /* No interfiere con eventos */
  background: transparent;
}

/* Óvalo de verificación facial */
#oval {
  position: fixed;           /* Relativo al viewport, no al contenedor */
  left: 50%;
  top: 50%;
  width: 300px;
  height: 420px;
  margin-left: -150px;
  margin-top: -210px;
  border: 3px solid lime;
  border-radius: 50%;
  z-index: 1001;             /* Debajo del emoji, encima del overlay */
  box-shadow: 0 0 12px rgba(0,255,0,0.5);
}

/* Emoji que sigue la mirada */
#emoji {
  position: fixed;
  width: 40px;
  height: 40px;
  z-index: 1002;             /* Encima del óvalo y del overlay */
  pointer-events: none;
  will-change: left, top, transform;
  transform: translate(-50%, -50%);
  line-height: 40px;
}

/* Texto de estado */
#statusText {
  position: fixed;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  text-align: center;
  color: white;
  font-size: 28px;
  font-weight: bold;
  z-index: 1002;
  text-shadow: 0 0 6px rgba(0,0,0,0.7);
}

/* Cuenta regresiva dentro del óvalo */
#ovalCountdown {
  position: fixed;
  left: 50%;
  top: calc(50% + 140px);
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: bold;
  color: white;
  z-index: 1002;
  text-shadow: 0 0 6px rgba(0,0,0,0.7);
}

/* Punto rojo de calibración */
.punto {
  position: fixed;
  width: 30px;
  height: 30px;
  background-color: red;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  color: white;
  font-weight: bold;
  animation: pulse 1.2s infinite;
  z-index: 1003;             /* Encima del emoji (si se superponen) */
  box-shadow: 0 0 10px rgba(255,0,0,0.6);
}

@keyframes pulse {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* Mensaje final centrado (post-calibración) */
.mensaje-final {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  color: white;
  z-index: 1100;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

/* ====== Video en esquina ====== */
#webgazerVideoFeed {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 240px;
  height: 180px;
  border: 2px solid lime;
  z-index: 100;
  background: black;
  object-fit: cover;
}

/* ====== Ocultar duplicados ====== */
#webgazerVideoCanvas,
#webgazerFaceOverlay,
#webgazerFaceFeedbackBox,
#webgazerGazeDot {
  display: none !important;
}

/* ====== (Opcional) Ajustes de accesibilidad visual ====== */
@media (prefers-reduced-motion: reduce) {
  .punto {
    animation: none;
  }
}
