/* Asteroids — page-specific styles (old-school vector arcade) */

.arcade-page {
  max-width: 960px;
  margin: 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.arcade-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.2s;
}

.arcade-back:hover,
.arcade-back:focus-visible {
  color: var(--color-coral);
  outline: none;
}

.arcade-header {
  text-align: center;
  margin-bottom: 2rem;
}

.arcade-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-coral);
  margin-bottom: 0.75rem;
}

.arcade-instructions {
  max-width: 640px;
  margin: 0 auto;
  color: var(--color-text-muted);
  font-size: 1.02rem;
}

.arcade-panel {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.arcade-panel h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

/* Playfield */
.arcade-stage {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.arcade-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #000000;
  border-radius: var(--radius-sm);
  border: 4px solid var(--color-sun);
  touch-action: none;
  cursor: crosshair;
}

.arcade-canvas:focus-visible {
  outline: 3px solid var(--color-coral);
  outline-offset: 3px;
}

.arcade-status {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: 1rem;
  min-height: 1.6em;
}

.arcade-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-secondary {
  background: var(--color-sky);
  color: white;
  box-shadow: 0 4px 0 var(--color-sky-dark);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--color-sky-dark);
  outline: none;
}

.btn-secondary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--color-sky-dark);
}

/* Touch controls — shown on touch screens and small displays */
.touch-pad {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 2px dashed #f0e6d6;
}

.touch-pad.is-visible {
  display: flex;
}

.touch-btn {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 4rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid #e8e2d8;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background 0.1s, border-color 0.1s, transform 0.1s;
}

.touch-btn--fire {
  font-size: 1rem;
  letter-spacing: 0.08em;
  background: var(--color-coral);
  border-color: var(--color-coral);
  color: white;
}

.touch-btn.is-pressed {
  transform: translateY(2px);
  border-color: var(--color-purple);
  background: var(--color-purple);
  color: white;
}

/* Help */
.arcade-help dl {
  display: grid;
  grid-template-columns: minmax(8rem, auto) 1fr;
  gap: 0.6rem 1.25rem;
  font-size: 0.98rem;
}

.arcade-help dt {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-coral);
}

.arcade-help dd {
  color: var(--color-text-muted);
}

kbd {
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--color-bg);
  border: 2px solid #e8e2d8;
  border-bottom-width: 3px;
  color: var(--color-text);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .touch-pad {
    display: flex;
  }
}

@media (max-width: 640px) {
  .arcade-panel {
    padding: 1rem;
  }

  .arcade-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .touch-btn {
    min-width: 3.4rem;
    padding: 0.65rem 0.75rem;
  }

  .arcade-help dl {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .arcade-help dd {
    margin-bottom: 0.6rem;
  }
}
