/* 3D First-Person Game Styles */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&family=JetBrains+Mono:wght@400;700&display=swap');

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0d0e12;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f3f4f6;
  user-select: none;
  -webkit-user-select: none;
}

/* 3D キャンバスのコンテナ */
#game-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* 画面中央のクロスヘア (照準) */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  mix-blend-mode: difference;
}

#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
}

/* 横線 */
#crosshair::before {
  top: 4px;
  left: 0;
  width: 10px;
  height: 2px;
}

/* 縦線 */
#crosshair::after {
  top: 0;
  left: 4px;
  width: 2px;
  height: 10px;
}

/* ポインターロック・開始オーバーレイ */
#blocker {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(13, 14, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;
  transition: opacity 0.3s ease;
}

#instructions {
  width: 100%;
  max-width: 640px;
  padding: 30px;
  background: rgba(16, 18, 27, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.15), 0 20px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

#instructions:hover {
  transform: scale(1.01);
  border-color: rgba(99, 102, 241, 0.6);
}

/* ポーズメニュー内のセクション構造 */
.menu-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 15px;
  margin-bottom: 25px;
  text-align: left;
}

/* 3つのセクションがあるため、最後のセクションは2列ぶち抜きに */
.menu-section {
  background: rgba(26, 29, 44, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 14px;
}

.menu-section:nth-child(3) {
  grid-column: span 2;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #818cf8; /* インディゴ */
  margin-top: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(129, 140, 248, 0.2);
  padding-bottom: 4px;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.status-item {
  display: flex;
  justify-content: space-between;
}

.status-label {
  color: #9ca3af;
}

.status-value {
  font-weight: 700;
}

/* コンフィグ設定 */
.config-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.config-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.config-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-slider {
  flex-grow: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #2d3142;
  outline: none;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  transition: transform 0.1s;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: #818cf8;
  min-width: 30px;
  text-align: right;
}

/* HUD (ゲーム内情報オーバーレイ) */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* 下の3Dキャンバスにクリックを通す */
  z-index: 5;
  padding: 20px;
  display: grid;
  grid-template-columns: 240px 1fr 180px;
  grid-template-rows: auto 1fr;
  grid-template-areas: 
    "left center right"
    "bottom-left . bottom-right";
}

.hud-panel {
  background: rgba(13, 14, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  pointer-events: auto; /* HUD操作を有効に（必要なら） */
}

/* 左上：プレイヤーパネル */
.left-panel {
  grid-area: left;
  gap: 12px;
  align-self: start;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.1em;
}

.hud-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.2rem;
}

/* HPバー */
.hp-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hp-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #10b981; /* 緑 */
  letter-spacing: 0.05em;
}

.hp-bar-bg {
  width: 100%;
  height: 10px;
  background: #1f2230;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
  transition: width 0.2s ease-out;
}

.hp-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: right;
  margin-top: 2px;
}

/* 武器＆弾薬 */
.weapon-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.weapon-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #a5b4fc;
}

