/* === Global CRT vibe === */
body {
  background: #0c0010;
  color: #00ffcc;
  font-family: 'VT323', monospace;
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px; /* breathing room on small screens */
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 1.4;
  position: relative;
}

/* subtle scanline overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 1px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 3px
  );
  mix-blend-mode: overlay;
  z-index: 1;
}

.game-container, .wrap {
  position: relative;
  width: 100%;
  max-width: 720px; /* keeps it centered on desktop */
  background: #0c0010;
  border: 2px solid #00ffcc;
  padding: 12px 16px;
  box-shadow: 0 0 12px #00ffcc44;
  z-index: 2;
}

/* === Headings === */
h1, h2 {
  margin: 0 0 8px;
  text-align: center;
  text-shadow: 0 0 6px #00ffcc, 0 0 12px #00ffcc;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.2rem; color: #ff00aa; }

/* === HUD badges (score / best) === */
.hud {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
}

.badge {
  font-size: 18px;
  background: #0c0010;
  border: 2px solid #00ffcc;
  padding: 4px 10px;
  box-shadow: inset 0 0 6px #00ffcc;
}

/* === Stage / canvas === */
.stage {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 60vh; /* prevents overflow on mobile */
  border: 2px solid #00ffcc;
  background: #0a0f1c;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px #00ffcc33;
}

canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* === Buttons === */
button, .btn {
  font-family: 'VT323', monospace;
  font-size: 20px;
  text-transform: uppercase;
  cursor: pointer;
  image-rendering: pixelated;

  background: #00ffcc;
  color: #0c0010;
  border: 3px solid #00ffcc;
  border-radius: 0;
  padding: 6px 18px;
  margin: 4px auto;
  display: inline-block;

  box-shadow: 0 0 0 2px #0c0010, 0 0 8px #00ffcc;
  transition: background .1s, color .1s, border-color .1s, box-shadow .1s;
}

button:hover, .btn:hover {
  background: #0c0010;
  color: #00ffcc;
  border-color: #00ffcc;
  box-shadow: 0 0 0 2px #0c0010, 0 0 12px #00ffcc, inset 0 0 6px #00ffcc;
}

button:active, .btn:active {
  background: #0c0010;
  color: #ff00aa;
  border-color: #ff00aa;
  box-shadow: 0 0 0 2px #0c0010, 0 0 10px #ff00aa, inset 0 0 6px #ff00aa;
}

button:focus-visible, .btn:focus-visible {
  outline: 2px solid #ff00aa;
  outline-offset: 2px;
}

/* === Help text === */
.help {
  font-size: 14px;
  text-align: center;
  margin-top: 12px;
  color: #00ffcc;
}

.help strong {
  color: #ff00aa;
}

/* === Links === */
a {
  color: #00ffcc;
  text-decoration: underline;
}
a:hover {
  color: #ff00aa;
  text-shadow: 0 0 6px #ff00aa;
}

/* === Mobile tweaks === */
@media (max-width: 600px) {
  body {
    padding: 8px;
    align-items: stretch;
  }
  .wrap {
    padding: 10px;
  }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1rem; }
  .badge { font-size: 16px; padding: 3px 8px; }
  button, .btn { font-size: 18px; padding: 5px 14px; }
}