/* 離婚サイトと同じ配色 */
:root {
  --navy: #1B365D;
  --navy-deep: #0F2340;
  --gold: #C9A84C;
  --gold-dark: #8A6E2F;
  --ivory: #F4EFE6;
  --font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #111a26; font-family: var(--font); }
.stage { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }

/* 9:16 の枠。中の部品は枠幅基準（cqw）で拡縮するので動画上の位置とずれない */
.iv {
  position: relative;
  width: min(100%, calc((100dvh - 32px) * 9 / 16), 460px);
  aspect-ratio: 9 / 16;
  container-type: inline-size;
  --u: 1cqw;
  border-radius: 16px;
  overflow: hidden;
  background: var(--navy-deep);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
@media (max-width: 500px) {
  .stage { padding: 0; }
  .iv { width: 100%; border-radius: 0; }
}
.iv video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; visibility: hidden; }
.iv video.on { visibility: visible; }
.layer { position: absolute; inset: 0; }
.layer > * { pointer-events: auto; }

/* 最初の再生ボタン */
.poster {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 24%; gap: calc(4 * var(--u)); color: #fff; text-align: center; background: color-mix(in srgb, var(--navy-deep) 20%, transparent);
}
.poster p { margin: 0; font-weight: 700; font-size: calc(4.2 * var(--u)); line-height: 1.6; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.poster small { font-weight: 500; font-size: calc(3.2 * var(--u)); opacity: .85; }
.play {
  width: calc(20 * var(--u)); height: calc(20 * var(--u)); border-radius: 50%; border: calc(0.8 * var(--u)) solid #fff; background: color-mix(in srgb, var(--gold) 92%, transparent);
  color: #fff; display: grid; place-items: center; cursor: pointer; animation: pulse 1.8s ease-in-out infinite;
}
.play svg { width: calc(9 * var(--u)); height: calc(9 * var(--u)); margin-left: calc(1 * var(--u)); }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* 共通ボタン */
.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6cqw;
  font-family: var(--font); font-weight: 700; font-size: calc(4.3 * var(--u)); text-decoration: none; text-align: center;
  border: 0; border-radius: calc(2.4 * var(--u)); padding: calc(3.2 * var(--u)) calc(4 * var(--u)); cursor: pointer; line-height: 1.3;
}
.btn small { font-size: calc(3.2 * var(--u)); font-weight: 500; opacity: .9; }
.btn-primary { background: var(--gold); color: var(--navy-deep); box-shadow: 0 calc(1 * var(--u)) 0 var(--gold-dark); }
.btn-primary:active { transform: translateY(.6cqw); box-shadow: 0 .4cqw 0 var(--gold-dark); }
.btn-secondary { background: #fff; color: var(--navy); }
.btn-tel { background: var(--navy); color: #fff; border: .4cqw solid rgba(255,255,255,.5); }
.btn-ghost { background: transparent; color: var(--navy); border: .4cqw solid var(--navy); }
.btn-lg { font-size: calc(5.4 * var(--u)); padding: calc(4.2 * var(--u)) calc(10 * var(--u)); border-radius: calc(10 * var(--u)); }

/* 導入の開始ボタン */
.panel-start { position: absolute; left: 0; right: 0; top: 64%; display: flex; justify-content: center; animation: rise .35s ease-out both; }

/* 質問の選択肢 */
.panel-choices { position: absolute; left: 7%; right: 7%; top: 41%; display: flex; flex-direction: column; gap: calc(2.4 * var(--u)); }
.choice {
  display: flex; align-items: center; gap: calc(3.5 * var(--u)); width: 100%; text-align: left; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: calc(4.6 * var(--u)); line-height: 1.4; color: var(--navy);
  background: #fff; border: .5cqw solid color-mix(in srgb, var(--navy) 18%, transparent); border-left: calc(1.6 * var(--u)) solid var(--gold);
  border-radius: calc(2.4 * var(--u)); padding: calc(3 * var(--u)) calc(4 * var(--u)); box-shadow: 0 calc(1 * var(--u)) calc(2.5 * var(--u)) color-mix(in srgb, var(--navy-deep) 10%, transparent);
  animation: rise .35s ease-out both; transition: transform .12s, background .12s;
}
.choice:hover { background: color-mix(in srgb, var(--ivory) 50%, #fff); }
.choice:active { transform: scale(.98); background: var(--ivory); }
.choice-no {
  flex: 0 0 calc(8 * var(--u)); height: calc(8 * var(--u)); border-radius: 50%; background: var(--navy); color: var(--gold);
  display: grid; place-items: center; font-size: calc(4 * var(--u));
}
.choice-label { word-break: auto-phrase; }
.choice-label small { display: block; margin-top: .4cqw; font-size: calc(3.5 * var(--u)); font-weight: 500; color: #5a6b85; }
.back {
  position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%);
  font-family: var(--font); font-weight: 700; font-size: calc(3.6 * var(--u)); color: var(--navy);
  background: rgba(255,255,255,.8); border: .4cqw solid color-mix(in srgb, var(--navy) 30%, transparent); border-radius: calc(8 * var(--u)); padding: calc(2 * var(--u)) calc(5 * var(--u)); cursor: pointer;
}

/* 結果動画の途中に出るタグ */
.tag {
  position: absolute; left: 50%; top: 61.5%; transform: translate(-50%, calc(2 * var(--u))); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: calc(2.4 * var(--u)); white-space: nowrap; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: calc(4.2 * var(--u)); color: var(--navy-deep);
  background: #fff; border: .6cqw solid var(--gold); border-radius: calc(10 * var(--u)); padding: calc(2.6 * var(--u)) calc(5 * var(--u));
  box-shadow: 0 calc(1 * var(--u)) calc(4 * var(--u)) rgba(0,0,0,.35); transition: opacity .3s, transform .3s;
}
.tag.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tag-dot { width: calc(2.4 * var(--u)); height: calc(2.4 * var(--u)); border-radius: 50%; background: var(--gold); animation: blink 1.2s infinite; }
.tag-arrow { color: var(--gold-dark); font-size: calc(5 * var(--u)); line-height: 1; }
@keyframes blink { 50% { opacity: .25; } }

/* 結果の終了パネル */
.panel-end {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 42%; overflow-y: auto;
  padding: calc(8 * var(--u)) calc(6 * var(--u)) calc(5 * var(--u)); display: flex; flex-direction: column; gap: calc(2.6 * var(--u));
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--navy-deep) 92%, transparent) 12%, color-mix(in srgb, var(--navy-deep) 97%, transparent) 100%);
  animation: fade .4s ease-out both;
}
/* 回答に応じた注記（1行のボタン。タップで詳細ポップアップ） */
.note {
  display: flex; align-items: center; gap: calc(2.4 * var(--u)); width: 100%; cursor: pointer; text-align: left;
  font-family: var(--font); font-weight: 700; font-size: calc(3.7 * var(--u)); color: var(--navy);
  background: var(--ivory); border: 0; border-left: calc(1.4 * var(--u)) solid var(--gold); border-radius: calc(2.4 * var(--u)); padding: calc(2.6 * var(--u)) calc(4 * var(--u));
}
.note-icon { flex: 0 0 calc(5.4 * var(--u)); height: calc(5.4 * var(--u)); border-radius: 50%; background: var(--gold); color: var(--navy-deep); display: grid; place-items: center; font-size: calc(3.4 * var(--u)); }
.note .tag-arrow { margin-left: auto; }
.ctas { display: grid; grid-template-columns: 1fr 1fr; gap: calc(2.6 * var(--u)); }
.ctas .btn-primary { grid-column: 1 / -1; font-size: calc(5 * var(--u)); }
.subnav { display: flex; justify-content: space-between; align-items: center; gap: calc(3 * var(--u)); }
.related { color: var(--gold); font-weight: 700; font-size: calc(3.4 * var(--u)); text-decoration: none; word-break: auto-phrase; }
.again {
  flex: 0 0 auto; font-family: var(--font); font-weight: 700; font-size: calc(3.4 * var(--u)); color: #fff; background: transparent;
  border: .4cqw solid rgba(255,255,255,.5); border-radius: calc(8 * var(--u)); padding: calc(1.8 * var(--u)) calc(4 * var(--u)); cursor: pointer;
}

/* 用語ポップアップ */
.popup-wrap { position: absolute; inset: 0; background: color-mix(in srgb, var(--navy-deep) 60%, transparent); display: flex; align-items: center; padding: calc(6 * var(--u)); animation: fade .2s both; }
.popup { background: #fff; border-radius: calc(3 * var(--u)); padding: calc(6 * var(--u)) calc(5.5 * var(--u)); border-top: calc(1.6 * var(--u)) solid var(--gold); animation: rise .25s ease-out both; }
.popup h3 { margin: 0 0 calc(3 * var(--u)); color: var(--navy); font-size: calc(5.2 * var(--u)); }
.popup p { margin: 0 0 calc(5 * var(--u)); color: #333; font-size: calc(3.9 * var(--u)); line-height: 1.75; }
.popup-row { display: grid; grid-template-columns: 1fr 1fr; gap: calc(2.6 * var(--u)); }
.popup-row .btn { font-size: calc(3.8 * var(--u)); padding: calc(3 * var(--u)) calc(2 * var(--u)); }
.popup-row .btn-secondary { background: var(--gold); color: var(--navy-deep); }

@keyframes rise { from { opacity: 0; transform: translateY(calc(3 * var(--u))); } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== PC版（16:9） ===== */
.iv.pc { width: min(100%, calc((100dvh - 32px) * 16 / 9), 1280px); aspect-ratio: 16 / 9; --u: .52cqw; }
@media (max-width: 500px) { .iv.pc { width: 100%; } }
.iv.pc .poster { flex-direction: row; justify-content: center; align-items: flex-end; padding: 0 0 7% 36%; gap: calc(2 * var(--u)); }
.iv.pc .play { width: calc(12 * var(--u)); height: calc(12 * var(--u)); }
/* PC版もスマホ版と同じ比率（三角＝円の45%、右へ5%）にそろえる */
.iv.pc .play svg { width: calc(5.4 * var(--u)); height: calc(5.4 * var(--u)); margin-left: calc(.6 * var(--u)); }
.iv.pc .poster p { text-align: left; }
.iv.pc .panel-start { top: 66%; left: 37%; right: 3%; }
.iv.pc .panel-choices { left: 50%; right: 5%; top: 55%; transform: translateY(-50%); gap: calc(2.2 * var(--u)); }
.iv.pc .back { left: 5%; right: auto; bottom: 5%; transform: none; }
.iv.pc .tag { left: 77%; top: 80%; }
.iv.pc .panel-end {
  left: 56%; right: 0; top: 43%; bottom: 0; max-height: none; padding: calc(4 * var(--u)) calc(5 * var(--u));
  background: color-mix(in srgb, var(--navy-deep) 94%, transparent); border-top-left-radius: calc(3 * var(--u)); justify-content: center;
}
.iv.pc .popup-wrap { justify-content: center; }
.iv.pc .popup { max-width: 58%; }
.iv.pc .ctas .btn { font-size: calc(3.6 * var(--u)); padding: calc(2.4 * var(--u)) calc(2 * var(--u)); }
.iv.pc .ctas .btn-primary { font-size: calc(4.2 * var(--u)); }
.iv.pc .panel-end { gap: calc(2 * var(--u)); }

/* サイトのページに埋め込んだとき：外枠の余白・影・角丸はページ側に任せる */
body.embed { background: transparent; }
body.embed .stage { padding: 0; height: 100%; }
body.embed .iv, body.embed .iv.pc { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
/* PC版の終了パネルは高さが限られるので、注記が2つでも収まるよう詰める */
.iv.pc .panel-end { padding: calc(3 * var(--u)) calc(4.5 * var(--u)); gap: calc(1.6 * var(--u)); }
.iv.pc .note { font-size: calc(3.2 * var(--u)); padding: calc(1.8 * var(--u)) calc(3 * var(--u)); }
.iv.pc .related, .iv.pc .again { font-size: calc(3 * var(--u)); }
