/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cyan:   #00ffff;
  --green:  #39ff14;
  --pink:   #ff2d78;
  --yellow: #ffe600;
  --purple: #bf00ff;
  --orange: #ff8c00;
  --bg:     #020010;
}

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100dvh;
  background: #020010; color: #fff;
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
}

#app-wrapper {
  display: flex; justify-content: center; align-items: stretch; /* 子供を上下いっぱいまで伸ばす */
  width: 100%; height: 100dvh; overflow: hidden;
}

#game-container {
  display: flex; flex-direction: column;
  flex: 1; /* 親の横幅残りを全て使う */
  height: 100dvh; max-width: 1200px;
  position: relative; overflow: hidden;
}

#sidebar-ranking {
  display: none;
  width: 250px; height: 100%;
  background: rgba(0, 4, 18, 0.85); box-shadow: 0 0 20px rgba(0,255,255,.1);
  border-right: 1px solid rgba(0, 255, 255, 0.2);
  padding: 20px; flex-direction: column; overflow-y: auto;
  z-index: 50; margin-right: 10px;
}
@media (min-width: 1050px) {
  #sidebar-ranking { display: flex; }
}

.sidebar-logo {
  text-align: center; margin-bottom: 25px; line-height: 0.85; margin-top: 10px;
}
.sl-hama {
  font-size: 46px; font-weight: 900; letter-spacing: 5px; font-style: italic; display: inline-block; margin-bottom: 2px;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--purple) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px var(--cyan));
}
.sl-game {
  font-size: 46px; font-weight: 900; letter-spacing: 5px; font-style: italic; display: inline-block;
  background: linear-gradient(90deg, var(--orange) 0%, var(--pink) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px var(--pink));
}

.sidebar-title {
  color: var(--yellow); text-shadow: 0 0 8px var(--yellow);
  font-family: 'Orbitron', 'Share Tech Mono', monospace; font-size: 22px; text-align: center; font-weight: bold;
  margin-bottom: 15px; letter-spacing: 5px; border-bottom: 1px dashed rgba(255,255,255,.2); padding-bottom: 10px;
}
.ranking-list-small { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.ranking-list-small li {
  display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.1);
}
.ranking-list-small li span:nth-child(1) { width: 30px; font-weight: bold; }
.ranking-list-small li span:nth-child(2) { flex: 1; text-align: left; }
.ranking-list-small li span:nth-child(3) { color: var(--cyan); text-align: right; }
.ranking-list-small li.rank-in {
  animation: bgFlash 0.4s ease-in-out 8;
  background: rgba(255,45,120,0.4);
}

@keyframes bgFlash {
  0%,100% { background: transparent; transform: scale(1); text-shadow: none; }
  50% { background: rgba(255,45,120,0.8); transform: scale(1.05); text-shadow: 0 0 10px #fff; }
}

/* ===== LAYOUT & LOGO ===== */
#gameCanvas {
  display: block;
  flex: 1; /* 縦方向の残り空間を全てキャンバスがもらう */
  width: 100%;
  max-width: 100%;
  min-height: 280px; /* 潰れ防止 */
}

/* ===== STARS ===== */
#stars-container {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none; overflow: hidden;
}
.star {
  position: absolute; background: #fff; border-radius: 50%;
  animation: twinkle var(--d,3s) var(--dl,0s) infinite alternate ease-in-out;
}
@keyframes twinkle {
  0%   { opacity: .15; transform: scale(.7); }
  100% { opacity: 1;   transform: scale(1.3); }
}
.star.shoot {
  width: 2px !important; height: 70px !important; border-radius: 0 !important;
  background: linear-gradient(to bottom, transparent, #fff);
  transform-origin: top center;
  animation: shoot 1.4s ease-in forwards;
}
@keyframes shoot {
  from { opacity:1; transform:translateY(0) rotate(155deg); }
  to   { opacity:0; transform:translateY(280px) rotate(155deg); }
}

/* ===== LAYOUT ===== */

/* ===== 新HUD: トップ(ステータス) ===== */
.hud-minimal-top {
  width: 100%; max-width: 1200px;
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap;
  padding: 8px 25px;
  background: rgba(0,8,28,.8);
  border-bottom: 2px solid rgba(0,255,255,.3);
  position: relative; z-index: 50;
  gap: 15px;
}
.hm-stat {
  display: flex; align-items: baseline; gap: 8px;
}
.hud-label {
  font-size: 18px; letter-spacing: 2px; color: rgba(0,255,255,.8); margin: 0; font-weight: bold;
}
#score-display, #hiscore-display, #level-display {
  font-family: 'Share Tech Mono', monospace; font-size: 38px;
  color: var(--cyan); text-shadow: 0 0 15px var(--cyan); line-height: 1;
}

