/* =========================================================
   YAMA TYPE — 登山タイプ診断
   北欧×アウトドアのデザイントークン
   ========================================================= */
:root {
  --birch:   #F3F6F4;  /* 背景（淡いバーチグレー） */
  --paper:   #FFFFFF;  /* カード面 */
  --pine:    #1E3A31;  /* 深いパイン緑：主要テキスト・A側 */
  --fjord:   #46708F;  /* フィヨルド青：B側 */
  --sun:     #E0A33B;  /* 太陽オーカー：アクセント */
  --stone:   #7C8A83;  /* 補助テキスト */
  --line:    #DCE4DF;  /* 罫線 */

  --radius-card: 18px;
  --radius-btn: 999px;
  --shadow-card: 0 2px 10px rgba(30, 58, 49, .07);
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN",
          "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  overflow-x: clip;
  background: var(--birch);
  color: var(--pine);
  line-height: 1.7;
  min-height: 100dvh;
}

.app {
  min-height: 100dvh;
  position: relative;
}

/* ---------- 画面切り替え ---------- */
.screen {
  display: none;
  min-height: 100dvh;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  flex-direction: column;
}
/* スタート画面だけ、タブレット/PC幅で横に広げる（質問・結果画面は現行幅を維持） */
@media (min-width: 768px) {
  #screen-start { max-width: 1200px; }
}
.screen.is-active { display: flex; animation: screenIn .45s ease both; }

@keyframes screenIn {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .screen.is-active, .quiz-page { animation: none !important; }
  .q-card { opacity: 1; transform: none; animation: none !important; }
  .dot.selected { animation: none; }
  .climb-marker.hop { animation: none; }
  .summit-spark.show { animation: none; opacity: 0; }
}

/* ---------- ボタン ---------- */
.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-btn);
  padding: 15px 34px;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:disabled { opacity: .35; cursor: default; }
.btn-ghost {
  background: transparent;
  color: var(--stone);
  border: 1.5px solid var(--line);
}
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pine);
  color: #fff;
  text-decoration: none;
  justify-content: center;
}

/* =========================================================
   スタート画面
   ========================================================= */
.hero {
  margin: auto;
  max-width: 480px;
  width: 100%;
  text-align: center;
  padding: 24px 0;
}
.hero-mountains .sun  { fill: var(--sun); }
.hero-mountains .snow { fill: var(--pine); opacity: .9; }

/* タイトル下の英字。数字だけオーカーで大きくして情報として立たせる */
.hero-en,
.list-en {
  font-family: "Outfit", "Zen Maru Gothic", sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .24em;
  color: var(--fjord);
  line-height: 1.15;
  margin-top: -2px;   /* タイトルの副題として詰めて寄り添わせる */
  margin-bottom: 0;
}
.hero-en b,
.list-en b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--sun);
  margin-right: 2px;
}
.list-en { margin-top: 6px; margin-bottom: 8px; line-height: 1.4; }
.hero-title {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: .04em;
  margin-bottom: 0;
}
.hero-title .beta {
  display: inline-block;
  vertical-align: baseline;
  margin-left: 0;
  font-family: "Outfit", var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--sun);
  background: #FBF1DE;
  border: 1.5px solid #EBD5A8;
  border-radius: 999px;
  padding: 2px 10px;
}

.hero-lead {
  font-size: 14.5px;
  color: #45564e;
  margin-bottom: 30px;
  /* 行末に1〜2文字だけ残るのを防ぐ */
  text-wrap: balance;
}
.hero-lead strong { color: var(--pine); }
.hero-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--stone);
}

/* =========================================================
   質問画面
   ========================================================= */
.quiz-header {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -20px;
  padding: 6px 20px 8px;
  background: var(--birch);
  box-shadow: 0 6px 12px -8px rgba(30, 58, 49, .22);
}

/* ---------- 登山道プログレス ---------- */
.climb-svg {
  display: block;
  width: 100%;
  height: auto;
}
.climb-route,
.climb-done {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.climb-route { stroke: var(--line); }
.climb-done {
  stroke: var(--pine);
  stroke-dashoffset: 9999;
  transition: stroke-dashoffset .45s ease;
}

.climb-start {
  fill: var(--paper);
  stroke: #7FA08F;
  stroke-width: 2.2;
}
.climb-marker {
  fill: var(--pine);
  transition: cx .45s cubic-bezier(.34, 1.56, .64, 1), cy .45s cubic-bezier(.34, 1.56, .64, 1);
}
/* 1問答えるごとに、マーカーがぴょんと跳ねながら進む */
.climb-marker.hop { animation: markerHop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes markerHop {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-9px) scale(1.12); }
  100% { transform: translateY(0) scale(1); }
}

/* 遊び心：Midpointの手前は木、その先は岩をちらす（背景の飾り・進捗には無関係） */
.deco-tree path { fill: var(--pine); }
.deco-tree rect  { fill: #8B6A4A; }
.deco-tree, .deco-rock { opacity: .5; }
.deco-rock path { fill: var(--stone); }

/* 道標（Start / Midpoint / Summit） */
.sign .pole {
  stroke: var(--line);
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: stroke .4s ease;
}
.sign .board {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 1.4;
  transition: fill .4s ease, stroke .4s ease;
}
.sign .board-text {
  fill: var(--stone);
  font-family: "Outfit", var(--font);
  font-size: 6.6px;
  font-weight: 700;
  letter-spacing: .04em;
  text-anchor: middle;
  transition: fill .4s ease;
}
.sign .flag {
  fill: var(--line);
  transition: fill .4s ease;
}
.sign .flag-text {
  fill: var(--stone);
  font-family: "Outfit", var(--font);
  font-size: 6.2px;
  font-weight: 700;
  letter-spacing: .04em;
  text-anchor: middle;
  transition: fill .4s ease;
}
/* 道の上の丸。通過すると塗りつぶす */
.sign .node {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 2.2;
  transition: fill .4s ease, stroke .4s ease;
}

.sign.passed .pole { stroke: var(--pine); }
.sign.passed .board { fill: var(--pine); stroke: var(--pine); }
.sign.passed .board-text { fill: #fff; }
.sign.passed .flag { fill: var(--pine); }
.sign.passed .flag-text { fill: var(--pine); }
.sign.passed .node { fill: var(--pine); stroke: var(--pine); }

#sign-peak.passed .pole { stroke: var(--sun); }
#sign-peak.passed .flag { fill: var(--sun); }
#sign-peak.passed .flag-text { fill: var(--sun); }
#sign-peak.passed .node { fill: var(--sun); stroke: var(--sun); }

/* 最後の質問に答えた瞬間だけ、山頂にキラキラを出す */
.summit-spark { opacity: 0; pointer-events: none; }
.summit-spark.show { animation: summitPop .9s ease forwards; }
.summit-spark path { fill: var(--sun); }
@keyframes summitPop {
  0%   { opacity: 0; transform: scale(.4); }
  35%  { opacity: 1; transform: scale(1.15); }
  60%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.3); }
}

