:root{
  --paper:#f7f2e8;
  --ink:#2b2b2b;
  --muted:#6b6b6b;
  --card:#ffffffcc;
  --stroke:#00000022;
  --shadow: 0 8px 24px rgba(0,0,0,.08);
  --radius: 18px;

  /* スマホ基準の最大幅（ここが“中央寄せの芯”） */
  --max: 720px;
}

*{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Arial, sans-serif;
  color:var(--ink);
  background: var(--paper);
}

/* 上部バー（中央に揃える） */
.topbar{
  position: static; /* ← sticky をやめる */
  background: transparent;
  border-bottom: none;
}


.brand{
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 14px;

  display:flex;
  align-items:center;
  gap:12px;
  justify-content:center;     /* ← 中央寄せ */
}

.brand__logo{
  width:44px;
  height:44px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #fff;
}

.brand__text{ text-align:left; }

.brand__title{
  font-weight:800;
  font-size: 18px;
  line-height: 1.2;
}

.brand__subtitle{
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* 全体を中央の“縦レーン”にする */
.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 14px 24px;

  display:flex;
  flex-direction:column;
  gap: 14px;

  align-items: center;        /* ← 子要素を中央に */
}

/* カードはレーン幅いっぱい（スマホでも綺麗） */
.card{
  width: 100%;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}

.label{
  font-weight: 800;
  font-size: 14px;
}

/* 画像（ロゴやヘッダー）を“画面幅にフィット”させたい時用 */
.hero{
  width: 100%;
  display:flex;
  justify-content:center;
}

.hero img{
  width: 100%;
  max-width: var(--max);
  height: auto;
  border-radius: 18px;
  display:block;
}

/* 年齢画像ボタン：中央寄せ＆均等配置 */
.age-img-group{
  width: 100%;
  display:flex;
  gap: 12px;
  justify-content:center;
  align-items:center;
}

.age-img-btn{
  flex: 1 1 0;
  max-width: 220px;        /* PCでデカくなりすぎ防止 */
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: .55;
  transition: transform .08s ease, opacity .12s ease, filter .12s ease;
  user-select: none;
}

.age-img-btn:hover{
  transform: translateY(-1px);
}

.age-img-btn.is-active{
  opacity: 1;
  filter: saturate(1.05);
}

.age-img{
  width: 100%;
  height: auto;
  display:block;
  border-radius: 16px;
  -webkit-user-drag: none;
  user-select: none;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.12));
}

/* 質問欄も中央レーン幅に合わせる */
.question{
  width:100%;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  padding: 12px 12px;
  font-size: 16px;
  line-height: 1.5;
  background: rgba(255,255,255,.9);
  outline: none;
}

.question:focus{
  border-color: rgba(0,0,0,.35);
}

/* メインボタン：中央＆レスポンシブ */
.actions{
  display:flex;
  justify-content:center;
  padding-top: 12px;
}

.ask-btn{
  border: none;
  background: transparent;
  cursor:pointer;
  padding: 0;
}

.ask-btn img{
  width: clamp(180px, 70vw, 320px);  /* ← スマホ〜PCで自然な幅 */
  height: auto;
  display:block;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.14));
  transition: transform .08s ease;
}

.ask-btn:active img{
  transform: scale(0.99);
}

.ask-btn.is-busy{
  cursor: wait;
}

.ask-btn:disabled{
  opacity: .9;
}

/* 回答ボックス */
.answer{
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.9);
  padding: 12px;
  min-height: 54px;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.6;
}

.answer--kid{
  font-size: 18px;
  font-weight: 800;
}

.answer--parent{
  color: #333;
}

/* 注釈 */
.footnote{
  width: 100%;
  text-align:center;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 0 18px;
}

.footnote__line{ margin-top: 2px; }

/* スマホで年齢ボタンが詰まる場合は2行に折る */
@media (max-width: 420px){
  .age-img-group{
    flex-wrap: wrap;
  }
  .age-img-btn{
    max-width: none;
    flex: 1 1 46%;
  }
}
.tts-actions{
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.tts-btn{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.9);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}

.tts-btn.is-playing{
  background: #fff3;
  font-weight: 700;
}