.ammo-container {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.ammo-slash {
  font-size: 0.8rem;
  color: #4b526d;
  margin: 0 2px;
}

.ammo-max {
  font-size: 0.85rem;
  color: #6b7280;
}

/* 鍵インジケータ */
.key-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.key-indicator.locked {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.key-indicator.unlocked {
  background: rgba(16, 18, 27, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
  animation: pulse 1.5s infinite;
}

/* 中央上：統計情報 */
.center-panel {
  grid-area: center;
  align-self: start;
  justify-self: center;
  background: rgba(13, 14, 18, 0.5);
  padding: 8px 20px;
  border-radius: 0 0 16px 16px;
  border-top: none;
}

.hud-stats-grid {
  display: flex;
  gap: 24px;
}

.hud-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.65rem;
  color: #9ca3af;
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
}

/* 画面中央にポップアップするメッセージ */
.game-message {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  border-radius: 8px;
  background: rgba(13, 14, 18, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.game-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(10px);
}

/* 右上：ミニマップ */
.right-panel {
  grid-area: right;
  align-self: start;
  padding: 10px;
  border-radius: 12px;
  width: 154px;
  height: 174px;
}

.minimap-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#minimap {
  width: 130px;
  height: 130px;
  background: #090a0f;
  border-radius: 10px;
  border: 2px solid #2d3142;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.minimap-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #6366f1;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.text-green-400 { color: #4ade80; }
.text-indigo-400 { color: #818cf8; }
.text-yellow-400 { color: #facc15; }
.text-yellow-600 { color: #ca8a04; }
.text-rose-500 { color: #f43f5e; }
.text-red-400 { color: #f87171; }
.text-gray-400 { color: #9ca3af; }

.title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.subtitle {
  font-size: 1.1rem;
  color: #9ca3af;
  margin-bottom: 30px;
  letter-spacing: 0.05em;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 操作ガイド */
.controls-guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 30px;
  text-align: left;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  background: #2d3142;
  border: 1px solid #4b526d;
  border-bottom: 3px solid #1f2230;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.key.long {
  min-width: 65px;
}

.key.wide {
  min-width: 80px;
}

.desc {
  font-size: 0.95rem;
  color: #d1d5db;
  margin-left: 8px;
}

.esc-note {
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  color: #6b7280;
  margin: 0;
}

/* --- タイトル画面、高機能レイアウト、本気実話（Maji Jitsuwa）のスタイリング --- */

.menu-container {
  width: 100%;
  max-width: 680px;
  padding: 35px;
  background: rgba(16, 18, 27, 0.96);
  border: 2px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.25), 0 25px 50px rgba(0, 0, 0, 0.7);
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s ease;
  max-height: 92vh;
  overflow-y: auto;
}

/* カスタムスクロールバー */
.menu-container::-webkit-scrollbar {
  width: 6px;
}
.menu-container::-webkit-scrollbar-track {
  background: rgba(16, 18, 27, 0.5);
}
.menu-container::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 3px;
}

/* タイトルテキストのネオンデザイン */
.title-main {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0;
  background: linear-gradient(135deg, #a5b4fc 10%, #6366f1 50%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  animation: title-glow 3s infinite ease-in-out;
}

.title-produce {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  color: #818cf8;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 5px;
  margin-bottom: 25px;
  opacity: 0.95;
  text-shadow: 0 0 8px rgba(129, 140, 248, 0.5);
}

@keyframes title-glow {
  0%, 100% { text-shadow: 0 0 15px rgba(99, 102, 241, 0.4); }
  50% { text-shadow: 0 0 25px rgba(99, 102, 241, 0.7), 0 0 35px rgba(99, 102, 241, 0.4); }
}

/* 押しやすいモダンボタン */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  padding: 14px 32px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
  outline: none;
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6), 0 0 15px rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-red {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}
.btn-red:hover {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6);
}

.pulse {
  animation: btn-pulse 2s infinite;
}

@keyframes btn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* 本気実話 2D CSS キャラクター */
.sprite-showcase {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(13, 14, 18, 0) 70%);
  padding: 10px 0;
  border-radius: 20px;
  margin-bottom: 25px;
}

.maji-character-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.maji-character-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 4px 16px;
  border-radius: 20px;
  letter-spacing: 0.1em;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.maji-title-sprite {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
  object-fit: cover;
  animation: maji-title-behavior 12s infinite ease-in-out;
  background: rgba(16, 18, 27, 0.8);
}

/* タイトル画面の「本気実話」：左右に揺れながら動いたり止まったり、反転したりするアニメーション */
@keyframes maji-title-behavior {
  /* 0% - 15%: 左側で立ち止まっている (正面向き scaleX(1)) */
  0%, 15% {
    transform: translateX(-60px) scaleX(1) translateY(0) rotate(0deg);
  }
  /* 15% - 20%: 反転して右を向く */
  20% {
    transform: translateX(-60px) scaleX(-1) translateY(0) rotate(0deg);
  }
  /* 20% - 45%: 右へ移動しながら、上下に揺れる (歩行風) */
  23% { transform: translateX(-45px) scaleX(-1) translateY(-6px) rotate(-3deg); }
  26% { transform: translateX(-30px) scaleX(-1) translateY(0) rotate(3deg); }
  29% { transform: translateX(-15px) scaleX(-1) translateY(-6px) rotate(-3deg); }
  32% { transform: translateX(0px) scaleX(-1) translateY(0) rotate(3deg); }
  35% { transform: translateX(15px) scaleX(-1) translateY(-6px) rotate(-3deg); }
  38% { transform: translateX(30px) scaleX(-1) translateY(0) rotate(3deg); }
  41% { transform: translateX(45px) scaleX(-1) translateY(-6px) rotate(-3deg); }
  45% { transform: translateX(60px) scaleX(-1) translateY(0) rotate(0deg); }
  
  /* 45% - 60%: 右側で立ち止まっている */
  45%, 60% {
    transform: translateX(60px) scaleX(-1) translateY(0) rotate(0deg);
  }
  /* 60% - 65%: 反転して左を向く */
  65% {
    transform: translateX(60px) scaleX(1) translateY(0) rotate(0deg);
  }
  
  /* 65% - 90%: 左へ移動しながら、上下に揺れる (歩行風) */
  68% { transform: translateX(45px) scaleX(1) translateY(-6px) rotate(3deg); }
  71% { transform: translateX(30px) scaleX(1) translateY(0) rotate(-3deg); }
  74% { transform: translateX(15px) scaleX(1) translateY(-6px) rotate(3deg); }
  77% { transform: translateX(0px) scaleX(1) translateY(0) rotate(-3deg); }
  80% { transform: translateX(-15px) scaleX(1) translateY(-6px) rotate(3deg); }
  83% { transform: translateX(-30px) scaleX(1) translateY(0) rotate(-3deg); }
  86% { transform: translateX(-45px) scaleX(1) translateY(-6px) rotate(3deg); }
  90% { transform: translateX(-60px) scaleX(1) translateY(0) rotate(0deg); }
  
  /* 90% - 100%: 左側で立ち止まっている */
  90%, 100% {
    transform: translateX(-60px) scaleX(1) translateY(0) rotate(0deg);
  }
}

/* ハイスコア セクション */
.highscore-section {
  margin-top: 35px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 16px;
}

.highscore-title {
  font-size: 1.1rem;
  color: #fbbf24;
  margin: 0 0 12px 0;
  letter-spacing: 0.1em;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.3);
}

.highscore-table {
  width: 100%;
  border-collapse: collapse;
}

.highscore-table th {
  font-family: 'Space Grotesk', sans-serif;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.highscore-table th:last-child {
  text-align: right;
}

.highscore-table td {
  padding: 10px 16px;
}

/* ミニプロフィールカード用ミニスプライト (PauseConfig内) */
.maji-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 18px;
  text-align: left;
}

.maji-profile-img-mini {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(129, 140, 248, 0.6);
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.4);
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(16, 18, 27, 0.8);
}

.maji-profile-info {
  display: flex;
  flex-direction: column;
}

.maji-profile-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: bold;
  font-size: 0.95rem;
  color: #fbcfe8;
}

.maji-profile-desc {
  font-size: 0.75rem;
  color: #a5b4fc;
  margin-top: 2px;
  font-weight: 500;
}

/* ゲームオーバー画面の設定 */
.gameover-stats {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 25px;
  font-size: 1.15rem;
  font-family: 'Space Grotesk', sans-serif;
  display: inline-block;
}
.gameover-stats p {
  margin: 6px 0;
}

/* スマホ・タッチ操作用UI */
#touch-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 20px;
  z-index: 15;
  pointer-events: none; /* 下の3D画面のドラッグ視点移動を妨げない */
}

#touch-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto; /* ボタン上のみイベントを有効化 */
  background: rgba(16, 18, 27, 0.4);
  padding: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dpad-middle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.touch-btn {
  width: 54px;
  height: 54px;
  background: rgba(99, 102, 241, 0.3);
  border: 1.5px solid rgba(99, 102, 241, 0.5);
  border-radius: 12px;
  color: white;
  font-size: 1.3rem;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  outline: none;
  transition: background 0.1s;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
  background: rgba(99, 102, 241, 0.8);
  transform: scale(0.92);
}

.dpad-center {
  width: 44px;
  height: 44px;
}

#touch-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  pointer-events: auto; /* ボタン上のみイベントを有効化 */
}

