/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Courier New", monospace;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
}

/* Game container */
.game-container {
  background: #2c3e50;
  border: 4px solid #34495e;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Game header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 10px;
}

.game-header h1 {
  font-size: 24px;
  color: #ecf0f1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-info {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* Health bar */
.health-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.health-container {
  width: 120px;
  height: 20px;
  background: #34495e;
  border: 2px solid #2c3e50;
  border-radius: 4px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  width: 100%;
  transition: width 0.3s ease;
}

/* Score */
.score {
  font-weight: bold;
  font-size: 16px;
}

/* Canvas */
#gameCanvas {
  border: 3px solid #34495e;
  background: #87ceeb;
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Game controls */
.game-controls {
  margin-top: 15px;
  text-align: center;
}

.controls-info {
  background: #34495e;
  padding: 10px 15px;
  border-radius: 6px;
  border: 2px solid #2c3e50;
}

.controls-info p {
  margin: 5px 0;
  font-size: 14px;
}

.controls-info strong {
  color: #3498db;
}

/* Game Over Screen */
.game-over-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.game-over-content {
  background: #2c3e50;
  padding: 40px;
  border-radius: 15px;
  border: 3px solid #3498db;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.game-over-content h2 {
  color: #e74c3c;
  font-size: 48px;
  margin: 0 0 20px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.final-score {
  color: #f39c12;
  font-size: 24px;
  margin: 20px 0;
  font-weight: bold;
}

.restart-btn {
  background: #27ae60;
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 20px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  margin: 20px 0 10px 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.restart-btn:hover {
  background: #2ecc71;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.restart-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.help-text {
  color: #bdc3c7;
  font-size: 14px;
  margin: 10px 0 0 0;
}

/* Responsive design */
@media (max-width: 900px) {
  .game-container {
    padding: 15px;
    margin: 10px;
    position: relative;
  }

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

  .game-header {
    flex-direction: column;
    gap: 10px;
  }

  .game-info {
    justify-content: center;
  }

  .game-over-content {
    padding: 30px;
  }

  .game-over-content h2 {
    font-size: 36px;
  }
}
