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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0e0e16;
  touch-action: none;          /* no scroll/zoom on touch devices */
  overscroll-behavior: none;   /* no pull-to-refresh */
}

#game {
  display: block;
  cursor: crosshair;
  touch-action: none;
}

/* On-screen buttons for touch devices (shown via JS only when touch is present) */
#touch-ui {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: row;
  gap: 16px;
  z-index: 5;
}
#touch-ui button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  font-size: 26px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Start / game-over screen, drawn over the canvas. */
#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  background: rgba(8, 8, 14, 0.78);
  color: #e5e7eb;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  user-select: none;
}
#overlay h1 { font-size: 2.4rem; }
#overlay p { font-size: 1.05rem; opacity: 0.9; }
#overlay .hint { margin-top: 0.75rem; opacity: 0.7; font-size: 0.95rem; }

/* Between-wave shop */
.shop-group { margin: 0.4rem 0; }
.shop-group-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
  margin-bottom: 0.3rem;
}
.shop-cost { opacity: 0.75; margin-left: 0.25rem; }
.shop {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 640px;
  margin: 0.5rem 1rem;
}
.shop-buy {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}
.shop-buy:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.shop-buy:disabled { opacity: 0.4; cursor: default; }
.shop-launch {
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 0.75rem;
  color: #fff;
  background: var(--green, #1a9e58);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
}
.shop-launch:hover { background: var(--green-dark, #157a44); }
.start-btn {
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  background: var(--green, #1a9e58);
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}
.start-btn:hover { background: var(--green-dark, #157a44); }
