/* ===========================================================
   Asteroids — game-specific styles only.
   Chrome (body, h1, buttons, .score-box, .hint) comes from
   shared.css; we only lay out the canvas, overlay and pad here.
   =========================================================== */

body {
  gap: 16px;
  user-select: none;
  -webkit-user-select: none;
  /* Stop the page scrolling/zooming when tapping the on-screen pad */
  touch-action: manipulation;
}

h1 { font-weight: 700; font-size: 2.4rem; }

/* row of score / lives / best chips */
.stats {
  display: flex;
  gap: 10px;
}

/* ---------- playfield ---------- */
#stage {
  position: relative;
  width: 600px;
  max-width: 94vw;          /* clamp on small screens */
}

#game {
  display: block;
  width: 100%;
  /* keep the 4:3 aspect ratio whatever the clamped width is */
  aspect-ratio: 4 / 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px var(--shadow);
  touch-action: none;
}

/* ---------- game-over overlay ---------- */
#overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  border-radius: 12px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 10;
}
#overlay.show { display: flex; }
#overlay .msg { font-size: 2rem; font-weight: 700; text-align: center; }
#overlay .sub { font-size: 1rem; opacity: 0.75; margin-top: -8px; }

/* ---------- on-screen controls ---------- */
#pad {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
#pad button {
  padding: 0;
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
  /* let press-and-hold work without selecting/zooming */
  -webkit-touch-callout: none;
}
#pad button:hover  { background: var(--surface-3); opacity: 1; }
#pad button.active { background: var(--accent); color: var(--accent-text); }
#btn-fire { color: var(--red); }

/* a touch more breathing room on phones */
@media (max-width: 420px) {
  h1 { font-size: 2rem; }
  #pad button { width: 56px; height: 56px; }
}
