html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #05040a;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
}
#gl { z-index: 1; }
#hud { z-index: 2; }

#loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: radial-gradient(ellipse at 50% 40%, #1a1030 0%, #05040a 70%);
  transition: opacity 0.5s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }

.load-inner { text-align: center; max-width: 420px; }
.load-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(26px, 8vw, 44px);
  letter-spacing: 0.08em;
  color: #ffd21f;
  text-shadow: 0 0 8px rgba(255, 210, 31, 0.8), 0 0 24px rgba(255, 140, 20, 0.6);
}
.load-msg {
  margin-top: 14px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 3.6vw, 16px);
  letter-spacing: 0.25em;
  color: #6ff3ff;
  text-shadow: 0 0 6px rgba(37, 184, 255, 0.9), 0 0 18px rgba(37, 184, 255, 0.5);
  animation: pulse 1.2s ease-in-out infinite alternate;
}
.load-bar {
  margin: 18px auto 0;
  width: 70%;
  height: 3px;
  background: rgba(111, 243, 255, 0.15);
  overflow: hidden;
  border-radius: 2px;
}
.load-bar span {
  display: block;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, #ffd21f, #6ff3ff);
  box-shadow: 0 0 10px #6ff3ff;
  animation: sweep 1.1s ease-in-out infinite;
}
.load-error {
  display: none;
  margin-top: 20px;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: #ffb3a0;
  text-shadow: 0 0 6px rgba(255, 90, 31, 0.6);
}
#loading.error .load-msg { animation: none; color: #ff5a1f; text-shadow: 0 0 8px rgba(255, 90, 31, 0.8); }
#loading.error .load-bar { display: none; }
#loading.error .load-error { display: block; }

@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
