/* ─── Base del repo (R2: body transparente, 8th Wall pinta la cámara detrás) ── */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --red: #c8102e;
  --red-dark: #8a0a1f;
  --gold: #e8b65a;
  --ui-font: Impact, 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
}

html {
  background: #000;
  height: 100%;
}

body {
  background: transparent;
  margin: 0;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

a-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* <video> de cámara que inyecta 8th Wall (sin id). Los vídeos de las
   pantallas (id="vid-*") viven en <a-assets> y no se muestran en el DOM. */
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;
}

/* ─── Pantalla de carga ─────────────────────────────────────────────────── */
#loading {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #2a0508 0%, #000 70%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 16px;
}

#loading-logo {
  max-width: 60%;
  max-height: 40%;
  margin-bottom: 1.5rem;
}

#loading-title {
  margin: 0 0 2rem;
  color: #f2e6dc;
  font-family: var(--ui-font);
  font-size: 1rem;
  letter-spacing: 0.25em;
  text-align: center;
}

#loading-title span {
  display: block;
  margin-top: 0.3rem;
  color: var(--gold);
  font-size: 1.9rem;
  letter-spacing: 0.12em;
}

#continuar-btn {
  background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  border: 2px solid #ff4d5e;
  padding: 0.9rem 2.6rem;
  font-family: var(--ui-font);
  font-size: 1.35rem;
  letter-spacing: 0.15em;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(200, 16, 46, 0.55);
}

#continuar-btn:active {
  transform: scale(0.97);
}

#continuar-btn:disabled {
  opacity: 0.7;
}

/* ─── Indicación "APUNTA AL MARCADOR" ───────────────────────────────────── */
#hint {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(6vh + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 0.6rem 1.2rem;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(200, 16, 46, 0.8);
  border-radius: 6px;
  color: #fff;
  font-family: var(--ui-font);
  letter-spacing: 0.15em;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

body[data-state="RUNNING"]:not(.marker-found) #hint {
  display: block;
}

/* ─── Botones flotantes ─────────────────────────────────────────────────── */
#recenterButtonContainer {
  position: absolute;
  width: 10vmin;
  height: 10vmin;
  right: 2vmax;
  top: calc(2vmax + env(safe-area-inset-top));
  pointer-events: auto;
  z-index: 200;
}

#recenterButtonContainer img {
  pointer-events: none;
  max-height: 10vmin;
  filter: drop-shadow(1px 1px 7px #00000026);
}

#music-btn {
  position: absolute;
  left: 2vmax;
  top: calc(2vmax + env(safe-area-inset-top));
  width: 48px;
  height: 48px;
  padding: 11px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(200, 16, 46, 0.75);
  z-index: 200;
  cursor: pointer;
}

#music-btn svg {
  width: 100%;
  height: 100%;
  fill: #fff;
}

#music-btn .icon-off,
#music-btn.muted .icon-on {
  display: none;
}

#music-btn.muted .icon-off {
  display: block;
}

#music-btn.muted {
  background: rgba(0, 0, 0, 0.55);
}

.pulse-once {
  animation: pulse-once 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86) both;
}
@keyframes pulse-once {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.8); }
  100% { transform: scale(1); }
}
