* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  background: #FFF8F0;
  color: #3A3A3A;
  line-height: 1.7;
}

#app {
  max-width: 480px; margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 20px calc(60px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* ---------- ランディング ---------- */
.landing { text-align: center; padding-top: 12px; }
.hero-chars canvas { width: 100%; max-width: 330px; height: auto; }
.logo { font-size: 34px; font-weight: 800; letter-spacing: 2px; margin-top: 8px; }
.logo-accent { color: #FF8A3D; }
.main-copy { font-size: 18px; font-weight: 800; margin-top: 14px; color: #D14B77; }
.sub-copy { font-size: 13px; color: #6E5F50; margin: 10px 0 22px; }
.hint { font-size: 12px; color: #8A7A6A; margin-top: 22px; }
.notice { font-size: 13px; font-weight: 700; color: #C0392B; background: #FFF0F0; border-radius: 12px; padding: 10px 14px; margin: 4px 0 14px; }

/* ---------- ボタン ---------- */
.btn {
  display: block; width: 100%; border: none; cursor: pointer;
  border-radius: 999px; padding: 16px 20px; font-size: 17px; font-weight: 700;
  font-family: inherit; margin-top: 14px; transition: transform .08s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .6; cursor: default; }
.btn:focus-visible { outline: 3px solid #D14B77; outline-offset: 2px; }
.btn-sub { display: block; font-size: 12px; font-weight: 500; opacity: .9; margin-top: 2px; }
.btn-primary { background: linear-gradient(135deg, #FF8A3D, #E86A92); color: #fff; box-shadow: 0 6px 18px rgba(232,106,146,.35); }
.btn-secondary { background: #fff; color: #D14B77; border: 2px solid #E86A92; }
.btn-ghost { background: none; color: #8A7A6A; font-size: 14px; font-weight: 600; text-decoration: underline; }
.btn-deepcta { background: #FFF3E0; color: #B26A00; border: 2px dashed #FFB74D; font-size: 15px; }

/* ---------- クイズ ---------- */
.quiz { padding-top: 8px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.back-btn { background: none; border: none; font-family: inherit; font-size: 14px; font-weight: 700; color: #8A7A6A; cursor: pointer; padding: 10px 8px; min-height: 44px; }
.back-btn:active { color: #E86A92; }
.quiz-logo { font-size: 13px; font-weight: 800; color: #C9B8A8; cursor: pointer; }
.progress { height: 10px; background: #F0E4D8; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #FF8A3D, #E86A92); border-radius: 99px; transition: width .3s; }
.q-count { font-size: 13px; color: #8A7A6A; margin: 14px 0 6px; font-weight: 700; }
.q-text { font-size: 21px; font-weight: 800; margin-bottom: 26px; min-height: 3.4em; }
.btn-choice {
  background: #fff; color: #3A3A3A; text-align: left; border: 2px solid #F0E4D8;
  border-radius: 20px; font-size: 16px; padding: 18px 20px; line-height: 1.5;
  box-shadow: 0 3px 10px rgba(0,0,0,.05);
}
.btn-choice:active { border-color: #E86A92; background: #FFF0F4; }

/* ---------- ローディング演出 ---------- */
.loading { text-align: center; padding-top: 34vh; }
.loading-spin { width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 50%; border: 6px solid #F0E4D8; border-top-color: var(--accent, #E86A92); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 22px; font-weight: 800; }
.dots i { animation: blink 1.2s infinite; } .dots i:nth-child(2){ animation-delay:.2s } .dots i:nth-child(3){ animation-delay:.4s }
@keyframes blink { 0%,100%{opacity:.2} 50%{opacity:1} }
.loading-sub { font-size: 14px; color: #8A7A6A; margin-top: 8px; }

/* ---------- 結果 ---------- */
.result { text-align: center; }

.inflow { background: linear-gradient(135deg,#FFF0F4,#FFF8E8); border: 2px solid #FFD6E4; border-radius: 20px; padding: 16px; margin-bottom: 18px; }
.inflow-t { font-size: 14px; font-weight: 800; color: #3A3A3A; }
.inflow-s { font-size: 18px; font-weight: 800; color: #D14B77; margin: 2px 0 10px; }

.hero-card { background: #fff; border: 2px solid var(--accent); border-radius: 26px; padding: 18px 16px 20px; box-shadow: 0 6px 20px rgba(0,0,0,.07); }
.r-label { font-size: 14px; color: #6E5F50; font-weight: 700; }
.r-char canvas { width: 210px; height: 210px; }
.r-code { font-size: 22px; font-weight: 800; letter-spacing: 6px; color: var(--tc); }
.r-name { font-size: 32px; font-weight: 800; margin: 2px 0 6px; color: var(--tc); }
.r-catch { font-size: 15px; color: #4A3E32; font-weight: 700; }
.axis-legend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.chip { font-size: 12px; font-weight: 700; color: var(--tc); background: #fff; border: 1.5px solid var(--accent); border-radius: 99px; padding: 3px 10px; }

.copy-kit { background: #FFFDF8; border: 1.5px dashed #E8D8C4; border-radius: 18px; padding: 16px; margin-top: 16px; }
.copy-kit-h { font-size: 14px; font-weight: 800; color: #4A3E32; margin-bottom: 8px; }
.copy-box { background: #fff; border: 1px solid #EADFD0; border-radius: 12px; padding: 12px; font-size: 15px; font-weight: 700; word-break: break-all; }
.btn-copy { margin-top: 10px; padding: 12px; font-size: 15px; }
.copy-bio { font-size: 12px; color: #6E5F50; margin-top: 10px; }
.copy-bio b { color: var(--tc); }

.bars { margin: 18px 4px 6px; text-align: left; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; font-size: 12px; font-weight: 700; color: #8A7A6A; }
.bar-row .on { color: var(--tc); }
.bar-l, .bar-r { width: 96px; flex-shrink: 0; }
.bar-r { text-align: right; }
.bar { flex: 1; height: 11px; background: #F0E4D8; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; }

.r-sec { background: #fff; border-radius: 24px; padding: 22px 20px; margin-top: 18px; text-align: left; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
.r-sec h2 { font-size: 16px; font-weight: 800; color: var(--tc); margin-bottom: 12px; padding-left: 10px; border-left: 4px solid var(--accent); }
.r-sec h2 small { font-size: 12px; color: #8A7A6A; font-weight: 600; }
.r-desc { font-size: 14.5px; }
.r-aruaru { list-style: none; }
.r-aruaru li { font-size: 14.5px; font-weight: 700; padding: 10px 0 10px 34px; position: relative; border-bottom: 1px dashed #F0E4D8; }
.r-aruaru li:last-child { border-bottom: none; }
.r-aruaru li::before { content: "✅"; position: absolute; left: 2px; }

.compat-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed #F0E4D8; }
.compat-row:last-child { border-bottom: none; }
.compat-icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; background: #fff; border: 2px solid; object-fit: cover; }
.compat-body { flex: 1; min-width: 0; }
.compat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.compat-label { font-size: 13px; font-weight: 800; }
.compat-name { font-size: 15px; font-weight: 800; }
.compat-name small { color: #8A7A6A; font-weight: 600; }
.compat-note { font-size: 12.5px; color: #6E5F50; margin-top: 4px; }

/* ペア相性チェック */
.pair-sec { background: linear-gradient(135deg,#FFF6FA,#FFFDF6); }
.pair-hint { font-size: 12.5px; color: #6E5F50; margin-bottom: 12px; }
.pair-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.pair-pick { display: flex; align-items: center; gap: 7px; background: #fff; border: 1.5px solid #EEE2D4; border-radius: 12px; padding: 6px 9px 6px 6px; min-height: 46px; font-family: inherit; font-size: 12px; font-weight: 700; color: #4A3E32; cursor: pointer; text-align: left; }
.pair-pick .pp-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; object-fit: cover; }
.pair-pick .pp-name { line-height: 1.2; }
.pair-pick:active { transform: scale(.97); }
.pair-pick.sel { border-color: var(--pc); background: #fff; box-shadow: 0 0 0 2px var(--pc) inset; color: var(--pc); }
.pair-card { margin-top: 14px; background: #fff; border: 2px solid var(--accent); border-radius: 18px; padding: 16px; text-align: center; }
.pair-avatars { display: flex; justify-content: center; align-items: center; gap: 10px; }
.pair-av { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px; }
.pair-av img { width: 62px; height: 62px; border-radius: 50%; border: 2.5px solid; background: #fff; object-fit: cover; }
.pair-av span { font-size: 12px; font-weight: 800; line-height: 1.2; }
.pair-x { color: #B5A595; font-size: 20px; font-weight: 800; }
.pair-score { font-size: 20px; font-weight: 800; margin-top: 8px; }
.pair-score b { font-size: 30px; }
.pair-verdict { font-size: 15px; font-weight: 800; margin: 4px 0 10px; }
.pair-note { font-size: 13px; color: #4A3E32; }
.pair-caution { font-size: 12.5px; color: #A06A00; margin-top: 4px; }
.pair-card .btn { margin-top: 12px; }

.r-approach { background: linear-gradient(135deg, #FFF0F4, #FFF8E8); }
.r-nudge { font-size: 13px; font-weight: 800; color: #D14B77; margin-top: 12px; }
.r-ghost { background: #F4FBF6; }
.r-ghost h2 { color: #2E8B57; border-left-color: #7BD389; }

.r-cta { margin-top: 26px; }
.story-note { font-size: 14px; font-weight: 800; color: #D14B77; margin-top: 12px; }
.story-img { width: 70%; border-radius: 18px; margin: 14px 0 4px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.story-hint { font-size: 11.5px; color: #8A7A6A; margin-top: 8px; }
.footer-note { font-size: 12px; color: #8A7A6A; margin-top: 34px; }

.manual-copy { background: #fff; border: 1px solid #EADFD0; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.manual-copy p { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.manual-copy textarea { width: 100%; height: 70px; font-size: 13px; border: 1px solid #EADFD0; border-radius: 8px; padding: 8px; font-family: inherit; }

/* ---------- トースト ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #3A3A3A; color: #fff; font-size: 14px; font-weight: 700; padding: 12px 20px; border-radius: 99px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 999; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- アイコンDL ---------- */
.icon-dl { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 800; color: var(--tc); text-decoration: none; background: #fff; border: 1.5px solid var(--accent); border-radius: 99px; padding: 8px 18px; }
.icon-dl:active { transform: scale(.97); }

/* ---------- 公式LINE CTA ---------- */
.line-cta { background: linear-gradient(135deg, #E8FBEF, #F4FFF7); border: 2px solid #B7EFC9; }
.line-cta h2 { color: #14a44a; border-left-color: #2ad572; }
.line-cta p { font-size: 14px; }
.line-cta b { color: #14a44a; }
.btn-line { background: linear-gradient(135deg, #21c65a, #06B34E); color: #fff; margin-top: 14px; box-shadow: 0 6px 18px rgba(6,179,78,.32); }

/* ---------- ランディング豪華化 ---------- */
.lp-badge { display: inline-block; font-size: 12px; font-weight: 800; color: #D14B77; background: #FFF0F4; border: 1.5px solid #FFD1E0; border-radius: 99px; padding: 6px 16px; margin-bottom: 12px; }
.hero-hint { font-size: 12px; font-weight: 700; color: #B5A595; margin-top: -6px; margin-bottom: 6px; }
.type-marquee { overflow: hidden; margin: 14px -20px 4px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mq-track { display: inline-flex; gap: 8px; white-space: nowrap; animation: mq 26s linear infinite; will-change: transform; }
@keyframes mq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.mq-chip { flex-shrink: 0; font-size: 12px; font-weight: 800; background: #fff; border: 1.5px solid; border-radius: 99px; padding: 5px 12px; }
.lp-features { list-style: none; text-align: left; max-width: 340px; margin: 18px auto 6px; }
.lp-features li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: #4A3E32; padding: 9px 14px; background: #fff; border-radius: 14px; margin-bottom: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.lp-features li span { font-size: 20px; }
.lp-features b { color: #E86A92; }
@media (prefers-reduced-motion: reduce) { .mq-track { animation: none; } }