.climb-count {
  fill: var(--stone);
  font-family: var(--font);
  font-size: 8.6px;
  font-weight: 500;
  text-anchor: end;
}
.climb-count #progress-count { fill: var(--pine); font-weight: 700; font-size: 10.5px; }

.quiz-viewport { flex: 1; }
.quiz-page.page-in  { animation: screenIn .4s ease both; }

/* --- 質問カード --- */
.q-card {
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 22px 20px 24px;
  margin-bottom: 16px;
  border: 2px solid transparent;
  transition: border-color .25s ease;
  opacity: 0;
  transform: translateY(14px);
  animation: cardIn .45s cubic-bezier(.2, .7, .3, 1) forwards;
  animation-delay: var(--cd, 0s);
}
@keyframes cardIn {
  to { opacity: 1; transform: none; }
}
.q-card.is-answered { border-color: transparent; }
.q-card.needs-answer { border-color: var(--sun); }

.q-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--fjord);
  background: #EAF1F6;
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 10px;
}
.q-text {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.opt-label {
  font-size: 13.5px;
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: 12px;
}
.opt-a { background: #EDF3EF; color: var(--pine); margin-bottom: 7px; }
.opt-b { background: #EAF1F6; color: #2E4B60; }

/* --- 目盛り（A / B の対応を示す） --- */
.scale { margin-top: 17px; }

.scale-notes {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--stone);
}

/* --- 6段階ドット --- */
.dots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}
.dot {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  border: 2.5px solid var(--stone);
  background: var(--paper);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.dot:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* 端ほど大きく（強い同意） */
.dot[data-v="0"], .dot[data-v="5"] { width: 40px; height: 40px; }
.dot[data-v="1"], .dot[data-v="4"] { width: 32px; height: 32px; }
.dot[data-v="2"], .dot[data-v="3"] { width: 25px; height: 25px; }

/* A側=パイン緑、B側=フィヨルド青 */
.dot[data-v="0"], .dot[data-v="1"], .dot[data-v="2"] { border-color: #7FA08F; }
.dot[data-v="3"], .dot[data-v="4"], .dot[data-v="5"] { border-color: #8FAFC4; }

.dot.selected { animation: dotPop .38s cubic-bezier(.34, 1.56, .64, 1) forwards; }
@keyframes dotPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.32); }
  100% { transform: scale(1.14); }
}
.dot-ripple {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: .6;
  animation: rippleOut .5s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleOut {
  from { transform: scale(1);   opacity: .55; }
  to   { transform: scale(2.1); opacity: 0; }
}
.dot[data-v="0"].selected, .dot[data-v="1"].selected, .dot[data-v="2"].selected {
  background: var(--pine); border-color: var(--pine);
}
.dot[data-v="3"].selected, .dot[data-v="4"].selected, .dot[data-v="5"].selected {
  background: var(--fjord); border-color: var(--fjord);
}

.quiz-footer {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}
.quiz-footer .btn { flex: 1; padding-left: 0; padding-right: 0; }

/* =========================================================
   結果画面
   ========================================================= */
.result {
  margin: auto 0;
  text-align: center;
  padding: 0 0 28px;
}
.result-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--stone);
  margin-bottom: 10px;
}
.result-id {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.result-group {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
}

/* コードは記号なので小さく。主役は動物名 */
.result-code {
  display: inline-block;
  background: var(--pine); /* JSがグループ色に差し替えます */
  color: #fff;
  font-family: "Outfit", var(--font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1;
  padding: 6px 9px 6px 15px;
  border-radius: 7px;
}

.result-desc {
  font-size: 14.5px;
  color: #45564e;
  margin-bottom: 28px;
  padding: 0 8px;
}

/* --- 4軸バー --- */
.axes {
  background: var(--paper);
  margin-top: 14px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px 18px;
  margin-bottom: 28px;
  text-align: left;
}
.axis { margin-bottom: 18px; }
.axis:last-child { margin-bottom: 0; }
.axis-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 5px;
}
.axis-labels .lose { color: var(--stone); font-weight: 500; }
.axis-track {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  display: flex;
}
.axis-bar {
  height: 100%;
  border-radius: 999px;
  transition: width .8s ease;
}
.axis-bar.side-a { background: var(--pine); }
.axis-bar.side-b { background: var(--fjord); margin-left: auto; }
/* 勝った側はオーカーで大きく、負けた側は薄く */
.axis-labels .win { color: var(--pine); font-weight: 700; }
.axis-labels .lose { color: #B9C6BF; font-weight: 500; }
.axis-labels b {
  font-family: "Outfit", var(--font);
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 0 6px;
}
.axis-labels .win b { color: var(--sun); }
.axis-labels .lose b { color: #C9D2CC; }
.axis-labels span:last-child b { margin: 0 6px 0 0; }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- 小さい画面の微調整 ---------- */
@media (max-width: 360px) {
  .hero-title { font-size: 29px; }
  .result-animal { font-size: 31px; }
  .char-lg { width: 128px; }
}


/* ---------- 結果画面：キャッチコピー ---------- */
.result-copy {
  font-size: 15px;
  font-weight: 700;
  color: var(--fjord);
  margin: 14px 0 4px;
  padding: 0 8px;
  line-height: 1.7;
}

/* ---------- 結果画面：説明パネル ---------- */
.panel {
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 18px 18px 20px;
  margin-bottom: 14px;
  text-align: left;
}
.panel-title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
  padding-left: 11px;
  border-left: 4px solid var(--pine);
  line-height: 1.4;
}
.panel-body {
  font-size: 14px;
  line-height: 1.85;
  color: #3d4d46;
}


/* ---------- 結果画面：大きなシェアボタン ----------
   「気をつけたいこと」と4軸バーの間。背景色はJSで生息エリアのdeep色を入れる。
   パネルより狭い幅にして、ボタンらしさを出す */
.share-cta-wrap { margin: 18px 0; }
.share-cta {
  position: relative;
  display: flex;
  border: none;
  align-items: center;
  width: 76%;
  height: 64px;
  margin: 0 auto;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  border-radius: var(--radius-btn);
  color: #FFFFFF;
  box-shadow: 0 3px 12px rgba(30, 58, 49, .22);
  padding: 0 18px 0 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
.share-cta:active { transform: scale(.98); box-shadow: 0 2px 6px rgba(30, 58, 49, .25); }
/* キャラクター：72px固定・背景円なし・-9度。64pxのボタンから上下に少しはみ出す */
.share-cta .char {
  width: 72px;
  height: 72px;
  flex: none;
  transform: rotate(-9deg);
  margin: -10px 2px -6px 8px;
  filter: drop-shadow(0 2px 3px rgba(30, 58, 49, .18));
}
.share-cta-txt {
  flex: 1;
  text-align: center;
  line-height: 1.35;
  padding-right: 48px;  /* キャラクターの分だけ右に寄るのを戻す */
}
.share-cta-main {
  display: block;
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: .04em;
}
.share-cta-sub {
  display: block;
  font-size: 11px;
  font-weight: 700;
  opacity: .85;
  letter-spacing: .06em;
}


/* ---------- シェア用モーダル（ボトムシート） ----------
   .screenのtransform対策で、マークアップは.appの外に置いてある */
.smodal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.smodal-veil {
  position: absolute;
  inset: 0;
  background: rgba(20, 34, 29, .55);
  opacity: 0;
  transition: opacity .22s ease;
}
.smodal.open .smodal-veil { opacity: 1; }
.smodal-sheet {
  position: relative;
  width: 100%;
  max-width: 430px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 14px 18px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(20, 34, 29, .3);
  transform: translateY(100%);
  transition: transform .26s ease;
}
.smodal.open .smodal-sheet { transform: none; }
.smodal-grip {
  width: 40px;
  height: 4.5px;
  border-radius: 999px;
  background: var(--line);
  margin: 0 auto 10px;
}
.smodal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  background: #EDF2EF;
  color: var(--stone);
  font-size: 15px;
  line-height: 1;
  font-family: var(--font);
}
.smodal-title {
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 12px;
}
/* シェア用画像のプレビュー（縦長9:16） */
.smodal-pv {
  width: 176px;
  margin: 0 auto 12px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(30, 58, 49, .16);
}
.smodal-pv svg { display: block; width: 100%; height: auto; }
/* アクションボタン */
.smodal-acts { display: grid; gap: 8px; }
.sm-act {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  padding: 11px 16px;
  text-decoration: none;
  transition: transform .12s ease;
}
.sm-act:active { transform: scale(.98); }
.sm-act svg { width: 18px; height: 18px; flex: none; }
.sm-act span { flex: 1; text-align: center; margin-right: 28px; }
.sm-dl   { background: var(--pine); }
.sm-x    { background: #0F1419; }
.sm-line { background: #06C755; }
.sm-ig   { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); }
.sm-copy { background: var(--paper); color: var(--pine); border: 1.6px solid var(--line); }
.sm-note {
  font-size: 10.5px;
  color: var(--stone);
  text-align: center;
  line-height: 1.6;
  margin-top: 10px;
}

/* シークレットキャラの匂わせ（シルエット＋吹き出し） */
.smodal-tease {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tease-silhouettes { display: flex; flex: none; }
.tease-silhouettes .char {
  width: 38px; height: 38px;
  filter: brightness(0) saturate(100%);
  opacity: .82;
}
.tease-silhouettes .char + .char { margin-left: -8px; }
.tease-silhouettes .spark { width: 10px; height: 10px; color: var(--sun); margin: -4px 0 0 -4px; }

.tease-bubble {
  position: relative;
  font-size: 10.5px;
  color: var(--pine);
  line-height: 1.7;
  text-align: left;
  background: #EDF3EF;
  border-radius: 12px;
  padding: 7px 10px;
}
.tease-bubble .tease-line1 { white-space: nowrap; }
.tease-bubble .tease-line2 {
  display: block;
  margin-top: 2px;
  color: var(--stone);
  font-size: 10px;
}
.tease-bubble .tease-line2 a {
  color: var(--stone);
  font-weight: 700;
  text-decoration: none;
}
.tease-bubble .tease-line2 a:hover { text-decoration: underline; }
.tease-bubble::before {
  content: "";
  position: absolute;
  left: -6px; top: 12px;
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 7px solid #EDF3EF;
}

/* トースト */
/* =========================================================
   スクロール連動アニメーション（Intersection Observerで発火）
   ※ 既存の結果画面の登場演出が「.reveal」という名前をすでに使っていたため、
     名前がぶつからないよう、ここだけ「.sr-reveal」（scroll reveal）にしている
   ========================================================= */
.sr-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}
.sr-reveal.in-view { opacity: 1; transform: none; }

.sr-reveal-pop {
  opacity: 0;
  transform: scale(.9) translateY(10px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2, .7, .3, 1);
  transition-delay: var(--reveal-d, 0s);
}
.sr-reveal-pop.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .sr-reveal, .sr-reveal-pop { transition: none; }
}
/* =========================================================
   スクロール追従ヘッダー（トップページ・16タイプ詳細ページ用）
   ========================================================= */
.scroll-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: #FFFFFF;
  box-shadow: 0 2px 12px rgba(30, 58, 49, .16);
  transform: translateY(-100%);
  transition: transform .28s ease;
}
.scroll-header.show { transform: translateY(0); }
.scroll-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sh-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 900;
  color: var(--pine);
  text-decoration: none;
}
.sh-logo svg { width: 22px; height: 22px; flex: none; }
.sh-cta {
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--pine);
  border-radius: 999px;
  padding: 8px 16px;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .scroll-header { transition: none; }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(8px);
  background: var(--pine);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 18px;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%); }


