* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  font-family: 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro', 'MS Gothic', 'メイリオ', sans-serif;
}

#game-container {
  position: relative;
  width: 100%;
  max-width: 960px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid #4a4a6a;
  box-shadow: 0 0 30px rgba(100, 100, 200, 0.3);
}

/* =============================================
   タッチコントロール（スマホ・タブレット専用）
   ============================================= */
#touch-controls {
  display: none; /* デスクトップでは非表示 */
  width: 100%;
  background: rgba(0, 0, 0, 0.85);
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #333;
}

#touch-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

#touch-up-down {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#touch-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

#touch-right {
  display: flex;
  align-items: center;
}

.touch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 56px;
  background: rgba(60, 60, 90, 0.9);
  border: 2px solid #5a5a8a;
  border-radius: 10px;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.08s, transform 0.08s;
}

.touch-btn span {
  font-size: 9px;
  color: #aaa;
  margin-top: 2px;
}

.touch-btn:active,
.touch-btn.pressed {
  background: rgba(100, 120, 200, 0.9);
  border-color: #88aaff;
  transform: scale(0.93);
}

.touch-btn-sprint {
  width: 80px;
  height: 80px;
  font-size: 26px;
  background: rgba(40, 80, 140, 0.9);
  border-color: #4488cc;
}

.touch-btn-enter {
  width: 80px;
  height: 56px;
  background: rgba(100, 60, 20, 0.9);
  border-color: #cc8844;
  font-size: 22px;
}

/* タッチデバイス（スマホ・タブレット）でコントロールを表示 */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  #touch-controls {
    display: flex;
  }

  body {
    align-items: flex-start;
  }
}
