@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  font-family: 'Share Tech Mono', monospace;
  color: #33ff33;
  cursor: crosshair;
  user-select: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #050805;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#scanline-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  z-index: 10;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

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

.hud-label {
  display: block;
  font-size: 10px;
  letter-spacing: 3px;
  color: #1a991a;
  margin-bottom: 4px;
  text-transform: uppercase;
}

#grid-integrity,
#phosphor-reservoir,
#wave-info {
  min-width: 180px;
}

#integrity-value,
#phosphor-value,
#wave-value {
  display: block;
  font-size: 18px;
  letter-spacing: 2px;
  color: #33ff33;
  text-shadow: 0 0 8px #33ff33;
}

#integrity-bar-bg,
#phosphor-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(51, 255, 51, 0.08);
  border: 1px solid rgba(51, 255, 51, 0.3);
  margin-top: 6px;
}

#integrity-bar,
#phosphor-bar {
  height: 100%;
  background: #33ff33;
  box-shadow: 0 0 6px #33ff33;
  transition: width 0.15s ease-out;
}

#integrity-bar.critical {
  background: #ff3333;
  box-shadow: 0 0 6px #ff3333;
}

#status-message {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

#message-text {
  font-size: 14px;
  letter-spacing: 4px;
  color: #33ff33;
  text-shadow: 0 0 10px #33ff33;
}

#start-screen,
#game-over-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: auto;
}

#title {
  font-size: 42px;
  letter-spacing: 12px;
  color: #33ff33;
  text-shadow: 0 0 20px #33ff33, 0 0 40px rgba(51, 255, 51, 0.4);
  margin-bottom: 12px;
}

#subtitle {
  font-size: 14px;
  letter-spacing: 8px;
  color: #1a991a;
  margin-bottom: 40px;
}

#instructions {
  font-size: 12px;
  letter-spacing: 2px;
  line-height: 2;
  color: #1a991a;
  margin-bottom: 30px;
  text-align: left;
  display: inline-block;
}

#start-btn,
#restart-btn {
  background: transparent;
  border: 1px solid #33ff33;
  color: #33ff33;
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  letter-spacing: 6px;
  padding: 12px 32px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

#start-btn:hover,
#restart-btn:hover {
  background: rgba(51, 255, 51, 0.15);
  box-shadow: 0 0 15px rgba(51, 255, 51, 0.4);
}

#end-title {
  font-size: 36px;
  letter-spacing: 10px;
  color: #33ff33;
  text-shadow: 0 0 20px #33ff33;
  margin-bottom: 16px;
}

#end-title.defeat {
  color: #ff3333;
  text-shadow: 0 0 20px #ff3333;
}

#end-message {
  font-size: 14px;
  letter-spacing: 4px;
  color: #1a991a;
  margin-bottom: 30px;
}

#timer-box {
  margin-top: 8px;
}

#ingest-timer {
  font-size: 22px;
  letter-spacing: 3px;
  color: #ffaa00;
  text-shadow: 0 0 8px #ffaa00;
}

#score-box {
  min-width: 140px;
  text-align: right;
}

#kills-value {
  font-size: 18px;
  letter-spacing: 2px;
  color: #33ff33;
  text-shadow: 0 0 8px #33ff33;
}

/* Wave incoming flash */
#wave-flash {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(51,255,51,0.15), transparent 70%);
  opacity: 0;
  z-index: 15;
  transition: opacity 0.3s;
}

/* CRT vignette */
#crt-vignette {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
  z-index: 11;
}
