/* 影響力タイプ診断 — プロトタイプ用の最小スタイル
   スマホ縦画面前提。作り込みは骨格が動いてから。 */

:root {
  --pink: #e3aec2;
  --pink-soft: #f7e6ec;
  --pink-deep: #c2708f;
  --ink: #3b3340;
  --ink-soft: #6f6675;
  --line: #e8dde2;
  --paper: #ffffff;
  --bg: #fbf4f6;
  --caution: #fff6ef;
  --caution-line: #f0d8c4;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

/* PCで開いたとき：外側を一段濃く塗り、スマホ風カラムを画面中央に浮かせる */
@media (min-width: 600px) {
  html, body { background: #f0e2e8; }
  #app {
    background: var(--bg);
    margin: 28px auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(59, 51, 64, 0.10);
    padding: 28px 24px 48px;
  }
}

/* 画面切り替え */
.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* カード */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 14px;
}
.card.center { text-align: center; }
.card.tenkai {
  background: var(--pink-soft);
  border-color: var(--pink);
}

/* 文字 */
h1 {
  font-size: 24px;
  line-height: 1.5;
  margin: 6px 0 10px;
}
h2 {
  font-size: 19px;
  line-height: 1.6;
  margin: 0 0 16px;
}
h3 {
  font-size: 15px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--pink-deep);
  letter-spacing: 0.04em;
}
.card.tenkai h3 {
  border-bottom-color: var(--pink);
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0;
}
.lead {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
/* セリフの吹き出し。キャラ画像の下に置き、しっぽを上に向ける */
.balloon {
  position: relative;
  display: inline-block;
  background: var(--pink-soft);
  border: 1px solid var(--pink);
  border-radius: 18px;
  padding: 10px 20px;
  font-size: 16px;
  color: var(--pink-deep);
  margin: 2px 0 12px;
}
.balloon::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  margin-left: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 9px solid var(--pink);
}
.balloon::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  margin-left: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid var(--pink-soft);
}

/* あるある */
.aruaru {
  list-style: none;
  margin: 0;
  padding: 0;
}
.aruaru li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  margin-bottom: 10px;
}
.aruaru li:last-child { margin-bottom: 0; }
.aruaru li::before {
  content: "☑";
  position: absolute;
  left: 0;
  color: var(--pink-deep);
}
.note {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 12px 0 0;
}
.body p {
  margin: 0 0 12px;
  font-size: 15px;
}
.body p:last-child { margin-bottom: 0; }
.error {
  color: #c0392b;
  font-size: 13px;
  min-height: 20px;
  margin: 8px 0 0;
}
code {
  background: var(--pink-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* キャラ画像 */
.char {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 14px;
  background: var(--pink-soft);
}

/* 進捗 */
.progress { margin-bottom: 14px; }
.progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--pink);
  transition: width 0.25s ease;
}
.progress-text {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 6px 0 0;
  text-align: right;
}
.qtext { min-height: 3.2em; }

/* 選択肢 */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.option:active,
.option.selected {
  background: var(--pink-soft);
  border-color: var(--pink);
}

/* ボタン */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 10px;
  text-align: center;
  text-decoration: none;
}
.btn.primary {
  background: var(--pink-deep);
  color: #fff;
}
.btn.ghost {
  background: var(--paper);
  color: var(--pink-deep);
  border: 1px solid var(--pink);
}
.btn.link {
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 10px;
}
.btn:active { opacity: 0.75; }

/* 3ステップの説明（結果画面のシークレット区画） */
.steps {
  width: fit-content;
  margin: 14px auto 14px;
  text-align: left;
}
.steps p {
  font-size: 14px;
  line-height: 1.9;
  margin: 0 0 6px;
}
.steps p:last-child { margin-bottom: 0; }

/* コード */
.code {
  font-size: 22px;
  letter-spacing: 0.14em;
  font-family: "SF Mono", Menlo, monospace;
  color: var(--ink);
  background: var(--pink-soft);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 14px;
}

