/* ----------------------------
   GLOBAL + A-FRAME CANVAS
---------------------------- */
html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  height: 100svh;               /* fixes iOS toolbar jump */
  overflow: hidden;
  touch-action: none;           /* no pinch/scroll on AR */
}

a-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
}

/* Fill screen, no white edges */
canvas,
.a-canvas,
video {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100svh !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  background: transparent !important;
  pointer-events: none !important; /* Allow clicks to pass through to buttons */
}

/* Re-enable pointer events for interactive A-Frame elements */
a-entity[clickable],
a-entity[class*="clickable"],
.face-button {
  pointer-events: auto !important;
}

a-image {
  image-rendering: auto;
  transform-origin: center;
}

/* ----------------------------
   HUD (glass panel UI)
---------------------------- */
#hud {
  display: none;                 /* Hidden by default - shown after 8 seconds */
  pointer-events: none;         /* Not clickable until active */
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  min-width: 280px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  color: #fff;
  font: 12px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  z-index: 1000;                /* High z-index to be above A-Frame canvas */
}
#hud.active { 
  display: flex; 
  pointer-events: auto;         /* Clickable when active */
  flex-direction: column; 
  gap: 8px; 
  align-items: center; 
  transition: all 0.3s ease;
}

#hud .main-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

#hud .sub-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
}

#hud.expanded .sub-buttons {
  opacity: 1;
  max-height: 40px;
  margin-top: 4px;
}

.sub-buttons .pill {
  flex: 1;
  height: 34px;
  font-size: 12px;
  padding: 0 10px;
  white-space: nowrap;
  min-width: 0;
}

.step { display: flex; align-items: center; gap: 8px; margin: 0; }
.badge{
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: #f49c2f; color: #fff; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.4);
}
.pill{
  flex: 1; height: 34px; padding: 0 14px;
  border-radius: 12px; border: 1.5px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.25); color: #fff;
  cursor: pointer; transition: transform .08s ease, background .15s ease;
  font-size: 12px;
  white-space: nowrap;
  min-width: 0;
}
.pill:hover { transform: translateY(-1px); background: rgba(255,255,255,.12); }
.pill:active{ transform: translateY(0); }

/* Safe-area breathing room on iPhones */
@supports (padding: max(0px)) {
  #hud {
    margin-bottom: max(16px, env(safe-area-inset-bottom));
    margin-right:  max(16px, env(safe-area-inset-right));
  }
}

/* ----------------------------
   CUSTOM TRACKER OVERLAY
---------------------------- */
#tracker-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0.5; /* 50% transparency */
}

#tracker-overlay img {
  position: relative !important;
  display: block !important;

  width: auto !important;
  height: auto !important;

  max-width: min(80vw, 80vh) !important;
  max-height: min(80vw, 80vh) !important;

  margin: 0 auto !important;

  object-fit: contain !important;
  object-position: center !important;
  image-rendering: auto !important;
}


#tracker-overlay.hidden {
  display: none;
}

/* ----------------------------
   WAN SLIDE NAVIGATION
---------------------------- */
.wan-navigation {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 20px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 15;
  pointer-events: auto;
}

.wan-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.wan-nav-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

.wan-nav-btn:active {
  transform: scale(0.95);
}

.wan-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wan-slide-indicator {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 0;
  text-align: center;
  writing-mode: horizontal-tb;
  min-width: 40px;
}
