/* =========================================================
   AI副業タイプ診断 v2 — style.css
   スマホファースト / 白基調 × ネオンブルー #4eb8ff / キャラクター主役
   ========================================================= */
:root {
  --blue: #4eb8ff; --blue-deep: #2a93e0; --blue-soft: #eaf6ff; --blue-line: #d4ecff;
  --ink: #1f2d3d; --ink-soft: #5b6b80; --ink-mute: #8a99ad;
  --paper: #f7fbff; --card: #ffffff; --line: #e9eef4;
  --shadow: 0 18px 50px -24px rgba(42, 147, 224, 0.35);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
  background:
    radial-gradient(circle at 10% -4%, rgba(78,184,255,0.18), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(127,208,255,0.16), transparent 40%),
    var(--paper);
  color: var(--ink); line-height: 1.85; min-height: 100dvh;
  display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
.app { width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 18px 40px; flex: 1; display: flex; flex-direction: column; }

.screen { display: none; }
.screen.active { display: block; animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.brand { text-align: center; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; color: var(--blue-deep); font-size: 13px; letter-spacing: 0.14em; margin-bottom: 6px; }
.brand .dot { color: var(--blue); }

/* ===== スタート / オープニング ===== */
.hero {
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: var(--shadow); padding: 26px 24px 32px; text-align: center; margin-top: 3vh;
  position: relative; overflow: hidden;
}
.hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: linear-gradient(90deg, var(--blue), #7fd0ff); }

/* 8体チラ見せ */
.peek { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin: 6px 0 14px; }
.peek-ch { width: 56px; height: 56px; display: inline-block; animation: peekIn .5s cubic-bezier(.2,1.2,.4,1) both; animation-delay: var(--d); }
.peek-ch svg { width: 56px; height: 56px; display: block; }
.peek-ch:nth-child(odd) { transform: translateY(-3px); }
@keyframes peekIn { from { opacity: 0; transform: translateY(14px) scale(.6); } to { opacity: 1; transform: none; } }

.hero h1 { font-family: 'Zen Maru Gothic', sans-serif; font-size: 28px; font-weight: 900; line-height: 1.4; color: var(--ink); margin-bottom: 12px; }
.hero h1 .hl { color: var(--blue-deep); position: relative; }
.hero h1 .hl::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: 2px; height: 8px; background: rgba(78,184,255,0.22); border-radius: 4px; z-index: -1; }
.hero p.lead { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 18px; }
.meta-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.chip { font-size: 12.5px; font-weight: 700; color: var(--blue-deep); background: var(--blue-soft); border: 1px solid var(--blue-line); padding: 6px 13px; border-radius: 30px; font-family: 'Zen Maru Gothic', sans-serif; }

/* ニックネーム入力 */
.nick-field { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; }
.nick-field label { display: block; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 13px; color: var(--blue-deep); margin-bottom: 6px; }
.nick-field input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--blue-line); border-radius: 11px; font-size: 15px; font-family: inherit; background: #fff; color: var(--ink); }
.nick-field input:focus { outline: none; border-color: var(--blue); }
.nick-note { font-size: 11px; color: var(--ink-mute); margin-top: 7px; line-height: 1.6; }

/* ボタン */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep)); color: #fff; border: none;
  padding: 17px 24px; border-radius: 16px; font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900; font-size: 17px; cursor: pointer; box-shadow: 0 14px 30px -10px rgba(42,147,224,0.55);
  transition: transform .16s ease, box-shadow .16s ease; letter-spacing: 0.02em;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -10px rgba(42,147,224,0.6); }
.btn-primary:active { transform: translateY(0) scale(0.99); }
.disclaimer { margin-top: 16px; font-size: 11.5px; color: var(--ink-mute); line-height: 1.7; }
.foot { text-align: center; font-size: 11px; color: var(--ink-mute); padding: 22px 16px 8px; line-height: 1.8; }