/* LP：主役の1枚絵＋その下の左右キャプション（吹き出し・名前・称号） */
.lp-heroes {
  margin: 16px 0 14px;
}
.lp-duo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 38vh;   /* ファーストビューにキャッチ大と同居させるための上限 */
  margin: 0 auto;
  border-radius: 14px;
}
.lp-captions {
  display: flex;
  justify-content: center;
  align-items: stretch;   /* 吹き出しの行数が違っても列の高さを揃える */
  gap: 6px;
  margin-top: 8px;
}
.lp-cap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lp-hero-name {
  font-size: 11px;
  margin-top: auto;   /* 吹き出しの行数が違っても、名前と称号を下端で揃える */
  padding-top: 8px;
  color: var(--ink-soft);
}
.lp-hero-title {
  font-size: 13px;
  font-weight: 600;
  margin-top: 1px;
  color: var(--ink);
}

/* LPの主役に付ける小さめの吹き出し */
.balloon.small {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 12px;
  margin: 6px 0 2px;
  text-wrap: balance;   /* 2行になるときは「正/解」のような半端な折れ方を避ける */
}

/* LP：シークレットの個別シルエット。はがきと同じ「6人が1列に並ぶ」構図。
   輪郭が個性なので円形マスクは使わない */
.lp-secrets {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;   /* 図柄の実幅で並べているので、この隙間がそのまま等間隔になる */
  margin: 4px 0;
}
.secret {
  position: relative;
  /* 6人の合計幅が画面に収まる高さ。PNGは透明余白を切り詰め済みで、幅は高さ×各自の比率になる */
  height: clamp(48px, 17vw, 72px);
}
.secret img {
  width: auto;
  height: 100%;
  opacity: 0.8;
}
/* 「?」はシルエットの上に小さく重ねるバッジ */
.secret .q,
.cell-secret .q {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(59, 51, 64, 0.55);
  border-radius: 50%;
}

/* 結果画面：8タイプの段階開示グリッド */
.grid8 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
  margin-bottom: 4px;
}
.cell-img {
  position: relative;
  width: 62px;
  height: 62px;
  margin: 0 auto;
}
.cell-img img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--pink-soft);
}
.cell-label {
  font-size: 11px;
  margin-top: 4px;
  color: var(--ink-soft);
  min-height: 16px;
  line-height: 1.4;
}
.cell-you .cell-img img { box-shadow: 0 0 0 3px var(--pink-deep); }
.cell-you .cell-label { color: var(--pink-deep); font-weight: 600; }
.cell-mate .cell-label {
  color: var(--pink-deep);
  font-size: 10px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* 未開示・相性◎は個別シルエット。円形マスクなしで輪郭を見せる */
.grid8 img.sil {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
}
.cell-secret img.sil { opacity: 0.55; }
.cell-mate img.sil {
  opacity: 0.95;
  filter: drop-shadow(0 0 5px rgba(217, 138, 168, 0.9));
}

/* 個別シルエットが無いタイプ（T02/T06）は汎用の人型シルエットで隠している。
   個別シルエットの素材が来たら SIL_IMAGES（app.js）に足すだけでよい */

/* 入力 */
input[type="text"] {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  letter-spacing: 0.1em;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: "SF Mono", Menlo, monospace;
  background: var(--bg);
  color: var(--ink);
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--pink);
  background: var(--paper);
}

/* 相性結果 */
.pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.pair-side { flex: 1; }
.pair-side img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--pink-soft);
}
.pair-name { font-size: 11px; color: var(--ink-soft); margin: 6px 0 0; line-height: 1.4; }
.pair-title { font-size: 13px; font-weight: 600; margin: 1px 0 0; line-height: 1.5; }
.pair-x { color: var(--ink-soft); font-size: 18px; }

