:root {
  --bg: #07060a;
  --ink: #f4ece8;
  --accent: #ff4060;
  --muted: #b8a8b0;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.stage-wrap {
  position: relative;
  width: min(100vw, 177.78vh); /* 16:9 を画面に収める */
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 80px rgba(255, 40, 70, 0.12);
}
#stage {
  display: block;
  width: 100%;
  height: 100%;
}

/* DOM オーバーレイ(録画には映らない) */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: radial-gradient(ellipse at center, rgba(10, 8, 14, 0.72), rgba(5, 4, 8, 0.92));
  backdrop-filter: blur(2px);
}
.overlay.hidden { display: none; }

.title-card, .done-card {
  max-width: 720px;
  width: 100%;
  text-align: center;
}
.badge {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.3em 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: var(--muted);
  margin-bottom: 1.2rem;
}
.badge.mock { color: #ffd27a; border-color: rgba(255, 210, 122, 0.4); }

h1 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 900;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  margin: 0 0 0.4rem;
  letter-spacing: 0.08em;
  text-shadow: 0 0 24px rgba(255, 60, 90, 0.5);
}
h1 span { font-size: 0.4em; letter-spacing: 0.3em; color: var(--muted); display: block; }

.lead { font-size: clamp(0.95rem, 2.2vw, 1.15rem); color: #e8dde0; line-height: 1.7; }
.lead b { color: var(--accent); }

.how {
  text-align: left;
  max-width: 520px;
  margin: 1.4rem auto;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}
.how li { margin-bottom: 0.4rem; }
.how li b { color: var(--accent); font-weight: 700; }
.how li .sub {
  display: block;
  font-size: 0.8rem;
  color: #8a7d86;
  line-height: 1.5;
  margin-top: 0.1rem;
}

.start {
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff4060, #b3122f);
  border: none;
  border-radius: 14px;
  padding: 0.9em 1.8em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 40, 70, 0.35);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.start:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(255, 40, 70, 0.5); }
.start:disabled { opacity: 0.6; cursor: default; transform: none; }

.mic { margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }
.note { margin-top: 1.4rem; color: #7d7078; font-size: 0.78rem; line-height: 1.6; }

/* 設定 */
.settings-fold { max-width: 440px; margin: 0 auto 1.2rem; text-align: center; }
.settings-fold summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #b39db0;
  list-style: none;
  user-select: none;
}
.settings-fold summary::-webkit-details-marker { display: none; }
.settings-fold summary::before { content: "▸ "; }
.settings-fold[open] summary::before { content: "▾ "; }
.settings-fold .settings { margin-top: 0.9rem; margin-bottom: 0.4rem; }

.settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1rem;
  max-width: 440px;
  margin: 0 auto 1.6rem;
  text-align: left;
}
.settings label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.settings label span { color: #7d7078; font-size: 0.74rem; }
.settings input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.45em 0.6em;
  text-align: center;
}
.settings input:focus { outline: none; border-color: var(--accent); }

/* 完了画面 */
.done-card h2 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  text-shadow: 0 0 20px rgba(255, 60, 90, 0.4);
}
#preview {
  width: 100%;
  max-height: 56vh;
  border-radius: 12px;
  background: #000;
  margin: 1rem 0;
}
#preview.hidden { display: none; }
.api-terms { margin: 0.4rem 0 0; font-size: 0.78rem; color: #9a8794; }
.api-terms.hidden { display: none; }
.api-terms a { color: #c9a6ff; text-decoration: underline; }

.consent {
  margin: 0.75rem auto 0.25rem;
  max-width: 34rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #cbb8c4;
}
.consent.hidden { display: none; }
.consent-row { display: flex; gap: 0.5rem; align-items: flex-start; line-height: 1.4; cursor: pointer; }
.consent-row input { margin-top: 0.2rem; flex: 0 0 auto; }
.consent-note { margin: 0.25rem 0 0; font-size: 0.8rem; color: #ff9db0; }
.consent-note.ok { color: #9fe3c0; }   /* 成功(提供受付・取り下げ案内)は中立寄りの色 */
.consent-note.hidden { display: none; }
.consent-hint { margin: 0.1rem 0 0; font-size: 0.78rem; color: #8f95b0; line-height: 1.4; }

/* 予算オーバーでの停止案内(タイトル画面)。 */
.budget-note { margin: 0.6rem auto 0; max-width: 30rem; color: #ffb4c0; font-weight: 600; line-height: 1.5; }
.budget-note.hidden { display: none; }
.consent-row.hidden { display: none; }   /* (d) 提供できるクリップが無いときはチェックごと隠す */

/* (b) ダウンロード変換の進捗案内。準備完了で中立色に切り替える。 */
.conv-status { margin: 0.4rem auto 0; max-width: 34rem; font-size: 0.82rem; color: #ffd27a; text-align: center; }
.conv-status.ready { color: #9fe3c0; }
.conv-status.hidden { display: none; }

.actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #ff4060, #b3122f);
  border: none;
  border-radius: 12px;
  padding: 0.8em 1.6em;
  cursor: pointer;
}
.btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); }
.btn.disabled { opacity: 0.4; pointer-events: none; }

/* トースト */
.toast {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 14, 20, 0.92);
  border: 1px solid rgba(255, 80, 100, 0.4);
  color: var(--ink);
  padding: 0.7em 1.2em;
  border-radius: 10px;
  font-size: 0.9rem;
  max-width: 80%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