/* ---------- 結果画面：相性 ---------- */
.match { padding: 13px 0; border-bottom: 1px solid var(--line); }
.match:last-child { padding-bottom: 0; border-bottom: none; }
.match:first-child { padding-top: 4px; }
.match-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--stone);
  margin-bottom: 5px;
}
.match-name {
  font-size: 15.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 3px;
}
.match-code {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  color: #fff;
  background: var(--fjord);
  border-radius: 6px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.match-why { font-size: 12.5px; color: var(--stone); line-height: 1.7; }

/* 結果画面はカード群が続くので、余白を上下に確保 */
.result-actions { margin-top: 26px; }

/* ---------- 公開前の一時設定 ----------
   Xシェアボタンを非表示にしています。
   内容が固まって公開する準備ができたら、下の1行を削除してください。 */


/* =========================================================
   キャラクター
   ========================================================= */
.char { display: block; width: 100%; height: auto; }
.char-lg { width: 142px; margin: 0 auto; }
.char-sm { width: 62px; flex-shrink: 0; }

.result-char { margin: 4px 0 10px; }
.result-animal {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.3;
  margin: 6px 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.animal-footprint { width: 20px; height: 20px; flex: none; color: var(--stone); opacity: .7; transform: translateY(-3px); }
.animal-footprint svg { width: 100%; height: 100%; }
.result-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--stone);
}