/* 相性入力画面の「?」側 */
.pair-unknown {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto;
}
.pair-unknown img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  opacity: 0.35;
}
.pair-unknown .q {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 30px;
  font-weight: 600;
}
/* 相性結果：2人を大きく並べ、中央に%の円形バッジを重ねる */
.mpair {
  position: relative;
  display: flex;
  justify-content: center;
  /* バッジ(110px)の食い込みが左右それぞれ直径の1/4(約27px)になる間隔 */
  gap: 56px;
  margin-bottom: 4px;
}
.mpair-side {
  flex: 1;
  max-width: 150px;
  min-width: 0;
}
.mpair-side img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 4px #fff, 0 8px 18px rgba(180, 90, 125, 0.22);
}
.mpair .pair-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpair .pair-name {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.score-badge {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d98aa8 0%, #b95f84 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(185, 95, 132, 0.45);
}
.score-num {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
}
.score-sub {
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-top: 1px;
}

/* ペア専用のキャッチ（compat.json の score_label。無いペアでは非表示） */
.pair-catch {
  font-size: 15px;
  font-weight: 700;
  color: var(--pink-deep);
  margin: 14px 0 0;
  line-height: 1.6;
}

/* いまのふたり（シーン描写） */
.scene-box {
  background: var(--pink-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 14px;
  text-align: left;
}
.scene-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--pink-deep);
  margin: 0 0 2px;
}
.scene {
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

/* 解説3カードの見出し：マーカー風の下地 */
/* マーカーは transparent 入りグラデーションにしない（iOS Safariで黒帯になるため）。
   下部だけを塗る単色レイヤーで描く */
#screen-matchresult h3.mk {
  border-bottom: none;
  display: inline-block;
  padding: 0 8px 2px;
  margin-bottom: 8px;
  color: var(--ink);
  background: linear-gradient(rgba(227, 174, 194, 0.5), rgba(227, 174, 194, 0.5))
    no-repeat left 78% / 100% 26%;
}

/* 最下部の大きな導線ボタン */
.btn.primary.big {
  background: linear-gradient(135deg, #d98aa8 0%, #b95f84 100%);
  border-radius: 999px;
  padding: 18px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 20px rgba(185, 95, 132, 0.35);
  margin-top: 6px;
}

/* ==================================================================
   LP専用の仕上げ（#screen-start 配下だけに効く。他画面には影響しない）
   はがきの世界観：可愛さの中に上品さ。飾り罫＋クラシカルな装飾
   ================================================================== */

/* 背景：淡いピンクのグラデーション＋ごく薄いドット柄。
   position:fixed の擬似要素で画面全体に敷く（LPが消えれば一緒に消える） */
#screen-start { position: relative; }
#screen-start::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(rgba(194, 112, 143, 0.07) 1px, rgba(194, 112, 143, 0) 1.4px),
    linear-gradient(180deg, #f3c8da 0%, #f9e0ea 45%, #fdf4f7 100%);
  background-size: 22px 22px, 100% 100%;
}

/* カードの枠を消して、装飾背景の上に直接置く */
#screen-start .card {
  background: transparent;
  border: none;
  padding: 16px 4px 8px;
}

/* eyebrow：飾り罫で挟むクラシカルな帯 */
#screen-start .eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--pink-deep);
}
#screen-start .eyebrow::before,
#screen-start .eyebrow::after {
  content: "";
  height: 1px;
  width: 52px;
  flex: none;
}
#screen-start .eyebrow::before {
  background: linear-gradient(to right, rgba(194, 112, 143, 0), rgba(194, 112, 143, 1));
}
#screen-start .eyebrow::after {
  background: linear-gradient(to left, rgba(194, 112, 143, 0), rgba(194, 112, 143, 1));
}

/* フック（主役・疑問形）：画面幅いっぱいの極太。2行に折り返してよい */
#screen-start h1 {
  font-size: clamp(38px, 12vw, 50px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 10px 0 12px;
  color: var(--ink);
  /* マーカー風の下地。transparent入りグラデーションはiOSで黒帯になるので使わない */
  background: linear-gradient(rgba(227, 174, 194, 0.45), rgba(227, 174, 194, 0.45))
    no-repeat left 82% / 100% 22%;
}

/* サブ：白抜きの帯でアクセント */
#screen-start .lp-sub {
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--pink-deep);
  padding: 9px 22px;
  border-radius: 8px;
  margin: 0 0 8px;
  box-shadow: 0 4px 12px rgba(185, 95, 132, 0.3);
}

