/* モグの診断ページ。色・角丸・余白はアプリの DESIGN.md トークンに合わせる。 */
:root {
  color-scheme: light dark;
  --ink: #3B3A3E;
  --ink-soft: #67646F;
  --surface: #FBF7EE;
  --accent: #4F5D8C;
  --blush: #F2A9A0;
  --bg-top: #EAE3F7;
  --bg-bottom: #F8F1EA;
  --radius: 24px;
  --line: rgba(79, 93, 140, .14);

  /* モーション。DESIGN.md の motion トークン(Spring は使わない) */
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --ease-gentle: cubic-bezier(.33, 0, .15, 1);
  --ease-breath: cubic-bezier(.45, 0, .55, 1);
  --dur-tap: .15s;
  --dur-standard: .35s;
  --dur-gentle: .7s;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E3DFEC;
    --ink-soft: #A8A4B8;
    --surface: #2E2E3E;
    --accent: #9AA6D8;
    --bg-top: #1D1D2C;
    --bg-bottom: #2B2540;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0 20px 64px;
  font-family: "Zen Maru Gothic", -apple-system, BlinkMacSystemFont, "Hiragino Maru Gothic ProN", sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  min-height: 100vh;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 520px; margin: 0 auto; }
.screen { padding-top: 40px; text-align: center; }
.hidden { display: none; }

/* 導入のモグ。LP と同じ「呼吸」と「光だまり」で、同じ生きものだと分かるように */
.baku-figure { position: relative; display: grid; place-items: center; }
.baku-figure::before {
  content: ''; position: absolute; width: min(420px, 88vw); aspect-ratio: 1;
  background: radial-gradient(circle, var(--surface) 0%, transparent 66%);
  opacity: .8;
}
.baku {
  position: relative; width: 168px; height: auto; margin-bottom: 8px;
  animation: breathe 5.5s var(--ease-breath) infinite;
}
@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.025); }
}
.baku-small { width: 72px; height: auto; }
h1 { font-size: clamp(1.9rem, 6vw, 2.4rem); font-weight: 900; line-height: 1.36; letter-spacing: -.025em; margin: 8px 0 14px; }
.lead { color: var(--ink-soft); margin: 0 0 28px; }
.note { color: var(--ink-soft); font-size: .78rem; margin-top: 24px; }

/* ── 6 つのかたち(はじめる前に見せる)──
   休みの姿を .82 にしておき、JS は「灯す」方向にだけ働く。
   JS が動かなくても 6 つとも読めるので、消える方向には倒れない */
