* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  touch-action: none;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

/* Loading state (see index.html's inline script) — visible by DEFAULT (no display:none here,
   unlike #loadError below) so a slow first load reads as "loading", not a blank/dark screen
   that looks broken even when nothing is actually wrong. Hidden once the game is confirmed
   running. */
#loadingScreen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #1a1a2e;
  color: #EDE9F6;
  font-family: sans-serif;
}

#loadingSpinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(237,233,246,0.25);
  border-top-color: #6EC6FF;
  animation: loadingSpin 0.8s linear infinite;
}

@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}

/* Load-failure fallback (see index.html's inline script) — hidden unless the automatic retry
   (see index.html) already happened once and the game still isn't running, in which case it's
   revealed as a visible, actionable manual-retry state instead of a silent blank page. */
#loadError {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #FFF0F6;
  color: #4A4A68;
  font-family: sans-serif;
  text-align: center;
  padding: 24px;
}

#retryBtn {
  font-size: 18px;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  background: #6EC6FF;
  color: #fff;
  font-weight: bold;
}
