/* うちの子タイプ診断 — ベージュの紙／墨色／朱 */
:root {
  --paper: #F3ECDF;
  --card: #FAF6EE;
  --ink: #3A332C;
  --sub: #60574C;
  --line: #D9CDB8;
  --red: #C4483A;
  --line-green: #06C755;
  --serif: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* ごく薄いノート罫 */
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(96,87,76,0.07) 31px, rgba(96,87,76,0.07) 32px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-tap-highlight-color: transparent;
}
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(48px, calc(32px + env(safe-area-inset-bottom)));
}
[hidden] { display: none !important; }
.screen { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1, h2, h3, p { margin: 0; }
.title { font-family: var(--serif); font-weight: 700; font-size: 28px; line-height: 1.4; margin: 16px 0 20px; }
.hero, .r-img { display: block; width: 100%; height: auto; margin: 0 0 20px; border-radius: 4px; }
/* 最初の画面に「はじめる」ボタンまで入るよう、トップ画像は小さめ */
.hero { width: 62%; max-width: 260px; margin: 0 auto 20px; }
.r-img { width: 78%; max-width: 340px; margin: 0 auto 20px; }
.lead { font-family: var(--serif); font-size: 18px; line-height: 2; margin-bottom: 20px; }
.meta { color: var(--sub); font-size: 14px; margin-bottom: 24px; }
.note { color: var(--sub); font-size: 13px; line-height: 1.7; margin-top: 24px; }

/* ボタン */
.btn {
  display: block; width: 100%; min-height: 56px; margin: 0 0 12px;
  padding: 14px 16px; border-radius: 6px; border: 1px solid var(--ink);
  background: var(--card); color: var(--ink);
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.5;
  text-align: center; text-decoration: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.btn-sub { background: transparent; color: var(--sub); border-color: var(--line); margin-top: 24px; }
.btn-line { background: var(--line-green); border-color: var(--line-green); color: #fff; font-weight: 700; }
.btn[disabled], .btn.is-disabled { background: #E4DCCB; border-color: #E4DCCB; color: var(--sub); cursor: default; }
.btn.selected { background: var(--ink); color: #fff; }

/* 立体ボタン：下に厚み（濃い色の帯）＋上に薄いツヤ。押すと沈む */
.btn {
  position: relative;
  margin-bottom: 18px;
  border-width: 0;
  background-image: linear-gradient(to bottom, rgba(255,255,255,.55), rgba(255,255,255,0) 55%);
  box-shadow: 0 5px 0 #B9AA92, 0 8px 14px rgba(58,51,44,.18), inset 0 0 0 1px rgba(58,51,44,.25);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-primary {
  background-image: linear-gradient(to bottom, rgba(255,255,255,.22), rgba(255,255,255,0) 55%);
  box-shadow: 0 5px 0 #8E2E24, 0 8px 14px rgba(142,46,36,.30);
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}
.btn-line {
  background-image: linear-gradient(to bottom, rgba(255,255,255,.22), rgba(255,255,255,0) 55%);
  box-shadow: 0 5px 0 #04913E, 0 8px 14px rgba(4,145,62,.30);
  text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.btn.selected {
  background-image: none;
  box-shadow: 0 2px 0 #1E1A16, inset 0 0 0 1px #1E1A16;
  transform: translateY(3px);
}
.btn-sub { background-image: none; box-shadow: 0 3px 0 var(--line), inset 0 0 0 1px var(--line); }
.btn:active { transform: translateY(4px); }
.btn:active { box-shadow: 0 1px 0 #B9AA92, 0 2px 4px rgba(58,51,44,.15), inset 0 0 0 1px rgba(58,51,44,.25); }
.btn-primary:active { box-shadow: 0 1px 0 #8E2E24, 0 2px 4px rgba(142,46,36,.25); }
.btn-line:active { box-shadow: 0 1px 0 #04913E, 0 2px 4px rgba(4,145,62,.25); }
.btn[disabled], .btn.is-disabled { background-image: none; box-shadow: none; transform: none; }

/* 質問 */
.progress { margin-bottom: 28px; }
.progress-text { display: block; font-size: 14px; color: var(--sub); margin-bottom: 8px; }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--ink); transition: width .3s ease; }
.q-text { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.7; margin-bottom: 12px; }
.q-sub { color: var(--sub); font-size: 14px; margin-bottom: 12px; }
.options { margin-top: 20px; }
.lesson {
  margin: 8px 0 20px; padding: 16px; background: var(--card);
  border-left: 3px solid var(--ink); animation: fade .4s ease both;
}
.lesson-label { font-size: 12px; color: var(--sub); letter-spacing: .1em; margin-bottom: 4px; }
.lesson-text { font-size: 16px; line-height: 1.9; }
.back-wrap { text-align: center; margin-top: 16px; }
.back { background: none; border: 0; padding: 12px; color: var(--sub); font-size: 14px; text-decoration: underline; font-family: var(--sans); cursor: pointer; }

/* 結果 */
.r-label { font-size: 13px; color: var(--sub); letter-spacing: .15em; margin-top: 8px; }
.r-name { font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1.3; margin: 4px 0 8px; }
.r-catch { font-family: var(--serif); font-size: 18px; margin-bottom: 20px; }
.block { background: var(--card); padding: 20px 16px; margin-bottom: 20px; border-radius: 4px; }
.h3 { font-family: var(--serif); font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.block .h3 + .body + .h3 { margin-top: 16px; }
.body { font-size: 16px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding-left: 28px; margin-bottom: 8px; }
.checks li::before {
  content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 13px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(40deg);
}
.both { color: var(--sub); font-size: 15px; }
.key-block { border-left: 3px solid var(--red); }
.key-label { color: var(--red); font-weight: 700; font-size: 13px; letter-spacing: .1em; margin-bottom: 4px; }
.key-text { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.8; }
.ng, .ok { display: flex; align-items: flex-start; }
.mark { flex: 0 0 28px; font-weight: 700; }
.ng { color: var(--sub); margin-bottom: 12px; }
.ng-text { text-decoration: line-through; text-decoration-color: rgba(96,87,76,.6); opacity: .8; }
.ok .mark { color: var(--red); }
.ok-text { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.7; }
.why { margin-top: 12px; font-size: 15px; color: var(--sub); }
.outro { margin: 24px 0; line-height: 2; }
.line-block { background: var(--card); border: 1px solid var(--line); padding: 20px 16px; border-radius: 4px; }
.line-title { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.6; margin-bottom: 8px; }
.line-body { font-size: 15px; margin-bottom: 16px; }
.step-label { font-weight: 700; font-size: 15px; margin: 8px 0; }
.send-name { font-family: var(--serif); font-weight: 700; font-size: 20px; padding: 8px 12px; background: var(--paper); border: 1px dashed var(--sub); display: inline-block; margin: 4px 0 12px; -webkit-user-select: text; user-select: text; }
.step-text { font-size: 15px; margin-bottom: 4px; }
.copy-msg { font-size: 13px; color: var(--sub); min-height: 1.5em; }
.close { font-family: var(--serif); font-weight: 700; font-size: 20px; text-align: center; margin: 28px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .screen, .lesson { animation: none; }
  .bar-fill { transition: none; }
}
