/* Star Sweep arcade game (home page). The play screen stays dark in both themes, like an arcade cabinet. */
.arcade-section .section-head { margin-bottom: 28px; }
.arcade {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
}
.arcade-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: space-between;
  padding: 4px 6px 12px;
  font-size: 14px;
  color: var(--muted);
}
.arcade-hud div { display: flex; gap: 8px; align-items: baseline; }
.arcade-hud { align-items: center; }
.arcade-hud strong { color: var(--head); font-size: 18px; font-variant-numeric: tabular-nums; }
.arcade-sound {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--head);
  cursor: pointer;
}
.arcade-sound:hover { border-color: var(--blue); }
.arcade-sound svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.arcade-sound .snd-off, .arcade-sound.is-muted .snd-on { display: none; }
.arcade-sound.is-muted .snd-off { display: block; }
.arcade-sound.is-muted { color: var(--muted); }
.arcade-screen { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: #0A0612; }
.arcade canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; outline: none; touch-action: none; }
.arcade canvas[style*="height"] { aspect-ratio: auto; }
.arcade canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.arcade.is-playing canvas:focus-visible { box-shadow: none; }

.arcade-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(10, 6, 18, .72) 0%, rgba(10, 6, 18, .38) 70%, rgba(10, 6, 18, .2) 100%);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
  color: #CBC2DD;
}
.arcade-overlay[hidden] { display: none; }
.arcade-overlay-title { margin: 0; color: #FFFFFF; font-size: clamp(24px, 5vw, 40px); line-height: 1.1; }
.arcade-overlay-text { margin: 0 0 8px; max-width: 440px; font-size: 15px; }
.arcade-keys { margin: 4px 0 0; font-size: 13px; color: #9C90B8; }
.arcade-keys kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-bottom-width: 2px;
  border-radius: 5px;
  font: 600 12px/1.5 var(--font);
  color: #F8F5FD;
}

/* Touch controls: only shown on touch screens */
.arcade-pad { display: none; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; }
.arcade-pad-group { display: flex; align-items: center; gap: 12px; }
.arcade-pad button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--head);
  font: 700 13px var(--font);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.arcade-pad button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.arcade-pad button.is-down { background: var(--blue); color: #FFFFFF; border-color: var(--blue); }
.arcade-pad .arcade-fire { width: 74px; height: 74px; background: var(--green-soft); letter-spacing: .04em; }
@media (hover: none) and (pointer: coarse) {
  .arcade-pad { display: flex; }
  .arcade-keys { display: none; }
}
.arcade.has-touch .arcade-pad { display: flex; }
.arcade.has-touch .arcade-keys { display: none; }
@media (max-width: 520px) {
  .arcade-section .section-head { margin-bottom: 18px; }
  .arcade { padding: 8px; border-radius: var(--radius-sm); }
  .arcade-hud { gap: 4px 10px; padding: 2px 4px 8px; font-size: 12px; }
  .arcade-hud div { gap: 5px; }
  .arcade-hud strong { font-size: 15px; }
  .arcade-overlay { gap: 8px; padding: 14px; }
  .arcade-overlay-text { font-size: 14px; }
  .arcade-pad button { width: 56px; height: 56px; }
  .arcade-pad .arcade-fire { width: 68px; height: 68px; }
}
@media (max-width: 340px) {
  .arcade-pad-group { gap: 8px; }
  .arcade-pad button { width: 50px; height: 50px; }
  .arcade-pad .arcade-fire { width: 60px; height: 60px; }
}