.types {
  list-style: none; padding: 0;
  margin: 4px auto 12px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
/* 絵が小さいと 6 つとも「黒いかたまり」に見えて選べない。
   見分けの手がかりは持ち物(月・虫めがね・スマホ)なので、絵を大きく取る */
.types li {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 12px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  opacity: .82;
  transition: opacity var(--dur-gentle) var(--ease-gentle),
              transform var(--dur-gentle) var(--ease-gentle);
}
.types img { width: clamp(68px, 21vw, 108px); height: auto; }
.types span {
  font-size: clamp(.66rem, 2.7vw, .76rem); font-weight: 700;
  color: var(--ink); line-height: 1.45;
}
.types li.lit { opacity: 1; transform: translateY(-4px) scale(1.03); }
.types-cap { color: var(--ink-soft); font-size: .84rem; margin: 0 0 20px; }

/* 縦の狭い画面では「はじめる」が折り返しの下に落ちてしまう(実測 737px / 画面 718px)。
   6 つのかたち自体がモグの絵なので、頭の 1 匹を小さくして席を空ける */
@media (max-width: 520px) {
  .screen { padding-top: 24px; }
  #intro .baku { width: 112px; margin-bottom: 4px; }
  #intro h1 { margin-bottom: 10px; }
  #intro .lead { margin-bottom: 20px; }
  .types li { padding: 8px 4px 10px; }
  .types img { width: clamp(60px, 19vw, 108px); }
}

/* 押す前に知りたいこと(所要時間・無料・登録不要) */
.start-meta { color: var(--ink-soft); font-size: .84rem; margin: 10px 0 0; }
/* 矢印は「この先がある」の合図。絵文字ではなく組版の記号 */
.arw { margin-left: 8px; font-weight: 500; display: inline-block;
       transition: transform var(--dur-standard) var(--ease-standard); }

/* 免責は消さずに畳む。ボタンの手前を重くしないため */
.fineprint { margin-top: 22px; text-align: left; max-width: 420px; margin-inline: auto; }
.fineprint > summary {
  cursor: pointer; list-style: none;
  color: var(--ink-soft); font-size: .8rem; text-align: center;
  text-decoration: underline; text-underline-offset: 4px;
  padding: 10px; min-height: 44px; display: flex; align-items: center; justify-content: center;
}
.fineprint > summary::-webkit-details-marker { display: none; }
.fineprint > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
.fineprint .note { margin-top: 4px; }

button, .link {
  display: block; width: 100%; border: 0; border-radius: 18px;
  min-height: 48px;
  transition: transform var(--dur-standard) var(--ease-tap);
  font-size: 1rem; font-weight: 600; font-family: inherit;
  padding: 17px 20px; cursor: pointer; text-decoration: none;
}
.primary { background: var(--accent); color: #fff; }
.primary:active { transform: scale(.97); }
.ghost { background: transparent; color: var(--ink-soft); font-weight: 500; }

/* 設問 */
.progress { height: 4px; background: rgba(128,128,128,.2); border-radius: 2px; overflow: hidden; }
/* width(レイアウト)ではなく transform(合成)で伸ばす。毎フレームの再レイアウトを避ける */
.bar {
  height: 100%; width: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease-gentle);
}
.count { color: var(--ink-soft); font-size: .8rem; margin: 12px 0 0; }
.question { font-size: clamp(1.2rem, 4.4vw, 1.42rem); font-weight: 700; margin: 8px 0 24px; line-height: 1.55; letter-spacing: -.015em; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  background: var(--surface); color: var(--ink); border-radius: 18px;
  padding: 18px 20px; text-align: left; font-weight: 500; line-height: 1.6;
  transition: transform .18s cubic-bezier(.4,0,.2,1), opacity .18s;
}
.choice:active { transform: scale(.97); }
/* 選んだ手応え。押したものだけが残り、ひと呼吸おいて次の問いへ */
.choice.chosen {
  background: var(--accent); color: #FDFBF6;
  transform: scale(.985);
  transition: background .12s var(--ease-standard), color .12s var(--ease-standard), transform .12s var(--ease-standard);
}
.choices.locked .choice:not(.chosen) { opacity: .4; transition: opacity .12s var(--ease-standard); }
.choices.locked { pointer-events: none; }
/* pointer: fine も要る。これが無いと、触る画面でタップ後にホバーが残る */
@media (hover: hover) and (pointer: fine) {
  .choice:hover { transform: translateX(3px); background: color-mix(in srgb, var(--surface) 88%, var(--accent)); }
  /* 影は足さない。1px 浮くだけで十分伝わる */
  .primary:hover { transform: translateY(-1px); }
  .ghost:hover { color: var(--ink); }
}
button:focus-visible, .link:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
/* 設問が入れ替わるたび、選択肢を上から順に置く(一斉に出ると「早く選べ」の圧になる) */
@keyframes choice-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.choices .choice { animation: choice-in .5s var(--ease-gentle) both; }
.choices .choice:nth-child(2) { animation-delay: .07s; }
.choices .choice:nth-child(3) { animation-delay: .14s; }
.choices .choice:nth-child(4) { animation-delay: .21s; }

/* 結果 */
@keyframes result-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
/* 結果は一斉に出さず、上から順に。モグが読み上げているように見せる */
#result:not(.hidden) > * { animation: result-in .65s var(--ease-gentle) both; }
#result:not(.hidden) > *:nth-child(1) { animation-delay: .05s; }
#result:not(.hidden) > *:nth-child(2) { animation-delay: .18s; }
#result:not(.hidden) > *:nth-child(3) { animation-delay: .28s; }
#result:not(.hidden) > *:nth-child(4) { animation-delay: .36s; }
#result:not(.hidden) > *:nth-child(5) { animation-delay: .44s; }
#result:not(.hidden) > *:nth-child(6) { animation-delay: .52s; }
#result:not(.hidden) > *:nth-child(7) { animation-delay: .60s; }

/* ── 診断票。結果そのものを 1 枚の紙にする(ここがシェアされる絵) ── */
.ticket {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 26px 34px;
  margin-bottom: 20px;
  overflow: hidden;
}
/* 紙の上端に、券らしい細い帯 */
.ticket::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 5px;
  background: var(--accent); opacity: .85;
}
/* 型ごとの描き下ろし。モグがその癖の場面にいる絵 */
.ticket-art { display: grid; place-items: center; margin-bottom: 6px; }
.ticket-art img { width: clamp(180px, 46vw, 230px); height: auto; }
/* 結果が出た瞬間、少し沈んだところから起き上がる */
.ticket-art img { animation: art-in .9s var(--ease-gentle) .35s both; }
@keyframes art-in {
  from { opacity: 0; transform: translateY(16px) scale(.92); }
  to { opacity: 1; transform: none; }
}

