/* Layout: 1カラムの「判定書」。スマホ基準・最大幅 560px。ハンコ（判定スタンプ）が唯一の強い装飾。 */
:root {
  --paper: #F3EEF4;      /* 薄いライラック系の紙 */
  --card: #FFFDFE;
  --ink: #2B1631;        /* 深いプラム */
  --muted: #6F5F75;
  --line: #DCD1DF;
  --out: #E0245E;        /* 浮気：チェリー */
  --gray: #9A88A3;       /* 嫌：ラベンダーグレー */
  --safe: #2E8C7E;       /* OK：ティール */
  --out-soft: #FBE3EA;
  --gray-soft: #EEE8F1;
  --safe-soft: #E1F1EE;
  --on-accent: #FFFFFF;

  --f-display: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", sans-serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  --f-mono: "DM Mono", ui-monospace, "SFMono-Regular", monospace;

  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #170E1A; --card: #22162A; --ink: #F3EAF5; --muted: #B3A3B9; --line: #3B2C43;
    --out: #FF4F82; --gray: #B5A3BE; --safe: #45B8A6;
    --out-soft: #3A1626; --gray-soft: #2D2235; --safe-soft: #12302C; --on-accent: #170E1A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #170E1A; --card: #22162A; --ink: #F3EAF5; --muted: #B3A3B9; --line: #3B2C43;
  --out: #FF4F82; --gray: #B5A3BE; --safe: #45B8A6;
  --out-soft: #3A1626; --gray-soft: #2D2235; --safe-soft: #12302C; --on-accent: #170E1A;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.75;
  padding-inline: 16px;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--out); outline-offset: 3px; }

.shell { max-width: 560px; margin: 0 auto; padding-block: env(safe-area-inset-top, 0px) 32px; display: flex; flex-direction: column; min-height: 100vh; }
.view { display: flex; flex-direction: column; gap: 28px; flex: 1; padding-block: 8px 40px; }

/* ---- top bar ---- */
.topbar { padding-block: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-seal { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--out); color: var(--out); display: grid; place-items: center; font-family: var(--f-display); font-size: 15px; transform: rotate(-8deg); }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.brand-name b { font-weight: 700; color: var(--out); margin-left: 2px; }

/* ---- type ---- */
.eyebrow, .mini { font-family: var(--f-body); font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.h2 { font-family: var(--f-display); font-weight: 400; font-size: 22px; line-height: 1.4; }
.h3 { font-size: 15px; font-weight: 700; }
.sub, .body { color: var(--muted); font-size: 15px; }
.body { color: var(--ink); }
.fine { font-size: 13px; color: var(--muted); }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

/* ---- hero ---- */
.hero { display: flex; flex-direction: column; gap: 20px; padding-top: 12px; }
.hero-title { font-family: var(--f-display); font-weight: 400; font-size: clamp(52px, 17vw, 88px); line-height: 1.05; letter-spacing: -.01em; }
.hero-em { color: var(--out); position: relative; display: inline-block; }
.hero-em::after { content: ""; position: absolute; left: 4%; right: 6%; bottom: .06em; height: .1em; background: var(--out); opacity: .25; border-radius: 2px; }
.lead { font-size: 16px; }
.verdict-legend { display: flex; flex-wrap: wrap; gap: 10px; }

.stamp { display: inline-flex; align-items: center; justify-content: center; padding: 4px 12px; border: 2px solid currentColor; border-radius: 6px; font-weight: 700; font-size: 14px; letter-spacing: .06em; }
.stamp--out { color: var(--out); transform: rotate(-3deg); }
.stamp--gray { color: var(--gray); transform: rotate(1.5deg); }
.stamp--safe { color: var(--safe); transform: rotate(-1deg); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 22px; border-radius: 999px; border: 2px solid var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; transition: transform .12s ease, background-color .15s ease; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--out); border-color: var(--out); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--card); }
.btn-xl { min-height: 60px; font-size: 18px; }
.btn-block { width: 100%; }

