/* ===== 投資計算ラボ — ラボにゃん マスコットUI ===== */
/* 信頼感を保つため、彩度低め・余白広め・サイズ控えめに統一 */

/* ---- ひとことカード（結果の補足） ---- */
.nyan-say {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(180deg, #F3F9FF, #EFF6FF);
  border: 1px solid #DCEAFB; border-radius: var(--r-lg);
  padding: 16px 20px 16px 16px; margin-top: 20px;
}
.nyan-say .av {
  width: 60px; height: 60px; flex-shrink: 0; border-radius: 50%;
  background: #fff; border: 1px solid #E1ECFB; overflow: hidden;
  display: grid; place-items: center;
}
.nyan-say .av img { width: 80%; height: 80%; object-fit: contain; }
.nyan-say .body { min-width: 0; }
.nyan-say .who {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800;
  color: var(--primary); margin-bottom: 3px; letter-spacing: .02em;
}
.nyan-say .who::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.nyan-say p { margin: 0; font-size: 13.5px; color: var(--ink-700); line-height: 1.6; }

/* ---- 入力ヒント（フォーム横の小さな吹き出し） ---- */
.nyan-hint {
  display: flex; align-items: center; gap: 11px;
  background: #F6FBF7; border: 1px solid #D8EEE0; border-radius: var(--r-md);
  padding: 11px 14px; margin-bottom: 18px;
}
.nyan-hint .av { width: 38px; height: 38px; flex-shrink: 0; }
.nyan-hint .av img { width: 100%; height: 100%; object-fit: contain; }
.nyan-hint p { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--green-dark); line-height: 1.5; }

/* ---- 空状態（計算前の結果エリア） ---- */
.nyan-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px 20px; min-height: 320px;
}
.nyan-empty img { width: 168px; height: 168px; object-fit: contain; margin-bottom: 6px; }
.nyan-empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--ink-700); }
.nyan-empty p { margin: 0; font-size: 13px; color: var(--ink-500); max-width: 26em; line-height: 1.6; }
.nyan-empty .speech {
  position: relative; background: #EFF6FF; border: 1px solid #DCEAFB; color: var(--primary);
  font-size: 13px; font-weight: 700; border-radius: var(--r-pill); padding: 8px 18px; margin-bottom: 16px;
}
.nyan-empty .speech::after {
  content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: #EFF6FF; border-bottom: 0;
}

/* ---- 見出し横のミニラボにゃん ---- */
.nyan-mini { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; margin-right: 2px; }
.sec-label.with-nyan { display: flex; align-items: center; gap: 8px; }

/* ---- 入力例を反映ボタン ---- */
.btn-example {
  width: 100%; margin-top: 10px; padding: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #F6FBF7; border: 1.5px dashed #BFE3CC; color: var(--green-dark);
  font-weight: 700; font-size: 14px; border-radius: var(--r-md); transition: .15s;
}
.btn-example:hover { background: #ECFAF0; border-color: var(--green); }
.btn-example img { width: 26px; height: 26px; object-fit: contain; }

/* ---- 汎用 吹き出し（ヒーロー等） ---- */
.nyan-bubble {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 13px 18px; font-size: 14px; font-weight: 700;
  color: var(--ink-700); box-shadow: var(--sh-md); line-height: 1.45;
}
.nyan-bubble .em { color: var(--primary); }
.nyan-bubble::after {
  content: ""; position: absolute; width: 16px; height: 16px; background: #fff;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.nyan-bubble.point-bl::after { left: 26px; bottom: -8px; transform: rotate(45deg); }
.nyan-bubble.point-br::after { right: 26px; bottom: -8px; transform: rotate(45deg); }

/* ---- ヒーローのラボにゃん構成 ---- */
.hero-nyan { position: absolute; inset: 0; overflow: hidden; border-radius: var(--r-xl); }
.hero-nyan .ground {
  position: absolute; left: 50%; bottom: 11%; transform: translateX(-50%);
  width: 40%; height: 18px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(37,99,235,.16), rgba(37,99,235,0) 72%);
}
.hero-nyan .cat {
  position: absolute; left: 50%; bottom: 12%; width: 56%; max-width: 280px;
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 14px rgba(37,99,235,.12));
  animation: nyan-float 5s ease-in-out infinite;
}
@keyframes nyan-float { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }
.hero-nyan .b1 { position: absolute; left: 7%; top: 10%; max-width: 168px; z-index: 3; }
.hero-nyan .motif {
  position: absolute; object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(15,23,42,.10));
  animation: motif-float 4.5s ease-in-out infinite;
}
.hero-nyan .m-coin { width: 52px; left: 15%; bottom: 24%; animation-delay: .3s; }
.hero-nyan .m-pie { width: 56px; right: 13%; bottom: 20%; animation-delay: 1.1s; }
.hero-nyan .m-sprout { width: 40px; right: 16%; top: 15%; animation-delay: .7s; }
@keyframes motif-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { .hero-nyan .cat { animation: none; transform: translateX(-50%); } .hero-nyan .motif { animation: none; } }

/* ---- 目的カードのアイテムモチーフ ---- */
.purpose-card .motif-img {
  position: absolute; right: 12px; bottom: 10px; width: 52px; height: 52px;
  object-fit: contain; opacity: .96; pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(15,23,42,.08));
}
.purpose-card.has-motif .p-ic { display: none; }
.purpose-card.has-motif .p-go { opacity: 0; }
.purpose-card.has-motif:hover .motif-img { transform: scale(1.06); transition: .18s; }

/* ---- 関連ツールカードのモチーフ ---- */
.related-card { position: relative; }
.related-card .rc-motif { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; object-fit: contain; opacity: .9; }

/* ---- 成功リアクション（計算完了時の小さな反応） ---- */
.nyan-pop {
  position: fixed; right: 26px; bottom: 26px; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #D8EEE0; border-radius: var(--r-pill);
  box-shadow: var(--sh-lg); padding: 8px 16px 8px 8px;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: .28s ease;
}
.nyan-pop.show { opacity: 1; transform: translateY(0); }
.nyan-pop img { width: 40px; height: 40px; object-fit: contain; }
.nyan-pop span { font-size: 13px; font-weight: 700; color: var(--green-dark); }

@media (max-width: 760px) {
  .nyan-empty { min-height: 220px; padding: 18px; }
  .nyan-empty img { width: 120px; height: 120px; }
  .nyan-say .av { width: 50px; height: 50px; }
  .nyan-pop { right: 12px; bottom: 12px; }
  /* スマホ表示順: 結果 → ひとこと → グラフ */
  #result-body { display: flex; flex-direction: column; }
  #result-body .nyan-say { order: 4; }
  #result-body .chart-card { order: 5; }
}
