/* ============================================================
   layout.css — splash / title / header / stage
   ============================================================ */

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg);
  z-index: 1000;
  transition: opacity 0.3s;
}
.splash__logo {
  /* SPEC-029: 画像ロゴ。 1100×320 banner、 横幅基準で fit */
  width: min(80vw, 480px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(86, 204, 242, 0.35));
}
.splash__loading {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Title ---------- */
.title-screen {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse at top, rgba(196,163,90,.12), transparent 60%),
    var(--bg);
  z-index: 200;
  text-align: center;
}
.title-screen__title {
  /* SPEC-029: 画像ロゴ用 wrapper (= h1 のままセマンティクスは保持) */
  margin: 0;
  display: flex;
  justify-content: center;
  width: 100%;
}
.title-screen__logo {
  width: min(86vw, 600px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 16px rgba(86, 204, 242, 0.45));
}
.title-screen__sub {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.85rem, 2.4vw, 1.1rem);
}
.title-screen__press {
  appearance: none;
  background: var(--accent);
  color: #1a1420;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  margin-top: 1rem;
  animation: press-pulse 1.6s ease-in-out infinite;
}
@keyframes press-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* ---------- Lang toggle (= title 内) ---------- */
.lang-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.lang-toggle-label {
  color: var(--muted);
  font-size: 0.85rem;
}
.lang-toggle-buttons {
  display: flex;
  gap: 0.5rem;
}
.lang-btn {
  appearance: none;
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s;
}
.lang-btn:hover { border-color: var(--accent); color: var(--text); }
.lang-btn--active {
  background: var(--accent);
  color: #1a1420;
  border-color: var(--accent);
}

/* ---------- App / Header / Stage ---------- */
.app {
  display: flex;
  flex-direction: column;
  /* SPEC-010: viewport 厳密ロック。 min-height だと HUD 折り返し時に app が伸びて
     canvas の取得 height が壊れる。 height で固定し overflow を抑える。 */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  /* SPEC-010: .app が overflow:hidden になったので sticky → 静的 (= flex 子要素として配置) */
  position: relative;
  z-index: 50;
  flex: 0 0 auto;
}
.hud { flex: 0 0 auto; }
.header__left  { justify-self: start; }
.header__center { justify-self: center; }
.header__right { justify-self: end; display: flex; gap: 0.4rem; }
.header__title {
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.stage {
  position: relative;
  /* SPEC-010: 親 .app が height:100dvh、 .header / .hud が flex:0 で頭打ちなので、
     .stage は残りの縦領域を確実に埋める。 flex-basis 0 + min-height 0 が肝。 */
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: #0e0c14;
}