/* 診断名：◆で挟むだけのシンプルなロゴ */
#screen-start .lp-logo {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: 14px 0 4px;
}
#screen-start .lp-logo::before,
#screen-start .lp-logo::after {
  content: "◆";
  font-size: 0.6em;
  vertical-align: 2px;
  color: var(--ink);
}
#screen-start .lp-logo::before { margin-right: 6px; }
#screen-start .lp-logo::after { margin-left: 6px; }

/* 助走コピー（8偉人〜）：各文が1行に収まるすっきりサイズ */
#screen-start .lead {
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0;
  margin-bottom: 10px;
}

/* 主役の1枚絵：カードとカラムの余白を打ち消して画面幅いっぱいにブリードさせる。
   左右の -20px は #app の padding 16px ＋ LPカードの padding 4px ぶん */
#screen-start .lp-heroes {
  margin: 10px -20px 4px;
}
#screen-start .lp-duo {
  animation: lp-fade-up 0.7s ease 0.15s both;
  box-shadow: 0 12px 26px rgba(180, 90, 125, 0.20);
}

/* 吹き出し：白地に整った形。ふわっと1回だけ出現 */
#screen-start .balloon {
  background: #fff;
  box-shadow: 0 3px 10px rgba(194, 112, 143, 0.16);
  animation: lp-fade-up 0.6s ease 0.35s both;
}
#screen-start .balloon::after {
  border-bottom-color: #fff;
}
#screen-start .lp-cap:nth-child(2) .balloon {
  animation-delay: 0.6s;
}
@keyframes lp-fade-up {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}

/* 名前と称号：画像直下のコンパクト表示 */
#screen-start .lp-hero-name {
  font-size: 11px;
  letter-spacing: 0.06em;
  padding-top: 3px;
}
#screen-start .lp-hero-title { font-size: 13px; letter-spacing: 0.04em; }

/* シルエット6人：1列に大きく。左右の余白を少し使って広げる。?バッジはゆっくり明滅 */
#screen-start .lp-secrets { margin: 12px -12px 6px; }
#screen-start .secret .q {
  animation: lp-blink 2.8s ease-in-out infinite;
}
#screen-start .secret:nth-child(1) .q { animation-delay: 0s; }
#screen-start .secret:nth-child(2) .q { animation-delay: 0.4s; }
#screen-start .secret:nth-child(3) .q { animation-delay: 0.8s; }
#screen-start .secret:nth-child(4) .q { animation-delay: 1.2s; }
#screen-start .secret:nth-child(5) .q { animation-delay: 1.6s; }
#screen-start .secret:nth-child(6) .q { animation-delay: 2.0s; }
@keyframes lp-blink {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}
#screen-start .note {
  font-size: 11px;
  letter-spacing: 0.12em;
  margin: 10px 0 22px;
}

/* ボタン：グラデーション＋影＋大きめの角丸 */
#screen-start .btn.primary {
  background: linear-gradient(135deg, #d98aa8 0%, #b95f84 100%);
  border-radius: 999px;
  padding: 18px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow:
    0 8px 20px rgba(185, 95, 132, 0.35),
    0 2px 6px rgba(59, 51, 64, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#screen-start .btn.primary:active {
  transform: translateY(2px);
  box-shadow:
    0 4px 10px rgba(185, 95, 132, 0.3),
    0 1px 3px rgba(59, 51, 64, 0.08);
  opacity: 1;
}
#screen-start .btn.ghost {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  font-size: 16px;
}

/* PCではカラムの中もグラデーションにする（:has非対応ブラウザでは無地のまま） */
@media (min-width: 600px) {
  #app:has(#screen-start.active) {
    background-image:
      radial-gradient(rgba(194, 112, 143, 0.07) 1px, rgba(194, 112, 143, 0) 1.4px),
      linear-gradient(180deg, #f3c8da 0%, #f9e0ea 45%, #fdf4f7 100%);
    background-size: 22px 22px, 100% 100%;
  }
}

/* 動きを減らす設定の人にはアニメーションを止める */
@media (prefers-reduced-motion: reduce) {
  #screen-start .balloon { animation: none; }
  #screen-start .secret .q { animation: none; }
  #screen-start .lp-duo { animation: none; }
}
