.container {
  max-width: 800px;
  margin: 5px auto;
  padding: 5px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.game-container {
  margin: 5px auto;
  max-width: 480px;
}

.target-display {
  background-color: #f5f5f5;
  padding: 5px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.instruction {
  font-size: 24px;
  color: #333;
}

.target-emoji {
  font-size: 48px;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 5px;
}

.target-emoji:hover {
  transform: scale(1.1);
}

#gameCanvas {
  background-color: #9EAD86;
  border: 8px solid #494F42;
  border-radius: 10px;
  margin-bottom: 20px;
  width: 480px;
  height: 480px;
}

.game-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin: 15px auto;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.control-btn {
  width: 64px;
  height: 64px;
  font-size: 28px;
  background-color: #494F42;
  color: #9EAD86;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:active {
  background-color: #2c2f28;
}

.game-buttons {
  display: flex;
  justify-content: center;
}

.action-btn {
  padding: 12px 24px;
  font-size: 20px;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.action-btn:hover {
  background-color: #d32f2f;
}

.navigation {
  display: flex;
  justify-content: flex-start;
  margin-top: 20px;
  padding: 0 20px;
}

.nav-button {
  background-color: #2196F3;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 24px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s;
}

.nav-button:hover {
  background-color: #1976D2;
}

.firework {
  position: absolute;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

/* Prevent double-tap zoom on iOS */
* {
  touch-action: manipulation;
}

/* Disable text selection */
.control-btn, .action-btn {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile responsiveness */
@media (max-width: 500px) {
  .game-container {
    width: 100%;
    max-width: 100%;
  }

  #gameCanvas {
    width: 100%;
    height: auto;
    border-width: 5px;
  }

  .control-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .target-emoji {
    font-size: 40px;
  }

  .action-btn {
    padding: 10px 20px;
    font-size: 18px;
  }

  .nav-button {
    padding: 10px 20px;
    font-size: 20px;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #gameCanvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
  }
}
