/* こどもタイプ図鑑 共通スタイル（端末のフォントのみ・外部読み込みなし） */
:root {
  --bg: #FFF8EC;
  --surface: #FFFFFF;
  --surface-2: #FFF1DC;
  --text: #3A3029;
  --muted: #6E6158;
  --border: #EFE2CF;
  --accent: #C2502A;        /* 白文字とのコントラスト 4.6:1 */
  --accent-weak: #FDE7D6;
  --on-accent: #FFFFFF;
  --radius: 20px;
  --shadow: 0 2px 10px rgba(120, 80, 40, .08);
  --tc: #F08A4B; --tt: #FDE7D6; --td: #9A4517;
  color-scheme: light;
}
.t-sun { --tc: #F08A4B; --tt: #FDE7D6; --td: #9A4517; }
.t-wind { --tc: #4DB89A; --tt: #DDF3EC; --td: #1F6B57; }
.t-rainbow { --tc: #E8789F; --tt: #FBE2EB; --td: #9C2F57; }
.t-star { --tc: #E9B92F; --tt: #FBF0CC; --td: #7A5A00; }
.t-cloud { --tc: #7FB0E3; --tt: #E1EEFA; --td: #2F5F94; }
.t-sea { --tc: #3B86C2; --tt: #D9E9F6; --td: #1D4F78; }
.t-moon { --tc: #9A8AD6; --tt: #ECE8F8; --td: #4E3F94; }
.t-forest { --tc: #5FA562; --tt: #E0F0DD; --td: #2E6531; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", "Hiragino Maru Gothic Pro", "BIZ UDPGothic", "Kosugi Maru", "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.45; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.3em; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
main { padding: 20px 0 40px; min-height: 60vh; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 100; }
.offscreen { position: fixed; left: -9999px; top: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.lead { font-size: 1.02rem; }
br.pc { display: none; }
@media (min-width: 720px) { br.pc { display: inline; } h1 { font-size: 1.8rem; } }
code { background: var(--surface-2); padding: 0 4px; border-radius: 6px; }

/* ---------- ヘッダー・フッター ---------- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.hd { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 60px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1rem; min-height: 48px; }
.logo img { width: 32px; height: 32px; }
.gnav { display: flex; gap: 4px; }
.gnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 9px; color: var(--text); text-decoration: none; font-size: .85rem; border-radius: 999px; }
.gnav a:hover { background: var(--surface-2); }
.gnav a[aria-current="page"] { background: var(--accent-weak); color: var(--accent); font-weight: 700; }
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 32px; font-size: .85rem; color: var(--muted); background: var(--surface-2); }
.foot-note { margin-bottom: 12px; }
.foot-links { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 0 16px; }
.foot-links a { display: inline-block; padding: 8px 0; color: var(--muted); }
.foot-copy { margin: 0; }

/* ---------- ボタン ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid transparent; text-align: center; line-height: 1.4; }
.btn-main { background: var(--accent); color: var(--on-accent); box-shadow: 0 3px 0 #94391B; }
.btn-main:hover { filter: brightness(1.05); }
.btn-main:active { transform: translateY(2px); box-shadow: 0 1px 0 #94391B; }
.btn-big { min-width: 240px; font-size: 1.15rem; min-height: 56px; }
.btn-sub { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-line { background: #06C755; color: #fff; }
.btn-line:hover { filter: brightness(.95); }
.btn-text { background: none; border: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; cursor: pointer; padding: 0 8px; }

/* ---------- 共通部品 ---------- */
.box { background: var(--surface); border-radius: var(--radius); padding: 18px 18px 6px; margin: 0 0 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.box h2 { font-size: 1.08rem; }
.box[class*="t-"] h2 { color: var(--td); }
.box[class*="t-"] { border-top: 6px solid var(--tc); }
.sec { margin: 32px 0; }
.disclaimer { font-size: .8rem; color: var(--muted); text-align: center; margin: 24px 0 0; }
.note { font-size: .82rem; color: var(--muted); }
.soft { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.crumb a { color: var(--muted); }
.err { color: #A3301A; min-height: 1em; margin: 4px 0; }
.preorder { margin: 32px 0 8px; border: 2px dashed var(--border); border-radius: var(--radius); padding: 16px 16px 4px; font-size: .92rem; background: var(--surface); }

/* ---------- トップ ---------- */
.hero { text-align: center; padding: 16px 0 8px; }
.hero-icons { list-style: none; padding: 0; margin: 0 auto 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 420px; }
.hero-icons img { width: 36px; height: 36px; display: block; }
@media (min-width: 720px) { .hero-icons img { width: 44px; height: 44px; } }
.hero-kicker { display: inline-block; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 14px; font-size: .85rem; color: var(--muted); }
.hero h1 { margin-top: 4px; }
.hero .lead { text-align: left; }
@media (min-width: 720px) { .hero .lead { text-align: center; } }
.hero-note { font-size: .82rem; color: var(--muted); }
.last-result a { display: inline-flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 18px 6px 8px; text-decoration: none; color: var(--text); min-height: 48px; }
.last-result img { width: 40px; height: 40px; }
.axes { list-style: none; padding: 0; }
.axis { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 2px; margin-bottom: 10px; }
.axis-k { font-weight: 700; margin-bottom: 6px; color: var(--muted); font-size: .88rem; }
.axis-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.axis-row p { font-size: .88rem; margin-bottom: 10px; }
.axis-row strong { display: block; font-size: 1.02rem; color: var(--text); }
.feats { list-style: none; padding: 0; }
.feats li { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; font-size: .92rem; }
.feats strong { display: block; font-size: 1rem; }

/* タイプのカード（グリッド） */
.tgrid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
@media (min-width: 720px) { .tgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px 12px; background: var(--tt); border-radius: var(--radius); text-decoration: none; color: var(--text); border: 2px solid transparent; height: 100%; }
.tcard:hover { border-color: var(--tc); }
.tc-name { font-weight: 700; font-size: 1.05rem; color: var(--td); }
.tc-name small, .thead-name small { font-size: .7em; margin-left: 2px; }
.tc-ax { font-size: .75rem; color: var(--muted); text-align: center; }

/* タイプ一覧 */
.tlist { list-style: none; padding: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .tlist { grid-template-columns: 1fr 1fr; } }
.tlcard { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 8px solid var(--tc); border-radius: var(--radius); text-decoration: none; color: var(--text); height: 100%; }
.tlcard:hover { background: var(--tt); }
.tlcard img { flex: none; width: 64px; height: 64px; }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-name { font-weight: 700; font-size: 1.1rem; color: var(--td); }
.tl-ax { font-size: .78rem; color: var(--muted); }
.tl-catch { font-size: .9rem; }

/* ---------- タイプの見出し・本文 ---------- */
.result-kicker { text-align: center; color: var(--muted); margin: 0; }
.thead { text-align: center; background: var(--tt); border-radius: 28px; padding: 20px 16px 10px; margin: 8px 0 12px; }
.thead .big { width: 112px; height: 112px; display: block; margin: 0 auto 4px; }
.thead-kicker { font-size: .85rem; color: var(--td); margin: 0; font-weight: 700; }
.thead-name { font-size: 2rem; color: var(--td); margin: 0 0 4px; }
.thead-catch { font-size: 1rem; text-align: left; }
@media (min-width: 720px) { .thead-catch { text-align: center; } }
.chips { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 16px; }
.chips li { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; }
.chip-k { font-size: .68rem; color: var(--muted); line-height: 1.3; }
.chip-v { font-weight: 700; color: var(--td); }
.dots li { margin-bottom: 6px; }
.pair-row { border-top: 1px dashed var(--border); padding-top: 10px; }
.pair-row:first-of-type { border-top: none; padding-top: 0; }
.scene { margin-bottom: 6px; }
.hint { background: var(--tt); border-radius: 14px; padding: 10px 12px; }
.lbl { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 0 8px; margin-right: 6px; background: var(--surface); color: var(--td); border: 1px solid var(--tc); vertical-align: 1px; }
.words { list-style: none; padding: 0; }
.words li { background: var(--tt); border-radius: 18px 18px 18px 4px; padding: 10px 14px; margin-bottom: 8px; font-weight: 700; color: var(--td); }
.swap { border-top: 1px dashed var(--border); padding-top: 10px; }
.swap:first-of-type { border-top: none; padding-top: 0; }
.swap .ng { color: var(--muted); margin-bottom: 0; }
.swap .ng .lbl { border-color: var(--border); color: var(--muted); }
.swap .arrow { margin: 0; color: var(--tc); font-weight: 700; padding-left: 12px; }
.swap .ok { font-weight: 700; margin-bottom: 4px; }
.swap .why { font-size: .85rem; color: var(--muted); }

/* ---------- 診断 ---------- */
.quiz { max-width: 560px; margin: 0 auto; }
.quiz-mode { text-align: center; font-size: .88rem; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 4px 12px; border: 1px solid var(--border); }
.mode-oya .quiz-mode { background: #ECE8F8; color: #4E3F94; border-color: #D6CEF0; }
.q-progress { display: flex; align-items: center; gap: 10px; margin: 8px 0 18px; }
.q-count { font-weight: 700; font-size: .9rem; min-width: 4.2em; }
.bar { flex: 1; height: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #F2B85B, #F08A4B); border-radius: 999px; transition: width .25s; }
.q-text { font-size: 1.25rem; min-height: 4.5em; background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; align-items: center; }
.q-text:focus { outline: none; }
.choices { list-style: none; padding: 0; display: grid; gap: 10px; margin: 16px 0; }
.choice { width: 100%; min-height: 56px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); font: inherit; font-weight: 700; color: var(--text); cursor: pointer; padding: 8px 16px; }
.choice:hover { border-color: #F2B85B; background: #FFF6E6; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.q-backrow { text-align: center; }

/* ---------- 結果のおまけ・共有 ---------- */
.bd-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bd-form label { width: 100%; font-weight: 700; font-size: .9rem; }
.bd-form input { font: inherit; min-height: 48px; padding: 6px 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); flex: 1 1 180px; min-width: 0; }
.bd-out { background: var(--surface-2); border-radius: 16px; padding: 14px 14px 4px; margin: 8px 0 14px; }
.bd-label { font-size: .8rem; color: var(--muted); margin: 0; }
.bd-theme { font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; }
.bd-color { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.swatch { display: inline-block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.sw-0 { background: #F5B7C5; } .sw-1 { background: #F7D154; } .sw-2 { background: #A8D58A; } .sw-3 { background: #9CCBEE; } .sw-4 { background: #F5A55C; }
.sw-5 { background: #C3B1E1; } .sw-6 { background: #9FDCC8; } .sw-7 { background: #F3E3B5; } .sw-8 { background: #F28F7F; } .sw-9 { background: #6FA8DC; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.share-row .btn { flex: 1 1 140px; }
.copy-msg { min-height: 1.5em; }
.next .btn { width: 100%; }

/* ---------- 親子相性 ---------- */
.selbox { display: grid; gap: 12px; margin: 16px 0; }
@media (min-width: 720px) { .selbox { grid-template-columns: 1fr 1fr; } }
.sel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 2px; }
.sel label { display: block; font-weight: 700; margin-bottom: 6px; }
.sel select { width: 100%; font: inherit; min-height: 48px; border-radius: 14px; border: 2px solid var(--border); padding: 6px 10px; background: var(--surface); color: var(--text); }
.sel .btn { width: 100%; margin-top: 10px; }
.pairhead { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 12px; }
.ph-side { background: var(--tt); border-radius: var(--radius); padding: 12px 8px 4px; text-align: center; flex: 1 1 0; min-width: 0; max-width: 200px; }
.ph-side img { width: 72px; height: 72px; display: block; margin: 0 auto; }
.ph-role { font-size: .78rem; color: var(--muted); margin: 0; }
.ph-name { font-weight: 700; color: var(--td); margin-bottom: 6px; }
.ph-x { font-size: 1.6rem; color: var(--muted); margin: 0; }
.pair-sum { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--border); font-weight: 700; }
.axtable { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: 16px; border: 1px solid var(--border); margin-bottom: 16px; font-size: .88rem; overflow: hidden; }
.axtable caption { text-align: left; font-weight: 700; padding: 0 0 6px; }
.axtable th, .axtable td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.axtable tr:last-child th, .axtable tr:last-child td { border-bottom: none; }
.pair .axtable td { white-space: nowrap; }
.axtable thead th { background: var(--surface-2); font-size: .8rem; }
.same { display: inline-block; border-radius: 999px; padding: 0 8px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.is-same { background: #DDF3EC; color: #1F6B57; }
.is-diff { background: #FDE7D6; color: #9A4517; }
.axlist { list-style: none; padding: 0; }
.axlist li { border-top: 1px dashed var(--border); padding: 10px 0; }
.axlist li:first-child { border-top: none; padding-top: 0; }
.axtag { display: block; font-size: .75rem; color: var(--muted); font-weight: 700; }
.pb-clash { border-top: 6px solid #F2B85B; }
.pb-word { border-top: 6px solid #E8789F; }
.pb-word .axlist li { font-weight: 700; }
.pb-fun { border-top: 6px solid #4DB89A; }

/* ---------- 運営者情報など ---------- */
.info { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 16px; overflow: hidden; margin-bottom: 24px; }
.info th, .info td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.info th { width: 8em; background: var(--surface-2); font-size: .9rem; }
.notfound { text-align: center; padding: 24px 0; }
.notfound img { width: 96px; height: 96px; }
