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

body {
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', Arial, sans-serif;
}

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

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#ui {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  color: white;
  font-size: 18px;
  background: rgba(0,0,0,0.6);
  padding: 10px 20px;
  border-radius: 10px;
  pointer-events: none;
}

#score {
  font-size: 24px;
  font-weight: bold;
}

#best-score {
  font-size: 14px;
  opacity: 0.8;
}

/* Layar mulai & game over */
#start-screen,
#gameover-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.8);
  z-index: 20;
  color: white;
  text-align: center;
}

h1 {
  font-size: 48px;
  margin-bottom: 20px;
  color: #ffcc00;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

p {
  font-size: 18px;
  margin-bottom: 30px;
  color: #ddd;
}

button {
  padding: 15px 40px;
  font-size: 20px;
  background: #ffcc00;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  color: #333;
  font-weight: bold;
  transition: transform 0.2s, background 0.2s;
}

button:hover {
  background: #ffdb4d;
  transform: scale(1.05);
}

h2 {
  font-size: 40px;
  margin-bottom: 20px;
  color: #ff6b6b;
}

#final-score {
  font-size: 24px;
  margin-bottom: 30px;
}

/* Kontrol HP */
#mobile-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: none;
  gap: 10px;
}

#mobile-controls button {
  width: 60px;
  height: 60px;
  font-size: 24px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,204,0,0.3);
  color: white;
  border: 2px solid #ffcc00;
}

#mobile-controls button:active {
  background: #ffcc00;
  color: #333;
}

/* Tampilkan kontrol di layar kecil */
@media (max-width: 768px) {
  #mobile-controls {
    display: flex;
  }
  
  h1 {
    font-size: 32px;
  }
  
  p {
    font-size: 16px;
    padding: 0 20px;
  }
}
