/* ===========================================================
   Space Invaders — game-specific styles only.
   Chrome, buttons, #status, .stat, .hint, help dialog all come
   from shared.css. Colours use the shared CSS custom properties
   so the game tracks light/dark mode.
   =========================================================== */

/* tighten the column a touch so everything fits on small phones */
body { gap: 14px; }

/* ---------- score / lives / best row ---------- */
.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- playfield ---------- */
.board-wrap {
  position: relative;
  width: min(480px, 94vw);
}

#game {
  display: block;
  width: 100%;
  height: auto;            /* keep the 480x600 aspect ratio */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 26px var(--shadow);
  touch-action: none;      /* stop scroll-hijacking on touch */
}

/* ---------- start / game-over overlay ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  border-radius: 12px;
  backdrop-filter: blur(2px);
}
.overlay.show { display: flex; }

.overlay-card {
  text-align: center;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 90%;
}
#overlayTitle {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
}
.overlay-card .hint { opacity: 0.85; }

/* ---------- on-screen touch controls ---------- */
.touch-controls {
  display: flex;
  gap: 12px;
  width: min(480px, 94vw);
  justify-content: center;
}
.tc-btn {
  flex: 1;
  max-width: 130px;
  padding: 16px 0;
  font-size: 1.3rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 3px 10px var(--shadow);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tc-btn:hover { opacity: 1; background: var(--surface-3); }
.tc-btn:active { background: var(--surface-2); transform: translateY(1px); }
.tc-fire {
  font-size: 1.05rem;
  letter-spacing: 1px;
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}
.tc-fire:hover { opacity: 0.9; background: var(--accent); }

/* a hair more breathing room on very small screens */
@media (max-width: 380px) {
  .tc-btn { padding: 14px 0; font-size: 1.15rem; }
}
