* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
}

#world {
  position: relative;
  width: 100%;
  height: 100%;
}

#world canvas {
  display: block;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hud-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-overlay[hidden] {
  display: none;
}

.hud-panel {
  padding: 20px 32px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  text-align: center;
}

.hud-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
}

.hud-start {
  pointer-events: auto;
  margin-bottom: 12px;
  padding: 8px 24px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.hud-start:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hud-help {
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.6;
}

.hud-help p {
  margin: 0;
}

.hud-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) center / 100% 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) center / 1px 100% no-repeat;
}

.hud-crosshair[hidden] {
  display: none;
}

.hud-debug {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre;
}

.hud-debug[hidden] {
  display: none;
}

.touch-joystick {
  position: absolute;
  bottom: 32px;
  left: 32px;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  touch-action: none;
}

.touch-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.touch-look {
  position: absolute;
  inset: 0 0 0 50%;
  touch-action: none;
}

.touch-button {
  position: absolute;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 22px;
  touch-action: none;
}

.touch-jump {
  right: 32px;
  bottom: 32px;
}

.touch-fly {
  right: 108px;
  bottom: 32px;
}