/* ---- types ---- */
.types, .howto { display: flex; flex-direction: column; gap: 12px; }
.type-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.type-list li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
.type-list .mini-seal { grid-row: span 2; width: 44px; height: 44px; font-size: 20px; border-width: 2px; }
.type-list .t-name { font-weight: 700; font-size: 14px; line-height: 1.35; }
.type-list .t-range { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

/* ---- seal (ハンコ) ---- */
.seal, .mini-seal { display: grid; place-items: center; border-radius: 50%; border: 4px solid var(--out); color: var(--out); font-family: var(--f-display); line-height: 1; }
.seal { width: 112px; height: 112px; font-size: 54px; transform: rotate(-10deg); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--out); }

/* ---- partner banner ---- */
.partner { background: var(--out-soft); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.partner .eyebrow { color: var(--out); }
.partner strong { color: var(--out); }

/* ---- quiz ---- */
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress-row { display: flex; justify-content: space-between; align-items: center; }
.counter { font-family: var(--f-mono); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter b { color: var(--ink); font-weight: 500; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--out); border-radius: 99px; transition: width .3s ease; }

.qcard { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px 34px; min-height: 230px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.q-cat { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.q-prompt { margin-top: 14px; font-size: 14px; color: var(--muted); font-weight: 500; }
.q-text { font-size: clamp(22px, 6.2vw, 27px); line-height: 1.5; font-weight: 700; }
.qcard.enter { animation: cardIn .28s ease both; }
@keyframes cardIn { from { transform: translateX(14px); opacity: .2; } to { transform: none; opacity: 1; } }

.stamp-drop { position: absolute; right: 18px; bottom: 16px; pointer-events: none; font-family: var(--f-display); font-size: 22px; padding: 6px 14px; border: 3px solid currentColor; border-radius: 8px; opacity: 0; }
.stamp-drop.show { animation: stampIn .32s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stampIn { from { opacity: 0; transform: scale(1.8) rotate(-14deg); } to { opacity: .95; transform: scale(1) rotate(-8deg); } }

.answers { display: flex; flex-direction: column; gap: 10px; }
.ans { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 12px 18px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 17px; text-align: left; cursor: pointer; transition: border-color .12s ease, background-color .12s ease, transform .1s ease; }
.ans:active { transform: scale(.985); }
.ans-key { font-family: var(--f-mono); font-size: 12px; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; border: 1px solid currentColor; opacity: .7; flex: none; }
.ans--out { color: var(--out); }
.ans--gray { color: var(--ink); }
.ans--safe { color: var(--safe); }
.ans--out.is-picked { border-color: var(--out); background: var(--out-soft); }
.ans--gray.is-picked { border-color: var(--gray); background: var(--gray-soft); }
.ans--safe.is-picked { border-color: var(--safe); background: var(--safe-soft); }
@media (hover: hover) {
  .ans--out:hover { border-color: var(--out); background: var(--out-soft); }
  .ans--gray:hover { border-color: var(--gray); background: var(--gray-soft); }
  .ans--safe:hover { border-color: var(--safe); background: var(--safe-soft); }
}

/* ---- result ---- */
.result-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-top: 8px; }
.r-type { font-family: var(--f-display); font-weight: 400; font-size: clamp(32px, 10vw, 44px); line-height: 1.25; margin-top: 6px; }
.r-catch { color: var(--muted); font-weight: 500; }
.score { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.score-label { font-weight: 700; font-size: 15px; letter-spacing: .1em; }
.score-num { font-family: var(--f-display); line-height: 1; color: var(--out); font-variant-numeric: tabular-nums; }
.score-num b { font-weight: 400; font-size: clamp(76px, 26vw, 112px); }
.score-num small { font-size: 32px; margin-left: 2px; }
.meter { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 4px; }
.meter-track { height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--safe-soft), var(--gray-soft), var(--out-soft)); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--out); border-radius: 99px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.meter-scale { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.border { margin-top: 12px; width: 100%; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 14px 4px; display: flex; flex-direction: column; gap: 2px; }
.border-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.border-text { font-size: 18px; font-weight: 700; }
.border-text em { font-style: normal; color: var(--out); }

.actions { display: flex; flex-direction: column; gap: 10px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-url { width: 100%; font: 13px var(--f-mono); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }

.compare { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px 18px; display: flex; flex-direction: column; gap: 14px; }
.compare-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; text-align: center; }
.compare-v { font-weight: 700; font-size: 14px; line-height: 1.4; }
.compare-big { font-family: var(--f-display); font-size: 48px; line-height: 1.1; color: var(--out); font-variant-numeric: tabular-nums; }
.diff-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.diff-list li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.diff-pair { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }

.detail { display: flex; flex-direction: column; gap: 14px; }
.cat-bars { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 12px; }
.cat-bars li { display: grid; grid-template-columns: 82px minmax(0, 1fr) 48px; gap: 12px; align-items: center; font-size: 14px; font-weight: 700; }
.cat-bars .track { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cat-bars .fill { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.cat-bars .num { font-family: var(--f-mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.aru { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.pair-type { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.pair-type p:last-child { font-weight: 700; }
.tip { font-size: 15px; padding-left: 14px; border-left: 3px solid var(--out); }

.review details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review summary { cursor: pointer; padding: 16px 0; font-weight: 700; }
.review-list { list-style: none; padding: 0 0 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.review-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.chip { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; border: 1.5px solid currentColor; white-space: nowrap; }
.chip--0 { color: var(--out); } .chip--1 { color: var(--gray); } .chip--2 { color: var(--safe); }

/* ---- ads ---- */
.ad:empty { display: none; }
.ad { min-height: 100px; }
.ad-ph { display: grid; place-items: center; min-height: 100px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font: 12px var(--f-mono); letter-spacing: .1em; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer a { color: var(--muted); }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; z-index: 10; background: rgba(23, 14, 26, .72); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-box { background: var(--card); border-radius: 20px; padding: 18px; width: min(560px, 100%); display: flex; flex-direction: column; gap: 12px; }
.modal-box img { border-radius: 10px; border: 1px solid var(--line); display: block; width: 100%; }
.img-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.img-pair figure { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.img-pair figcaption { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---- 静的ページ ---- */
.doc { display: flex; flex-direction: column; gap: 16px; padding-block: 8px 48px; }
.doc h1 { font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1.4; }
.doc h2 { font-size: 17px; margin-top: 12px; }
.doc ul { margin: 0; padding-left: 1.3em; }
.doc a { color: var(--out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- みんなの結果 ---- */
.crowd-count { font-size: 14px; color: var(--muted); }
.crowd-count b { font-family: var(--f-mono); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.demo-tag { margin-left: 8px; font-size: 11px; letter-spacing: .06em; padding: 1px 6px; border-radius: 4px; background: var(--gray-soft); color: var(--muted); font-weight: 700; }
.divisive { display: flex; flex-direction: column; gap: 10px; padding: 20px 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.divisive-q { font-size: 18px; font-weight: 700; line-height: 1.55; }

.split { display: flex; flex-direction: column; gap: 4px; }
.split-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); gap: 2px; }
.split-bar span { display: block; height: 100%; min-width: 0; }
.split-bar .s0 { background: var(--out); } .split-bar .s1 { background: var(--gray); } .split-bar .s2 { background: var(--safe); }
.split-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.split-legend .mine { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.split-legend i { font-style: normal; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 1px; }

.rank { font-size: 15px; font-weight: 700; padding: 6px 14px; border-radius: 99px; background: var(--out-soft); color: var(--ink); }
.rank b { font-family: var(--f-display); font-weight: 400; color: var(--out); font-size: 20px; margin-inline: 2px; }

.minority { display: flex; flex-direction: column; gap: 12px; }
.minority-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.minority-list li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.minority-q { font-weight: 700; font-size: 15px; line-height: 1.55; }
.minority-note { font-size: 13px; color: var(--muted); }
.minority-note b { color: var(--out); font-family: var(--f-mono); font-weight: 500; }
.review-note { font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 6px; }
.review-list li .split { grid-column: 1 / -1; }

/* ---- 状況の条件・おまけ質問 ---- */
.q-detail { display: flex; gap: 8px; align-items: baseline; margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.q-detail-tag { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 1px 7px; border-radius: 4px; background: var(--gray-soft); color: var(--muted); }
.qcard.is-self { background: var(--out-soft); border-color: transparent; }
.qcard.is-self .q-cat { color: var(--out); border-color: var(--out); }
.answers--self .ans { color: var(--ink); }
.answers--self .ans.is-picked { border-color: var(--ink); background: var(--card); }
@media (hover: hover) { .answers--self .ans:hover { border-color: var(--ink); background: var(--card); } }
.self-line { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; }
.self-line b { color: var(--ink); }
.self-badge { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; border: 1.5px solid var(--out); color: var(--out); }
.self-compare { font-size: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
