html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  background: radial-gradient(ellipse at 50% 20%, #1a0a2e 0%, #0a0a12 45%, #050508 100%);
  color: #0ff;
  font-family: "JetBrains Mono", "Courier New", monospace;
}

#game-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Soft vignette */
#game-wrap::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    ellipse at 50% 45%,
    transparent 0%,
    transparent 45%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

#game {
  display: block;
  margin: 0 auto;
  background: transparent;
  position: relative;
  z-index: 2;
}

/* CRT / scanlines */
#game-wrap::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12),
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.35;
}

#overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background: rgba(5, 5, 10, 0.82);
  color: #9fd;
  text-align: center;
  font-size: clamp(14px, 3.5vw, 18px);
  padding: 16px;
  box-sizing: border-box;
}

#overlay.hidden {
  display: none;
}

#overlay h1 {
  margin: 0 0 12px;
  font-size: clamp(1.4rem, 5vw, 2rem);
  text-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
  color: #aff;
}

#overlay p {
  margin: 8px 0;
  line-height: 1.5;
  color: #8cb;
  max-width: 420px;
}

#overlay button {
  background: linear-gradient(180deg, #f6f 0%, #c0c 100%);
  color: #100;
  border: none;
  padding: 12px 24px;
  margin-top: 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(255, 0, 255, 0.4);
}

#overlay button:hover,
#overlay button:focus-visible {
  background: linear-gradient(180deg, #0f0 0%, #080 100%);
  color: #020;
  outline: none;
}

#overlay .hiscore-list {
  text-align: left;
  font-size: 13px;
  margin: 12px auto;
  max-width: 280px;
  color: #7a9;
}

#overlay input.initials {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 18px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  width: 8em;
  max-width: 100%;
  text-align: center;
  background: #0a1018;
  border: 1px solid #0aa;
  color: #0ff;
  font-family: inherit;
}