/* 相性欄はキャラクターを左に並べる */
.match { display: flex; gap: 13px; align-items: flex-start; }
.match-body { flex: 1; }

/* スタート画面・結果画面から一覧へ */
/* 主ボタンより小さい、枠線のサブボタン */
.hero-link {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 10px;
}
.result .hero-link { margin-top: 20px; }

/* 足跡の区切り線（歩行風：一方向・左右交互のわずかなずれ） */
.footprint-divider {
  margin: 20px auto;
  width: 100%;
  max-width: 100%;
  color: var(--stone);
  opacity: .6;
}
.footprint-divider svg { display: block; width: 100%; height: auto; }
/* hero末尾の足跡だけ、下側に.heroのpadding分の余白がすでにあるため、
   上下の見た目の余白が揃うよう個別に調整する */
#hero-footprint-divider { margin-top: 36px; margin-bottom: 4px; }

.hero-link a {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fjord);
  text-decoration: none;
  background: var(--paper);
  border: 1.5px solid #C3D5E0;
  border-radius: 999px;
  padding: 8px 16px;
  line-height: 1.4;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.hero-link a:hover { background: #EDF3F7; border-color: var(--fjord); }
.hero-link a:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.list-foot.hero-link { margin-top: 22px; }
.hero-link a:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* =========================================================
   スタート画面：16タイプが山に集合したビジュアル
   両斜面と山頂に16体を配置し、麓ほど大きく見えるようにしている
   ========================================================= */
.cluster-wrap { margin: 0 -4px 2px; }
.cluster-wrap svg { display: block; width: 100%; height: auto; }

/* キャラクター1体ぶんの浮遊アニメーション。
   位置（translate）は親のgに固定でつけてあるので、ここでは動きだけを扱う。
   ※ CSSのtransformはSVGのtransform属性を丸ごと上書きしてしまうため、
     位置指定用のgとアニメーション用のgは必ず分けること */
.cl-char {
  transform-origin: center bottom;
  opacity: 0;
  animation:
    clusterIn .5s cubic-bezier(.2, .7, .3, 1) forwards,
    clusterFloat var(--fd, 4.4s) ease-in-out infinite;
  animation-delay: var(--d, 0s), calc(var(--d, 0s) + .5s);
}
@keyframes clusterIn {
  from { opacity: 0; transform: translateY(10px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
@keyframes clusterFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* トップの一言。ボタン風にせず、控えめな見出しとして */
.hook {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .02em;
  color: #C98A1F;
  margin: 4px 0 0;
}

/* 「16 TYPES OF HIKERS」とバージョンを同じ行に並べる */
.hero-en-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -2px 0 16px;
}
.hero-en-row .hero-en { margin: 0; }

/* バージョン表示：番号・日付は出さず、山の名前だけをシンプルに。赤みの色で目立たせる。
   「診断をはじめる」ボタン（丸ピル）と形がかぶらないよう角丸の四角にしている */
.ver-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  background: #C1503E;
  border: 1.5px solid #C1503E;
  border-radius: 7px;
  padding: 3px 11px;
}

/* 動きが苦手な人には出さない */
@media (prefers-reduced-motion: reduce) {
  .cl-char { opacity: 1; animation: none; }
  .result.reveal .result-char { animation: none; }
}

/* =========================================================
   16タイプ紹介ページ（types.html）
   ========================================================= */
.list-page { max-width: 720px; margin: 0 auto; padding: 0 16px 60px; }

.list-head { padding: 34px 0 20px; text-align: center; }
.list-head h1 { font-size: 27px; font-weight: 900; letter-spacing: .03em; }
.list-head p { font-size: 14px; color: #45564e; margin-top: 8px; }

.legend {
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 18px 18px 16px;
  margin-bottom: 20px;
  text-align: left;
}
.legend h2 {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 10px;
  padding-left: 11px;
  border-left: 4px solid var(--pine);
}
.legend p { font-size: 13.5px; line-height: 1.85; color: #3d4d46; }
.legend p + p { margin-top: 8px; }
.legend b { color: var(--pine); }

/* ---- 入口：4グループのカード ---- */
.group-cards { display: grid; gap: 12px; margin-bottom: 8px; }
.gcard {
  position: relative;
  display: block;
  border-radius: 20px;
  padding: 16px 16px 14px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.gcard:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.gcard-bg {
  position: absolute;
  right: 10px;
  top: -6px;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: .04em;
  opacity: .13;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}
.gcard-head {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.gcard-name { font-size: 21px; font-weight: 900; letter-spacing: .04em; }
.gcard-lead { font-size: 13px; font-weight: 700; color: #3d4d46; }
.gcard-chars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 10px 0 8px;
}
.gcard-chars svg { width: 100%; height: auto; display: block; }
.gcard-foot {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  color: var(--stone);
}
.gcard-code { font-family: "Outfit", var(--font); font-weight: 700; letter-spacing: .08em; }

/* ---- 詳細：切り替えタブ ---- */
.group-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--birch);
  padding: 8px 0;
  transition: top .28s ease;
}
/* スクロール追従ヘッダーが出ている間だけ、タブをヘッダーの高さ分下げる（重なり防止） */
body.header-visible .group-tabs { top: var(--header-h, 57px); }
@media (prefers-reduced-motion: reduce) {
  .group-tabs { transition: none; }
}
.gtab {
  font-family: inherit;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--stone);
  border-radius: 14px;
  padding: 7px 2px 6px;
  cursor: pointer;
  display: block;
}
.gtab.on { border-color: transparent; font-weight: 900; }
.gtab:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.gtab-char { width: 100%; max-width: 42px; margin: 0 auto 1px; display: block; }
.gtab-name { font-size: 11.5px; font-weight: 700; display: block; }

/* ---- 詳細：グループの大見出し ---- */
.group-hero {
  position: relative;
  border-radius: 20px;
  padding: 20px 18px 18px;
  margin-bottom: 18px;
  overflow: hidden;
}
.gh-bg {
  position: absolute;
  right: 8px;
  top: -10px;
  font-size: 82px;
  font-weight: 900;
  letter-spacing: .04em;
  opacity: .14;
  line-height: 1;
  white-space: nowrap;
}
.gh-name { position: relative; font-size: 26px; font-weight: 900; letter-spacing: .05em; }
.gh-lead { position: relative; font-size: 14px; font-weight: 700; color: #3d4d46; margin-top: 3px; }
.gh-axis { position: relative; font-size: 11.5px; color: var(--stone); margin-top: 7px; }

/* ---- 各タイプ ---- */
.type-item {
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px 18px 18px;
  margin-bottom: 18px;
  /* 追従するタブの下に隠れないよう、タブの高さぶん余白を取る
     --tab-h は types.html が実測して設定します */
  scroll-margin-top: calc(var(--tab-h, 90px) + 14px);
}
.ti-head { display: flex; gap: 15px; align-items: center; margin-bottom: 15px; }
.ti-char { width: 104px; flex-shrink: 0; }
.ti-title { flex: 1; min-width: 0; }
.tc-code {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  color: #fff;
  background: var(--pine);
  border-radius: 5px;
  padding: 2px 9px;
}
.ti-name {
  font-size: 21px; font-weight: 900; margin-top: 6px; line-height: 1.35;
  display: flex; align-items: center; gap: 6px;
}
.ti-name .animal-footprint { width: 16px; height: 16px; flex: none; color: var(--stone); opacity: .6; transform: translateY(-2px); }
.ti-name .animal-footprint svg { width: 100%; height: 100%; }
.tc-type { font-size: 12.5px; font-weight: 700; color: var(--stone); margin-top: 3px; }
.tc-copy { font-size: 13.5px; font-weight: 700; color: var(--fjord); margin-top: 6px; line-height: 1.6; }

/* 4軸の内訳 */
  /* コードの行との間隔を広げる */
.ti-axes {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.ti-axes .ax {
  font-size: 11.5px;
  font-weight: 500;
  color: #3d4d46;
  background: #EDF3EF;
  border-radius: 999px;
  padding: 3px 11px;
}
.ti-axes .ax b { font-weight: 900; color: var(--pine); margin-right: 4px; }

.ti-block { margin-bottom: 16px; }
.ti-block:last-of-type { margin-bottom: 12px; }
.ti-label {
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
  padding-left: 10px;
  border-left: 4px solid var(--pine);
  line-height: 1.4;
}

.ti-text { font-size: 13.5px; line-height: 1.85; color: #3d4d46; }

/* 持ちもの（キャッチコピーの下） */
.ti-item {
  display: inline-block;
  font-size: 11.5px;
  color: var(--stone);
  background: #F2F5F3;
  border-radius: 999px;
  padding: 3px 12px;
  margin-top: 8px;
  line-height: 1.6;
}
.ti-item b {
  font-weight: 700;
  color: #3d4d46;
  margin-right: 6px;
}

/* 結果画面の持ちもの */
.result-item {
  display: inline-block;
  font-size: 12px;
  color: #4a5a52;
  background: rgba(255, 255, 255, .72);
  border-radius: 999px;
  padding: 4px 14px;
  margin-top: 10px;
  line-height: 1.6;
}
.result-item b {
  font-weight: 700;
  color: var(--pine);
  margin-right: 7px;
}

/* 紹介ページ内の相性リンク */
.type-item .match {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 9px 10px;
  border-radius: 13px;
  background: #F7F9F8;
  margin-top: 8px;
}
.type-item .match:hover { background: #EDF3EF; }
.type-item .match:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.type-item .match-label,
.type-item .match-name,
.type-item .match-why { display: block; }
.type-item .match-name { margin: 3px 0 1px; font-size: 15px; }
.match-type { font-size: 11.5px; font-weight: 700; color: var(--stone); }
.type-item .match-type { display: block; margin-bottom: 2px; }
.type-item .match-code { margin-right: 8px; }

.list-foot { text-align: center; margin-top: 32px; }

/* 結果画面の相性から紹介ページへ */
.match-char { display: block; flex-shrink: 0; border-radius: 50%; }
.match-char:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.match-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1.5px solid #C3D5E0;
}
.match-link:hover { border-bottom-color: var(--fjord); }
.match-link:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* =========================================================
   仕組みのページ：4軸の解説（左右対比）
   ========================================================= */
.axis-table { margin-top: 14px; }
.ax-item { padding: 15px 0; border-top: 1px solid #EAEEEB; }
.ax-item:first-child { border-top: none; padding-top: 4px; }

.ax-row { display: flex; align-items: center; gap: 10px; }
.ax-end { flex-shrink: 0; width: 84px; text-align: center; }
.ax-ltr {
  display: block;
  font-family: "Outfit", var(--font);
  font-size: 34px;
  font-weight: 700;
  line-height: .95;
}
.ax-end.l .ax-ltr { color: var(--pine); }
.ax-end.r .ax-ltr { color: var(--fjord); }
.ax-word {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.35;
  color: var(--stone);
}
.ax-en {
  display: block;
  font-family: "Outfit", var(--font);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: #A9B5AE;
  margin-top: 2px;
}
.ax-mid { flex: 1; min-width: 0; text-align: center; }
.ax-title {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  color: #3d4d46;
  margin-bottom: 6px;
}
.ax-arrow { display: block; width: 100%; height: 12px; }
.ax-memo {
  font-size: 11.5px;
  color: var(--stone);
  margin-top: 10px;
  line-height: 1.65;
  text-align: center;
}

/* =========================================================
   仕組みのページ：4系統のマトリクス
   ========================================================= */
.matrix { margin: 8px 0 4px; }
.mx-axis {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--stone);
  text-align: center;
  line-height: 1.4;
}
/* 軸のアルファベット */
.mx-axis b {
  font-family: "Outfit", var(--font);
  font-size: 17px;
  font-weight: 700;
  color: var(--pine);
  margin-right: 4px;
  vertical-align: -1px;
}
.mx-left b, .mx-bottom b { color: var(--fjord); }

.mx-top { margin-bottom: 6px; }
.mx-bottom { margin-top: 6px; }
.mx-mid { display: flex; align-items: stretch; gap: 5px; }
.mx-left, .mx-right {
  flex-shrink: 0;
  align-self: center;
  width: 17px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: .04em;
  line-height: 1.1;
}
.mx-left b, .mx-right b {
  writing-mode: horizontal-tb;
  display: block;
  margin: 0 0 3px;
  text-align: center;
}

.mx-grid {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
/* 中央を通る十字の軸線 */
.mx-cross {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  pointer-events: none;
  z-index: 1;
  preserveAspectRatio: none;
}

.mx-cell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  padding: 10px 9px 10px;
  color: inherit;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}
/* キャラクター1体ずつが個別のリンク */
.mx-char {
  display: block;
  border-radius: 10px;
  padding: 1px;
  transition: background .15s;
}
.mx-char:hover { background: rgba(255, 255, 255, .55); }
.mx-char:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
.mx-char svg { display: block; width: 100%; height: auto; }
/* 背景に薄く大きく系統名 */
/* 系統名は薄い大文字のみ。左の2つは左上、右の2つは右上に置く */
.mx-bg {
  position: absolute;
  top: 6px;
  z-index: 0;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.05;
  opacity: .2;
  white-space: nowrap;
  pointer-events: none;
}
.mx-l .mx-bg { left: 10px; }
.mx-r .mx-bg { right: 10px; }
/* 下段は文字を下に置く */
.mx-bottom .mx-bg { top: auto; bottom: 6px; }
.mx-bottom .mx-lead { order: 2; margin-top: 6px; margin-bottom: 34px; }
.mx-bottom .mx-chars { order: 1; margin-top: 2px; }
.mx-r { text-align: right; }
.mx-r .mx-code { text-align: left; }
.mx-name {
  position: relative;
  display: block;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .04em;
}
.mx-lead {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: #3d4d46;
  margin-top: 34px;
  line-height: 1.5;
  text-wrap: balance;
}
.mx-chars {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  margin: 8px 14px 6px;
}
.mx-chars svg { width: 100%; height: auto; display: block; }
/* 整列しすぎて生き物っぽさが薄れないよう、1体ずつ小さめ・少し傾けて配置する */
.mx-char { width: 84%; margin: 0 auto; }
.mx-char:nth-child(1) { --mx-tilt: rotate(-7deg); --mx-d: 0s;    justify-self: end;   margin-right: 6%; }
.mx-char:nth-child(2) { --mx-tilt: rotate(6deg);  --mx-d: .5s;   justify-self: start; margin-left: 6%; }
.mx-char:nth-child(3) { --mx-tilt: rotate(5deg);  --mx-d: .9s;   justify-self: end;   margin-right: 4%; }
.mx-char:nth-child(4) { --mx-tilt: rotate(-6deg); --mx-d: 1.4s;  justify-self: start; margin-left: 8%; }
.mx-code {
  position: relative;
  display: block;
  text-align: right;
  font-family: "Outfit", var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--stone);
}

/* =========================================================
   結果画面：ヒーロー帯と波の区切り
   ========================================================= */
.result-hero {
  position: relative;
  /* 画面の端まで、上は最上部まで広げる */
  margin: calc(-1 * max(20px, env(safe-area-inset-top))) -20px 0;
  padding: calc(30px + max(20px, env(safe-area-inset-top))) 20px 74px;
  overflow: hidden;
  background: #E9EEF1;        /* JSがグループの淡色に差し替えます */
}
/* 帯の下端を稜線で切る。奥は濃い山影、手前はページ背景でくり抜く */
.result-hero .ridge-cut {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 58px;
  display: block;
}
.rc-back { fill: rgba(30, 58, 49, .13); }
.rc-front { fill: var(--birch); }
.result-hero .result-copy { margin-bottom: 0; }

/* 4軸のタグ */
.result-axtags {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: center;
  gap: 6px;
}
@media (min-width: 460px) {
  .result-axtags { grid-template-columns: repeat(4, auto); }
}
.axtag {
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
  padding: 4px 12px 4px 9px;
  background: rgba(255, 255, 255, .72);
  line-height: 1.5;
}
.axtag b {
  font-family: "Outfit", var(--font);
  font-weight: 700;
  font-size: 12.5px;
  margin-right: 5px;
}
.axtag.s-a { color: #2b463c; }
.axtag.s-a b { color: var(--pine); }
.axtag.s-b { color: #2E4B60; }
.axtag.s-b b { color: var(--fjord); }

/* パネルの見出しを中央揃えに */
.panel { text-align: center; }
.panel-title {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  margin: 0 0 12px;
  padding: 0 0 6px;
  border-left: none;
  border-bottom: 2.5px solid var(--pine);
  line-height: 1.4;
}

.panel-body { text-align: left; }
.axes { text-align: left; }
.axes-title-wrap { text-align: center; }

/* =========================================================
   結果画面：順番に現れる演出
   ========================================================= */
.result > *,
.result-hero > *:not(.wave) { opacity: 0; }

.result.reveal > *,
.result.reveal .result-hero > *:not(.wave) {
  animation: resIn .5s cubic-bezier(.2, .7, .3, 1) forwards;
  animation-delay: calc(var(--i, 0) * .12s);
}
.result.reveal .result-char {
  /* 跳ねて現れたあと、ゆっくり上下に揺れ続ける */
  animation:
    resPop .55s cubic-bezier(.2, 1.3, .4, 1) forwards,
    resFloat 4.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * .12s), calc(var(--i, 0) * .12s + .55s);
}

@keyframes resFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.result.reveal .result-hero { opacity: 1; animation: none; }

@keyframes resIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes resPop {
  from { opacity: 0; transform: scale(.82); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .result > *,
  .result-hero > *:not(.wave) { opacity: 1; }
  .result.reveal > *,
  .result.reveal .result-hero > *:not(.wave),
  .result.reveal .result-char { animation: none; }
}

/* hidden 属性は常に非表示を優先する */
[hidden] { display: none !important; }

/* =========================================================
   シークレットキャラクター
   ========================================================= */
.secret-badge {
  display: inline-block;
  font-family: "Outfit", var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2em;
  color: #4A3410;
  background: linear-gradient(100deg, #F7DC8C, #E0A33B 55%, #C98F22);
  border-radius: 999px;
  padding: 6px 20px;
  margin-bottom: 7px;
  box-shadow: 0 2px 8px rgba(176, 130, 30, .4);
}
.secret-lead {
  font-size: 11.5px;
  font-weight: 700;
  color: #8a6a20;
  margin-bottom: 10px;
}
.secret-spark i {
  position: absolute;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, #F0C860, rgba(240, 200, 96, 0));
  border-radius: 50%;
}
.result.is-secret .result-hero { box-shadow: inset 0 0 60px rgba(224, 163, 59, .22); }
.result-hero { position: relative; }

.secret-note {
  font-size: 12px;
  color: #4a5a52;
  margin-top: 12px;
  padding: 0 10px;
  line-height: 1.75;
}

/* シークレットは動物名が長いので一段小さく */
.result.is-secret .result-animal { font-size: 27px; letter-spacing: .02em; }
@media (max-width: 380px) {
  .result.is-secret .result-animal { font-size: 24px; }
}

/* シークレットのときだけキャラクターをゆっくり光らせる */
.result.is-secret .result-char {
  filter: drop-shadow(0 0 18px rgba(224, 163, 59, .45));
}
@media (prefers-reduced-motion: no-preference) {
  .result.is-secret.reveal .result-char { animation-duration: .9s; }
}

/* =========================================================
   紹介ページ：相性3人を1行3列に
   ========================================================= */
.match-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.type-item .match-row .match {
  display: block;
  text-align: center;
  border-radius: 14px;
  padding: 11px 8px 12px;
  text-decoration: none;
  color: inherit;
}
.type-item .match-row .char-sm { width: 58px; margin: 4px auto 5px; display: block; }
.type-item .match-row .match-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--stone);
  line-height: 1.4;
  min-height: 2.8em;
}
.type-item .match-row .match-code {
  display: inline-block;
  font-family: "Outfit", var(--font);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #fff;
  border-radius: 4px;
  padding: 2px 7px;
}
.type-item .match-row .match-name {
  display: block;
  font-size: 12.5px;
  font-weight: 900;
  margin-top: 3px;
  line-height: 1.4;
}
.type-item .match-row .match-type {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--stone);
  margin-top: 1px;
  line-height: 1.4;
}
.type-item .match-row .match-why {
  display: block;
  font-size: 10.5px;
  color: #4a5a52;
  margin-top: 6px;
  line-height: 1.65;
  text-align: left;
}
@media (max-width: 400px) {
  .match-row { gap: 5px; }
  .type-item .match-row .match { padding: 9px 5px 10px; }
  .type-item .match-row .match-why { font-size: 10px; }
}

/* =========================================================
   結果画面：相性3人を1行3列に
   ========================================================= */
.result .match-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  text-align: left;
}
.result .match-row .match {
  display: block;
  text-align: center;
  border-radius: 14px;
  padding: 11px 7px 12px;
  text-decoration: none;
  color: inherit;
}
.result .match-row .match:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.result .match-row .char-sm { width: 54px; margin: 4px auto 5px; display: block; }
.result .match-row .match-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--stone);
  line-height: 1.45;
  min-height: 2.9em;
}
.result .match-row .match-code {
  display: inline-block;
  font-family: "Outfit", var(--font);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #fff;
  border-radius: 4px;
  padding: 2px 7px;
}
.result .match-row .match-name {
  display: block;
  font-size: 12.5px;
  font-weight: 900;
  margin-top: 3px;
  line-height: 1.4;
}
.result .match-row .match-type {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--stone);
  margin-top: 1px;
  line-height: 1.4;
}
.result .match-row .match-why {
  display: block;
  font-size: 10.5px;
  color: #4a5a52;
  margin-top: 6px;
  line-height: 1.7;
  text-align: left;
}
@media (max-width: 400px) {
  .result .match-row { gap: 5px; }
  .result .match-row .match { padding: 9px 5px 10px; }
  .result .match-row .match-why { font-size: 10px; }
}

/* =========================================================
   結果画面：おすすめの山
   ========================================================= */
.mt-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.mt {
  background: #F2F5F3;
  border-radius: 14px;
  padding: 11px 9px 12px;
  text-align: left;
}
.mt-name {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}
.mt-flag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #8a5a10;
  background: #FBEFD8;
  border-radius: 999px;
  padding: 2px 7px;
  margin-top: 3px;
  white-space: nowrap;
}
.mt-why {
  font-size: 10.5px;
  color: #4a5a52;
  margin-top: 6px;
  line-height: 1.7;
}
.mt-note {
  font-size: 11px;
  color: var(--stone);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  line-height: 1.75;
  text-align: left;
}
@media (max-width: 400px) {
  .mt-row { gap: 5px; }
  .mt { padding: 9px 6px 10px; }
  .mt-name { font-size: 12px; }
  .mt-why { font-size: 10px; }
}

