:root {
  --bg: #05060f;
  --accent: #5df2ff;
  --hot: #ff5ea8;
  font-size: 16px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------- HUD buttons ---------- */
#hud-buttons {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  z-index: 20;
}

.hud-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(120, 220, 255, 0.35);
  background: rgba(10, 16, 34, 0.65);
  color: #bfeeff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.08s ease, background 0.15s ease;
}
.hud-btn:active { transform: scale(0.92); background: rgba(40, 70, 110, 0.8); }
.hud-btn.muted { opacity: 0.55; }

/* ---------- Overlay screens ---------- */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(30, 40, 90, 0.55), rgba(4, 5, 14, 0.92) 70%);
  backdrop-filter: blur(3px);
  transition: opacity 0.25s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }

#overlay-card {
  text-align: center;
  padding: 28px 34px;
  max-width: min(88vw, 460px);
  color: #eaf6ff;
}

#overlay-title {
  font-size: clamp(2rem, 8vw, 3.2rem);
  letter-spacing: 0.14em;
  font-weight: 800;
  background: linear-gradient(100deg, #5df2ff, #b07bff 45%, #ff5ea8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(93, 242, 255, 0.25);
  margin-bottom: 6px;
}

#overlay-sub {
  color: #9fb4d8;
  font-size: 0.95rem;
  margin-bottom: 14px;
  line-height: 1.45;
}

#overlay-stats {
  font-size: 1rem;
  color: #cfeaff;
  margin-bottom: 18px;
  line-height: 1.7;
  white-space: pre-line;
}

#overlay-btn {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 14px 44px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #03121c;
  background: linear-gradient(100deg, #5df2ff, #7cb0ff);
  box-shadow: 0 0 26px rgba(93, 242, 255, 0.45);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
#overlay-btn:active { transform: scale(0.94); box-shadow: 0 0 14px rgba(93, 242, 255, 0.3); }
#overlay-btn.hidden { display: none; }

#overlay-hint {
  margin-top: 16px;
  font-size: 0.78rem;
  color: #6c80a5;
  line-height: 1.6;
}
