body {
  font-family: sans-serif;
  text-align: center;
  margin: 0;
  padding: 10px;
  background-color: #000;
  color: white;
  overflow-x: hidden;
}

canvas {
  border: 2px solid #0000FF;
  background-color: black;
  touch-action: none;
  max-width: 100vw;
  max-height: 70vh;
  image-rendering: pixelated; /* Scherpe pixels voor retro look */
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.lives-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 15px auto;
  padding: 10px;
  background-color: #000;
  color: #FFD700;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 1.1em;
}

#livesDisplay {
  display: flex;
  gap: 5px;
  align-items: center;
}

.life-icon {
  width: 20px;
  height: 20px;
  background-color: #FFD700;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.life-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #000;
  transform: translate(-30%, -50%);
}

.score-container {
  display: flex;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto 10px auto;
  padding: 10px;
  background-color: #111;
  border: 1px solid #333;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.game-controls {
  text-align: center;
  margin: 10px auto;
}

.new-game-btn {
  font-size: 1.5em !important;
  padding: 12px 24px !important;
  background-color: #FFD700 !important;
  color: black !important;
  border: 2px solid #FFA500 !important;
  border-radius: 15px !important;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
  margin-bottom: 15px;
}

.new-game-btn:hover {
  background-color: #FFA500 !important;
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(255, 215, 0, 0.5);
}

.new-game-btn:active {
  transform: scale(0.95);
}

.high-score, .player-score {
  font-size: 1.2em;
  color: #00FF00;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 10px;
  max-width: 300px;
  margin: 20px auto;
  padding: 20px;
}

.controls button:nth-child(1) { /* Up */
  grid-column: 2;
  grid-row: 1;
}

.controls button:nth-child(2) { /* Left */
  grid-column: 1;
  grid-row: 2;
}

.controls button:nth-child(3) { /* Down */
  grid-column: 2;
  grid-row: 3;
}

.controls button:nth-child(4) { /* Right */
  grid-column: 3;
  grid-row: 2;
}

button {
  font-size: 2em;
  padding: 15px;
  background-color: #0000FF;
  color: white;
  border: 2px solid #4444FF;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 60px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

button:hover, button:active {
  background-color: #4444FF;
  transform: scale(1.1);
}

button:active {
  transform: scale(0.95);
}

.score-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 95vw;
  margin: 0 auto 20px;
  padding: 8px 15px;
  background-color: #333;
  border-radius: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.high-score, .player-score, .lives-display, .level-display {
  font-size: 1.1em;
  font-weight: bold;
  white-space: nowrap;
}

.high-score {
  color: #FFD700; /* Goud voor high score */
}

.player-score {
  color: #00FF00; /* Groen voor player score, zoals in origineel */
}

.lives-display {
  color: #FF6B6B; /* Rood voor levens */
}

.level-display {
  color: #00BFFF; /* Blauw voor level */
}

/* Nieuwe instructies sectie */
.instructions {
  max-width: 600px;
  margin: 15px auto;
  padding: 15px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  text-align: left;
}

.instructions h3 {
  margin-top: 0;
  color: #FFD700;
  text-align: center;
  font-family: 'Courier New', monospace;
}

.instructions p {
  margin: 8px 0;
  font-size: 0.9em;
  line-height: 1.4;
}

.instructions strong {
  color: #00FF00;
}

/* Responsive design voor verschillende schermgroottes */
@media (max-width: 768px) {
  .score-container {
    font-size: 0.85em;
    padding: 6px;
    max-width: 98vw;
    gap: 8px;
  }
  
  .high-score, .player-score, .lives-display, .level-display {
    font-size: 0.95em;
  }
  
  .controls {
    max-width: 250px;
    gap: 8px;
    padding: 15px;
  }
  
  button {
    font-size: 1.8em;
    padding: 12px;
    min-height: 50px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 5px;
  }
  
  .score-container {
    font-size: 0.75em;
    padding: 4px;
    margin-bottom: 5px;
    flex-direction: column;
    gap: 5px;
  }
  
  .high-score, .player-score, .lives-display, .level-display {
    font-size: 0.9em;
  }
  
  .controls {
    max-width: 200px;
    gap: 5px;
    padding: 10px;
    margin: 10px auto;
  }
  
  button {
    font-size: 1.5em;
    padding: 8px;
    min-height: 40px;
  }
  
  canvas {
    border-width: 1px;
  }
}

/* Landscape mode op mobiel */
@media (max-height: 500px) and (orientation: landscape) {
  .controls {
    max-width: 180px;
    gap: 5px;
    padding: 5px;
    margin: 5px auto;
  }
  
  button {
    font-size: 1.2em;
    padding: 5px;
    min-height: 35px;
  }
  
  .score-container {
    font-size: 0.7em;
    padding: 3px;
    margin-bottom: 3px;
  }
}
