/* ふるさと、どっち？ — 生成りの紙に墨と朱。雑誌のような大きな文字組み */
:root {
  --paper: #f3eee5;
  --card: #fffcf6;
  --ink: #15120f;
  --muted: #6f665c;
  --line: #d8cebf;
  --red: #e8452c;
  --red-soft: #fbe1da;
  --green: #1f5c4a;
  --green-soft: #dcebe4;
  --yellow: #f2c230;
  --mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", serif;
  --gothic: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --latin: "Space Grotesk", "Zen Kaku Gothic New", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--gothic); line-height: 1.75;
  /* うっすら紙の質感 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main { max-width: 720px; margin: 0 auto; padding: 0 20px 64px; overflow-x: clip; }
button { font: inherit; color: inherit; cursor: pointer; }
.screen { animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- ヘッダー・フッター ---------- */
.site-header { background: var(--ink); color: var(--paper); }
.header-inner { max-width: 720px; margin: 0 auto; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { text-decoration: none; color: var(--paper); display: grid; line-height: 1.2; }
.logo-ja { font-family: var(--mincho); font-weight: 800; font-size: 1.1rem; letter-spacing: .04em; }
.logo-en { font-family: var(--latin); font-size: .62rem; letter-spacing: .28em; color: #a89d8f; }
.pr { font-family: var(--latin); font-size: .68rem; border: 1.5px solid var(--paper); padding: 1px 8px; border-radius: 999px; }
.site-footer { background: var(--ink); color: #d9d2c7; font-size: .75rem; padding: 36px 20px 48px; }
.site-footer p { max-width: 720px; margin: 6px auto; }
.footer-logo { font-family: var(--mincho); font-size: 1.3rem; color: var(--paper); font-weight: 800; }

.eyebrow { font-family: var(--latin); font-size: .7rem; letter-spacing: .3em; color: var(--red); margin: 0 0 10px; font-weight: 700; }
.num { font-family: var(--latin); font-weight: 700; color: var(--red); margin-right: 10px; }

/* ---------- 濃い背景の帯（ヘッダーから続くヒーロー、結果のタイプ） ---------- */
.bleed { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
.dark { background: var(--ink); color: var(--paper); isolation: isolate; }
.dark .eyebrow { color: var(--yellow); }

/* ---------- ヒーロー ---------- */
.hero { padding: 26px 20px 30px; border-bottom: 6px solid var(--red); }
.hero-title { font-family: var(--mincho); font-weight: 800; font-size: clamp(2.8rem, 14vw, 5.6rem); line-height: 1.08; letter-spacing: -.02em; margin: 0; }
.hero-title em { font-style: normal; color: var(--red); }
.hero-lead { color: #cfc6b8; max-width: 32em; margin: 16px 0 22px; font-size: .95rem; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0; margin: 0; }
.steps li { border-top: 2px solid var(--paper); padding-top: 8px; font-size: .76rem; font-weight: 700; }
.steps span { display: block; font-family: var(--latin); font-size: 1.4rem; line-height: 1.2; color: var(--yellow); }

/* ---------- 入力フォーム ---------- */
.cond { display: grid; gap: 28px; margin-top: 30px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-family: var(--mincho); font-weight: 800; font-size: 1.2rem; padding: 0; margin-bottom: 12px; }
.hint { font-family: var(--gothic); font-weight: 500; font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-left: 6px; }
.group-label { font-size: .78rem; font-weight: 700; color: var(--muted); margin: 14px 0 8px; display: flex; align-items: center; gap: 8px; }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#fav-life { grid-template-columns: repeat(4, 1fr); }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile span { display: grid; place-items: center; gap: 2px; text-align: center; padding: 12px 4px 10px; min-height: 84px; border-radius: 16px; border: 1.5px solid var(--ink); background: var(--card); font-weight: 700; font-size: .78rem; line-height: 1.3; cursor: pointer; transition: transform .15s, background .15s; user-select: none; }
.tile i { font-style: normal; font-size: 1.9rem; line-height: 1; }
.tile span:hover { transform: translateY(-2px); }
.tile input:checked + span { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.tile input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
.tile input:disabled + span { opacity: .35; cursor: default; transform: none; }
@media (max-width: 360px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 legend { grid-column: 1 / -1; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 label { display: grid; gap: 6px; font-size: .82rem; font-weight: 700; }
select {
  font: inherit; font-size: .95rem; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink);
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat;
}
.motives { display: grid; gap: 8px; }
.check { display: flex; gap: 10px; align-items: center; font-size: .92rem; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--red); flex: none; }
.error { color: var(--red); font-size: .85rem; margin: 8px 0 0; font-weight: 700; }
.note { font-size: .75rem; color: var(--muted); margin: 0; text-align: center; }

.btn-primary {
  border: 0; border-radius: 999px; padding: 18px 28px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 1.05rem;
  display: flex; justify-content: space-between; align-items: center; width: 100%; box-shadow: 5px 5px 0 var(--red); transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--red); }
.btn-primary:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--red); }
.btn-text { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; padding: 12px; }
.btn-outline { width: 100%; background: var(--card); border: 1.5px solid var(--ink); border-radius: 999px; padding: 15px 20px; font-weight: 700; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s; }
.btn-outline:hover { transform: translate(-2px, -2px); }

/* ---------- 対決 ---------- */
/* 対決中は画面の高さぴったりに収め、スクロールさせない */
body.in-duel { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
body.in-duel .site-footer { display: none; }
body.in-duel main { flex: 1; min-height: 0; width: 100%; padding-bottom: 0; display: flex; flex-direction: column; }
#duel:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; padding: 10px 0 14px; }
.duel-head { display: flex; align-items: flex-end; gap: 16px; }
.counter { margin: 0; font-family: var(--latin); font-weight: 700; line-height: 1; }
#round-now { font-size: clamp(2rem, 7vh, 3rem); letter-spacing: -.04em; }
.of { font-size: 1rem; color: var(--muted); margin-left: 4px; }
.progress { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
#progress-bar { height: 100%; background: var(--red); transition: width .35s ease; }
.duel-q { font-family: var(--mincho); font-weight: 800; font-size: clamp(1.2rem, 5vw, 1.8rem); margin: 1.6vh 0 1.8vh; }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; align-items: stretch; width: 100%; margin: 0 auto;
  /* 写真は正方形。画面の高さからはみ出さない幅に抑える（見出し・名前・ボタン分を引く） */
  max-width: min(720px, calc((100dvh - 330px) * 2 + 12px)); }
.vs { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) rotate(-8deg); z-index: 2; background: var(--red); color: #fff; font-family: var(--latin); font-weight: 700; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--paper); font-size: .95rem; pointer-events: none; }
.card {
  text-align: left; padding: 0; background: var(--card); border: 1.5px solid var(--ink); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 5px 5px 0 var(--ink); transition: transform .15s, box-shadow .15s; animation: rise .35s ease both;
}
.card:hover, .card:focus-visible { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--red); outline: none; }
.card:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.photo { aspect-ratio: 1; display: grid; place-items: center; font-size: clamp(2.6rem, 12vw, 4.5rem); position: relative; overflow: hidden; background: #eee6d9; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-img { position: absolute; inset: 0; }
.card-body { padding: 10px 12px 12px; display: grid; gap: 2px; align-content: start; }
.card-body strong { font-size: .9rem; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag { font-size: .68rem; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-family: var(--latin); font-size: .85rem; font-weight: 700; color: var(--red); }
#skip { display: block; margin: 1.2vh auto 0; }

/* ---------- 結果：タイプ ---------- */
.type-hero { padding: 30px 20px 30px; border-bottom: 6px solid var(--red); }
.type-name { margin: 6px 0 0; font-family: var(--mincho); font-weight: 800; line-height: 1.1; display: grid; animation: rise .6s ease both .1s; }
.type-axis { font-size: clamp(1.4rem, 6.5vw, 2.2rem); color: var(--yellow); }
.type-cat { font-size: clamp(2.8rem, 15vw, 5.2rem); letter-spacing: -.01em; }
.type-sub { font-size: .95rem; margin: 18px 0 0; color: #cfc6b8; }

/* ---------- 結果：ブロック ---------- */
.block { margin-top: 44px; }
.block-title { font-family: var(--mincho); font-weight: 800; font-size: 1.6rem; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.map { background: var(--card); border: 1.5px solid var(--ink); border-radius: 22px; padding: 12px 16px 20px; box-shadow: 5px 5px 0 var(--ink); }
.radar { width: 100%; max-width: 420px; display: block; margin: 0 auto; overflow: visible; }
.radar .ring { fill: none; stroke: var(--line); stroke-dasharray: 3 5; }
.radar .spoke { stroke: var(--line); }
.radar .shape { fill: url(#pop); fill-opacity: .8; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; transform-origin: 180px 170px; animation: grow .8s cubic-bezier(.2, 1.3, .4, 1) both .3s; }
@keyframes grow { from { transform: scale(0); } to { transform: scale(1); } }
.radar .bubble { stroke: var(--ink); stroke-width: 2; }
.radar .emoji { font-size: 20px; }
.radar .clabel { font-size: 11px; font-weight: 700; fill: var(--ink); font-family: var(--gothic); }
.radar .top { fill: var(--red); }
.axes { display: grid; gap: 10px; margin-top: 8px; }
.axis { display: grid; grid-template-columns: 1fr 5.2fr 1fr; align-items: center; gap: 10px; font-size: .74rem; color: var(--muted); }
.axis > span:last-child { text-align: right; }
.axis .strong { color: var(--ink); font-weight: 700; }
.track { position: relative; height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--green-soft), #f1ebe0 50%, var(--red-soft)); border: 1.5px solid var(--ink); }
.track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1.5px; background: var(--ink); opacity: .25; }
.dot { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); transition: left .6s cubic-bezier(.2, 1.3, .4, 1); }
@media (max-width: 480px) {
  .axis { grid-template-columns: 1fr 1fr; grid-template-areas: "neg pos" "track track"; gap: 6px 8px; }
  .axis > span:first-child { grid-area: neg; } .axis > span:last-child { grid-area: pos; } .axis .track { grid-area: track; }
}
.radar .crown { font-family: var(--latin); font-size: 9px; font-weight: 700; fill: #fff; }
.radar .crown-bg { fill: var(--red); stroke: var(--ink); stroke-width: 1.5; }

/* ---------- 結果：おすすめ ---------- */
.recs { display: grid; gap: 18px; }
.rec { background: var(--card); border: 1.5px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 5px 5px 0 var(--ink); display: grid; grid-template-columns: 132px 1fr; }
.rec.rec-b { box-shadow: 5px 5px 0 var(--green); border-color: var(--green); }
.rec-img { width: 132px; height: 100%; min-height: 132px; object-fit: cover; background: #eee6d9; }
.rec-body { padding: 14px 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.rec-no { font-family: var(--latin); font-weight: 700; font-size: .75rem; color: var(--red); letter-spacing: .1em; }
.rec-b .rec-no { color: var(--green); }
.rec-body strong { font-size: 1rem; line-height: 1.45; }
.meta { font-size: .74rem; color: var(--muted); }
.flag { display: inline-block; margin-left: 6px; font-size: .68rem; border: 1px solid var(--ink); border-radius: 999px; padding: 0 7px; color: var(--ink); }
.why { grid-column: 1 / -1; margin: 0; padding: 12px 16px; background: var(--red-soft); border-top: 1.5px dashed var(--ink); font-size: .85rem; }
.why b { color: var(--red); margin-right: 6px; }
.rec-b .why { background: var(--green-soft); }
.rec-b .why b { color: var(--green); }
.btn-link { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; text-decoration: none; background: var(--ink); color: var(--paper); font-weight: 700; font-size: .9rem; padding: 13px 18px; }
.btn-link:hover { background: var(--red); }
.rec-b .btn-link:hover { background: var(--green); }
@media (max-width: 480px) { .rec { grid-template-columns: 104px 1fr; } .rec-img { width: 104px; min-height: 104px; } }

.winners { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.win { background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; overflow: hidden; display: grid; text-decoration: none; color: var(--ink); transition: transform .15s; }
.win:hover { transform: translateY(-3px); }
.win img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eee6d9; }
.win span { padding: 8px 10px 2px; font-size: .78rem; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.win em { font-style: normal; padding: 0 10px 10px; font-family: var(--latin); font-size: .78rem; color: var(--red); font-weight: 700; }

.actions { display: grid; gap: 6px; margin-top: 44px; }

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

/* ---------- シェア ---------- */
.share-note { font-size: .78rem; color: var(--muted); margin: 10px 0 14px; text-align: center; }
.sns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sns-btn { display: block; text-align: center; text-decoration: none; font-weight: 700; font-size: .88rem; padding: 12px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; }
.sns-x { background: var(--ink); color: #fff; }
.sns-line { background: #06c755; border-color: #06c755; color: #fff; }
.sns-fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.sns-btn:hover { filter: brightness(1.08); }

/* ---------- しっくりこないとき ---------- */
.rec-body { position: relative; }
.nope { position: absolute; top: 10px; right: 10px; font-size: .7rem; font-weight: 700; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.nope:hover { color: var(--red); border-color: var(--red); }
.rec-body strong { padding-right: 6px; }
.tune { margin-top: 22px; padding: 18px 16px; border: 1.5px dashed var(--ink); border-radius: 18px; background: var(--card); text-align: center; }
.tune-title { font-family: var(--mincho); font-weight: 800; font-size: 1.15rem; margin: 0 0 12px; }
.tune-note { font-size: .78rem; color: var(--muted); margin: 10px 0 0; }

.note a { color: inherit; }
.footer-link { color: var(--paper); }
/* ---------- 規約・ポリシーのページ ---------- */
.doc { padding: 28px 0 40px; }
.doc h1 { font-family: var(--mincho); font-weight: 800; font-size: 1.9rem; margin: 0 0 6px; }
.doc h2 { font-family: var(--mincho); font-weight: 800; font-size: 1.15rem; margin: 30px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.doc p, .doc li { font-size: .92rem; }
.doc ul { padding-left: 1.2em; }
.doc .updated { color: var(--muted); font-size: .8rem; }
.doc a { color: var(--red); }
