html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: black;
  font-family: Arial, sans-serif;
  touch-action: none;
  overscroll-behavior: none;
}

body {
  position: fixed;
  width: 100%;
}

#container {
  width: 100vw;
  height: 100vh;
}

#loadingScreen,
#startScreen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#loadingScreen {
  z-index: 40;
  cursor: default;
}

#startScreen {
  cursor: pointer;
}

#startScreen.is-hidden,
#loadingScreen.is-hidden {
  display: none;
}

.loading-card {
  width: min(420px, calc(100vw - 48px));
  text-align: center;
}

.loading-card h1,
#startScreen h1 {
  margin: 0 0 18px;
  font-size: clamp(1.6rem, 5vw, 3rem);
  letter-spacing: 0.08em;
  font-weight: 700;
}

#loadingStatus,
#loadingPercent {
  margin: 0;
  opacity: 0.82;
  font-size: 0.95rem;
}

.progress-track {
  width: 100%;
  height: 6px;
  margin: 22px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: rgba(255,255,255,0.88);
  transition: width 0.18s ease-out;
}

#loadingError {
  display: none;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

#reloadButton {
  display: none;
  margin-top: 16px;
  padding: 10px 18px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  background: transparent;
  color: white;
  font: inherit;
  cursor: pointer;
}

#reloadButton:hover {
  background: rgba(255,255,255,0.12);
}

#rotateOverlay {
  position: absolute;
  inset: 0;
  background: #000;
  color: white;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 30;
  padding: 20px;
}

/* Mobile joystick */
.joystick {
  position: absolute;
  bottom: 40px;
  left: 40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  z-index: 20;
}

.stick {
  position: absolute;
  width: 40px;
  height: 40px;
  left: 40px;
  top: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
}
