:root {
  --paper: #f7f2ec;
  --paper-2: #fffdf9;
  --ink: #473c43;
  --muted: #7c6b73;
  --rose: #b87991;
  --rose-soft: #f2e3e8;
  --blue: #7188a7;
  --blue-soft: #e4ebf4;
  --line: #e7dce0;
  --shadow: 0 18px 50px rgba(79, 56, 67, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, rgba(216, 184, 196, .22), transparent 24rem),
    radial-gradient(circle at 92% 35%, rgba(183, 201, 220, .22), transparent 26rem),
    var(--paper);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  line-height: 1.9;
  letter-spacing: .035em;
  min-height: 100vh;
}

button, a { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 253, 249, .88);
  box-shadow: 0 0 48px rgba(80, 62, 69, .07);
  overflow: hidden;
}

.screen { display: none; min-height: 100vh; }
.screen.is-active { display: block; animation: fade-in .45s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }

.hero {
  position: relative;
  display: block;
  width: 100%;
  min-height: 520px;
  padding: 0;
  border: 0;
  text-align: left;
  overflow: hidden;
  background: #e9e1d7;
}
.hero img { width: 100%; height: 520px; object-fit: cover; object-position: 54% center; }
.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(38, 28, 34, .02) 18%, rgba(47, 34, 42, .72) 100%);
}
.hero__copy {
  position: absolute;
  left: clamp(24px, 6vw, 46px);
  right: clamp(24px, 6vw, 46px);
  bottom: 38px;
  color: #fff;
  text-shadow: 0 2px 16px rgba(36, 27, 33, .35);
}
.hero__copy strong { display: block; margin-bottom: 24px; font-size: clamp(40px, 8vw, 58px); font-weight: 500; letter-spacing: .08em; line-height: 1.2; }
.hero__button { width: min(100%, 420px); }
.primary-button {
  width: min(100%, 500px);
  min-height: 68px;
  padding: 16px 26px;
  border: 0;
  border-radius: 20px;
  color: white;
  background: #7a587d;
  box-shadow: 0 12px 28px rgba(86, 57, 90, .20);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
}
.primary-button span { margin-left: 10px; }
.screen--quiz { padding: 18px clamp(14px, 4vw, 28px) 82px; }
.quiz-head { margin-bottom: 17px; }
.quiz-head__labels { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; color: var(--muted); font-size: 13px; }
.quiz-head__labels b { font-size: 17px; font-weight: 500; color: var(--ink); }
.progress { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.progress span { height: 7px; border-radius: 999px; background: #ebe4e9; transition: background .25s, transform .25s; }
.progress span.is-done { background: #c793a7; }
.progress span.is-current { background: #7a587d; transform: scaleY(1.35); }

.question-card {
  padding: 23px clamp(18px, 5vw, 34px) 25px;
  border: 1px solid rgba(211, 193, 201, .72);
  border-radius: 28px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow);
}
.question-card.is-changing { animation: question-out .22s ease both; }
@keyframes question-out { to { opacity: 0; transform: translateX(-12px); } }
.question-kind { margin: 0 0 7px; color: var(--rose); font-size: 13px; }
.question-card h1 { display: flex; align-items: center; height: 3.25em; margin: 0 0 18px; font-size: clamp(22px, 5vw, 30px); font-weight: 500; line-height: 1.55; letter-spacing: .04em; }
.choices { display: grid; gap: 10px; }
.choice {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 11px 20px 11px 12px;
  border: 1px solid #dfd3d9;
  border-radius: 20px;
  background: #fffafc;
  text-align: left;
  font-size: clamp(16px, 3.8vw, 19px);
  line-height: 1.6;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.choice:nth-child(2) { background: #f5f8fc; border-color: #d5dce7; }
.choice:nth-child(3) { background: #fbf8f6; }
.choice:hover, .choice:focus-visible { transform: translateY(-2px); border-color: #aa7990; outline: none; }
.choice.is-selected { background: #ead3dc; border-color: #aa7990; transform: scale(.985); }
.choice__mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #765164; background: rgba(255,255,255,.78); font-size: 16px; }

.screen--thinking { display: none; place-items: center; padding: 30px; }
.screen--thinking.is-active { display: grid; }
.thinking-card { text-align: center; }
.thinking-card p { color: var(--muted); }
.thinking-title { margin: 28px 0 4px; color: var(--ink) !important; font-size: 21px; }
.map-loader-unused { position: relative; width: 230px; height: 86px; margin: auto; }
.map-loader-unused::before { content: ""; position: absolute; left: 16px; right: 16px; top: 42px; border-top: 2px dashed #c89aae; }
.map-loader-unused i { position: absolute; top: 33px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 5px solid #c89aae; animation: map-point 1.25s ease-in-out infinite; }
.map-loader-unused i:nth-child(1) { left: 5px; }
.map-loader-unused i:nth-child(2) { left: 72px; animation-delay: .15s; }
.map-loader-unused i:nth-child(3) { left: 139px; animation-delay: .3s; }
.map-loader-unused i:nth-child(4) { right: 5px; animation-delay: .45s; }
@keyframes map-point { 0%, 65%, 100% { transform: scale(.75); opacity: .55; } 32% { transform: scale(1.15); opacity: 1; } }

.screen--result { padding-bottom: 96px; }
.result__head { padding: 44px 8px 28px; text-align: center; }
.result__catch { margin: 0; font-size: clamp(22px, 5.35vw, 36px); font-weight: 500; line-height: 1.7; letter-spacing: .025em; }
.result__catch.is-compact { font-size: clamp(19px, 4.8vw, 33px); }
.result__catch.is-small { font-size: clamp(17.5px, 4.35vw, 30px); }
.result__catch span { display: block; white-space: nowrap; }
.result__identity { padding: 28px 24px 4px; text-align: center; }
.result__name { margin: 0; color: #6d526e; font-size: clamp(46px, 10vw, 68px); font-weight: 500; line-height: 1.2; letter-spacing: .08em; }
.result__location { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.result__image { width: calc(100% - 32px); margin: 0 16px; border-radius: 26px; aspect-ratio: 3/2; object-fit: cover; box-shadow: var(--shadow); }
.result__body { padding: 34px clamp(24px, 7vw, 52px) 0; }
.result-section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.result-section h2 { margin: 0 0 14px; color: #76516d; font-size: 19px; font-weight: 500; }
.result-section p { margin: 0; font-size: 16px; }
.concierge { display: block; border-bottom: 0; text-align: center; }
.concierge img { width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 20px; object-fit: cover; object-position: center 16%; box-shadow: 0 8px 22px rgba(79,56,67,.12); }
.concierge__speech { position: relative; width: 100%; padding: 20px 22px; border: 1px solid #eadce2; border-radius: 22px; background: #fffafa; text-align: left; }
.concierge__speech p { font-size: 15px; }
.map-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.map-button { display: grid; place-items: center; min-height: 62px; padding: 12px; border: 1px solid #cdbac5; border-radius: 18px; color: #6e5169; background: #fff; text-decoration: none; text-align: center; font-size: 14px; font-weight: 700; line-height: 1.5; }
.meeting { grid-column: 1 / -1; margin: 0 0 4px; color: var(--muted); text-align: center; font-size: 12px; }
.retry { display: block; width: min(100%, 390px); margin: 38px auto 0; }

.corner-links {
  position: fixed;
  z-index: 20;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  gap: 7px;
}
.corner-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid rgba(115,84,119,.16);
  border-radius: 14px;
  color: #655568;
  background: rgba(255,253,250,.94);
  box-shadow: 0 5px 16px rgba(64,54,68,.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
}

@media (max-width: 780px) {
  .app-shell { box-shadow: none; }
}
@media (max-width: 480px) {
  .hero, .hero img { min-height: 455px; height: 455px; }
  .question-card { padding: 20px 16px 22px; }
  .question-card h1 { height: 3.15em; margin-bottom: 15px; }
  .choice { min-height: 72px; padding-right: 14px; }
  .map-actions { grid-template-columns: 1fr; }
  .meeting { grid-column: auto; }
  .result__image { width: calc(100% - 20px); margin: 0 10px; border-radius: 20px; }
  .concierge img { width: 58px; height: 58px; border-radius: 17px; }
}

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

/* v4: 地図・体験型シリーズ共通の質問UI */
.concierge-line {
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: start;
  gap: 12px;
  min-height: 132px;
  margin-bottom: 18px;
}
.concierge-line__icon {
  width: 62px;
  height: 62px;
  border-radius: 19px;
  object-fit: cover;
  object-position: center 16%;
  box-shadow: 0 8px 22px rgba(79, 56, 67, .12);
}
.concierge-line__bubble {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 112px;
  padding: 14px 17px 15px;
  border: 1px solid #eadce2;
  border-radius: 18px;
  background: #fffafa;
}
.concierge-line__bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 24px;
  width: 14px;
  height: 14px;
  border-left: 1px solid #eadce2;
  border-bottom: 1px solid #eadce2;
  background: #fffafa;
  transform: rotate(45deg);
}
.question-card h1 {
  display: block;
  height: auto;
  min-height: 0;
  margin: 0;
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.55;
}
.pentagon-wrap { width: 100%; margin: 0 auto; }
.pentagon { display: block; width: min(100%, 330px); margin: auto; overflow: visible; }
.pentagon__ring { fill: none; stroke: #ddd2d8; stroke-width: 1.2; }
.pentagon__axis { stroke: #e6dce1; stroke-width: 1; }
.pentagon__shape {
  fill: rgba(184, 121, 145, .24);
  stroke: #9f6d82;
  stroke-width: 2.5;
  animation: pentagon-in .65s ease both;
  transform-origin: center;
}
.pentagon__label { fill: #695761; font-size: 13px; font-family: inherit; }
@keyframes pentagon-in { from { opacity: .15; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }

/* 世界観=明朝 / 操作=ゴシック */
.hero__copy strong,
.result__catch,
.result__name,
.result-section,
.result-section p,
.result-section h2 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
}
.question-card h1,
.choice,
.primary-button,
.quiz-head,
.quiz-head__labels,
.progress,
.corner-links,
.corner-links a,
.map-button,
.concierge__speech,
.result__location {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

@media (max-width: 480px) {
  .concierge-line { grid-template-columns: 56px 1fr; gap: 10px; min-height: 138px; }
  .concierge-line__icon { width: 56px; height: 56px; border-radius: 17px; }
  .concierge-line__bubble { min-height: 118px; padding: 12px 14px 13px; }
}


/* nanikau v1 */
:root { --accent:#7a587d; --accent-soft:#ead3dc; }
.screen--thinking { min-height: 520px; }
.shape-wrap { width:100%; margin:18px auto 0; }
.shape-svg { display:block; width:min(100%,360px); margin:auto; overflow:visible; }
.shape-ring { fill:none; stroke:#ddd2d8; stroke-width:1.2; }
.shape-axis { stroke:#e6dce1; stroke-width:1; }
.shape-area { fill:rgba(184,121,145,.24); stroke:#9f6d82; stroke-width:2.5; animation:shape-in .65s ease both; transform-origin:center; }
.shape-label { fill:#695761; font-size:12px; font-family:inherit; }
@keyframes shape-in { from {opacity:.15; transform:scale(.65)} to {opacity:1; transform:scale(1)} }
.result__head { padding-bottom: 16px; }
.result__body { padding-top: 0; }
.result-block { padding:28px 0; border-bottom:1px solid var(--line); }
.result-block h2 { margin:0 0 12px; color:#76516d; font-size:17px; font-weight:600; }
.result-block p { margin:0; font-size:16px; line-height:2; }
.result-scene { font-family:"Yu Mincho","Hiragino Mincho ProN","Noto Serif JP",serif; font-size:18px !important; }
.poem { margin:0; padding:0; font-family:"Yu Mincho","Hiragino Mincho ProN","Noto Serif JP",serif; font-size:18px; line-height:2.05; text-align:left; }
.poem p { margin:0 0 24px; font-size:18px; line-height:2.05; }
.poem p:last-child { margin-bottom:0; }
.product-flow { margin-top: 18px; }
.conversation-step { display:grid; grid-template-columns:62px 1fr; gap:12px; align-items:start; margin:18px 0; }
.conversation-step img { width:62px; height:62px; border-radius:19px; object-fit:cover; object-position:center 16%; box-shadow:0 8px 22px rgba(79,56,67,.12); }
.conversation-bubble { position:relative; padding:17px 18px; border:1px solid #eadce2; border-radius:20px; background:#fffafa; }
.conversation-bubble::before { content:""; position:absolute; left:-8px; top:22px; width:14px; height:14px; border-left:1px solid #eadce2; border-bottom:1px solid #eadce2; background:#fffafa; transform:rotate(45deg); }
.conversation-bubble p { margin:0; font-size:16px; line-height:1.8; }
.mini-choices { display:grid; gap:10px; margin:14px 0 0 74px; }
.mini-choice { min-height:56px; padding:12px 18px; border:1px solid #dfd3d9; border-radius:17px; background:#fffafc; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.mini-choice:hover,.mini-choice:focus-visible { border-color:#aa7990; outline:none; transform:translateY(-1px); }
.product-card { margin:22px 0 0 74px; padding:22px; border:1px solid #e4d7dd; border-radius:22px; background:#fff; box-shadow:0 10px 30px rgba(79,56,67,.08); }
.product-card__eyebrow { margin:0 0 7px; color:var(--muted); font-size:12px; }
.product-card h3 { margin:0 0 10px; color:#6d526e; font-size:24px; font-weight:600; line-height:1.5; }
.product-card p { margin:0; line-height:1.8; }
.store-actions { display:grid; gap:10px; margin-top:16px; }
.store-button { display:grid; place-items:center; min-height:58px; padding:12px 16px; border:1px solid #cdbac5; border-radius:17px; color:#6e5169; background:#fff; text-decoration:none; font-weight:700; }
.result-note { color:var(--muted); font-size:12px !important; line-height:1.7 !important; margin-top:12px !important; }
.end-box { margin:24px 0 0 74px; padding:20px; border-radius:20px; background:#f8f4f6; }
.retry.inline { margin:18px 0 0; width:100%; }
@media (max-width:480px) {
  .conversation-step { grid-template-columns:56px 1fr; gap:10px; }
  .conversation-step img { width:56px; height:56px; border-radius:17px; }
  .mini-choices,.product-card,.end-box { margin-left:66px; }
}

/* nanikau v3: dokosumuと結果体験を揃える */
.result__identity--scene {
  padding: 30px clamp(24px, 7vw, 52px) 20px;
  text-align: center;
}
.result__scene-label {
  margin: 0 0 12px;
  color: #76516d;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
}
.result__scene-title {
  margin: 0;
  color: #5f4d59;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-size: clamp(23px, 5.2vw, 34px);
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: .04em;
}
.result-block--poem { padding-top: 18px; }

/* nanikau v4: 結果の蛇足削除・会話テンポ調整 */
.result__scene-label { display:none !important; }
.result__scene-title {
  white-space: nowrap;
  font-size: clamp(16px, 4.9vw, 32px);
  line-height: 1.55;
  letter-spacing: .02em;
}
.product-card--stores { padding-top: 18px; padding-bottom: 18px; }
.product-card--stores .store-actions { margin-top: 0; }

/* nanikau v7: scene_core / scene_variant */
.result__scene-title {
  max-width: 94%;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 430px){
  .result__scene-title{ font-size: clamp(15px,4.35vw,19px); letter-spacing:0; }
}

/* nanikau v8: もうひと押しから一度だけ戻る */
.refine-back{
  display:block;
  width:100%;
  margin:14px 0 0;
  padding:12px 14px;
  border:1px solid rgba(44,62,64,.18);
  border-radius:14px;
  background:transparent;
  color:inherit;
  font:inherit;
  font-size:14px;
  cursor:pointer;
}
.refine-back:active{ transform:translateY(1px); }


/* nanikau v9: 店を見たあとだけ出る「もうひと押し♪」戻り導線 */
#refineReturnArea:empty{ display:none; }
#refineReturnArea{
  margin-top:18px;
}
.refine-return-action{
  margin:8px 0 0 74px;
}
.refine-return-action .refine-back{
  margin:0;
}
@media (max-width: 520px){
  .refine-return-action{ margin-left:0; }
}

.poem__last { font-weight: 600; }
