/* =============================================================
   GAME: Space Shooter
   ============================================================= */
.board-spaceshooter { display: flex; flex-direction: column; align-items: center; gap: 12px; outline: none; }
.ss-stage { position: relative; touch-action: none; cursor: crosshair; }
.ss-canvas {
  display: block; width: min(calc(100vw - 60px), 420px, calc((100vh - 230px) * .75)); min-width: 240px; aspect-ratio: 3 / 4;
  border-radius: 12px; background: #060a24;
  box-shadow: 0 0 0 2px #3d8bff, 0 0 26px rgba(61, 139, 255, .4);
}
.board-spaceshooter:focus-visible .ss-canvas { box-shadow: 0 0 0 3px #fff, 0 0 26px rgba(61, 139, 255, .55); }
.ss-msg {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); width: max-content; max-width: 84%;
  padding: 10px 16px; border-radius: 12px; background: rgba(6, 10, 36, .86); color: #dff4ff; font-weight: 700; text-align: center;
  box-shadow: 0 0 0 1px rgba(61, 139, 255, .6); pointer-events: none;
}
.ss-msg[hidden] { display: none; }
.ss-num { color: #8fd0ff; font-variant-numeric: tabular-nums; }
.ss-lives { color: #3df5ff; letter-spacing: 2px; text-shadow: 0 0 8px rgba(61, 245, 255, .6); }
.ss-bombs { color: #ffd23f; text-shadow: 0 0 8px rgba(255, 210, 63, .6); }

/* on-screen buttons: phones and tablets only */
.ss-pad { display: none; grid-template-columns: 1fr 1fr 54px 1fr; gap: 8px; width: min(100%, 380px); touch-action: none; }
.ss-key {
  display: grid; place-items: center; height: 52px; border: 0; border-radius: 14px; cursor: pointer; color: #8fd0ff;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(61, 139, 255, .5), 0 4px 0 rgba(0, 0, 0, .35);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ss-key svg { width: 26px; height: 26px; fill: currentColor; }
.ss-key.down { background: #10264a; transform: translateY(2px); box-shadow: inset 0 0 0 1px #3d8bff, 0 2px 0 rgba(0, 0, 0, .35); }
.ss-key-bomb { color: #ffd23f; box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .5), 0 4px 0 rgba(0, 0, 0, .35); }
.ss-key-pause { color: var(--ink); }
.ss-key-pause svg { width: 20px; height: 20px; }
@media (pointer: coarse) {
  .ss-pad { display: grid; }
  .board-spaceshooter { gap: 8px; }
  .ss-canvas { width: min(calc(100vw - 60px), 420px, calc((100vh - 320px) * .75)); }
}

/* hit: a short shake + red flash of the frame (off when motion is reduced) */
.ss-hit { animation: ssShake .4s cubic-bezier(.36, .07, .19, .97); }
.ss-hit .ss-canvas { box-shadow: 0 0 0 2px #ff4b5c, 0 0 30px rgba(255, 75, 92, .55); transition: box-shadow .3s; }
@keyframes ssShake { 15%, 55% { translate: -5px 0; } 35%, 75% { translate: 5px 0; } 90% { translate: -2px 0; } }
@media (prefers-reduced-motion: reduce) { .ss-hit { animation: none; } }
