* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: manipulation; /* Prevents double-tap zoom on iOS */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#gameContainer {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
  z-index: 1;
  cursor: crosshair;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#gameUI {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

#score {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
}

#checkpointScore {
  position: absolute;
  top: 50px;
  left: 20px;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0.8;
}

#lives {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
}

#soundStatus {
  position: absolute;
  top: 80px;
  left: 20px;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0.8;
}

.game-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: all 0.2s;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-button:hover {
  background: #45a049;
  transform: translate(-50%, -50%) scale(1.05);
}

.game-button:active {
  transform: translate(-50%, -50%) scale(0.95);
}

#enableMotion {
  background: #FF9800;
}

#enableMotion:hover {
  background: #F57C00;
}

#gameOver {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(0,0,0,0.8);
  padding: 30px;
  border-radius: 15px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 250px;
}

#gameOver h2 {
  margin-bottom: 15px;
  color: #ff4444;
}

#finalScore {
  margin-bottom: 20px;
  font-size: 18px;
}

#restartCheckpointButton, #restartBeginningButton {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: 100%;
  padding: 10px 20px; /* Reduced padding */
  margin-top: 5px; /* Added margin between buttons */
}

#restartCheckpointButton:hover, #restartBeginningButton:hover {
  transform: scale(1.05);
}

#restartCheckpointButton:active, #restartBeginningButton:active {
  transform: scale(0.95);
}

#livesRemaining {
  font-size: 16px;
  margin-bottom: 10px;
}

/* iOS Safari specific styles */
@supports (-webkit-touch-callout: none) {
  body {
    position: fixed;
    width: 100%;
    height: 100%;
  }
}

/* Prevent zoom on iOS */
input, textarea, button, select {
  font-size: 16px;
}
