/* style.css */
body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* 禁止滾動 */
  background-color: #000;
  touch-action: none;
  /* 關鍵：禁止手機瀏覽器預設的滑動行為 */
  font-family: "Microsoft JhengHei", Arial, sans-serif;
}

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

canvas {
  display: block;
  background-color: #333;
  /* 遊戲背景色 */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* --- 手機版 UI 層 (預設隱藏，手機端透過 JS 或 Media Query 顯示) --- */
#uiLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* 讓點擊穿透到下方 Canvas，除非點到按鈕 */
  display: none;
  /* 預設 PC 不顯示 */
}

/* 左側虛擬搖桿區域 */
#joystickZone {
  position: absolute;
  bottom: 50px;
  left: 50px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: auto;
  /* 允許接收觸控 */
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* 搖桿頭 */
#joystickKnob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* 右側功能鍵區域 */
#actionZone {
  position: absolute;
  bottom: 50px;
  right: 50px;
  pointer-events: auto;
  display: flex;
  gap: 20px;
}

.game-btn {
  width: 60px;
  height: 60px;
  background: rgba(0, 200, 0, 0.6);
  border-radius: 50%;
  color: white;
  font-size: 14px;
  border: 2px solid #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.btn-pause {
  background: rgba(200, 200, 0, 0.6);
}

.btn-save {
  background: rgba(0, 0, 200, 0.6);
}

/* --- 手機強制橫屏提示 (可選) --- */
@media screen and (orientation: portrait) {
  /* 這裡可以加一個覆蓋層提示用戶轉向，目前先不做，讓遊戲自動適配 */
}