/* ============================================================
   Helix Games — Shared Canvas Theme
   Common styling for any game's main <canvas>. Add class="game-canvas"
   to the canvas element; per-game overrides (custom background gradients,
   different sizes) can still target the canvas by id with higher specificity.
   ============================================================ */

/* Wrapper used by several games to centre and space the <canvas>. Moved
   here so games don't each redeclare the same `margin: 20px auto`. Games
   that need a different layout (e.g. planet-patrol uses flex centering)
   override locally. */
.canvas-container {
  margin: 20px auto;
}

.game-canvas {
  background: #000000;
  border: 3px solid var(--helix-primary);
  display: block;
  margin: 20px auto;
  box-shadow: 0 0 20px rgba(var(--helix-primary-rgb), 0.1);
  max-width: 100%;
}

@media (max-width: 768px) {
  .game-canvas {
    height: auto;
  }
}

/* ── Shared mobile touch controls ─────────────────────────────
   Several action games (star-fleet, star-invaders, etc.) render a
   touch-control bar on mobile. Keep the styling here so it is consistent;
   games can still add game-specific buttons by extending `.mobile-btn`.
   ============================================================ */

.mobile-controls {
  display: none;
  margin: 20px auto 0;
  padding: 20px;
  background: var(--helix-bg-card);
  border: 1px solid rgba(var(--helix-primary-rgb), 0.4);
  max-width: 400px;
}

.mobile-controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.mobile-btn {
  background: rgba(var(--helix-primary-rgb), 0.15);
  color: var(--helix-primary);
  border: 1px solid var(--helix-primary);
  padding: 20px;
  font-family: var(--helix-font-body);
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background 0.1s, color 0.1s, box-shadow 0.1s, transform 0.1s;
  min-width: 80px;
  min-height: 80px;
}

.mobile-btn:active {
  background: var(--helix-secondary);
  color: #0a0e10;
  border-color: var(--helix-secondary);
  transform: scale(0.95);
  box-shadow: 0 0 14px var(--helix-secondary-glow);
}

/* Movement keys keep the cool teal palette. */
.mobile-btn-move {
  background: rgba(var(--helix-primary-rgb), 0.2);
  color: var(--helix-primary);
  border: 1px solid var(--helix-primary);
}

/* Fire button switches to the warm dark-orange so it's never confused
   with movement under stress. */
.mobile-btn-fire {
  background: var(--helix-secondary-soft);
  color: var(--helix-secondary);
  border: 1px solid var(--helix-secondary);
  font-size: 18px;
  flex: 1;
  max-width: 150px;
}
.mobile-btn-fire:active {
  background: var(--helix-secondary);
  color: #0a0e10;
}

@media (max-width: 768px) {
  .mobile-controls {
    display: block;
  }
}
