:root {
  --neon-blue: #0ff;
  --neon-pink: #f0f;
  --neon-yellow: #ff0;
  --bg-color: #050510;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  /* Prevent text selection on mobile tap */
  touch-action: none;
  /* Prevent browser zooming/scrolling */
}

body {
  background-color: var(--bg-color);
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  /* Retro feel */
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

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

canvas {
  background-color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
  border: 2px solid #333;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Let clicks pass through to canvas/controls */
  display: flex;
  flex-direction: column;
}

#score-board {
  padding: 10px;
  font-size: 24px;
  color: var(--neon-blue);
  text-shadow: 0 0 5px var(--neon-blue);
  position: absolute;
  top: 10px;
  left: 20px;
}

#lives-board {
  padding: 10px;
  font-size: 24px;
  color: var(--neon-blue);
  text-shadow: 0 0 5px var(--neon-blue);
  position: absolute;
  top: 10px;
  right: 20px;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  z-index: 10;
}

.screen h1 {
  font-size: 48px;
  margin-bottom: 20px;
  color: var(--neon-yellow);
  text-shadow: 0 0 10px var(--neon-yellow);
  text-align: center;
}

.hidden {
  display: none !important;
}

button {
  padding: 10px 20px;
  font-size: 20px;
  background: transparent;
  color: var(--neon-pink);
  border: 2px solid var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink);
  cursor: pointer;
  font-family: inherit;
  margin-top: 20px;
}

button:active {
  background: var(--neon-pink);
  color: #000;
}

/* Mobile Controls */
#mobile-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: none;
  /* Hidden by default on desktop */
  z-index: 5;
}

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

.d-row {
  display: flex;
  gap: 40px;
}

.d-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  pointer-events: auto;
  margin: 0;
  /* Reset button margin */
  box-shadow: none;
}

.d-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

/* Show mobile controls on touch devices or small screens */
@media (max-width: 768px) {
  #mobile-controls {
    display: block;
  }
}

.life-icon {
  width: 20px;
  height: 20px;
  background-color: var(--neon-yellow);
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  /* Open mouth visual */
  clip-path: polygon(100% 0%, 100% 100%, 50% 50%, 0% 100%, 0% 0%);
  transform: rotate(-45deg);
}