html,body{
  width:100%;
  height:100%;
  margin:0;
  overflow:hidden;
  background:#000;
  color:#fff;
  font-family:Arial,Helvetica,sans-serif;
  touch-action:none;
}
*{box-sizing:border-box}
button{font:inherit}
#viewer{position:fixed;inset:0}
canvas{display:block;width:100%;height:100%}
#fade{
  position:fixed;
  inset:0;
  z-index:20;
  pointer-events:none;
  background:#000;
  opacity:1;
  transition:opacity .42s ease;
}
#topbar{
  position:fixed;
  z-index:30;
  top:max(12px,env(safe-area-inset-top));
  left:12px;
  right:12px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  pointer-events:none;
}
#sceneTitle,#gyroButton,#navigation button{pointer-events:auto}
#sceneTitle{
  max-width:min(72vw,680px);
  padding:10px 14px;
  border-radius:999px;
  background:rgba(0,0,0,.56);
  backdrop-filter:blur(8px);
  font-size:16px;
  font-weight:600;
}
button{
  border:1px solid rgba(255,255,255,.34);
  border-radius:999px;
  background:rgba(0,0,0,.62);
  color:#fff;
  padding:10px 14px;
  cursor:pointer;
  backdrop-filter:blur(8px);
}
button:hover{background:rgba(25,25,25,.82)}
button:active{transform:scale(.97)}
button:disabled{opacity:.45;cursor:default}
button.active{background:rgba(255,255,255,.93);color:#000}
#navigation{
  position:fixed;
  z-index:30;
  right:14px;
  bottom:max(14px,env(safe-area-inset-bottom));
  display:flex;
  gap:9px;
}
#navigation button{height:48px}
#previousButton,#nextButton{width:48px;padding:0;font-size:25px}
#galleryButton{min-width:92px}
#loadingMessage{
  position:fixed;
  z-index:25;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  padding:10px 14px;
  border-radius:999px;
  background:rgba(0,0,0,.64);
  transition:opacity .2s ease;
}
#errorBox{
  position:fixed;
  z-index:100;
  inset:18% 7%;
  overflow:auto;
  padding:22px;
  background:#260000;
  border:1px solid #ff7676;
  border-radius:14px;
  white-space:pre-wrap;
  line-height:1.45;
}
#editorPanel{
  position:fixed;
  z-index:60;
  left:14px;
  bottom:78px;
  width:min(430px,calc(100vw - 28px));
  padding:14px;
  border-radius:16px;
  background:rgba(0,0,0,.88);
  backdrop-filter:blur(10px);
}
#editorPanel p{margin:8px 0 12px;line-height:1.4}
.editor-actions{display:flex;flex-wrap:wrap;gap:8px}
#hotspotLayer{
  position:fixed;
  inset:0;
  z-index:55;
  pointer-events:none;
}
.hotspot-marker{
  position:absolute;
  width:44px;
  height:44px;
  margin:-22px 0 0 -22px;
  border-radius:50%;
  border:2px solid #fff;
  background:rgba(255,0,120,.86);
  color:#fff;
  font-weight:700;
  font-size:14px;
  display:grid;
  place-items:center;
  box-shadow:0 2px 14px rgba(0,0,0,.65);
  pointer-events:none;
}
@media(hover:hover) and (pointer:fine){
  #gyroButton{display:none}
}
@media(max-width:650px){
  #sceneTitle{max-width:57vw;font-size:14px}
  #gyroButton{max-width:40vw;font-size:13px}
  #navigation{left:50%;right:auto;transform:translateX(-50%)}
}
