:root {
  --red: #ef1d2b;
  --red-deep: #c4111d;
  --yellow: #ffc23c;
  --pink: #ff9fc0;
  --cream: #fff8ec;
  --paper: #ffffff;
  --ink: #3b2a2a;
  --ink-soft: #7a6666;
  --line: #f0e3d0;
  --shadow: 0 8px 24px rgba(120, 60, 30, 0.12);
  --radius: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #241818;
    --paper: #302121;
    --ink: #fbeee6;
    --ink-soft: #c9b0a6;
    --line: #4a3434;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
  :root:not([data-theme="light"]) .type-page .nick { color: var(--pink); }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  line-height: 1.85;
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red-deep); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) a { color: var(--pink); }
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* ヘッダー */
.site-header { background: var(--red); color: #fff; position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: 0.04em; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 6px 10px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.22); }

/* ヒーロー */
.hero { background: var(--red); color: #fff; padding: 36px 0 0; position: relative; overflow: hidden; }
.hero .wrap { display: grid; gap: 8px; grid-template-columns: 1.1fr 0.9fr; align-items: end; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.35; margin: 0 0 14px; font-weight: 900; }
.hero .lead { font-size: clamp(16px, 2.6vw, 20px); margin: 0 0 22px; opacity: 0.96; }
.hero-art { display: flex; justify-content: center; align-items: flex-end; gap: 0; min-height: 220px; }
.hero-art img { width: 38%; max-width: 190px; margin: 0 -2%; }
.hero-art img:nth-child(2) { width: 44%; max-width: 220px; position: relative; z-index: 1; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 28px; background: var(--cream); border-radius: 28px 28px 0 0; }
.hero .wrap { padding-bottom: 28px; }
.hero-wave { height: 0; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; background: #fff; color: var(--red-deep); font-weight: 800; border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.badge.ghost { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ボタン */
.btn { display: inline-block; background: var(--yellow); color: #4a2d00; font-weight: 900; text-decoration: none; padding: 14px 26px; border-radius: 999px; box-shadow: 0 4px 0 #d79a1c; font-size: 17px; }
.btn:hover { transform: translateY(1px); box-shadow: 0 3px 0 #d79a1c; }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-deep); }
.btn.soft { background: var(--paper); color: var(--red-deep); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.notice { margin: 16px 0 0; font-size: 14px; opacity: 0.9; }

/* セクション */
section { padding: 44px 0; }
.sec-title { text-align: center; margin: 0 0 8px; font-size: clamp(24px, 4.4vw, 34px); font-weight: 900; line-height: 1.4; }
.sec-title::after { content: ""; display: block; width: 64px; height: 6px; background: var(--yellow); border-radius: 6px; margin: 10px auto 0; }
.sec-sub { text-align: center; color: var(--ink-soft); margin: 14px auto 28px; max-width: 640px; }
.alt { background: var(--paper); }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--paper); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 2px solid var(--line); }
.alt .card { background: var(--cream); box-shadow: none; }
.card h3 { margin: 0 0 6px; font-size: 19px; line-height: 1.5; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.8; }
.card .mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--yellow); font-size: 22px; margin-bottom: 10px; }

/* アバター */
.avatar-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.avatar-card { background: var(--paper); border-radius: var(--radius); padding: 18px 18px 22px; text-align: center; border: 2px solid var(--line); box-shadow: var(--shadow); }
.avatar-card img { width: 170px; margin: 0 auto 8px; }
.avatar-card h3 { margin: 0; font-size: 22px; }
.avatar-card .kind { color: var(--ink-soft); font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.avatar-card p { margin: 0; font-size: 15px; color: var(--ink-soft); text-align: left; }
.avatar-card ul { margin: 10px 0 0; padding-left: 1.1em; text-align: left; font-size: 14.5px; color: var(--ink-soft); }
.avatar-card.a-rabbit { border-color: #ffd0e0; }
.avatar-card.a-bear { border-color: #ecc9a6; }
.avatar-card.a-panda { border-color: #d9d9d9; }
.avatar-card.a-lion { border-color: #ffe0a0; }

/* 診断 */
.type-hero { text-align: center; }
.type-strip { display: flex; gap: 10px; overflow-x: auto; padding: 8px 4px 18px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.type-strip a { flex: 0 0 120px; scroll-snap-align: center; text-decoration: none; color: inherit; text-align: center; }
.type-strip img { width: 120px; height: 120px; object-fit: contain; }
.type-strip span { display: block; font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.type-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.type-tile { display: block; background: var(--paper); border: 2px solid var(--line); border-radius: 20px; padding: 12px 10px 14px; text-align: center; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.type-tile:hover { transform: translateY(-2px); }
.type-tile img { width: 100%; max-width: 130px; margin: 0 auto 6px; aspect-ratio: 1; object-fit: contain; }
.type-tile .nick { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 700; line-height: 1.4; }
.type-tile .name { display: block; font-size: 15px; font-weight: 900; line-height: 1.4; margin-top: 2px; }
.type-tile .code { display: inline-block; margin-top: 6px; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--cream); color: var(--ink-soft); font-weight: 700; }
.axes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.axis { background: var(--paper); border-radius: 20px; padding: 16px 18px; border: 2px solid var(--line); }
.axis b { display: block; margin-bottom: 4px; }
.axis .poles { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 900; }
.axis .poles em { font-style: normal; background: var(--yellow); color: #4a2d00; border-radius: 999px; padding: 2px 12px; font-size: 15px; }
.axis .poles i { font-style: normal; color: var(--ink-soft); }
.steps { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: 0; list-style: none; }
.steps li { counter-increment: step; background: var(--paper); border-radius: 20px; padding: 18px 18px 18px 64px; position: relative; border: 2px solid var(--line); }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; display: grid; place-items: center; }
.steps li b { display: block; }

/* 診断の個別ページ */
.type-page { text-align: center; padding: 28px 0 8px; }
.type-page .portrait { width: min(320px, 70vw); margin: 0 auto; }
.type-page .nick { color: var(--red-deep); font-weight: 800; margin: 8px 0 0; }
.type-page h1 { margin: 0 0 6px; font-size: clamp(28px, 6vw, 40px); line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 0; padding: 0; list-style: none; }
.chips li { background: var(--yellow); color: #4a2d00; font-weight: 800; font-size: 14px; padding: 3px 14px; border-radius: 999px; }
.type-body { display: grid; gap: 16px; }
.block { background: var(--paper); border-radius: var(--radius); padding: 20px 22px; border: 2px solid var(--line); }
.block h2 { margin: 0 0 8px; font-size: 19px; }
.block p { margin: 0; }
.block ul { margin: 0; padding-left: 1.2em; }
.mini-types { display: flex; flex-wrap: wrap; gap: 12px; }
.mini-types a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; background: var(--cream); border-radius: 999px; padding: 4px 16px 4px 4px; border: 2px solid var(--line); font-weight: 800; font-size: 14.5px; }
.mini-types img { width: 52px; height: 52px; object-fit: contain; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 0; }

/* 画面のスクリーンショット */
.shots { display: flex; gap: 16px; overflow-x: auto; padding: 8px 4px 20px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; justify-content: center; }
.shots figure { margin: 0; flex: 0 0 auto; scroll-snap-align: center; text-align: center; }
.shots img { width: 220px; border-radius: 28px; box-shadow: var(--shadow); border: 6px solid #222; background: #222; }
.shots figcaption { margin-top: 8px; font-size: 13.5px; color: var(--ink-soft); font-weight: 700; }

/* 安心 */
.safe-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); padding: 0; list-style: none; margin: 0; }
.safe-list li { background: var(--paper); border-radius: 20px; padding: 16px 18px 16px 52px; position: relative; border: 2px solid var(--line); }
.safe-list li::before { content: "✓"; position: absolute; left: 16px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 15px; }
.safe-list b { display: block; }

/* 規約ページ */
.doc { background: var(--paper); border-radius: var(--radius); padding: 28px clamp(18px, 4vw, 40px); margin: 28px 0 40px; border: 2px solid var(--line); }
.doc h1 { font-size: clamp(26px, 5vw, 34px); margin: 0 0 16px; line-height: 1.4; }
.doc h2 { font-size: 20px; margin: 30px 0 8px; padding-left: 12px; border-left: 6px solid var(--yellow); line-height: 1.5; }
.doc h3 { font-size: 17.5px; margin: 22px 0 6px; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 4px 0; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 12px 0; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; }
.doc th { background: var(--cream); white-space: nowrap; }
.doc blockquote { margin: 12px 0; padding: 8px 16px; border-left: 4px solid var(--pink); background: var(--cream); border-radius: 0 12px 12px 0; }
.doc hr { border: 0; border-top: 2px dashed var(--line); margin: 28px 0; }
.doc code { background: var(--cream); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.toc { background: var(--cream); border-radius: 16px; padding: 12px 18px; margin: 16px 0 6px; font-size: 14.5px; }
.toc a { display: inline-block; margin: 2px 10px 2px 0; }

/* フッター */
.site-footer { background: #2a1a1a; color: #f3e4dc; padding: 36px 0 44px; font-size: 14.5px; line-height: 1.9; }
.site-footer a { color: #ffd2e0; }
.footer-cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-cols h4 { margin: 0 0 6px; font-size: 15px; color: #fff; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.copy { margin-top: 24px; opacity: 0.75; font-size: 13px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { min-height: 0; order: -1; margin-bottom: -4px; }
  .hero-art img { max-width: 130px; }
  .hero-art img:nth-child(2) { max-width: 150px; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .brand span { font-size: 18px; }
  section { padding: 34px 0; }
}
@media (max-width: 480px) {
  .brand span { display: none; }
  .nav { gap: 0; }
  .shots { justify-content: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  .type-tile, .btn { transition: transform 0.15s ease, box-shadow 0.15s ease; }
}
