
body {
  background: black;
  color: white;
  margin: 0;
  /* iOS TEMP: Use system fonts instead of Google Font */
  font-family: 'Courier New', Monaco, monospace;
  text-align: center;
}

canvas {
  display: block;
  margin: 0 auto;
  image-rendering: pixelated;
  background-color: black;
}

.bezel {
  border: 12px solid #333;
  border-radius: 6px;
  box-shadow: inset 0 0 12px #000;
  margin: 20px auto;
  width: fit-content;
  background: #111;
  padding-bottom: 25px;
}

#hud, #controls, #leaderboard, #initialsEntry, #gameOver {
  padding: 8px;
  font-size: 12px;
}

#score, #hiScore, #shieldTimer, #lives {
  display: inline-block;
  margin: 0 10px;
}

#hiScore {
  font-weight: bold;
}

#insertCoin, #startPrompt {
  margin: 4px 0;
}

.instructions {
  font-size: 11px;
  color: #ccc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  margin: 8px 0 4px 0;
}

.audio-controls {
  margin: 10px auto 0 auto;
  width: 480px;
}

/*
  Return to Overscan. Pink is this cabinet's accent on the portal (--accent:
  #f45db4), so the way out is coloured like the way in.
*/
.exit-line {
  margin: 10px 0 0 0;
}

.exit-link {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #f45db4;
  text-decoration: none;
  border: 1px solid rgba(244, 93, 180, 0.4);
  border-radius: 3px;
  padding: 6px 12px;
  display: inline-block;
  /* Comfortably tappable on a phone without becoming a button that competes
     with the game's own controls. */
  min-height: 20px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.exit-link:hover,
.exit-link:focus {
  background: rgba(244, 93, 180, 0.15);
  border-color: #f45db4;
}

/* Out of the way while a run is in progress */
body.in-play .exit-link {
  opacity: 0.25;
  pointer-events: none;
}

#audioCanvas {
  background-color: #222;
  border: 1px solid #444;
  border-radius: 3px;
}

.blink {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.pulse {
  animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0.75; }
}

.hidden {
  display: none;
}

#leaderboard ol {
  padding-left: 0;
  list-style: none;
}

#initials {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
}

.initial {
  border-bottom: 2px solid white;
  padding: 4px 8px;
}

/* Mobile/Desktop instruction display - controlled by JavaScript */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

/* Mobile device styles (applied via JavaScript class) */
body.mobile-device .mobile-only {
  display: block;
}

body.mobile-device .desktop-only {
  display: none;
}

body.mobile-device {
  margin: 0;
  padding: 5px;
  overflow: hidden;
  height: 100vh;
  box-sizing: border-box;
}

body.mobile-device html {
  height: 100%;
  overflow: hidden;
}

body.mobile-device .bezel {
  margin: 0 auto;
  border-width: 2px;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

body.mobile-device #gameCanvas {
  display: block;
  margin: 0 auto;
}

body.mobile-device #audioCanvas {
  max-width: 100%;
  width: 100%;
  height: auto;
}

body.mobile-device .audio-controls {
  width: 100%;
  max-width: 480px;
  margin: 1px auto 0 auto;
}

body.mobile-device .instructions {
  font-size: 9px;
  margin: 1px 0;
  padding: 0 5px;
  word-wrap: break-word;
  line-height: 1.2;
}

/* Desktop device styles (applied via JavaScript class) */
body.desktop-device .mobile-only {
  display: none;
}

body.desktop-device .desktop-only {
  display: block;
}



/*
  CRT scanlines. OFF by default, toggled in game with T.

  The original stylesheet referenced a scanlines.png that has never existed in
  any copy of this project — it lived only on the old Flywheel host, so every
  load since has been a silent 404 falling back to a flat background. Drawing
  them instead means no request, nothing to lose, and they scale with the
  display rather than tiling a fixed bitmap.

  Default off because they cost legibility on a small screen, and this game is
  meant to be playable on a phone.
*/
.bezel.crt {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.30) 3px,
      rgba(0, 0, 0, 0.30) 4px
    ),
    #111;
}