.ticket .eyebrow { color: var(--ink-soft); font-size: .78rem; letter-spacing: .14em; margin: 0 0 6px; }
.ticket .type-name { margin: 0 0 8px; }
.ticket .catch { color: var(--ink-soft); margin: 0 0 22px; font-size: .95rem; }
/* 切り取り線のような区切り */
.ticket-rule { display: flex; gap: 5px; justify-content: center; margin-bottom: 20px; }
.ticket-rule span { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .35; }
.ticket-body { margin: 0; text-align: left; font-size: .95rem; line-height: 1.95; }

/* ── こんな癖があります ── */
.block { margin-bottom: 20px; text-align: left; }
.block-title {
  font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  color: var(--accent); margin: 0 0 12px; text-align: center;
}
.signs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.signs li {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: baseline;
  padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: .95rem;
}
.signs li:first-child { border-top: 1px solid var(--line); }
/* 印は絵文字ではなく、線で描いたチェック */
.signs li::before {
  content: ''; width: 14px; height: 8px; margin-top: .5em;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  border-radius: 1px; transform: rotate(-45deg);
}

/* ── 処方箋。別の紙に見せる(同じカードを 2 枚並べると両方読み飛ばされる) ── */
.slip {
  position: relative; text-align: left;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 88px 22px 24px;
  margin-bottom: 26px;
}
.slip-title { font-size: .78rem; font-weight: 700; letter-spacing: .14em; color: var(--accent); margin: 0 0 8px; }
.slip-body { margin: 0; font-size: .95rem; line-height: 1.95; }
.slip-mogu { position: absolute; right: 18px; bottom: 16px; width: 56px; height: auto; }

/* ウェイトリスト */
.waitlist { margin-top: 18px; text-align: left; }
.waitlist-label { display: block; font-size: .9rem; color: var(--ink); margin-bottom: 8px; }
.waitlist-row { display: flex; gap: 8px; }
.waitlist-input {
  flex: 1; min-width: 0; border: 0; border-radius: 14px; padding: 14px 14px;
  font-size: 1rem; font-family: inherit; background: rgba(128,128,128,.12); color: var(--ink);
}
.waitlist-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.waitlist-button { width: auto; padding: 14px 18px; border-radius: 14px; white-space: nowrap; }
.waitlist-note { margin-top: 8px; }
.waitlist.done .waitlist-row { display: none; }
.waitlist.done .waitlist-label { color: var(--accent); font-weight: 600; }

footer { text-align: center; color: var(--ink-soft); font-size: .8rem; padding: 24px 0 8px; }
/* 指で押せる大きさ(44px)を確保する。文字は小さいままで、当たり判定だけ広げる */
footer a { color: var(--ink-soft); display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }

@media (prefers-reduced-motion: reduce) {
  .bar, .choice, .primary, .ghost { transition: none; }
  .baku, .choices .choice, #result:not(.hidden) > * { animation: none; }
  .ticket-art img { animation: none; }
  .choice:hover, .primary:hover { transform: none; }
  .choice.chosen { transition: none; }
}

@media (hover: hover) and (pointer: fine) {
  .primary:hover .arw { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .types li { opacity: 1; transition: none; }
  .types li.lit { transform: none; }
  .arw { transition: none; }
}
