@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=Orbitron:wght@500;700;900&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0014;
  font-family: 'Orbitron', monospace;
  color: #fff;
  user-select: none;
}

#gameWrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 0, 200, 0.25), transparent 60%),
    radial-gradient(ellipse at 50% 0%, rgba(0, 200, 255, 0.18), transparent 60%),
    linear-gradient(180deg, #0a0014 0%, #1a0030 50%, #0a0014 100%);
}

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

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 0, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10;
  padding: 20px;
  text-align: center;
}

.overlay.hidden { display: none; }

h1 {
  font-family: 'Audiowide', cursive;
  font-size: clamp(48px, 10vw, 120px);
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #ff00ff 0%, #00ffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(255, 0, 255, 0.6));
  margin-bottom: 8px;
  line-height: 1;
}

.subtitle {
  font-size: clamp(14px, 2vw, 18px);
  letter-spacing: 0.4em;
  color: #00ffff;
  margin-bottom: 40px;
  text-transform: uppercase;
  opacity: 0.85;
}

.instr {
  font-size: clamp(12px, 1.6vw, 15px);
  color: #ddd;
  letter-spacing: 0.2em;
  margin-bottom: 12px;
  line-height: 1.8;
}

.key {
  display: inline-block;
  padding: 4px 14px;
  margin: 0 4px;
  border: 2px solid #ff00ff;
  border-radius: 6px;
  font-weight: bold;
  color: #ff00ff;
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.5), inset 0 0 10px rgba(255, 0, 255, 0.2);
  font-family: 'Audiowide', cursive;
}

button.start {
  margin-top: 30px;
  padding: 16px 50px;
  font-family: 'Audiowide', cursive;
  font-size: clamp(18px, 2.5vw, 24px);
  letter-spacing: 0.3em;
  background: linear-gradient(135deg, #ff00ff, #00ffff);
  color: #0a0014;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.3);
  transition: transform 0.1s, box-shadow 0.2s;
  text-transform: uppercase;
}

button.start:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 0, 255, 0.9), 0 0 80px rgba(0, 255, 255, 0.5);
}

button.start:active { transform: scale(0.98); }

.stats {
  margin-top: 30px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Audiowide', cursive;
  font-size: clamp(24px, 4vw, 36px);
  color: #00ffff;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
}

#hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 5;
}

.hud-block {
  background: rgba(10, 0, 20, 0.6);
  border: 1px solid rgba(255, 0, 255, 0.4);
  padding: 8px 16px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.hud-label {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: #888;
  text-transform: uppercase;
}

.hud-value {
  font-family: 'Audiowide', cursive;
  font-size: 18px;
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

#progressBar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(50%, 400px);
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 4px;
  overflow: hidden;
  z-index: 5;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff00ff, #00ffff);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.8);
  transition: width 0.05s linear;
}

.deaths-text {
  color: #ff0066;
  text-shadow: 0 0 10px rgba(255, 0, 102, 0.6);
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 3px
  );
}
