:root {
  --paper: #fbf8f1;
  --surface: #ffffff;
  --ink: #1d1a17;
  --ink-soft: #5c564f;
  --line: #1d1a17;
  --accent: #e0362b;
  --accent-ink: #ffffff;
  --dots: rgba(29, 26, 23, 0.07);
  --chip: #fff1d6;
  --chip-ink: #6b4a00;
  --amazon: #ff9900;
  --rakuten: #bf0000;
  --ok: #1f9d55;
  --neutral: #d8d2c6;
  --radius: 14px;
  --shadow: 4px 4px 0 var(--line);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17161a;
    --surface: #232127;
    --ink: #f1ede6;
    --ink-soft: #b4ada3;
    --line: #f1ede6;
    --dots: rgba(241, 237, 230, 0.06);
    --chip: #3b3220;
    --chip-ink: #ffd88a;
    --ok: #3cc47a;
    --neutral: #4a463f;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--paper);
  background-image: radial-gradient(var(--dots) 1.2px, transparent 1.3px);
  background-size: 14px 14px;
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px 40px; }
[hidden] { display: none !important; }

/* ヘッダー・フッター */
.site-header { padding: 14px 16px; max-width: 640px; width: 100%; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: 0.04em; }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--line); border-radius: 8px; font-size: 16px; }
.site-footer { max-width: 640px; margin: 0 auto; padding: 20px 16px 32px; font-size: 12px; color: var(--ink-soft); text-align: center; }
.site-footer p { margin: 2px 0; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border: 2px solid var(--line); border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-big { font-size: 18px; padding: 16px 36px; }
.btn-amazon { background: var(--amazon); color: #1d1a17; }
.btn-rakuten { background: var(--rakuten); color: #fff; }
.btn-x { background: var(--ink); color: var(--paper); }
.btn-outline { background: var(--surface); }
.btn-ghost { box-shadow: none; border-style: dashed; background: transparent; }
.link-btn { background: none; border: none; color: var(--ink-soft); font: inherit; font-size: 14px; cursor: pointer; padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:disabled { opacity: 0.35; cursor: default; }

/* マスコット */
.mascot { width: 84px; height: 70px; flex: none; }
.mascot-big { width: 132px; height: 110px; animation: float 3s ease-in-out infinite; }
.mascot .page-l, .mascot .page-r { fill: var(--surface); stroke: var(--line); stroke-width: 4; stroke-linejoin: round; }
.mascot .page-r { fill: #ffe3a3; }
.mascot .spine { stroke: var(--line); stroke-width: 4; }
.mascot .eye { fill: var(--ink); }
.mascot .mouth { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* スタート */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: clamp(26px, 7vw, 36px); line-height: 1.4; margin: 12px 0; letter-spacing: 0.02em; }
.hero-sub { color: var(--ink-soft); margin: 0 0 28px; }
.hero-sub strong { color: var(--accent); font-size: 1.15em; }
.read-info { margin-top: 24px; font-size: 13px; color: var(--ink-soft); }
br.sp { display: none; }
@media (max-width: 480px) { br.sp { display: inline; } br.pc { display: none; } }

/* 質問 */
.progress { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; }
.progress-track { flex: 1; height: 10px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.progress-text { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.stage { display: flex; align-items: center; gap: 12px; }
.mood { margin: 0; color: var(--ink-soft); font-size: 14px; }
.bubble {
  position: relative; margin: 18px 0 22px; padding: 22px 20px 24px;
  background: var(--surface); border: 3px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.bubble::before {
  content: ""; position: absolute; left: 38px; top: -17px; width: 26px; height: 26px;
  background: var(--surface); border-left: 3px solid var(--line); border-top: 3px solid var(--line);
  transform: skewY(-28deg) rotate(32deg);
}
.bubble.pop { animation: pop 0.25s ease-out; }
@keyframes pop { from { transform: scale(0.96); opacity: 0.4; } }
.q-number { display: inline-block; font-weight: 900; color: var(--accent); font-size: 14px; letter-spacing: 0.08em; }
.q-text { margin: 4px 0 0; font-size: clamp(19px, 5.2vw, 23px); font-weight: 800; line-height: 1.5; }
.answers { display: grid; gap: 10px; }
.answer {
  padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 3px 3px 0 var(--line);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.answer:hover { background: var(--chip); }
.answer:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.answer-yes { border-width: 3px; }
.answer-idk { color: var(--ink-soft); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 14px; }

/* 結果 */
.result-lead { text-align: center; font-weight: 800; font-size: 18px; margin: 16px 0; }
.result-card { border: 3px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: 6px 6px 0 var(--line); animation: reveal 0.5s ease-out; }
@keyframes reveal { from { transform: translateY(14px) rotate(-1deg); opacity: 0; } }
.cover { padding: 30px 22px 24px; color: #fff; background: var(--cover, linear-gradient(135deg, #444, #111)); border-bottom: 3px solid var(--line); position: relative; }
.cover::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,0.14) 1.5px, transparent 1.6px); background-size: 10px 10px; pointer-events: none; }
.cover-demo { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border: 2px solid currentColor; border-radius: 999px; }
.cover-title { margin: 12px 0 4px; font-size: clamp(26px, 7.5vw, 38px); line-height: 1.3; font-weight: 900; text-shadow: 2px 2px 0 rgba(0,0,0,0.35); word-break: break-word; }
.cover-author { margin: 0; opacity: 0.9; font-weight: 600; }
.theme-battle { --cover: linear-gradient(135deg, #e0362b, #7a0f12); }
.theme-romance { --cover: linear-gradient(135deg, #f27ca6, #b23a73); }
.theme-comedy { --cover: linear-gradient(135deg, #f5b300, #e0661b); }
.theme-dark { --cover: linear-gradient(135deg, #3c3f6b, #121326); }
.theme-horror { --cover: linear-gradient(135deg, #4b2357, #0d0710); }
.theme-sports { --cover: linear-gradient(135deg, #1fa36b, #0b5a52); }
.theme-food { --cover: linear-gradient(135deg, #f28b30, #b6461b); }
.theme-mystery { --cover: linear-gradient(135deg, #2e5e9c, #14223f); }
.theme-fantasy { --cover: linear-gradient(135deg, #2aa6a1, #234c8a); }
.theme-scifi { --cover: linear-gradient(135deg, #3b7bd9, #1b1f5c); }
.theme-healing { --cover: linear-gradient(135deg, #8cc66d, #3f8f6a); }
.cover:has(.cover-img) { display: flex; gap: 18px; align-items: flex-end; }
.cover-img { position: relative; z-index: 1; width: 112px; flex: none; border: 3px solid var(--line); border-radius: 6px; box-shadow: 4px 4px 0 rgba(0,0,0,0.35); background: #fff; }
.cover-text { position: relative; z-index: 1; min-width: 0; }
.cover:has(.cover-img) .cover-title { font-size: clamp(22px, 6vw, 32px); }
@media (max-width: 400px) { .cover-img { width: 88px; } }
.card-body { padding: 20px 20px 22px; }
.fit { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--accent); }
.award { margin: -6px 0 14px; font-size: 13px; font-weight: 700; }
.chips-feat { margin-bottom: 14px; }
.points { margin: 0 0 16px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.points-head { margin: 0 0 8px; font-size: 15px; }
.points-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.7; }
.voice { margin: 10px 0 0; font-size: 13px; line-height: 1.7; }
.points-note { margin: 8px 0 0; font-size: 11px; color: var(--ink-soft); }
.chip-feat { background: transparent; color: var(--ink); border-color: var(--line); }
.mode { border: 0; padding: 0; margin: 0 auto 24px; width: fit-content; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.mode legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.mode label { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 600; }
.mode label:has(input:checked) { background: var(--chip); box-shadow: 3px 3px 0 var(--line); }
.mode input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.answers-anchor { grid-template-columns: 1fr 1fr; }
.site-footer a { color: inherit; }
.hook { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.meta { margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); }
.match { margin-bottom: 18px; padding: 14px; border: 2px dashed var(--ink-soft); border-radius: 12px; }
.match-head { margin: 0 0 8px; font-size: 14px; }
.match-head b { font-size: 17px; }
.match-num { color: var(--ok); font-size: 22px !important; }
.match-bar { display: flex; height: 10px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); margin-bottom: 12px; }
.seg { height: 100%; }
.seg-ok { background: var(--ok); }
.seg-neutral { background: var(--neutral); }
.seg-ng { background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chips-ng { margin-top: 10px; }
.chips-label { font-size: 12px; color: var(--ink-soft); margin-right: 2px; }
.chip { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); border: 1.5px solid currentColor; }
.chip-ng { background: transparent; color: var(--ink-soft); font-weight: 600; border-style: dashed; }
.buy { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-note { margin: 8px 0 0; font-size: 11px; color: var(--ink-soft); text-align: right; }
.doc { max-width: 680px; margin: 0 auto; padding: 8px 16px 24px; line-height: 1.8; font-size: 15px; }
.doc h1 { font-size: 22px; margin: 8px 0 16px; }
.doc h2 { font-size: 17px; margin: 28px 0 8px; }
.doc p { margin: 0 0 10px; }
.doc a, .site-footer a { color: inherit; }
.buy-label { margin: 12px 0 6px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.buy:has(> :only-child) { grid-template-columns: 1fr; }
.buy .btn { padding: 12px 8px; font-size: 15px; }
@media (max-width: 400px) { .buy { grid-template-columns: 1fr; } }
.others { margin: 22px 4px 0; }
.others summary { cursor: pointer; font-weight: 700; color: var(--ink-soft); }
.others ul { margin: 8px 0 0; padding-left: 20px; }
.others li { margin: 4px 0; }
.others a { color: var(--ink); font-weight: 700; }
.others-author { color: var(--ink-soft); font-size: 13px; }
.result-actions { display: grid; gap: 12px; margin-top: 26px; }
.empty { text-align: center; color: var(--ink-soft); }

/* スタート画面：2つの探し方 */
.ways { display: grid; gap: 16px; max-width: 460px; margin: 0 auto; }
.way { border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 16px 20px; box-shadow: var(--shadow); }
.way-head { font-size: 18px; margin: 0 0 12px; }
.way-sub { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; }
.qcount { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 16px; }
.qcount label { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.qcount label b { font-size: 16px; color: var(--ink); }
.qcount label:has(input:checked) { background: var(--chip); box-shadow: 3px 3px 0 var(--line); }
.qcount label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.qcount input { position: absolute; opacity: 0; pointer-events: none; }

/* 好きな漫画から探す */
#fav { text-align: center; padding-top: 24px; }
.fav-title { font-size: clamp(22px, 6vw, 28px); margin: 0 0 6px; }
.fav-sub { color: var(--ink-soft); margin: 0 0 20px; font-size: 14px; }
.fav-search { position: relative; max-width: 460px; margin: 0 auto 14px; text-align: left; }
.fav-search input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.fav-search input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.fav-suggest { list-style: none; margin: 6px 0 0; padding: 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; }
.fav-suggest button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; font: inherit; color: var(--ink); cursor: pointer; }
.fav-suggest button:hover, .fav-suggest button:focus-visible { background: var(--chip); outline: none; }
.fav-suggest .sg-author { display: block; font-size: 12px; color: var(--ink-soft); }
.fav-suggest .sg-none { padding: 9px 10px; font-size: 14px; color: var(--ink-soft); }
.fav-chosen { justify-content: center; max-width: 460px; margin: 0 auto 22px; min-height: 8px; }
.fav-chosen .chip { display: inline-flex; align-items: center; gap: 4px; }
.fav-chosen .chip button { background: none; border: 0; color: inherit; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; }
.btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; transform: none; }
#fav .quiz-nav { justify-content: center; }