.touch-action-btn, .touch-action-btn-shoot {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  font-size: 0.95rem;
  display: flex;
  justify-content: center;
  align-items: center;
  outline: none;
  transition: background 0.1s, transform 0.1s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-action-btn {
  background: rgba(107, 114, 128, 0.4);
  border: 1.5px solid rgba(156, 163, 175, 0.6);
  width: 60px;
  height: 60px;
  font-size: 0.8rem;
  align-self: flex-end;
}

.touch-action-btn:active {
  background: rgba(107, 114, 128, 0.8);
  transform: scale(0.92);
}

.touch-action-btn-shoot {
  background: rgba(239, 68, 68, 0.6);
  border: 2px solid rgba(239, 68, 68, 0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.touch-action-btn-shoot:active {
  background: rgba(239, 68, 68, 0.95);
  transform: scale(0.92);
}

/* スマホ用のメディアクエリ（HUDなどの最適化） */
@media (max-width: 768px) {
  #hud {
    padding: 6px;
    font-size: 0.75rem;
  }
  
  .hud-panel {
    transform: scale(0.85);
    transform-origin: top left;
  }
  
  .right-panel {
    transform-origin: top right;
  }

  .minimap-container canvas {
    width: 90px !important;
    height: 90px !important;
  }
  
  .title-main {
    font-size: 1.6rem !important;
  }
  
  .sprite-showcase {
    max-width: 140px !important;
  }
  
  .menu-sections {
    grid-template-columns: 1fr !important;
  }
  
  .menu-section:nth-child(3) {
    grid-column: span 1 !important;
  }
  
  .control-instructions {
    display: none !important;
  }
  
  /* スマホのときに説明文を変更する */
  .title-produce::after {
    content: " (スマホ：移動は十字キー、画面右ドラッグで視点移動)";
    display: block;
    font-size: 0.75rem;
    color: #818cf8;
    margin-top: 5px;
  }
}


