/* Minimal reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Black background for areas the camera doesn't cover */
html {
  background: #000;
  height: 100%;
}

/* body must be transparent — 8th Wall renders the camera feed behind the scene */
body {
  background: transparent;
  margin: 0;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

/* A-Frame scene fills the full viewport */
a-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/*
  8th Wall injects a camera <video> into the DOM (no id attribute).
  :not([id]) avoids matching our asset videos (id="vid-marker1" etc.).
  object-fit:cover fills portrait screens without black bars.
*/
video:not([id]) {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: -2;
}

/* Loading overlay */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  text-align: center;
  padding: 24px;
  gap: 40px;
}

#loading-logo {
  width: min(440px, 85vw);
  height: auto;
  flex-shrink: 0;
}

#loading-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#loading-text {
  font-size: 16px;
  opacity: 0.85;
  margin: 0;
  letter-spacing: 0.04em;
}

/* CONTINUAR button — oculto hasta que el AR esté listo */
#continuar-btn {
  display: none;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 14px 48px;
  border-radius: 40px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.2s, border-color 0.2s;
}

#continuar-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

/* Fase "listo": ocultar spinner+texto, mostrar botón */
#loading.ready #loading-body {
  display: none;
}

#loading.ready #continuar-btn {
  display: block;
  animation: btn-appear 0.4s ease both;
}

@keyframes btn-appear {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* CSS-only spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hint bar — oculto por defecto */
#hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 14px;
  white-space: nowrap;
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

body[data-state="AWAITING_MARKER"] #hint {
  display: block;
  opacity: 1;
}

body[data-state="RUNNING"] #hint {
  display: none;
}

/* Version badge — esquina inferior izquierda */
#version-badge {
  position: fixed;
  bottom: 8px;
  left: 8px;
  font-family: monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  z-index: 9998;
}
