/* 页面只剩三层：3D canvas、HUD canvas、聊天输入框。所有界面元素由 hud.js 画在 canvas 上。 */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0a0e13;
  color: #e8eef4;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

/* 3D 层 */
#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  pointer-events: none;
}
#scene:active { cursor: grabbing; }

/* HUD 层：压在上面，独占所有指针事件（摇杆 / 按钮 / 拖拽转视角都在这里） */
#hud {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
#hud:active { cursor: grabbing; }

/* 聊天输入：唯一保留的 DOM 控件（需要输入法），默认完全隐藏 */
#chatin {
  position: fixed;
  left: 50%;
  bottom: max(76px, calc(env(safe-area-inset-bottom, 0px) + 76px));
  transform: translateX(-50%);
  width: min(520px, 88vw);
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 12, 18, 0.86);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease;
}
#chatin.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#chatin:focus { border-color: #ffb457; }
