/* ============================================================
   style.css — UI / HUD / オーバーレイ
   近未来 SF 風。3D キャンバスの上に DOM を重ねる構成。
   ============================================================ */

:root {
  --accent: #ff8a3c;        /* Claude オレンジ */
  --accent-glow: #ffb066;
  --cyan: #4fe3ff;
  --bg-deep: #04060f;
  --font-ui: 'Orbitron', 'Trebuchet MS', 'Segoe UI', sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: #fff;
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.hidden { display: none !important; }

/* ===================== HUD ===================== */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 28px;
  pointer-events: none;
  z-index: 10;
  letter-spacing: 1px;
}
.hud-block { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.hud-center { align-items: center; text-align: center; }
.hud-right { align-items: flex-end; text-align: right; }
.hud-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  opacity: 0.75;
  text-shadow: 0 0 8px rgba(79,227,255,0.6);
}
.hud-value {
  font-size: 30px;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255,255,255,0.45);
}
.hud-lives { font-size: 24px; letter-spacing: 4px; color: var(--accent); text-shadow: 0 0 12px var(--accent-glow); }
.hud-power { margin-top: 4px; font-size: 14px; font-weight: 700; letter-spacing: 2px; color: #6cff8a; text-shadow: 0 0 8px rgba(108,255,138,0.6); }

/* ===================== オーバーレイ共通 ===================== */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  z-index: 20;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(4,6,15,0.35) 0%, rgba(4,6,15,0.82) 100%);
  animation: fadeIn 0.4s ease;
}
.overlay-clear { background: transparent; pointer-events: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===================== タイトル ===================== */
.title-main {
  font-size: clamp(40px, 8vw, 96px);
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1;
  text-shadow: 0 0 30px rgba(79,227,255,0.4), 0 0 60px rgba(79,227,255,0.2);
  animation: floaty 3.5s ease-in-out infinite;
}
.title-main .accent {
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(255,138,60,0.4);
}
.title-sub {
  font-size: clamp(12px, 2vw, 18px);
  letter-spacing: 10px;
  color: var(--cyan);
  opacity: 0.85;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.controls-card {
  margin-top: 10px;
  padding: 18px 26px;
  border: 1px solid rgba(79,227,255,0.25);
  border-radius: 14px;
  background: rgba(10,16,30,0.45);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ctrl-row { display: flex; align-items: center; gap: 12px; font-size: 15px; justify-content: center; }
.key {
  display: inline-block;
  min-width: 34px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.35);
  border-bottom-width: 3px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
}

/* ===================== ボタン ===================== */
.btn-primary {
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #04060f;
  padding: 14px 46px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent));
  box-shadow: 0 0 24px rgba(255,138,60,0.55), inset 0 0 12px rgba(255,255,255,0.3);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.btn-primary:hover { transform: scale(1.06); box-shadow: 0 0 40px rgba(255,138,60,0.8); }
.btn-primary:active { transform: scale(0.98); }

.hint { font-size: 13px; opacity: 0.6; letter-spacing: 2px; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 0.25; } 50% { opacity: 0.75; } }

/* ===================== ステージ演出 / クリア ===================== */
.stage-banner, .clear-banner { animation: stagePop 0.5s cubic-bezier(0.2,1.4,0.4,1); }
.stage-num {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(79,227,255,0.7);
}
.stage-ready { font-size: 22px; letter-spacing: 12px; margin-top: 10px; opacity: 0.85; }
.clear-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
}
.clear-sub { font-size: 20px; margin-top: 8px; color: var(--cyan); letter-spacing: 2px; }
@keyframes stagePop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===================== ゲームオーバー ===================== */
.over-title {
  font-size: clamp(40px, 9vw, 110px);
  font-weight: 900;
  letter-spacing: 8px;
  color: #ff4d4d;
  text-shadow: 0 0 30px rgba(255,77,77,0.7), 0 0 70px rgba(255,77,77,0.35);
  animation: glitch 2.4s ease-in-out infinite;
}
.over-stats { display: flex; flex-direction: column; gap: 8px; font-size: 22px; letter-spacing: 2px; }
.over-stats span { color: var(--accent); font-weight: 900; }
@keyframes glitch { 0%,100% { transform: translate(0,0); } 92% { transform: translate(0,0);} 94% { transform: translate(-3px,1px);} 96% { transform: translate(3px,-1px);} }

.pause-title { font-size: clamp(40px, 8vw, 90px); font-weight: 900; letter-spacing: 8px; color: var(--cyan); text-shadow: 0 0 30px rgba(79,227,255,0.6); }
