/* ============================================================
   SENDAI TYPE 12 ― 仙台タイプ診断  スタイル
   ============================================================ */
:root {
  --bg: #FAF7F0;            /* イラストの背景色に合わせたクリーム */
  --paper: #FFFFFF;
  --ink: #2B2622;
  --ink-2: #6B625A;
  --ink-3: #7D7369;
  --line: #EAE3D6;
  --brand: #4E8B5C;         /* 杜の都グリーン */
  --brand-2: #E08A2E;       /* 牛タン/紅葉オレンジ */
  --c: var(--brand);        /* 各キャラ色で上書き */
  --soft: #E4F0E6;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(60, 40, 20, .08);
  --font-jp: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-en: "Nunito", var(--font-jp);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-jp); font-weight: 500; line-height: 1.7; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a.btn, .opt, .sb-btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#app { min-height: 100vh; min-height: 100dvh; }

/* ---------- 共通 ---------- */
.wordmark {
  font-family: var(--font-en); font-weight: 800; letter-spacing: .22em; color: var(--c);
  font-size: 15px;
}
.wordmark span { background: var(--c); color: #fff; padding: 1px 8px; border-radius: 999px; margin-left: 4px; letter-spacing: 0; }
.wordmark.small { font-size: 13px; }
.wordmark.tiny { font-size: 12px; }
.sec-title { font-size: 20px; font-weight: 900; margin: 0 0 14px; letter-spacing: .02em; }
.sec-title.big { font-size: 28px; }
.sub-title { font-size: 15px; font-weight: 700; color: var(--ink-2); margin: 0 0 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 900; font-size: 16px; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  min-height: 52px; text-align: center;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--c); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 35%, transparent); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-xl { padding: 18px 34px; font-size: 18px; min-height: 60px; }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-x { background: #111; color: #fff; }
.btn-ig { background: linear-gradient(45deg, #f9ce34, #ee2a7b 55%, #6228d7); color: #fff; }
.link-sub { display: inline-block; margin-top: 18px; color: var(--ink-2); font-weight: 700; border-bottom: 2px dotted var(--line); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px;
}
.foot { text-align: center; padding: 40px 20px 60px; color: var(--ink-2); font-size: 13px; }
.foot-tags { color: var(--c); font-weight: 800; font-family: var(--font-en); }

/* ---------- TOP ---------- */
.top { text-align: center; padding: 14px 14px 10px; max-width: 960px; margin: 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-img { border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); margin: 0 auto 20px; }
.hero-img img { width: 100%; height: auto; display: block; }
.hero-cluster {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px 2px;
  max-width: 720px; margin: 22px auto 10px; padding: 0 4px;
}
.hero-char { aspect-ratio: 1; display: flex; align-items: flex-end; justify-content: center; }
.hero-char img {
  width: 100%; height: 100%; object-fit: contain;
  animation: float 4.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.37s);
  filter: drop-shadow(0 8px 10px rgba(60, 40, 20, .12));
}
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
.hero-title { font-size: 34px; font-weight: 900; line-height: 1.3; margin: 14px 0 12px; letter-spacing: .02em; }
.hero-title em { font-style: normal; color: var(--brand); background: linear-gradient(transparent 62%, var(--soft) 62%); padding: 0 2px; }
.hero-sub { font-size: 17px; margin: 0 0 8px; color: var(--ink-2); }
.hero-sub strong { color: var(--ink); font-weight: 900; }
.hero-meta { font-size: 14px; color: var(--ink-3); margin: 0 0 22px; }
.hero-note { margin: 22px 0 0; font-size: 14px; color: var(--ink-2); }
.how { max-width: 560px; margin: 40px auto 0; padding: 0 20px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.steps li div { display: grid; gap: 2px; }
.steps li strong { font-weight: 900; }
.steps li span:last-child { font-size: 13px; color: var(--ink-2); }
.step-no { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-family: var(--font-en); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

@media (min-width: 640px) {
  .hero-cluster { grid-template-columns: repeat(6, 1fr); gap: 10px; }
  .hero-title { font-size: 44px; }
  .hero-title br { display: none; }
}

/* ---------- 診断 ---------- */
.quiz { max-width: 540px; margin: 0 auto; padding: 18px 18px 40px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.progress { flex: 1; height: 10px; background: #EFE9DE; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand), #8CBF6A); border-radius: 999px; transition: width .4s ease; }
.qno { font-family: var(--font-en); font-weight: 800; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.qno strong { color: var(--ink); font-size: 20px; margin: 0 2px; }
.q-card { background: var(--paper); border-radius: 28px; padding: 28px 22px 22px; box-shadow: var(--shadow); animation: slidein .35s ease; position: relative; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px) } to { opacity: 1; transform: none } }
.q-card.is-sendai { background: linear-gradient(180deg, #FFF9EE, #fff 40%); }
.q-tag { position: absolute; top: -12px; left: 22px; background: var(--brand-2); color: #fff; font-weight: 900; font-size: 12px; padding: 4px 12px; border-radius: 999px; letter-spacing: .05em; }
.q-text { font-size: 22px; font-weight: 900; line-height: 1.45; margin: 0 0 22px; }
.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: 18px; border: 2px solid var(--line); background: #FFFDF9;
  font-weight: 700; font-size: 16px; line-height: 1.4; transition: all .12s ease;
}
.opt:hover { border-color: var(--brand); background: #F6FAF3; }
.opt.is-selected { border-color: var(--brand); background: var(--brand); color: #fff; transform: scale(1.01); }
.opt-emoji { font-size: 26px; flex: 0 0 34px; text-align: center; }

/* ---------- 結果演出 ---------- */
.reveal { min-height: 100vh; min-height: 100dvh; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; background: radial-gradient(circle at 50% 45%, var(--soft), var(--bg) 70%); }
.reveal-lead { font-size: 30px; font-weight: 900; letter-spacing: .1em; animation: pulse 1.3s ease-in-out infinite; margin: 0 0 20px; }
@keyframes pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
.reveal-char { width: min(70vw, 340px); height: min(70vw, 340px); display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(.4) translateY(40px); }
.reveal-char img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 20px rgba(60, 40, 20, .18)); }
.reveal.show-char .reveal-lead { animation: none; opacity: 1; }
.reveal.show-char .reveal-char { animation: pop .7s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes pop { to { opacity: 1; transform: none } }
.reveal-name { font-size: 28px; font-weight: 900; margin: 18px 0 0; opacity: 0; transform: translateY(10px); transition: all .5s ease; color: var(--c); }
.reveal-name small { font-family: var(--font-en); font-size: 14px; letter-spacing: .2em; color: var(--ink-3); }
.reveal.show-name .reveal-name { opacity: 1; transform: none; }

/* ---------- 結果 ---------- */
.result { max-width: 560px; margin: 0 auto; padding-bottom: 20px; }
.shared-bar { background: var(--ink); color: #fff; font-size: 13px; padding: 10px 16px; text-align: center; border-radius: 0 0 16px 16px; margin: 0 12px; }
.shared-cta { color: #FFD68A; font-weight: 900; margin-left: 6px; }
.r-hero { text-align: center; padding: 26px 20px 30px; background: radial-gradient(ellipse at 50% 35%, var(--soft), transparent 70%); }
.r-char { width: min(72vw, 330px); height: min(72vw, 330px); margin: 10px auto 6px; display: flex; align-items: center; justify-content: center; }
.r-char img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(60, 40, 20, .16)); animation: float 4.2s ease-in-out infinite; }
.r-you { margin: 0; color: var(--ink-2); font-weight: 700; }
.r-name { margin: 2px 0 6px; font-size: 32px; font-weight: 900; color: var(--c); letter-spacing: .02em; }
.r-name small { display: block; font-family: var(--font-en); font-size: 12px; letter-spacing: .25em; color: var(--ink-3); margin-top: -2px; }
.r-type { display: inline-block; margin: 0 0 14px; background: var(--c); color: #fff; font-weight: 900; padding: 5px 16px; border-radius: 999px; font-size: 15px; }
.r-tag { font-size: 22px; font-weight: 900; margin: 0; line-height: 1.4; }

.r-sec { padding: 22px 20px; }
.stats { display: grid; gap: 6px; background: var(--paper); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.stat-v { color: var(--c); letter-spacing: .1em; font-size: 18px; }
.desc { margin-top: 20px; font-size: 16px; }
.desc p { margin: 0 0 12px; }
.desc-last { font-weight: 900; color: var(--c); font-size: 18px; margin-top: 16px !important; }
.axes { margin-top: 22px; background: var(--paper); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.axis { display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; gap: 8px; font-size: 11px; white-space: nowrap; color: var(--ink-3); font-weight: 700; margin: 8px 0; }
.axis-l { text-align: right; } .axis-r { text-align: left; }
.axis .on { color: var(--c); font-weight: 900; }
.axis-bar { position: relative; height: 8px; background: #EFE9DE; border-radius: 999px; }
.axis-dot { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); transform: translate(-50%, -50%); }

.work-card { background: var(--paper); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border-left: 6px solid var(--c); }
.work-title { display: block; font-size: 22px; font-weight: 900; color: var(--c); margin-bottom: 4px; }
.work-card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.mini { background: var(--soft); border-radius: var(--radius); padding: 14px 12px 12px; text-align: center; display: grid; gap: 4px; justify-items: center; transition: transform .12s ease; }
.mini:hover { transform: translateY(-2px); }
.mini img { width: 84px; height: 84px; object-fit: contain; }
.mini-label { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.mini strong { color: var(--c); font-weight: 900; font-size: 15px; }
.mini-reason { font-size: 12px; color: var(--ink-2); line-height: 1.5; }

.sendai { background: var(--paper); border-radius: 32px 32px 0 0; margin-top: 10px; padding-top: 30px; }
.sendai-kicker { color: var(--ink-2); font-weight: 700; margin: 0 0 6px; font-size: 14px; }
.sendai-title { font-size: 20px; font-weight: 900; color: var(--c); margin: 0 0 6px; }
.sendai-lead { margin: 0 0 18px; color: var(--ink-2); }
.spots { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.spot { border-radius: var(--radius); overflow: hidden; background: var(--bg); box-shadow: var(--shadow); }
.spot-img {
  position: relative; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, hsl(var(--hue) 45% 78%), hsl(calc(var(--hue) + 30) 50% 62%));
}
.spot-emoji { font-size: 56px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .15)); }
.spot-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.spot-body { padding: 14px 16px 16px; }
.spot-name { margin: 0 0 4px; font-size: 17px; font-weight: 900; }
.spot-body p { margin: 0; font-size: 14px; color: var(--ink-2); }
.spot-credit { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--ink-3); text-decoration: none; }
.spot-credit:hover { color: var(--ink-2); text-decoration: underline; }

.wework { background: var(--ink); color: #fff; text-align: center; padding: 40px 24px; }
.ww-kicker { margin: 0 0 6px; color: #D9CFC2; font-weight: 700; }
.ww-title { font-family: var(--font-en); font-weight: 800; font-size: clamp(28px, 8.5vw, 40px); letter-spacing: .12em; margin: 0 0 16px; white-space: nowrap; }
.ww-title span { color: var(--brand-2); }
.ww-body { margin: 0 0 10px; line-height: 1.9; }
.ww-note { margin: 0; color: #D9CFC2; font-size: 13px; }

.share { background: var(--paper); }
.card-preview { width: min(62vw, 250px); margin: 0 auto 18px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-preview canvas { width: 100%; height: auto; display: block; }
.share-btns { display: grid; gap: 10px; }
.share-tip { text-align: center; font-size: 13px; color: var(--ink-2); min-height: 1.6em; margin: 12px 0 0; }
.again { text-align: center; padding-top: 30px; }

/* ---------- 12タイプ一覧 ---------- */
.types { max-width: 720px; margin: 0 auto; padding: 18px 18px 60px; text-align: center; }
.types-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.types-head .wordmark { color: var(--brand); }
.types-head .wordmark span { background: var(--brand); }
.types-lead { color: var(--ink-2); margin: -6px 0 20px; }
.type-grid { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.type-card { background: var(--paper); border-radius: var(--radius); padding: 14px 10px 14px; display: grid; justify-items: center; gap: 2px; box-shadow: var(--shadow); position: relative; transition: transform .12s ease; border-bottom: 5px solid var(--c); }
.type-card:hover { transform: translateY(-3px); }
.type-no { position: absolute; top: 10px; left: 12px; font-family: var(--font-en); font-weight: 800; color: var(--c); font-size: 13px; }
.type-card img { width: 110px; height: 110px; object-fit: contain; }
.type-card strong { font-weight: 900; color: var(--c); margin-top: 4px; }
.type-card span:last-child { font-size: 12px; color: var(--ink-2); }
@media (min-width: 560px) { .type-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) { .type-grid { grid-template-columns: repeat(4, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* ---------- スマホ最適化・追加要素 ---------- */
.facts { max-width: 560px; margin: 36px auto 0; padding: 0 20px; }
.fact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.fact-list li { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-align: left; }
.fact-list li div { display: grid; gap: 2px; }
.fact-list strong { font-weight: 900; }
.fact-list li span:last-child { font-size: 13px; color: var(--ink-2); }
.fact-e { font-size: 26px; flex: 0 0 34px; text-align: center; line-height: 1.2; }

.q-hint { margin: -14px 0 16px; font-size: 13px; color: var(--ink-3); text-align: center; font-weight: 700; }
.opt { min-height: 60px; }
.opt:active { transform: scale(.985); }
@media (max-width: 380px) {
  .q-text { font-size: 20px; }
  .opt { font-size: 15px; padding: 12px 14px; }
  .r-name { font-size: 28px; }
  .r-tag { font-size: 19px; }
  .sec-title.big { font-size: 24px; }
}

.r-motif { margin: 14px auto 0; max-width: 420px; font-size: 12.5px; color: var(--ink-2); background: rgba(255,255,255,.7); border-radius: 14px; padding: 8px 12px; line-height: 1.6; text-align: left; }
.r-motif span { display: inline-block; background: var(--c); color: #fff; font-size: 10px; font-weight: 900; padding: 1px 8px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; }

.sendai-note { font-size: 13px; color: var(--ink-2); background: var(--bg); border-radius: 14px; padding: 10px 14px; margin: 0 0 18px; line-height: 1.6; }
.spot-lead { font-weight: 700; color: var(--ink) !important; }
.spot-about { margin: 8px 0 0 !important; padding: 8px 10px; background: var(--paper); border-left: 3px solid var(--c); border-radius: 0 10px 10px 0; font-size: 13px !important; line-height: 1.6; }

.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(250, 247, 240, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.sb-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px; background: var(--c); color: #fff; font-weight: 900; font-size: 15px; }
.sb-btn.sb-alt { flex: 0 0 auto; padding: 0 18px; background: var(--paper); color: var(--ink); border: 2px solid var(--line); }
.result { padding-bottom: 90px; }
@media (min-width: 760px) { .sticky-bar { display: none; } .result { padding-bottom: 20px; } }

.spot-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.map-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--paper); border: 2px solid var(--c); color: var(--c); font-weight: 900; font-size: 14px; }
.map-btn:active { transform: scale(.97); }
.spot-foot .spot-credit { margin-top: 0; }


/* ---------- 完成度向上 ---------- */
:focus-visible { outline: 3px solid #2F6BFF; outline-offset: 3px; border-radius: 8px; }
h1:focus, h2:focus { outline: none; }
.last-result { display: inline-flex; align-items: center; gap: 8px; margin: 14px auto 0; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); font-size: 13px; color: var(--ink-2); font-weight: 700; }
.last-result img { width: 30px; height: 30px; object-fit: contain; }
.last-result strong { color: var(--ink); font-weight: 900; }
.how-cta { display: flex; margin: 20px auto 0; max-width: 360px; }
.foot-note { font-size: 11px; color: var(--ink-3); margin-top: 14px; line-height: 1.6; }
.reveal-skip { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: none; border: 0; color: var(--ink-3); font-weight: 700; font-size: 14px; padding: 10px 16px; opacity: 0; animation: fadein .4s ease 1.5s forwards; }
@keyframes fadein { to { opacity: 1 } }
.btn-line { background: #06C755; color: #fff; }
.shared-bar.is-browse { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); border-top: 0; }
.shared-bar.is-browse .shared-cta { color: var(--c); }
.type-card.is-mine { box-shadow: 0 0 0 3px var(--c), var(--shadow); }
.type-mine { position: absolute; top: 8px; right: 10px; background: var(--c); color: #fff; font-size: 10px; font-weight: 900; padding: 2px 8px; border-radius: 999px; }
.card-preview { cursor: zoom-in; }
.card-preview::after { content: 'タップで拡大'; display: block; text-align: center; font-size: 11px; color: var(--ink-3); padding: 6px 0; background: var(--paper); }
.share-btns .btn { min-height: 54px; }
@media (min-width: 560px) { .share-btns { grid-template-columns: 1fr 1fr; } .share-btns .btn-ghost { grid-column: 1 / -1; } }
.opt-text { display: grid; gap: 1px; }
.opt-sub { font-size: 12px; font-weight: 500; color: var(--ink-2); line-height: 1.4; }
.opt.is-selected .opt-sub { color: rgba(255,255,255,.85); }
