html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #05070d;
}

#stage,
#stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#stage canvas:active {
  cursor: grabbing;
}

/* opening veil — fades away, never shows any text or control */
#veil {
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, #0b1220 0%, #05070d 70%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 1.6s ease 0.2s;
}

body.ready #veil {
  opacity: 0;
}

/* viewpoint HUD — hint line + reset, kept quiet so the diorama stays the focus */
#hud {
  position: fixed;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  opacity: 0;
  transition: opacity 1.2s ease 1s;
}

body.ready #hud {
  opacity: 1;
}

/* H toggles the UI off for clean screenshots — also stops the buttons from catching clicks */
#hud.hud-hidden,
body.ready #hud.hud-hidden {
  opacity: 0;
  pointer-events: none;
}

/* …and hides the cursor over the canvas while the UI is away */
body.cursor-hidden,
body.cursor-hidden #stage,
body.cursor-hidden #stage canvas,
body.cursor-hidden #stage canvas:active {
  cursor: none;
}

#hint {
  font: 11px/1.4 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.06em;
  color: #9fb4cc;
  background: rgba(8, 12, 22, 0.55);
  border: 1px solid rgba(159, 214, 255, 0.14);
  border-radius: 999px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
  user-select: none;
}

#reset-view,
#cine-view {
  font: 12px/1 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.1em;
  color: #dce8f5;
  background: rgba(15, 24, 40, 0.72);
  border: 1px solid rgba(159, 214, 255, 0.28);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.25s ease, border-color 0.25s ease;
}

#reset-view:hover,
#cine-view:hover {
  background: rgba(47, 111, 184, 0.4);
  border-color: rgba(159, 214, 255, 0.55);
}

/* ---- 触屏/移动端适配 ---- */
.hint-touch {
  display: none;
}

/* 触摸设备：隐藏键盘操作提示，只显示手势提示 */
@media (pointer: coarse) {
  .hint-desktop {
    display: none;
  }
  .hint-touch {
    display: inline;
  }
}

/* 窄屏：HUD 换行铺满底部，按钮加大触控面积 */
@media (max-width: 640px), (max-height: 480px) {
  #hud {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
    gap: 8px;
  }
  #hint {
    flex: 1 1 100%;
    text-align: center;
    font-size: 10px;
  }
  #reset-view,
  #cine-view {
    flex: 1 1 auto;
    padding: 10px 12px;
  }
}
