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

:root {
  --accent: #ff2e4d;
  --bg1: #1a0d18;
  --bg2: #2a1530;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: "Arial Black", system-ui, sans-serif;
  background: #000;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 30% 20%, var(--bg2), var(--bg1) 60%, #0a050a 100%);
  cursor: crosshair;
  overflow: hidden;
}

/* ---- HUD ---- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  gap: 22px;
  padding: 14px 20px;
  z-index: 5;
  pointer-events: none;
}
.stat {
  font-size: 14px;
  letter-spacing: 2px;
  color: #ffb3bf;
  text-shadow: 0 2px 6px #000;
}
.stat span {
  display: inline-block;
  min-width: 1.5em;
  font-size: 24px;
  color: #fff;
}

/* ---- Roamer sprite ---- */
#roamer {
  position: absolute;
  height: 30vh;          /* sized relative to screen; tweak to taste */
  max-height: 320px;
  width: auto;
  display: none;
  cursor: crosshair;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.55));
  transform-origin: center bottom;
  transition: opacity .18s ease;
  will-change: transform, opacity;
}
#roamer.spawn { animation: pop .22s cubic-bezier(.2,1.4,.4,1); }
#roamer.hit   { animation: hit .4s ease; }
#roamer.flee  { opacity: 0; transform: translateY(14px) scale(.85); }

@keyframes pop {
  from { transform: scale(.2); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
@keyframes hit {
  0%   { transform: scale(1)    rotate(0); }
  25%  { transform: scale(1.18) rotate(-6deg); }
  60%  { transform: scale(1.05) rotate(4deg); }
  100% { transform: scale(1)    rotate(0); }
}

/* ---- Overlay (start) ---- */
#overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  background: rgba(10, 5, 10, .72);
  backdrop-filter: blur(3px);
  cursor: default;
}
#overlay.hidden { display: none; }
#overlay h1 {
  font-size: clamp(40px, 11vw, 96px);
  line-height: .95;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 24px var(--accent), 0 6px 0 #7a0d1e;
}
#overlay p {
  font-family: system-ui, sans-serif;
  font-weight: 600;
  color: #ffc2cc;
  max-width: 320px;
  line-height: 1.4;
}
#start {
  margin-top: 8px;
  padding: 16px 48px;
  font: 700 22px/1 system-ui, sans-serif;
  letter-spacing: 3px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 0 #99081f, 0 14px 24px rgba(0,0,0,.4);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
#start:active { transform: translateY(6px); box-shadow: 0 2px 0 #99081f; }

/* floating "+1" feedback */
.popup {
  position: absolute;
  z-index: 8;
  font: 800 30px/1 system-ui, sans-serif;
  color: #fff;
  text-shadow: 0 0 10px var(--accent);
  pointer-events: none;
  animation: float .7s ease-out forwards;
}
@keyframes float {
  from { transform: translateY(0) scale(.7); opacity: 1; }
  to   { transform: translateY(-60px) scale(1.2); opacity: 0; }
}
.popup.escape {
  font: 700 18px/1 system-ui, sans-serif;
  color: #8fb7ff;
  text-shadow: 0 1px 4px #000;
}
