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

body {
  background: #000;
  color: #00FF00;
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  position: absolute;
  background: #1a1a1a;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

#game-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Menu Screens */
.menu-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  pointer-events: all;
}

.game-title {
  font-size: 48px;
  color: #00FF00;
  margin-bottom: 60px;
  text-shadow: 
    0 0 10px #00FF00,
    0 0 20px #00CC00,
    0 0 30px #009900;
  animation: matrix-glow 2s ease-in-out infinite alternate;
}

@keyframes matrix-glow {
  from { 
    text-shadow: 
      0 0 10px #00FF00,
      0 0 20px #00CC00,
      0 0 30px #009900;
  }
  to { 
    text-shadow: 
      0 0 20px #00FF00,
      0 0 30px #00CC00,
      0 0 40px #009900;
  }
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.menu-button {
  background: transparent;
  border: 2px solid #00FF00;
  color: #00FF00;
  padding: 15px 30px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  pointer-events: all;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.menu-button:hover {
  background: #00FF00;
  color: #000;
  transform: scale(1.05);
  box-shadow: 
    0 0 10px #00FF00,
    0 0 20px #00CC00,
    inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.menu-footer {
  font-size: 10px;
  color: #666;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* HUD */
#game-hud {
  pointer-events: none;
}

.hud-top {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.hud-bottom {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-display,
.combo-display,
.wave-display,
.health-display,
.powerup-display,
.power-meter-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Intro & Instructions */
.intro-screen,
.instructions-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: #00FF00;
  padding: 40px;
  pointer-events: all;
  font-family: 'Share Tech Mono', monospace;
}

#intro-text {
  white-space: pre-line;
  line-height: 1.6;
  font-size: 14px;
}

.intro-prompt,
.instructions-prompt {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 16px;
  animation: blink 1s infinite;
}

.instructions-content {
  display: flex;
  justify-content: space-around;
  margin-top: 40px;
}

.instructions-column {
  flex: 1;
  max-width: 300px;
}

.instructions-column h3 {
  color: #00CC00;
  margin: 20px 0 10px;
  font-size: 16px;
}

.instructions-column p {
  color: #009900;
  margin: 5px 0;
  font-size: 12px;
  padding-left: 20px;
}

/* Power Meter */
.power-meter-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.power-meter {
  display: flex;
  gap: 4px;
  padding: 2px;
  border: 2px solid #00FF00;
  background: #001100;
}

.power-segment {
  width: 20px;
  height: 10px;
  background: #003300;
  transition: all 0.3s;
}

.power-segment.active {
  background: #00FF00;
  box-shadow: 0 0 10px #00FF00;
}

/* Update colors */
.label {
  color: #00CC00;
  font-size: 10px;
}

#score-value {
  color: #00FF00;
  text-shadow: 0 0 5px #00FF00;
}

#combo-value {
  color: #00FF00;
  font-size: 16px;
  text-shadow: 0 0 10px #00FF00;
}

.health-bar {
  width: 100px;
  height: 10px;
  border: 2px solid #00FF00;
  background: #001100;
}

.health-fill {
  height: 100%;
  background: #00FF00;
  transition: width 0.3s;
  box-shadow: 0 0 5px #00FF00;
}

.powerup-icon {
  width: 32px;
  height: 32px;
  border: 2px solid #00CC00;
  background: #001100;
}

/* Game Over */
.game-over-title {
  font-size: 24px;
  color: #FF0000;
  margin-bottom: 40px;
  text-shadow: 
    0 0 10px #FF0000,
    0 0 20px #CC0000;
}

.final-score {
  text-align: center;
  margin-bottom: 30px;
}

.final-score p:first-child {
  font-size: 12px;
  color: #00CC00;
  margin-bottom: 10px;
}

#final-score-value {
  font-size: 20px;
  color: #00FF00;
  text-shadow: 0 0 10px #00FF00;
}

.new-record {
  font-size: 16px;
  color: #00FF00;
  margin-bottom: 20px;
  animation: blink 0.5s infinite;
}

.name-input {
  background: #001100;
  border: 2px solid #00FF00;
  color: #00FF00;
  padding: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  text-align: center;
  width: 120px;
  margin-bottom: 30px;
  text-transform: uppercase;
}

/* Control Legend */
.control-legend {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border: 1px solid #00FF00;
  border-radius: 4px;
  font-size: 11px;
}

.control-item {
  color: #00CC00;
  white-space: nowrap;
}

.control-item:hover {
  color: #00FF00;
}

/* High Scores */
.screen-title {
  font-size: 20px;
  color: #00FF00;
  margin-bottom: 40px;
}

.highscores-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 40px;
  min-width: 300px;
}

.highscore-entry {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.highscore-rank {
  color: #009900;
}

.highscore-name {
  color: #00FF00;
  flex: 1;
  text-align: center;
}

.highscore-score {
  color: #00CC00;
}

/* Mobile Controls */
.mobile-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: all;
  display: flex;
  justify-content: space-between;
  padding: 20px;
}

.virtual-dpad {
  width: 150px;
  height: 150px;
  position: relative;
}

.action-buttons {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.action-button {
  width: 60px;
  height: 60px;
  border: 2px solid #00FF00;
  background: rgba(0, 255, 0, 0.1);
  color: #00FF00;
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  border-radius: 50%;
  cursor: pointer;
  touch-action: none;
}

.action-button:active {
  background: #00FF00;
  color: #000;
  transform: scale(0.95);
}

/* CRT Effect */
#game-canvas::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .game-title {
    font-size: 24px;
  }
  
  .menu-button {
    font-size: 12px;
    padding: 12px 24px;
  }
  
  .hud-top {
    font-size: 10px;
  }
  
  #combo-value {
    font-size: 14px;
  }
}