#lives-display { display: flex; gap: 8px; margin-top: 2px; }
.life-icon { width: 24px; height: 24px; filter: drop-shadow(0 0 8px var(--green)); transition: all 0.3s; }

/* 1UP（ライフ増加）アニメーション */
.life-icon.life-gain {
  animation: lifeGainAnim 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes lifeGainAnim {
  0% { transform: scale(2.5) translateY(15px); filter: brightness(3) drop-shadow(0 0 25px #fff); opacity: 0; }
  50% { transform: scale(1.3) translateY(-5px); filter: brightness(2) drop-shadow(0 0 15px var(--green)); opacity: 1; }
  100% { transform: scale(1) translateY(0); filter: brightness(1) drop-shadow(0 0 8px var(--green)); opacity: 1; }
}

/* 被弾（ライフ減少）アニメーション */
.life-icon.life-lose {
  animation: lifeLoseAnim 0.5s ease-in forwards;
}
@keyframes lifeLoseAnim {
  0% { transform: scale(1); filter: drop-shadow(0 0 8px #ff4400) hue-rotate(130deg); }
  40% { transform: scale(1.5); filter: brightness(2) drop-shadow(0 0 20px #ff0000) hue-rotate(160deg); opacity: 1; }
  100% { transform: scale(0) translateY(30px) rotate(45deg); filter: brightness(0.5); opacity: 0; }
}

/* ===== ALERTS (CENTER ZOOM & FADE) ===== */
.alert-center {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 60px;
  font-weight: 900;
  font-family: 'Share Tech Mono', monospace;
  text-align: center;
  color: var(--yellow);
  text-shadow: 0 0 20px var(--yellow);
  display: none;
  z-index: 100;
  pointer-events: none;
  animation: alertZoomFade 2s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

.alert-center.fever {
  top: 45%;
  font-size: 70px;
  color: var(--pink);
  text-shadow: 0 0 30px var(--pink);
}

@keyframes alertZoomFade {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; text-shadow: 0 0 50px currentColor; }
  25% { transform: translate(-50%, -50%) scale(1.0); opacity: 1; }
  75% { transform: translate(-50%, -60%) scale(1.0); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(0.9); opacity: 0; }
}

/* ===== CANVAS ===== */
#gameCanvas { display: block; background: transparent; cursor: crosshair; }

/* ===== TOUCH CONTROLS ===== */
#touch-controls {
  display: flex; align-items: flex-end; justify-content: space-between;
  width: 100%; max-width: 800px;
  padding: 10px 20px 40px 20px;
  background: rgba(0,5,20,.85);
  border-top: 1px solid rgba(0,255,255,.15);
  flex-shrink: 0;
}
.dpad {
  display: grid;
  grid-template-areas:
    ". up ."
    "left center right"
    ". down .";
  gap: 8px;
}
.dpad-btn { width: 60px; height: 60px; font-size: 26px; }
.touch-btn {
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(0,255,255,.4);
  border-radius: 12px;
  font-family: 'Orbitron', monospace;
  color: var(--cyan);
  background: rgba(0,255,255,.06);
  user-select: none; -webkit-user-select: none;
  cursor: pointer;
  transition: background .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
}
.touch-btn:active,
.touch-btn.pressed {
  background: rgba(0,255,255,.3);
  box-shadow: 0 0 20px rgba(0,255,255,.8);
}
.fire-btn {
  width: 100px; height: 100px;
  font-size: 22px; letter-spacing: 2px; font-weight: bold;
  border-radius: 50%;
  border-color: rgba(255,45,120,.6);
  color: var(--pink);
  background: rgba(255,45,120,.1);
  margin-bottom: 30px; margin-right: 10px;
}
.fire-btn:active, .fire-btn.pressed {
  background: rgba(255,45,120,.3);
  box-shadow: 0 0 24px rgba(255,45,120,.9);
}

/* デスクトップでは非表示 (768px以上) */
@media (min-width: 769px) {
  #touch-controls { display: none; }
}

/* ===== OVERLAYS ===== */
.overlay {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(2,0,16,.93);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(5px);
}
.overlay.hidden { display: none; }

.overlay-content {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center; padding: 32px 28px;
  border: 1px solid rgba(0,255,255,.22); border-radius: 6px;
  background: rgba(0,8,30,.92);
  box-shadow: 0 0 50px rgba(0,255,255,.08), inset 0 0 50px rgba(0,0,60,.4);
  animation: overlayIn .35s ease forwards;
  max-width: 95vw;
}
@keyframes overlayIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* ===== HAMA GAME BIG LOGO (スタート画面) ===== */
.hama-logo-big {
  display: flex; flex-direction: column; align-items: center;
  line-height: 1; gap: 2px;
}
.hlb-top, .hlb-bottom {
  display: flex; align-items: baseline; gap: 2px;
}

/* 各文字に虹色グロー */
.hlb-h  { font-size: clamp(66px,18vw,110px); font-weight:900; letter-spacing:-2px;
           color:#00ffff; text-shadow:0 0 20px #00ffff,0 0 50px #00ffff; }
.hlb-a  { font-size: clamp(66px,18vw,110px); font-weight:900; letter-spacing:-2px;
           color:#bf00ff; text-shadow:0 0 20px #bf00ff,0 0 50px #bf00ff; }
.hlb-m  { font-size: clamp(66px,18vw,110px); font-weight:900; letter-spacing:-2px;
           color:#ff8c00; text-shadow:0 0 20px #ff8c00,0 0 50px #ff8c00; }
.hlb-a2 { font-size: clamp(66px,18vw,110px); font-weight:900; letter-spacing:-2px;
           color:#ffe600;  box-shadow: 0 0 10px #ffe600, inset 0 0 5px #ffe600;
}

/* ===== 特殊能力タイマー ===== */
#opt-inv-container {
  font-family: 'Share Tech Mono', monospace; font-size: 16px; font-weight: bold;
  text-align: center; letter-spacing: 2px;
  animation: timerPulse 1s infinite alternate;
}
#opt-inv { color: #ffe600; text-shadow: 0 0 10px #ffe600; margin: 0 8px; }
#opt-lsr { color: #00ffff; text-shadow: 0 0 10px #00ffff; margin: 0 8px; }
#opt-wid { color: #ff8c00; text-shadow: 0 0 10px #ff8c00; margin: 0 8px; }
#opt-twin { color: #ff8c00; text-shadow: 0 0 10px #ff8c00; margin: 0 8px; font-weight: bold; }

@keyframes timerPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.5); }
}
.hlb-g  { font-size: clamp(66px,18vw,110px); font-weight:900; letter-spacing:-2px;
           color:#ff2d78; text-shadow:0 0 20px #ff2d78,0 0 50px #ff2d78; }
.hlb-a3 { font-size: clamp(66px,18vw,110px); font-weight:900; letter-spacing:-2px;
           color:#39ff14; text-shadow:0 0 20px #39ff14,0 0 50px #39ff14; }
.hlb-me { font-size: clamp(66px,18vw,110px); font-weight:900; letter-spacing:-2px;
           color:#00ffff; text-shadow:0 0 20px #00ffff,0 0 50px #00ffff; }

/* 文字を揺らすアニメ */
.hlb-top span, .hlb-bottom span {
  animation: letterFloat 2.5s ease-in-out infinite;
  display: inline-block;
}
.hlb-h  { animation-delay: 0s; }
.hlb-a  { animation-delay: .15s; }
.hlb-m  { animation-delay: .3s; }
.hlb-a2 { animation-delay: .45s; }
.hlb-g  { animation-delay: .6s; }
.hlb-a3 { animation-delay: .75s; }
.hlb-me { animation-delay: .9s; }

@keyframes letterFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.hlb-tagline {
  font-size: 11px; letter-spacing: 8px; margin-top: 6px;
  color: rgba(255,255,255,.5);
}

/* ===== OVERLAY TITLES ===== */
.overlay-title {
  font-size: clamp(28px,8vw,48px); font-weight: 900; letter-spacing: 5px;
  color: var(--cyan); text-shadow: 0 0 12px var(--cyan), 0 0 40px var(--cyan);
}
.overlay-title.red-glow   { color:var(--pink);  text-shadow:0 0 10px var(--pink),0 0 35px var(--pink); }
.overlay-title.green-glow { color:var(--green); text-shadow:0 0 10px var(--green),0 0 35px var(--green); }

/* ===== DEMO INVADERS ===== */
.demo-invaders {
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(0,0,0,.4); padding: 12px 18px;
  border: 1px solid rgba(0,255,255,.14); border-radius: 3px;
}
.demo-row { display: flex; align-items: center; gap: 8px; }
.inv-canvas { image-rendering: pixelated; }
.score-hint {
  font-family: 'Share Tech Mono', monospace; font-size: 12px;
  color: rgba(255,255,255,.55);
}

/* ===== CONTROLS INFO ===== */
.controls-info {
  display: flex; flex-direction: column; gap: 4px;
  font-family: 'Share Tech Mono', monospace; font-size: 11px;
  color: rgba(0,255,255,.65); letter-spacing: 1px;
}

/* ===== NEON BUTTON ===== */
.neon-btn {
  font-family: 'Orbitron', monospace; font-weight: 700;
  font-size: 13px; letter-spacing: 5px;
  padding: 13px 32px;
  background: transparent; color: var(--cyan);
  border: 2px solid var(--cyan); border-radius: 2px;
  cursor: pointer; text-transform: uppercase;
  box-shadow: 0 0 12px rgba(0,255,255,.4), inset 0 0 10px rgba(0,255,255,.04);
  transition: all .2s ease;
  animation: btnPulse 2s ease-in-out infinite;
}
@keyframes btnPulse {
  0%,100% { box-shadow:0 0 12px rgba(0,255,255,.4),inset 0 0 10px rgba(0,255,255,.04); }
  50%     { box-shadow:0 0 28px rgba(0,255,255,.9),inset 0 0 18px rgba(0,255,255,.14); }
}
.neon-btn:hover  { background:rgba(0,255,255,.1); transform:scale(1.05); }
.neon-btn:active { transform:scale(.97); }

/* ===== FINAL SCORE ===== */
#final-score-display, #cleared-level-display {
  font-family: 'Share Tech Mono', monospace; font-size: 16px;
  color: var(--yellow); text-shadow: 0 0 10px var(--yellow); letter-spacing: 2px;
}

/* ===== INPUT & BUTTON GROUP ===== */
.btn-group { display: flex; gap: 16px; margin-top: 10px; }

.neon-input {
  font-family: 'Share Tech Mono', monospace; font-size: 24px;
  color: var(--cyan); background: rgba(0,255,255,.05);
  border: 2px solid var(--cyan); border-radius: 4px; padding: 12px;
  text-align: center; width: 220px; outline: none;
  text-transform: uppercase;
  box-shadow: inset 0 0 10px rgba(0,255,255,.2);
}
.neon-input:focus {
  box-shadow: inset 0 0 15px rgba(0,255,255,.5), 0 0 12px var(--cyan);
}

.neon-btn.secondary {
  border-color: var(--pink); color: var(--pink);
  box-shadow: 0 0 12px rgba(255,45,120,.4), inset 0 0 10px rgba(255,45,120,.04);
  animation: btnPulsePink 2s ease-in-out infinite;
}
@keyframes btnPulsePink {
  0%,100% { box-shadow:0 0 12px rgba(255,45,120,.4),inset 0 0 10px rgba(255,45,120,.04); }
  50%     { box-shadow:0 0 28px rgba(255,45,120,.9),inset 0 0 18px rgba(255,45,120,.14); }
}
.neon-btn.secondary:hover { background: rgba(255,45,120,.1); }

/* ===== RANKING BOARD ===== */
.ranking-list-big {
  list-style: none; width: 100%; min-width: 280px;
  font-family: 'Share Tech Mono', monospace; font-size: 18px; color: #fff;
  text-align: left; margin: 10px 0;
}
.ranking-list-big li {
  display: flex; justify-content: space-between; padding: 10px 12px;
  border-bottom: 1px dashed rgba(255,255,255,.2);
}
.ranking-list-big li span:first-child { width: 40px; }
/* ===== 新HUD: ボトム(ゲージ) ===== */
.hud-minimal-bottom {
  width: 100%; max-width: 1200px;
  padding: 10px 25px;
  background: rgba(0,8,28,.85);
  border-top: 1px dashed rgba(0,255,255,.3);
  position: relative; z-index: 50;
  display: flex; flex-direction: column; align-items: center; gap: 8px; /* ゲージの下にタイマーを表示するためcolumnに変更 */
}

/* ゲージ類 */
.hud-gauges {
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: center;
  margin: 0;
}
.gauge-row {
  display: flex; align-items: center; gap: 6px;
}
.g-label {
  width: auto; text-align: right; letter-spacing: 2px;
  font-size: 16px; color: #fff; text-shadow: 0 0 5px rgba(255,255,255,0.7);
  font-style: italic; font-weight: bold; margin-right: 4px;
}
.g-bar {
  display: flex; gap: 3px; align-items: center;
}
.gauge-cell {
  width: 14px; height: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.15);
  transform: skewX(-15deg);
  box-shadow: inset 0 0 4px rgba(0,0,0,0.8);
  transition: all 0.2s ease-out;
}

#opt-spd .gauge-cell.fill {
  background: var(--cyan); border-color: #fff;
  box-shadow: 0 0 12px var(--cyan), inset 0 0 8px #fff;
}
#opt-msl .gauge-cell.fill {
  background: var(--pink); border-color: #fff;
  box-shadow: 0 0 12px var(--pink), inset 0 0 8px #fff;
}
#opt-pwr .gauge-cell.fill {
  background: var(--yellow); border-color: #fff;
  box-shadow: 0 0 12px var(--yellow), inset 0 0 8px #fff;
}

/* MAX時のアニメーション (ゲージ全体が脈打つ) */
.g-bar.max .gauge-cell.fill {
  animation: gaugePulse 0.4s infinite alternate;
}
@keyframes gaugePulse {
  from { filter: brightness(1) drop-shadow(0 0 2px #fff); }
  to { filter: brightness(1.4) drop-shadow(0 0 8px #fff); }
}

/* 新規取得セルのフラッシュアニメーション */
.gauge-cell.new-fill {
  animation: cellFlash 0.5s ease-out forwards;
}
@keyframes cellFlash {
  0%   { filter: brightness(3) drop-shadow(0 0 15px #fff); transform: scale(1.6) skewX(-15deg); background: #fff; z-index: 10; position: relative; }
  100% { filter: brightness(1) drop-shadow(0 0 2px rgba(255,255,255,0.5)); transform: scale(1) skewX(-15deg); z-index: 1; }
}


.ranking-list-big li span:nth-child(2) { flex: 1; text-align: left; padding-left:10px; }
.ranking-list-big li span:nth-child(3) { text-align: right; color: var(--cyan); padding-right: 15px;}
.ranking-list-big li span:last-child { text-align: right; font-size: 13px; color: rgba(255,255,255,0.6); width: 90px; }
.ranking-list-big li.rank-1 { color: var(--yellow); text-shadow: 0 0 8px var(--yellow); font-size: 22px; }
.ranking-list-big li.rank-1 span:nth-child(3) { color: var(--yellow); }
.ranking-list-big li.rank-2 { color: #ccc; text-shadow: 0 0 8px #ccc; }
.ranking-list-big li.rank-2 span:nth-child(3) { color: #ccc; }
.ranking-list-big li.rank-3 { color: #d98a55; text-shadow: 0 0 8px #d98a55; }
.ranking-list-big li.rank-3 span:nth-child(3) { color: #d98a55; }

/* ===== スマホ/狭小画面 最適化 ===== */
@media (max-width: 600px), (max-height: 750px) {
  .overlay-content {
    gap: 8px;
    padding: 12px 14px;
    max-height: 98vh;
    overflow-y: auto;
  }
  .hlb-h, .hlb-a, .hlb-m, .hlb-a2, .hlb-g, .hlb-a3, .hlb-me {
    font-size: clamp(30px, 8vw, 44px);
  }
  .hlb-tagline { margin-top: 2px; font-size: 9px; }
  .demo-invaders { padding: 6px 12px; gap: 4px; }
  .demo-row canvas { transform: scale(0.85); transform-origin: center; margin:-4px 0; }
  .controls-info { font-size: 11px; gap: 2px; }
  .controls-info p { margin: 1px 0 !important; line-height: 1.2; }
  .controls-info h3 { margin-top: 4px !important; margin-bottom: 2px !important; font-size: 12px; }
  .neon-btn { padding: 8px 16px; font-size: 12px; }
  .btn-group { gap: 10px; margin-top: 4px; }
  .touch-btn { width: 56px; height: 44px; font-size: 16px; }
  .fire-btn { width: 80px; height: 44px; font-size: 11px; letter-spacing: 1px; }
}

/* ===== スマホ/狭小画面用 タッチコントロール ===== */
#touch-controls { display: none; }
@media (max-width: 768px) {
  /* HUDトップを極限まで薄くし、2列での表示にする */
  .hud-minimal-top {
    padding: 2px 5px !important;
    gap: 2px !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  .hm-stat {
    width: 48% !important; /* 2列 */
    justify-content: space-between !important;
    gap: 2px !important;
  }
  .hud-label {
    font-size: 10px !important;
    letter-spacing: 0 !important;
  }
  #score-display, #hiscore-display, #level-display {
    font-size: 14px !important;
    text-shadow: 0 0 5px var(--cyan) !important;
  }
  .life-icon { width: 14px !important; height: 14px !important; }

  /* ボトムHUDも少し詰める */
  .hud-minimal-bottom { padding: 4px 8px !important; gap: 4px !important; }
  .hud-gauges { gap: 8px !important; }
  .g-label { font-size: 9px !important; width: 35px !important; }
  .g-bar { height: 10px !important; width: 60px !important; }
  #touch-controls {
    display: flex; justify-content: space-around; align-items: center;
    width: 100%; padding: 10px 15px;
    background: rgba(0,8,28,0.95);
    border-top: 2px solid cyan;
    flex-shrink: 0; position: relative;
  }
  .dpad {
    display: flex; gap: 20px;
  }
  #touch-up, #touch-down { display: none !important; }
  
  .touch-btn {
    background: rgba(0, 255, 255, 0.15); border: 2px solid cyan; border-radius: 8px;
    color: white; font-weight: bold; display: flex;
    justify-content: center; align-items: center; user-select: none; touch-action: none;
    box-shadow: 0 0 10px rgba(0,255,255,0.4); font-size: 26px;
    width: 65px; height: 65px; transition: 0.1s;
  }
  .touch-btn.pressed { background: cyan; color: black; box-shadow: 0 0 20px cyan; transform: scale(0.95); }
  .fire-btn {
    width: 85px; height: 85px; border-radius: 50%; border-color: #ff2d78;
    background: rgba(255, 45, 120, 0.15); box-shadow: 0 0 15px rgba(255,45,120,0.5);
    font-size: 20px; font-weight: 900; letter-spacing: 2px;
  }
  .fire-btn.pressed { background: #ff2d78; color: white; box-shadow: 0 0 25px #ff2d78; transform: scale(0.95); }

  /* ボスHPバーのスマホ対応 */
  #boss-hp-bar {
    width: 90% !important;
    top: 36px !important;
    font-size: 10px !important;
  }
  /* CONTINUEボタン群のスマホ対応 */
  .btn-group { flex-wrap: wrap; justify-content: center; }
  /* パスコード入力のスマホ対応 */
  #passcode-input { font-size: 22px !important; letter-spacing: 5px !important; width: 180px !important; }
  #passcode-value { font-size: 22px !important; letter-spacing: 4px !important; }
}

/* ボスHPバーはゲームコンテナ相対 */
#boss-hp-bar {
  position: absolute;
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
  pointer-events: none;
}
