/* EduGenZ Spatial 3D & Meta Quest 3 WebXR HUD + Virtual Joysticks + F8 Modal */
:root {
  --vr-ink: #f0f6f4;
  --vr-surface: rgba(18, 36, 52, 0.86);
  --vr-border: rgba(142, 184, 178, 0.36);
  --vr-accent: #39a287;
  --vr-gold: #e5b454;
}

/* Single-Row Top Bar (GWI Law L1: height <= 48px, <= 7 controls) */
#edugenz-vr-topbar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--vr-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--vr-border);
  border-radius: 999px;
  z-index: 9000;
  color: var(--vr-ink);
  font: 600 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 8px 26px rgba(9, 20, 30, 0.28);
  user-select: none;
}

#edugenz-vr-topbar a,
#edugenz-vr-topbar button,
#edugenz-vr-topbar select {
  font: 600 12.5px/1 system-ui, -apple-system, sans-serif;
  color: var(--vr-ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 7px 12px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

#edugenz-vr-topbar select {
  padding-right: 24px;
  background-color: rgba(24, 48, 68, 0.95);
}

#edugenz-vr-topbar a:hover,
#edugenz-vr-topbar button:hover,
#edugenz-vr-topbar select:hover {
  background: rgba(255, 255, 255, 0.17);
  border-color: rgba(255, 255, 255, 0.32);
}

#edugenz-vr-topbar button.vr-cta {
  background: linear-gradient(135deg, #278069, #39a287);
  border-color: #72d6b9;
  color: #ffffff;
}

#edugenz-vr-topbar button.vr-active {
  background: rgba(229, 180, 84, 0.22);
  border-color: var(--vr-gold);
  color: #ffe6ad;
}

/* Subtle coordinates & controls hint pill at bottom center */
#edugenz-vr-status {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 30, 44, 0.78);
  border: 1px solid rgba(142, 184, 178, 0.28);
  color: #d6e7e3;
  font: 500 12px/1.2 system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  z-index: 8900;
  pointer-events: none;
  white-space: nowrap;
}

/* Twin Virtual Joysticks for Desktop / Touch 3D Walk Preview */
.vr-joy-zone {
  position: fixed;
  bottom: 14px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(25, 52, 74, 0.55), rgba(14, 29, 43, 0.82));
  border: 2px solid rgba(132, 192, 182, 0.42);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26), inset 0 0 18px rgba(57, 162, 135, 0.16);
  z-index: 8950;
  touch-action: none;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#vrJoyLeft { left: 16px; }
#vrJoyRight { right: 16px; }

.vr-joy-ring {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(175, 218, 210, 0.28);
  pointer-events: none;
}

.vr-joy-knob {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #6ce0c1, #267862);
  border: 2px solid #c9f7ea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38);
  transform: translate(0px, 0px);
  pointer-events: none;
  transition: transform 0.04s linear;
}

#vrJoyRight .vr-joy-knob {
  background: radial-gradient(circle at 35% 35%, #f5cd79, #9f7122);
  border-color: #fff0cc;
}

.vr-joy-caption {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font: 600 11px/1 system-ui, -apple-system, sans-serif;
  color: #e6f3f0;
  background: rgba(15, 30, 44, 0.78);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(142, 184, 178, 0.28);
  pointer-events: none;
}

/* Island Teleport Bar for Room 1 */
#vr-island-bar {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 36, 52, 0.80);
  border: 1px solid rgba(142, 184, 178, 0.30);
  z-index: 8900;
}

#vr-island-bar button {
  font: 600 11.5px/1 system-ui, sans-serif;
  color: #e7f3f0;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}

#vr-island-bar button:hover,
#vr-island-bar button.active {
  background: rgba(57, 162, 135, 0.38);
  border-color: #7fe0c5;
}

/* Center Reticle Crosshair in 3D Walk Mode */
#vr-reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  background: rgba(57, 162, 135, 0.35);
  pointer-events: none;
  z-index: 8800;
}

/* F8 In-App Modal Sheet */
#edugenz-vr-f8-modal[hidden] { display: none !important; }
#edugenz-vr-f8-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vr-f8-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 30, 0.68);
  backdrop-filter: blur(5px);
}
.vr-f8-sheet {
  position: relative;
  width: min(1280px, 94vw);
  height: min(860px, 90vh);
  background: #f6f8f5;
  border-radius: 18px;
  border: 1px solid #9ab5ae;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.vr-f8-bar {
  min-height: 52px;
  padding: 6px 16px;
  background: #173347;
  color: #f1f7f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font: 600 13.5px/1 system-ui, sans-serif;
}
.vr-f8-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vr-f8-watch-pill {
  font: 600 12px/1.2 system-ui, sans-serif;
  color: #d6e9e4;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(159, 217, 206, 0.35);
  border-radius: 999px;
  padding: 6px 11px;
  white-space: nowrap;
}
.vr-f8-watch-pill.connected {
  background: rgba(16, 185, 129, 0.22);
  border-color: #6ee7b7;
  color: #d1fae5;
}
.vr-f8-watch-pill.warn {
  background: rgba(229, 180, 84, 0.22);
  border-color: #fbbf24;
  color: #fef3c7;
}
.vr-f8-btn {
  background: #1f5c52;
  color: #ffffff;
  border: 1px solid rgba(142, 240, 212, 0.45);
  border-radius: 999px;
  padding: 7px 12px;
  font: 600 12px/1 system-ui, sans-serif;
  cursor: pointer;
}
.vr-f8-btn:hover {
  background: #277366;
}
.vr-f8-close {
  background: #2c526d;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 7px 14px;
  font: 600 12.5px/1 system-ui, sans-serif;
  cursor: pointer;
}
.vr-f8-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #ffffff;
}

.vr-learner-pill {
  font: 600 12px/1 system-ui, sans-serif;
  color: #ffe6ad;
  background: rgba(229, 180, 84, 0.16);
  border: 1px solid rgba(229, 180, 84, 0.4);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

/* Force Room 1 desktop chrome hidden when in full-bleed 3D Spatial Canvas mode */
body.vr-spatial-room1 .topbar,
body.vr-spatial-room1 .mission-bar,
body.vr-spatial-room1 .work-panel,
body.vr-spatial-room1 .scene-top,
body.vr-spatial-room1 .scene-caption {
  display: none !important;
}
body.vr-spatial-room1 .play-layout {
  padding: 0 !important;
  display: block !important;
  height: 100vh !important;
  max-height: none !important;
}
body.vr-spatial-room1 .world {
  position: fixed !important;
  inset: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
