@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: 'Press Start 2P', monospace;
  overflow: hidden;
}

#screen {
  position: relative;
  width: 100%;
  max-width: 750px;
  aspect-ratio: 3 / 4;
  max-height: calc(100dvh - 70px);
  background: #000;
  box-shadow: 0 0 40px #0f0a, inset 0 0 60px #000;
  border: 4px solid #222;
  box-sizing: border-box;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}

#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0) 3px
  );
  mix-blend-mode: multiply;
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 120px 40px #000;
}

#hud {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  color: #0f0;
  text-shadow: 0 0 2px #0f0;
  font-size: 12px;
  letter-spacing: 1px;
  z-index: 3;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #0f0;
  text-shadow: 0 0 2px #0f0;
  text-align: center;
  z-index: 4;
  background: rgba(0, 0, 0, 0.8);
  padding: 20px;
  box-sizing: border-box;
}

#overlay.hidden { display: none; }

#overlay h1 {
  font-size: 22px;
  color: #ff2fd0;
  text-shadow: 0 0 3px #ff2fd0;
  margin: 0;
}

#overlay p {
  font-size: 10px;
  line-height: 1.8;
  margin: 0;
}

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

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

.back-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #0f0;
  background: #000;
  border: 2px solid #0f0;
  padding: 10px 18px;
  text-decoration: none;
  text-shadow: 0 0 2px #0f0;
  box-shadow: 0 0 10px #0f04;
  letter-spacing: 1px;
  cursor: pointer;
  flex-shrink: 0;
}

.back-btn:active { background: #0f02; }