/* ===== クイズ ===== */
.progress { height: 8px; background: var(--blue-soft); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #7fd0ff); border-radius: 99px; width: 0%; transition: width .45s cubic-bezier(.2,.8,.2,1); }
.q-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.q-count { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 13px; color: var(--ink-mute); letter-spacing: 0.08em; }
.q-axis { font-size: 12px; font-weight: 700; color: var(--blue-deep); background: var(--blue-soft); border: 1px solid var(--blue-line); padding: 4px 12px; border-radius: 30px; font-family: 'Zen Maru Gothic', sans-serif; }

/* ガイドキャラ */
.guide { display: flex; justify-content: center; margin: 2px 0 -6px; }
.guide svg { width: 84px; height: 84px; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }

.q-card { margin-top: 6px; }
.q-card.anim-in { animation: qin .34s cubic-bezier(.2,.8,.2,1) both; }
@keyframes qin { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.q-text { font-family: 'Zen Maru Gothic', sans-serif; font-size: 22px; font-weight: 900; line-height: 1.55; color: var(--ink); margin-bottom: 20px; min-height: 2.4em; text-align: center; }

.options { display: flex; flex-direction: column; gap: 12px; }
.opt { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 17px 18px; font-family: inherit; font-size: 16px; font-weight: 500; color: var(--ink); cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .12s ease, box-shadow .16s ease; line-height: 1.5; }
.opt::before { content: ""; display: inline-block; width: 18px; height: 18px; border: 2px solid var(--blue-line); border-radius: 50%; margin-right: 12px; vertical-align: -3px; transition: all .16s ease; }
.opt:hover { border-color: var(--blue); background: #fbfdff; transform: translateY(-1px); box-shadow: 0 8px 20px -14px rgba(42,147,224,0.5); }
.opt.selected { border-color: var(--blue); background: var(--blue-soft); }
.opt.selected::before { border-color: var(--blue); background: radial-gradient(circle at center, #fff 0 30%, var(--blue) 38%); box-shadow: 0 0 0 3px rgba(78,184,255,0.18); }
.q-nav { margin-top: 22px; }
.btn-back { background: transparent; border: none; color: var(--ink-mute); font-size: 14px; font-weight: 700; font-family: 'Zen Maru Gothic', sans-serif; cursor: pointer; padding: 8px 4px; }
.btn-back:hover { color: var(--blue-deep); }

/* ===== リビール（タメ） ===== */
#screen-reveal.active { display: flex; align-items: center; justify-content: center; min-height: 70dvh; }
.reveal-box { text-align: center; }
.reveal-ring { position: relative; width: 92px; height: 92px; margin: 0 auto 22px; }
.reveal-ring span { position: absolute; inset: 0; border: 4px solid transparent; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
.reveal-ring span:nth-child(2) { inset: 12px; border-top-color: #7fd0ff; animation-duration: 1.4s; }
.reveal-ring span:nth-child(3) { inset: 24px; border-top-color: var(--blue-deep); animation-duration: 0.8s; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal-text { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 19px; color: var(--blue-deep); line-height: 1.6; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ===== 結果（取扱説明書） ===== */
.result-head { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 18px 24px 26px; position: relative; overflow: hidden; }
.result-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: linear-gradient(90deg, var(--blue), #7fd0ff); }
.r-mascot { width: 168px; height: 168px; margin: 6px auto 2px; animation: drop .6s cubic-bezier(.2,1.25,.4,1) both; }
.r-mascot svg { width: 168px; height: 168px; }
@keyframes drop { from { opacity: 0; transform: translateY(-22px) scale(.7); } to { opacity: 1; transform: none; } }
.r-nick { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 15px; color: var(--blue-deep); letter-spacing: 0.08em; }
.r-nick::before { content: "“ "; } .r-nick::after { content: " ”"; }
.r-type { font-family: 'Zen Maru Gothic', sans-serif; font-size: 30px; font-weight: 900; color: var(--ink); margin: 2px 0 8px; }
.r-type .u { box-shadow: inset 0 -10px 0 rgba(78,184,255,0.28); }
.r-catch { font-size: 15px; color: var(--blue-deep); font-weight: 700; }
.r-habit { margin-top: 10px; font-size: 12.5px; color: var(--ink-mute); }

/* ハイブリッド */
.hybrid { margin-top: 16px; background: linear-gradient(135deg, #fff, var(--blue-soft)); border: 1px solid var(--blue-line); border-radius: 20px; padding: 18px 18px; text-align: center; }
.hy-label { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 12px; color: var(--ink-mute); letter-spacing: 0.1em; margin-bottom: 8px; }
.hy-combo { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; }
.hy-main { color: var(--blue-deep); font-size: 18px; }
.hy-x { color: var(--ink-mute); font-size: 15px; }
.hy-sub { color: var(--ink); font-size: 16px; }
.hy-line { font-size: 13.5px; color: var(--ink-soft); margin-top: 10px; line-height: 1.8; }

/* レーダー */
.radar-card { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px 12px 12px; text-align: center; }
.radar-t { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
#radar-canvas { width: 320px; height: 320px; max-width: 100%; }

/* 取説詳細 */
.detail { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.d-block { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px; }
.d-block .t { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 14px; color: var(--blue-deep); margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.d-block .t .ic { font-size: 16px; }
.d-block p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.85; }
.d-block.word { background: linear-gradient(135deg, var(--blue-soft), #fff); border-color: var(--blue-line); margin-top: 14px; }
.d-block.word p { color: var(--ink); font-weight: 500; }

/* 相性 */
.partner { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; }
.p-label { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 14px; color: var(--blue-deep); margin-bottom: 10px; }
.p-body { display: flex; align-items: center; gap: 14px; }
.p-mascot { width: 76px; height: 76px; flex-shrink: 0; }
.p-mascot svg { width: 76px; height: 76px; }
.p-name { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.p-why { font-size: 13.5px; color: var(--ink-soft); line-height: 1.8; }

/* 結果カード */
.card-area { margin-top: 18px; text-align: center; }
.card-area .ct { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; }
#card-preview { width: 100%; max-width: 380px; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.card-canvas-hidden { position: absolute; left: -99999px; top: 0; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn-primary { font-size: 15px; padding: 15px 16px; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; background: #fff; color: var(--blue-deep); border: 2px solid var(--blue); padding: 13px 16px; border-radius: 16px; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 15px; cursor: pointer; transition: background .16s ease, transform .14s ease; }
.btn-ghost:hover { background: var(--blue-soft); transform: translateY(-1px); }
.x-link { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--ink-mute); text-decoration: underline; text-underline-offset: 3px; }
.x-link:hover { color: var(--blue-deep); }

/* 図鑑ボタン */
.zukan-btn { width: 100%; margin-top: 18px; display: flex; align-items: center; gap: 14px; background: var(--card); border: 2px solid var(--blue-line); border-radius: 18px; padding: 16px 18px; cursor: pointer; text-align: left; transition: border-color .16s ease, transform .14s ease, box-shadow .16s ease; }
.zukan-btn:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow); }
.zukan-btn .zk-ic { font-size: 26px; }
.zukan-btn .zk-tx { flex: 1; display: flex; flex-direction: column; font-family: 'Zen Maru Gothic', sans-serif; }
.zukan-btn .zk-tx b { color: var(--ink); font-size: 15.5px; }
.zukan-btn .zk-tx small { color: var(--ink-mute); font-size: 12px; }
.zukan-btn .zk-ar { color: var(--blue); font-weight: 900; font-size: 18px; }

/* LINE CTA */
.line-cta { margin-top: 18px; background: linear-gradient(135deg, #0f2942, #1a3a5c); color: #fff; border-radius: 22px; padding: 26px 22px; text-align: center; }
.line-cta h3 { font-family: 'Zen Maru Gothic', sans-serif; font-size: 17px; font-weight: 900; line-height: 1.5; margin-bottom: 8px; }
.line-cta h3 .hl { color: #7fd0ff; }
.line-cta p { font-size: 13px; color: #cfe0f0; line-height: 1.8; margin-bottom: 18px; }
.line-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; background: #06c755; color: #fff; text-decoration: none; padding: 14px 26px; border-radius: 14px; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 15.5px; box-shadow: 0 12px 26px -10px rgba(6,199,85,0.55); transition: transform .16s ease; }
.line-btn:hover { transform: translateY(-2px); }
.line-btn .li { width: 24px; height: 24px; border-radius: 6px; background: #fff; color: #06c755; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; }
.line-cta .tiny { margin-top: 12px; font-size: 11px; color: #9db8d4; }

.retry-wrap { text-align: center; margin-top: 22px; }
.btn-retry { background: transparent; border: none; color: var(--ink-mute); font-size: 14px; font-weight: 700; font-family: 'Zen Maru Gothic', sans-serif; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-retry:hover { color: var(--blue-deep); }

/* ===== 図鑑モーダル ===== */
.zukan { position: fixed; inset: 0; background: rgba(15,41,66,0.55); backdrop-filter: blur(4px); z-index: 100; display: none; align-items: flex-end; justify-content: center; }
.zukan.show { display: flex; animation: fade .25s ease both; }
.zukan-panel { background: var(--paper); width: 100%; max-width: 600px; max-height: 92vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 22px 18px 36px; position: relative; }
.zukan-close { position: absolute; top: 14px; right: 16px; background: #fff; border: 1px solid var(--line); width: 36px; height: 36px; border-radius: 50%; font-size: 20px; color: var(--ink-soft); cursor: pointer; line-height: 1; }
.zukan-head { text-align: center; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 18px; color: var(--ink); margin-bottom: 18px; }
.zukan-head span { display: inline-block; font-size: 12px; color: var(--blue-deep); background: var(--blue-soft); padding: 2px 10px; border-radius: 20px; margin-left: 6px; vertical-align: 2px; }
.zukan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 480px) { .zukan-grid { grid-template-columns: repeat(4, 1fr); } }
.z-cell { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 8px 12px; cursor: pointer; text-align: center; transition: transform .14s ease, box-shadow .16s ease, border-color .16s ease; }
.z-cell:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: hsl(var(--hue) 72% 70%); }
.z-cell svg { width: 78px; height: 78px; }
.z-nick { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 13px; color: var(--ink); }
.z-type { font-size: 10.5px; color: var(--ink-mute); }

/* 図鑑 個別詳細 */
.zukan-detail { display: none; position: absolute; inset: 0; background: var(--paper); border-radius: 26px 26px 0 0; padding: 22px 22px 40px; overflow-y: auto; }
.zukan-detail.show { display: block; animation: fade .22s ease both; }
.zd-close { background: transparent; border: none; color: var(--blue-deep); font-weight: 700; font-size: 14px; font-family: 'Zen Maru Gothic', sans-serif; cursor: pointer; margin-bottom: 6px; }
.zd-mascot { width: 140px; height: 140px; margin: 0 auto; } .zd-mascot svg { width: 140px; height: 140px; }
.zd-nick { text-align: center; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; color: var(--blue-deep); font-size: 14px; }
.zd-nick::before { content: "“ "; } .zd-nick::after { content: " ”"; }
.zd-type { text-align: center; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 900; font-size: 24px; color: var(--ink); margin-bottom: 4px; }
.zd-habit { text-align: center; font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.zd-personality { text-align: center; font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.85; }
.zd-row { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.zd-row b { display: block; font-family: 'Zen Maru Gothic', sans-serif; font-size: 12px; color: var(--blue-deep); margin-bottom: 4px; }
.zd-row span { font-size: 13.5px; color: var(--ink-soft); line-height: 1.8; }

/* レスポンシブ */
@media (min-width: 600px) { .hero h1 { font-size: 31px; } .q-text { font-size: 24px; } }

/* reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .screen.active, .peek-ch, .guide svg, .reveal-ring span, .reveal-text, .r-mascot { animation: none !important; }
}