/* =========================================================
   紹介ページ：隠れた姿への切り替え
   ========================================================= */
.ti-char-wrap { cursor: default; }
.type-item.is-secret { box-shadow: 0 2px 14px rgba(176, 130, 30, .24); }
.type-item.is-secret .tc-code {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.type-item.is-secret .tc-code em {
  font-style: normal;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #4A3410;
  background: linear-gradient(100deg, #F0C860, #E0A33B);
  border-radius: 999px;
  padding: 2px 7px;
}


/* 詳細カードの生息エリア表記 */
.tc-area {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: 1px;
}

/* =========================================================
   結果ページ上部：横並び（案E）
   ========================================================= */
.result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: left;
  margin-top: 6px;
}
.result-txt { flex: 0 1 auto; }
.result-row .result-char { margin: 0; flex-shrink: 0; }
.result-row .result-char .char-lg { width: 128px; display: block; }

.result-row .result-animal { font-size: 27px; margin: 0; line-height: 1.25; }
.result.is-secret .result-row .result-animal { font-size: 19px; letter-spacing: .02em; }
.result-row .result-name { font-size: 12.5px; margin-top: 1px; }
.result-row .result-copy {
  font-size: 12.5px;
  margin: 7px 0 0;
  padding: 0;
  text-align: left;
  line-height: 1.6;
}
.result-id { margin-top: 12px; }
.result-code { font-size: 10.5px; padding: 3px 7px 3px 10px; border-radius: 5px; }
.result-group { font-size: 11px; }
.result-axtags { margin-top: 10px; grid-template-columns: repeat(4, auto); gap: 4px; }
.result-axtags span { font-size: 10px; padding: 4px 8px; white-space: nowrap; }
.result-item { font-size: 10.5px; padding: 4px 12px; margin-top: 8px; }
@media (max-width: 380px) {
  .result-row .result-char .char-lg { width: 112px; }
  .result-row .result-animal { font-size: 24px; }
}

/* 詳細カード：コードと生息エリアを横並びの下へ */
.ti-id { text-align: left; margin-top: 12px; }
.tc-area { margin-left: 8px; vertical-align: 1px; }

/* おすすめの山と相性の文字を少し大きく */
.type-item .mt-row,
.result .match-row,
.type-item .match-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.type-item .mt { background: #F2F5F3; border-radius: 12px; padding: 10px 8px 11px; }
.type-item .mt-name, .result .mt-name { font-size: 13.5px; font-weight: 900; text-align: center; line-height: 1.45; }
.type-item .mt-why, .result .mt-why { font-size: 11.5px; color: #4a5a52; margin-top: 5px; line-height: 1.75; }
.type-item .mt-note, .result .mt-note { font-size: 11.5px; margin-top: 11px; line-height: 1.8; }
.result .match-row .match-why,
.type-item .match-row .match-why { font-size: 11.5px; line-height: 1.8; }
.result .match-row .match-name,
.type-item .match-row .match-name { font-size: 13.5px; }
.result .match-row .match-label,
.type-item .match-row .match-label { font-size: 11px; }

/* エリアタブのアイコン */
.gtab-icon { width: 40px; height: 38px; display: block; margin: 0 auto 2px; }

/* おすすめの山：県名 */
.mt-pref {
  font-size: 10.5px;
  color: var(--stone);
  text-align: center;
  margin-top: 1px;
  line-height: 1.4;
}

/* おすすめの山：5座を3列2行で高さを揃える */
.result .mt-row,
.type-item .mt-row { align-items: stretch; }
.result .mt,
.type-item .mt { display: flex; flex-direction: column; }

/* =========================================================
   ページ下部のXリンク
   ========================================================= */
.site-foot {
  margin-top: 4px;
  padding: 0 14px 18px;
  text-align: right;
}
.site-foot a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--stone);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  transition: color .15s, background .15s;
}
.site-foot a:hover { color: var(--pine); background: rgba(255, 255, 255, .7); }
.site-foot a:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.site-foot svg { width: 13px; height: 13px; display: block; }

/* =========================================================
   トップページ：about統合セクション（旧 about.html の中身）
   ========================================================= */
.about-section { margin-top: 8px; }
.about-inner { text-align: left; }
.about-lead { text-align: center; margin-bottom: 22px; }
.about-lead h2 { font-size: 20px; font-weight: 900; }
.about-lead p { font-size: 13px; color: var(--stone); margin-top: 6px; line-height: 1.8; }

/* PC/タブレット幅：about全体（4軸・生息エリア・マトリクス）を1つの幅に統一。 */
.about-inner, #about-matrix-wrap {
  max-width: 480px;
  margin: 0 auto;
}
#about-matrix-wrap { margin-top: 8px; }

