/* 🌑 全体の基本設定 */
html, body {
  margin: 0;
  padding: 0;
  background: #111;
  color: white;
  font-family: sans-serif;
  text-align: center;
  overflow: hidden;
}
/* 🎮 メニュー画面のレイアウト調整 */
#menu {
  padding-top: 100px;            /* 上方向に100pxの余白（中央寄せ） */
}

/* メニュー内のボタンデザイン */
#menu button {
  display: block;                /* ボタンをブロック要素にして縦並びに */
  margin: 10px auto;             /* 上下に10pxの余白をとり、左右は自動で中央揃え */
  padding: 10px 30px;            /* 内側の余白：上下10px・左右30px */
  font-size: 20px;               /* 文字サイズをやや大きめに */
}

/* 🗺️ ゲームマップの見た目 */
#map {
  background-image: none;
}

/* 🎨 Canvas（プレイヤー・敵・背景）描画用 */
#canvas {
  display: block;
  margin: 0 auto;
  width: 100vw;
  height: auto;
  image-rendering: pixelated;
  background: black; /* ← 念のため背景追加しておくと安心 */
}

/* 💬 ステータスUIの余白設定 */
#ui {
  margin: 10px auto;              /* 上下10pxの余白＋中央揃え */
}

/* 💥 ダメージ数値の見た目とアニメーション設定 */
.damage {
  position: absolute;             /* 画面内の座標指定を可能に */
  color: red;                     /* 赤文字で表示 */
  font-weight: bold;             /* 太字で表示 */
  pointer-events: none;          /* マウスイベントを無効に（クリック無視） */
  animation: floatUp 1s ease-out forwards; /* 下から上にフェードするアニメ演出を付与 */
}

/* 💨 ダメージ表示のアニメーション */
@keyframes floatUp {
  from {
    opacity: 1;                   /* 透明度100% */
    transform: translateY(0);     /* 初期位置 */
  }
  to {
    opacity: 0;                   /* 完全に透明に */
    transform: translateY(-30px); /* 上に30px移動して消える */
  }
}

/* 🔖 バージョン表示のデザイン */
#version {
  margin-top: 30px;              /* 上に30pxの余白 */
  font-size: 14px;               /* 小さめの文字サイズ */
  color: #ccc;                   /* 薄いグレー文字で控えめな印象に */
}

/* 💬 汎用吹き出しスタイル（敵・レベルアップ共通） */
.bubble {
  font-family: sans-serif;
  background: white;
  color: black;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 999;
  position: absolute;
  pointer-events: none;
  animation: bubble-fade 1.5s ease-out forwards;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 💨 フキダシのフェードアニメーション */
@keyframes bubble-fade {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* 🔴 攻撃時の赤フラッシュ演出 */
.enemy-attack-flash {
  filter: brightness(2) hue-rotate(-30deg);
  transition: filter 0.1s;
}

/* 📱 モバイル用仮想ボタン */
#mobile-controls {
  position: fixed;
  bottom: 60px; /* 👈 画面に近づける（以前は20px） */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
  touch-action: manipulation; /* 👈 タッチ動作を強制的にボタン化 */
}

#mobile-controls div {
  display: flex;
  justify-content: center;
  gap: 10px;
}

#mobile-controls button {
  font-size: 28px;       /* 👈 押しやすく大きく */
  padding: 16px 24px;    /* 👈 指のフィット感をアップ */
  background-color: #444;
  color: white;
  border: 2px solid #888;
  border-radius: 10px;
  min-width: 64px;       /* 👈 押せないバグ回避用 */
}

@media (min-width: 600px) {
  #mobile-controls {
    display: none;
  }
}
