:root {
  --neon-green: #39ff14;
  --neon-cyan: #00fff7;
  --neon-pink: #ff2bd6;
  --neon-yellow: #fff21f;
  --neon-orange: #ff8a00;
  --crt-bg: #0a0d10;
  --cabinet: #161a1f;
  --cabinet-edge: #2a2f36;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: radial-gradient(ellipse at center, #1a1f25 0%, #050608 75%);
  font-family: 'Press Start 2P', ui-monospace, monospace;
  color: var(--neon-green);
  overflow: hidden;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

.crt {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cabinet {
  width: min(520px, 100%);
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, #1c2127 0%, #0e1115 100%);
  border: 4px solid var(--cabinet-edge);
  border-radius: 14px;
  box-shadow:
    0 0 0 2px #000,
    0 18px 50px rgba(0,0,0,0.7),
    inset 0 0 30px rgba(0, 255, 247, 0.05);
  position: relative;
}

.marquee {
  text-align: center;
  padding: 8px 6px 10px;
  border-bottom: 2px dashed rgba(0,255,247,0.25);
  margin-bottom: 10px;
  text-shadow: 0 0 6px var(--neon-cyan), 0 0 14px rgba(0,255,247,0.4);
  color: var(--neon-cyan);
}
.marquee-text {
  display: block;
  font-size: 14px;
  letter-spacing: 2px;
  animation: flicker 4s infinite;
}
.marquee-sub {
  display: block;
  margin-top: 6px;
  font-size: 8px;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
  letter-spacing: 1px;
}

.hud {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1.4fr 1fr;
  gap: 8px;
  padding: 8px 4px 10px;
  font-size: 9px;
}
.hud-cell {
  background: #06080a;
  border: 2px solid #1c2126;
  padding: 6px 6px;
  text-align: center;
  box-shadow: inset 0 0 8px rgba(57,255,20,0.08);
}
.hud-label {
  display: block;
  font-size: 7px;
  color: var(--neon-yellow);
  margin-bottom: 4px;
  text-shadow: 0 0 5px rgba(255,242,31,0.6);
}
#score, #hi, #lives, #level {
  color: var(--neon-green);
  text-shadow: 0 0 5px var(--neon-green);
}
#lives { color: var(--neon-pink); text-shadow: 0 0 6px var(--neon-pink); }

.screen-wrap {
  position: relative;
  background: #000;
  border: 3px solid #1c2126;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    inset 0 0 40px rgba(0,255,247,0.07),
    inset 0 0 80px rgba(0,0,0,0.6);
}

canvas#game {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  background: #000;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.85) 100%);
  z-index: 3;
  text-align: center;
  padding: 20px;
}
.overlay.hidden { display: none; }
.overlay-inner h1 {
  font-size: 22px;
  color: var(--neon-pink);
  text-shadow: 0 0 8px var(--neon-pink), 0 0 18px rgba(255,43,214,0.6);
  margin-bottom: 18px;
  letter-spacing: 3px;
}
.overlay-inner p { font-size: 9px; line-height: 1.8; color: var(--neon-cyan); text-shadow: 0 0 4px var(--neon-cyan); }
.overlay-inner .hint { color: var(--neon-yellow); text-shadow: 0 0 4px var(--neon-yellow); margin-top: 10px; font-size: 8px; }
.blink { animation: blink 1s steps(2, end) infinite; }

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.25) 3px,
    rgba(0,0,0,0.25) 3px
  );
  mix-blend-mode: multiply;
  z-index: 4;
}
.vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 100%);
  z-index: 5;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 6px 2px;
  font-size: 7px;
  color: rgba(57,255,20,0.5);
  letter-spacing: 1px;
}
.muted { color: var(--neon-yellow); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes flicker {
  0%, 19%, 21%, 23%, 100% { opacity: 1; }
  20%, 22% { opacity: 0.7; }
}

@media (max-width: 540px) {
  .cabinet { padding: 12px; }
  .marquee-text { font-size: 11px; }
  .overlay-inner h1 { font-size: 16px; }
}