/* =========================================================
   余白の足跡散らし（ページ全体・全画面共通）
   body直下の全高レイヤーに、JSで動的に配置する。動物本体ではなく足跡そのものなので、
   地面の跡らしく静止させたまま、薄い色で軽く敷いておく
   ========================================================= */
#scatter-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: -1;
}
.scatter-print {
  position: absolute;
  color: var(--stone);
  opacity: .13;
}
.scatter-print svg { display: block; width: 100%; height: auto; }

/* マトリクスのキャラクターにふわふわ浮く動きを付ける（山クラスターと同じ言葉づかい）。
   傾き（--mx-tilt）を消さないよう、キーフレームの中に含めて一緒に指定する */
.mx-char {
  animation: mxFloat var(--mx-fd, 3.6s) ease-in-out infinite;
  animation-delay: var(--mx-d, 0s);
}
@keyframes mxFloat {
  0%, 100% { transform: var(--mx-tilt, none) translateY(0); }
  50%      { transform: var(--mx-tilt, none) translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .mx-char { animation: none; }
}


@media (max-width: 380px) {
  .share-lf { font-size: 8.5px; }
}

/* 詳細カード：持ちものを4軸タグと同じ行に */
.ax-item b { font-family: var(--font); font-size: 10px; margin-right: 5px; }

/* 診断の仕組み：目的×仲間と生息エリアの対応 */
.area-rows { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.area-row { display: flex; align-items: center; font-size: 12px; padding: 0 2px; }
.ar-cmb { flex: 1; color: #3d4d46; }
.ar-arrow { color: #B9C6BF; margin: 0 10px; }
.ar-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
}
.ar-chip b { font-size: 12.5px; font-weight: 900; }
.ar-chip .gtab-icon { width: 18px; height: 17px; margin: 0; }
