:root {
  color-scheme: dark;
  --bg0: #0e0c20;
  --bg1: #171236;
  --bg2: #2a1b4f;
  --ink: #f5f2ff;
  --sub: #b9b2d6;
  --line: rgba(255, 255, 255, .14);
  --card: rgba(255, 255, 255, .06);
  --gold: #f3d28a;
  --gold2: #f0a970;
  --lav: #b9a7f5;
  --dark: #2a1b3d;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --sans: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg0);
  font-family: var(--sans); font-size: 16px; line-height: 1.75; min-height: 100vh;
  /* 改行は文節の切れ目（サーバーが入れる <wbr>）でだけ行う。収まらないときだけ途中で折る */
  word-break: keep-all; overflow-wrap: anywhere; line-break: strict;
}
p, li, dd, figcaption { text-wrap: pretty; }
h1, h2, .center, .hero p, .result p, .scan-step, .compat-title, .compat-lead { text-wrap: balance; }
a { color: var(--gold); }

/* 夜空 */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 45%, var(--bg2) 100%); }
.stars { position: absolute; inset: -20% 0 0 0; background-repeat: repeat; }
.stars.s1 { background-size: 240px 240px; opacity: .8;
  background-image:
    radial-gradient(1.2px 1.2px at 20px 30px, #fff 60%, transparent 61%),
    radial-gradient(1px 1px at 120px 80px, #e9e2ff 60%, transparent 61%),
    radial-gradient(1.4px 1.4px at 200px 150px, #fff 60%, transparent 61%),
    radial-gradient(1px 1px at 70px 190px, #ffe9b8 60%, transparent 61%),
    radial-gradient(.8px .8px at 160px 220px, #fff 60%, transparent 61%); }
.stars.s2 { background-size: 380px 380px; opacity: .55; animation: twinkle 5s ease-in-out infinite alternate;
  background-image:
    radial-gradient(1.6px 1.6px at 60px 110px, #fff 60%, transparent 61%),
    radial-gradient(1.2px 1.2px at 290px 60px, #ffe9b8 60%, transparent 61%),
    radial-gradient(1.4px 1.4px at 330px 300px, #d9ccff 60%, transparent 61%),
    radial-gradient(1px 1px at 180px 340px, #fff 60%, transparent 61%); }
.sky .glow { position: absolute; left: 50%; top: -180px; width: 620px; height: 620px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(185, 167, 245, .28), transparent 62%); }
@keyframes twinkle { from { opacity: .25; } to { opacity: .7; } }

.top, .wrap, .foot { position: relative; }
.top { border-bottom: 1px solid var(--line); background: rgba(14, 12, 32, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 8px; max-width: 560px; margin: 0 auto; padding: 8px 16px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; letter-spacing: .04em; }
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.has-sticky .wrap { padding-bottom: 110px; }

.cat { width: 64px; height: 64px; flex: none; }
.cat.sm { width: 34px; height: 34px; }
.cat.md { width: 52px; height: 52px; }
.cat.in-moon { width: 62%; height: 62%; filter: drop-shadow(0 4px 10px rgba(60, 40, 100, .35)); }
.moon { position: relative; width: 132px; height: 132px; margin: 8px auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 30%, #fff8e1, #f3d28a 58%, #d7a558);
  box-shadow: 0 0 46px rgba(243, 210, 138, .5), 0 0 110px rgba(243, 210, 138, .22); }
.moon.lg { width: 164px; height: 164px; margin-top: 22px; }
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .28); }
.ring.r1 { inset: -18px; animation: spin 26s linear infinite; }
.ring.r2 { inset: -36px; border-color: rgba(185, 167, 245, .3); animation: spin 40s linear infinite reverse; }
.ring::after { content: ""; position: absolute; top: 50%; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; }
.ring.r2::after { left: auto; right: -4px; background: var(--lav); box-shadow: 0 0 10px var(--lav); }
@keyframes spin { to { transform: rotate(360deg); } }

h1 { font-size: 1.4rem; line-height: 1.5; margin: 0 0 12px; }
h2 { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 1.08rem; margin: 0 0 12px; letter-spacing: .03em; }
h2 .ico { color: var(--gold); }
.display { font-family: var(--serif); font-size: 1.62rem; line-height: 1.55; letter-spacing: .03em; margin: 6px 0 12px; }
.gold { background: linear-gradient(90deg, #fbe7ae, #f0a970); -webkit-background-clip: text; background-clip: text; color: transparent; }
.display .gold { display: inline-block; }
.eyebrow { margin: 0; color: var(--lav); font-size: .84rem; letter-spacing: .18em; }
.lead { color: var(--sub); }
.small { font-size: .8rem; color: var(--sub); line-height: 1.65; }
.center { text-align: center; }
.hero { text-align: center; padding: 8px 0 10px; }
.ico { width: 22px; height: 22px; flex: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; margin: 16px 0;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card.quiet { background: transparent; }
fieldset.card { min-width: 0; }
legend { font-family: var(--serif); font-weight: 700; padding: 0 8px; letter-spacing: .03em; }
.tag { font-family: var(--sans); font-size: .7rem; font-weight: 600; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: middle; }
.tag.opt { color: var(--sub); border-color: var(--line); }
ul.plain { margin: 0; padding-left: 1.2em; }
ul.plain li { margin: 4px 0; }

.btn { display: block; width: 100%; padding: 15px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .05); color: var(--ink); font-size: 1rem; font-weight: 700; text-align: center;
  text-decoration: none; cursor: pointer; font-family: inherit; margin: 10px 0; letter-spacing: .04em; }
.btn.primary { border: 0; color: var(--dark); background: linear-gradient(90deg, #fbe2a2, #f0a970); }
.btn.glow { box-shadow: 0 8px 28px rgba(240, 169, 112, .42); }
.btn.ghost { width: auto; flex: 0 0 34%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.nav { display: flex; gap: 10px; align-items: center; }

/* トップ */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; display: grid; gap: 2px; }
.tile .ico { color: var(--gold); width: 26px; height: 26px; margin-bottom: 4px; }
.tile b { font-family: var(--serif); letter-spacing: .03em; }
.tile span { font-size: .78rem; color: var(--sub); }
.steps-list { list-style: none; counter-reset: s; margin: 0 0 6px; padding: 0; display: grid; gap: 14px; }
.steps-list li { counter-increment: s; position: relative; padding-left: 44px; display: grid; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; color: var(--dark); background: linear-gradient(135deg, #fbe2a2, #f0a970); }
.steps-list span { font-size: .84rem; color: var(--sub); }

/* 入力 */
.progress { display: flex; gap: 8px; justify-content: center; margin: 4px 0 14px; }
.dot { width: 34px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .16); transition: background .3s; }
.dot.on { background: linear-gradient(90deg, #fbe2a2, #f0a970); }
.js .step { display: none; }
.js .step.active { display: block; animation: rise .35s ease both; }
.ask { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.ask p { margin: 0; background: rgba(255, 255, 255, .1); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-size: .98rem; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
select, input[type="text"] { width: 100%; padding: 13px 10px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; font-size: 1rem;
  background: rgba(255, 255, 255, .08); color: var(--ink); font-family: inherit; }
select option { background: #1f1840; color: var(--ink); }
input::placeholder { color: rgba(255, 255, 255, .45); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: block; padding: 9px 15px; border: 1px solid rgba(255, 255, 255, .26); border-radius: 999px; background: rgba(255, 255, 255, .05); font-size: .95rem; transition: all .15s; }
.chip input:checked + span { background: linear-gradient(90deg, #fbe2a2, #f0a970); border-color: transparent; color: var(--dark); font-weight: 700; box-shadow: 0 4px 16px rgba(240, 169, 112, .35); }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.chip input:disabled + span { opacity: .35; }
.shoot { display: grid; grid-template-columns: 116px 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.frame { position: relative; width: 116px; height: 146px; border-radius: 14px; border: 1px dashed rgba(243, 210, 138, .7); display: grid; place-items: center; overflow: hidden; background: rgba(255, 255, 255, .04); }
.guide-hand { width: 78%; color: var(--gold); opacity: .85; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.guide { margin: 0; padding-left: 1.2em; font-size: .92rem; }
.guide li { margin: 4px 0; }
.guide strong { color: var(--gold); }
.filebox { display: block; border: 1px solid rgba(243, 210, 138, .75); border-radius: 14px; padding: 16px; text-align: center; color: var(--gold); font-weight: 700; cursor: pointer; background: rgba(243, 210, 138, .08); }
.filebox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: .9rem; }
.agree input { width: 20px; height: 20px; margin-top: 4px; flex: none; accent-color: #f0a970; }
.alert { background: rgba(243, 210, 138, .12); border: 1px solid rgba(243, 210, 138, .5); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.alert p { margin: 4px 0 0; }

/* 解析中 */
.loading { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 35%, rgba(42, 27, 79, .97), rgba(14, 12, 32, .98)); }
.loading[hidden] { display: none; }
.scan { position: relative; width: 200px; height: 250px; border-radius: 18px; overflow: hidden; background: rgba(255, 255, 255, .06); margin-bottom: 22px; box-shadow: 0 0 60px rgba(185, 167, 245, .35); }
.scan img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.9); }
.scan-line { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #fbe2a2, transparent); box-shadow: 0 0 18px 4px rgba(251, 226, 162, .6); animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 0% { top: 4%; } 50% { top: 94%; } 100% { top: 4%; } }
.corner { position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold); }
.c1 { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.c2 { top: 8px; right: 8px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.c3 { bottom: 8px; left: 8px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.c4 { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.scan-step { font-family: var(--serif); font-size: 1.05rem; margin: 0 0 6px; min-height: 1.8em; }

/* 結果 */
.result { text-align: center; }
.type { font-family: var(--serif); font-size: 1.95rem; letter-spacing: .05em; margin: 4px 0 6px; }
.one { margin: 0 0 16px; color: var(--ink); }
.facts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0; margin: 0 0 4px; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 4px 10px; display: grid; justify-items: center; gap: 1px; }
.facts .ico { color: var(--gold); }
.facts span { font-size: .72rem; color: var(--sub); letter-spacing: .1em; }
.facts b { font-family: var(--serif); font-size: 1.7rem; line-height: 1.25; }
.facts b.sm { font-size: 1.05rem; line-height: 2.05; }
.facts i { font-style: normal; font-size: .72rem; color: var(--lav); }
.palm { margin: 0 0 8px; }
.palm img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 14px; background: #000; display: block;
  box-shadow: 0 0 0 1px rgba(243, 210, 138, .5), 0 0 34px rgba(185, 167, 245, .35); }
.palm figcaption { font-size: .8rem; color: var(--sub); margin-top: 8px; text-align: center; }
.axes { display: grid; gap: 14px; }
.axis-name { display: block; font-size: .78rem; color: var(--sub); letter-spacing: .1em; margin-bottom: 4px; text-align: center; }
.axis-row { display: grid; grid-template-columns: 5.2em 1fr 5.2em; gap: 8px; align-items: center; }
.side { font-size: .86rem; color: var(--sub); text-align: center; }
.side.on { color: var(--gold); font-weight: 700; }
.track { position: relative; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.knob { position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: linear-gradient(135deg, #fbe2a2, #f0a970); box-shadow: 0 0 12px rgba(243, 210, 138, .8); }
.knob.left { left: 14%; }
.knob.right { right: 14%; }
.speaker { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; margin-bottom: 4px; letter-spacing: .03em; }
.reading p { margin: 12px 0; }
.flow { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; align-items: end; height: 150px; padding-top: 8px; }
.col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.bar { width: 100%; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #fbe2a2, #f0a970); }
.bar.lv3 { height: 100%; } .bar.lv2 { height: 66%; } .bar.lv1 { height: 36%; }
.col .mlabel { font-size: .64rem; color: var(--sub); white-space: nowrap; }
.col.locked .bar { background: rgba(255, 255, 255, .3); filter: blur(4px); }
.flow-lock { position: absolute; top: 0; bottom: 20px; right: 0; left: calc((100% + 5px) / 12 * var(--free)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink); text-decoration: none; font-size: .82rem; font-weight: 700; background: linear-gradient(90deg, rgba(23, 18, 54, .2), rgba(23, 18, 54, .55)); border-radius: 10px; }
.flow-lock .ico { width: 26px; height: 26px; color: var(--gold); }
.flow-list { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 8px; }
.flow-list li { display: grid; grid-template-columns: auto auto 1fr; gap: 2px 8px; align-items: center; background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 10px 12px; }
.flow-list b { font-family: var(--serif); }
.flow-list em { font-style: normal; color: var(--sub); font-size: .84rem; text-align: right; }
.flow-list p { grid-column: 1 / -1; margin: 0; font-size: .88rem; }
.phase { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 9px; color: var(--dark); background: #fbe2a2; }
.phase.p2 { background: #cfc3fb; } .phase.p1 { background: #a9dcd4; }
.locked-list { display: grid; gap: 10px; }
.locked-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.locked-card.first { border-color: rgba(243, 210, 138, .65); background: rgba(243, 210, 138, .08); }
.lc-text { flex: 1; display: grid; gap: 7px; }
.sk { display: block; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); filter: blur(2.5px); }
.sk.w80 { width: 80%; } .sk.w60 { width: 60%; }
.locked-card .ico { width: 24px; height: 24px; color: var(--gold); }
.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(14, 12, 32, .97) 34%); }
.price { font-family: var(--serif); font-size: 1.5rem; }
.price small { font-family: var(--sans); font-size: .78rem; color: var(--sub); font-weight: 400; margin-left: 4px; }
.product.first { border-color: rgba(243, 210, 138, .65); background: rgba(243, 210, 138, .07); }
.includes { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.includes li { padding-left: 1.5em; position: relative; }
.includes li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); }
.sticky .btn { max-width: 528px; margin: 0 auto; }
.reveal { animation: rise .7s ease both; }
.reveal.d1 { animation-delay: .15s; } .reveal.d2 { animation-delay: .3s; } .reveal.d3 { animation-delay: .45s; } .reveal.d4 { animation-delay: .6s; } .reveal.d5 { animation-delay: .75s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 友だちとの組み合わせ */
.via-note { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 14px; border-radius: 14px; font-size: .9rem;
  background: rgba(185, 167, 245, .14); border: 1px solid rgba(185, 167, 245, .45); }
.via-note .ico { color: var(--lav); }
.compat { border-color: rgba(243, 210, 138, .6); background: rgba(243, 210, 138, .07); text-align: center; }
.compat h2 { justify-content: center; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 4px 0 14px; }
.pair div { display: grid; gap: 2px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; }
.pair span { font-size: .72rem; color: var(--sub); letter-spacing: .1em; }
.pair b { font-family: var(--serif); font-size: .9rem; line-height: 1.45; }
.pair i { font-style: normal; color: var(--gold); font-size: 1.2rem; }
.pair-demo { max-width: 300px; margin: 2px auto 14px; }
.pair-demo div { justify-items: center; padding: 10px 6px 8px; }
.pair-demo .ico { color: var(--gold); width: 26px; height: 26px; }
.pair-demo span { font-size: .8rem; color: var(--ink); letter-spacing: .04em; }
.tile.accent { border-color: rgba(243, 210, 138, .6); background: rgba(243, 210, 138, .08); }
.compat-title { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 4px; letter-spacing: .04em; }
.compat-lead { margin: 0 0 14px; }
.compat-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; text-align: left; }
.compat-list li { background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 10px 12px; }
.compat-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.compat-head b { font-family: var(--serif); }
.compat-head span { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 9px; color: var(--dark); }
.compat-head .same { background: #fbe2a2; }
.compat-head .diff { background: #cfc3fb; }
.compat-head em { font-style: normal; font-size: .78rem; color: var(--sub); margin-left: auto; }
.compat-list p { margin: 4px 0 0; font-size: .9rem; }
.invite { border-color: rgba(185, 167, 245, .5); background: rgba(185, 167, 245, .1); }
.invite h2 .ico { color: var(--lav); }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-row .btn { margin-bottom: 0; }
.btn.line { border: 0; background: #06c755; color: #fff; }

/* 商品と共通ページ */
h1.page { font-family: var(--serif); letter-spacing: .04em; margin-top: 4px; }
.spec { margin: 10px 0; }
.spec div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.spec.wide div { flex-direction: column; gap: 2px; }
.spec dt { color: var(--sub); font-size: .84rem; }
.spec dd { margin: 0; font-weight: 600; }
.foot { max-width: 560px; margin: 0 auto; padding: 16px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--sub); }
.has-sticky .foot { padding-bottom: 96px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; }
.foot a { color: var(--sub); }
.foot .notice, .foot .op { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .stars.s2, .ring, .scan-line, .reveal, .js .step.active { animation: none; }
}
