/* 文字だけの画面。暗い背景・高いコントラスト・大きな文字（20px 以上）・大きな押し場所。絵文字・既製アイコンなし。 */
:root {
  --bg: #0b0b0c;
  --fg: #f4f2ec;
  --muted: #c9c5bb;
  --line: #f4f2ec;
  --focus: #ffd34d;
  --pointed-bg: #f4f2ec;
  --pointed-fg: #0b0b0c;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  --gap: 16px;
  --radius: 10px;
  --hit: 72px;
  --choice-min: 120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { background: transparent; } /* 地の色は html だけ（body に塗ると背景の絵が隠れる）*/
body {
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}

#app {
  min-height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.masthead h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.screen-text p { margin: 0 0 8px; color: var(--muted); font-size: 21px; }

button {
  font: inherit;
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  background: transparent;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  min-height: var(--hit);
  padding: 12px 20px;
  width: 100%;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible { outline: 4px solid var(--focus); outline-offset: 4px; }
button:disabled, button[aria-disabled="true"] { opacity: 0.55; cursor: default; }

.start { min-height: 40vh; font-size: 32px; }
.start[hidden], .start-sr[hidden] { display: none; }
.start-sr { font-size: 20px; font-weight: 400; }

.controls { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; }
.controls button { flex: 1 1 140px; width: auto; }
.controls button.wide, .controls button.big { flex-basis: 100%; }
.controls button.wide { min-height: 96px; }
/* 選ぶ場面の大きなボタン 2 つ（画面の下半分）。上に小さく「1つ目」、下に大きくボタンの文字 */
.controls button.big {
  min-height: max(var(--choice-min), 22dvh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 20px;
}
.controls button.big .sub { font-size: 17px; font-weight: 400; letter-spacing: 0.08em; color: var(--muted); }
.controls button.big .main { font-size: 28px; line-height: 1.35; }
.controls button.big:active { background-color: var(--pointed-bg); color: var(--pointed-fg); }
.controls button.big:active .sub { color: var(--pointed-fg); }
.controls button:not(.big):not(.wide) { min-height: 56px; font-size: 20px; font-weight: 400; }

/* 「聞いています」：マイクが開いているあいだだけ。文字だけで示す */
.status { margin: 0; font-size: 18px; color: var(--fg); letter-spacing: 0.06em; }
.status[hidden] { display: none; }

.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  z-index: 10;
}
.overlay[hidden] { display: none; }
.overlay h2 { margin: 0 auto 16px; max-width: 712px; font-size: 26px; }
.overlay-list { max-width: 712px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.overlay-list button { font-size: 22px; padding: 12px; white-space: pre-line; text-wrap: balance; }

@media (min-width: 900px) {
  body { font-size: 24px; }
  .masthead h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 孤立文字を出さない（行末の 1〜2 文字だけの行を避ける） */
p, h1, button { text-wrap: pretty; word-break: auto-phrase; }


/* 背景の絵（目の見える人のための飾り）。文字の読みやすさを優先し、文字の側を暗い幕で落とす */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg); }
.backdrop[hidden] { display: none; }
.bd-layer { position: absolute; inset: 0; background-size: cover; background-position: 66% 50%; opacity: 0; transition: opacity 1.8s ease; }
.bd-layer.on { opacity: 1; }
.bd-scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 11, 12, 0.90) 0%, rgba(11, 11, 12, 0.78) 34%, rgba(11, 11, 12, 0.28) 62%, rgba(11, 11, 12, 0) 100%); }
@media (max-width: 820px) {
  .bd-layer { background-position: 74% 50%; }
  .bd-scrim { background: linear-gradient(180deg, rgba(11, 11, 12, 0.80) 0%, rgba(11, 11, 12, 0.66) 30%, rgba(11, 11, 12, 0.28) 50%, rgba(11, 11, 12, 0.22) 80%, rgba(11, 11, 12, 0.45) 100%); }
  #app h1, #app p { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85); }
}
@media (min-width: 1100px) {
  #app { margin-left: clamp(32px, 7vw, 128px); max-width: 640px; }
}
@media (prefers-reduced-motion: reduce) { .bd-layer { transition: none; } }
/* 絵の上でもボタンと枠が読めるように、半透明の地を敷く */
button { background-color: rgba(11, 11, 12, 0.66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
button.is-pointed { background-color: var(--pointed-bg); color: var(--pointed-fg); }
/* 最初の画面の大きな「はじめる」：絵を隠さないよう地を薄くし、文字に影を付けて読みやすさを保つ（2026-12-06 Kengo「画像が暗すぎ」） */
.start, .start-sr { background-color: rgba(11, 11, 12, 0.34); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 12px rgba(0, 0, 0, 0.6); }
.overlay { background-color: rgba(11, 11, 12, 0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
