html,
body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  touch-action: none;
}

canvas {
  border: 3px solid #000000;
  border-radius: 20px;
  margin: 20px auto;
  display: block;
  max-width: 90%;
  width: 100%;
  height: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  image-rendering: pixelated;
}

/* ゲームコンテナ */
#game-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

#canvas-container {
  position: relative;
  overflow: hidden;
}

/* スマホ用コントロールボタン - 大型化 */
#left-button,
#right-button {
  position: fixed;
  bottom: 30px;
  width: 120px; /* 80px → 120px */
  height: 120px; /* 80px → 120px */
  border: 4px solid #333;
  border-radius: 50%;
  background: rgba(200, 200, 200, 0.85);
  color: #333;
  font-size: 36px; /* 24px → 36px */
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  z-index: 100;

  /* 押下効果 */
  transition: all 0.1s ease;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#left-button {
  left: 30px; /* 20px → 30px */
}

#left-button::before {
  content: "◀";
}

#right-button {
  right: 30px; /* 20px → 30px */
}

#right-button::before {
  content: "▶";
}

/* ボタン押下時の効果 */
#left-button:active,
#right-button:active {
  background: rgba(150, 150, 150, 0.9);
  transform: scale(0.95);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* ボタンが押されている状態 */
#left-button.pressed,
#right-button.pressed {
  background: rgba(100, 150, 255, 0.85);
  border-color: #0066cc;
  color: white;
}

/* 小さい画面でも十分なサイズを確保 */
@media (max-width: 480px) {
  #left-button,
  #right-button {
    width: 100px; /* 60px → 100px */
    height: 100px; /* 60px → 100px */
    font-size: 30px; /* 18px → 30px */
    bottom: 20px;
  }

  #left-button {
    left: 20px;
  }

  #right-button {
    right: 20px;
  }
}

/* 極小画面（古いスマホなど）でも操作しやすく */
@media (max-width: 360px) {
  #left-button,
  #right-button {
    width: 90px;
    height: 90px;
    font-size: 28px;
    bottom: 15px;
  }

  #left-button {
    left: 15px;
  }

  #right-button {
    right: 15px;
  }
}

/* 縦長画面（アスペクト比対応） */
@media (max-height: 600px) {
  #left-button,
  #right-button {
    bottom: 15px;
    width: 90px;
    height: 90px;
    font-size: 28px;
  }
}
