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

body {
  font-family: 'Courier New', monospace;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1042 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  overflow: hidden;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
  width: 100%;
  max-width: 800px;
}

.game-header {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 15px 25px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.score-board {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.label {
  font-size: 0.75rem;
  color: #00ff88;
  letter-spacing: 2px;
  font-weight: bold;
}

.value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.canvas-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 255, 136, 0.2);
}

#gameCanvas {
  display: block;
  background: #000;
  border: 2px solid #00ff88;
  border-radius: 8px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  text-align: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 12px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.game-title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  background: linear-gradient(45deg, #00ff88, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  letter-spacing: 4px;
  font-weight: bold;
}

.instructions {
  margin-bottom: 30px;
  font-size: 1rem;
  color: #aaa;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(45deg, #00ff88, #00d4ff);
  color: #000;
  border: none;
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 255, 136, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

.controls-hint {
  font-size: 0.85rem;
  color: #666;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Game Over Screen */
.game-over-screen {
  text-align: center;
}

.game-over-screen h2 {
  font-size: 2rem;
  color: #ff4444;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.final-score {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #00ff88;
}

.new-high-score {
  color: #ffd700;
  font-size: 1.2rem;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  animation: glow 1s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-container {
    padding: 10px;
    gap: 15px;
  }

  .game-title {
    font-size: 1.8rem;
  }

  .score-board {
    gap: 15px;
  }

  .value {
    font-size: 1.2rem;
  }

  .overlay-content {
    padding: 30px 20px;
  }

  .btn-primary {
    padding: 12px 30px;
    font-size: 1rem;
  }

  .instructions {
    font-size: 0.9rem;
  }

  #gameCanvas {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }

  .score-item {
    gap: 3px;
  }

  .label {
    font-size: 0.65rem;
  }

  .controls-hint {
    font-size: 0.75rem;
    text-align: center;
  }
}