* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #1a1430;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#stage { position: fixed; inset: 0; }

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;          /* let pointer-drag aim instead of scrolling */
  cursor: grab;
}
#game:active { cursor: grabbing; }

#hint {
  position: fixed;
  left: 50%;
  bottom: 32px;                /* clear the slim site footer */
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.5s ease;
}

/* ---- level HUD (top strip) ---- */
#hud {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 8px;
  pointer-events: none;          /* don't block aiming */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
}
#hud span {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
}

/* ---- win / lose overlay ---- */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 6, 24, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#overlay[hidden] { display: none; }
.overlay-card {
  background: rgba(32, 22, 58, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 28px 38px;
  text-align: center;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
}
.overlay-card h2 {
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 26px;
  margin-bottom: 18px;
}
#overlayBtn {
  font: 600 18px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #2a1f52;
  background: #ffd86b;
  border: none;
  border-radius: 999px;
  padding: 12px 34px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
#overlayBtn:hover { background: #ffe28c; }
#overlayBtn:active { transform: scale(0.95); }

/* ---- title / start screen (shows while assets load) ---- */
#title {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #2a1f52, #1a1430);
}
#title[hidden] { display: none; }
.title-card { text-align: center; padding: 24px; }
.title-card h1 {
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(34px, 8vw, 64px);
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  text-shadow: 0 4px 24px rgba(255, 216, 107, 0.35);
}
.title-card p {
  color: rgba(255, 255, 255, 0.6);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  margin: 0 0 26px;
}
#playBtn {
  font: 600 22px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #2a1f52;
  background: #ffd86b;
  border: none;
  border-radius: 999px;
  padding: 14px 48px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.2s ease;
}
#playBtn:not(:disabled):hover { background: #ffe28c; }
#playBtn:not(:disabled):active { transform: scale(0.95); }
#playBtn:disabled { opacity: 0.5; cursor: default; }
