/* ================================================
   いくらの森 style.css
   クレイアニメ・ジオラマ風 1ページサイト
   ================================================ */

:root {
  --cream: #FAF3E4;
  --brown: #5B4636;
  --brown-light: #8a6f58;
  --grass: #7CA24E;
  --grass-deep: #5d8038;
  --aka: #D8543C; /* 提灯の朱色 */
  --card-shadow: 0 10px 24px rgba(91, 70, 54, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  color: var(--brown);
  background: var(--cream);
  line-height: 1.9;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

/* ================================================
   1. ファーストビュー：森のジオラマ
   ================================================ */

.hero {
  background-image: url("assets/grass.png");
  background-repeat: repeat;
  background-size: 420px;
  padding: 24px 12px 8px;
  border-bottom: 6px solid var(--grass-deep);
}

/* クレイ看板風タイトル */
.hero-title {
  width: fit-content;
  margin: 0 auto 8px;
  background: var(--cream);
  border: 4px solid #eadfc8;
  border-radius: 24px;
  padding: 10px 34px 14px;
  text-align: center;
  box-shadow: 0 8px 0 rgba(63, 48, 34, 0.35), 0 14px 22px rgba(0, 0, 0, 0.18);
  transform: rotate(-1.2deg);
}

.hero-title h1 {
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.3;
}

.hero-title p {
  font-size: clamp(0.7rem, 2.8vw, 0.95rem);
  font-weight: 700;
  color: var(--brown-light);
}

/* --- 森コンテナ --- */
.village {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;   /* PC：ほぼ正方形の箱庭 */
}

/* --- 建物（共通） --- */
.building {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease;
  z-index: 2;
}

.building img {
  width: 100%;
  filter: drop-shadow(0 8px 8px rgba(40, 60, 20, 0.28));
}

/* ぷるんと弾む */
@keyframes purun {
  0%   { transform: scale(1, 1); }
  30%  { transform: scale(1.06, 0.94); }
  55%  { transform: scale(0.96, 1.05); }
  75%  { transform: scale(1.03, 0.98); }
  100% { transform: scale(1, 1); }
}

.building:hover img,
.building:focus-visible img,
.building:active img {
  animation: purun 0.5s ease;
  transform-origin: bottom center;
}

/* 白ピル型ラベル */
.pill {
  background: rgba(255, 255, 255, 0.94);
  color: var(--brown);
  font-size: clamp(0.58rem, 1.7vw, 0.82rem);
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(40, 60, 20, 0.25);
}

/* --- 配置（PC / タブレット）--- */
/* 上段 */
.b-yakuba    { left: 2%;  top: 1%;  width: 24%; }
.b-hachibei  { left: 38%; top: 3%;  width: 23%; }
.b-gift      { left: 73%; top: 1%;  width: 24%; }
/* 中段（スナック李が主役で大きめ） */
.b-hosokyoku { left: 1%;  top: 33%; width: 23%; }
.b-snack     { left: 34%; top: 30%; width: 30%; z-index: 3; }
.b-parfait   { left: 75%; top: 34%; width: 22%; }
/* 下段 */
.b-hachihug  { left: 2%;  top: 66%; width: 23%; }
.b-kyujin    { left: 38%; top: 68%; width: 22%; }
.b-keijiban  { left: 74%; top: 67%; width: 22%; }

/* --- 木 --- */
.tree {
  position: absolute;
  z-index: 1;
  filter: drop-shadow(0 6px 6px rgba(40, 60, 20, 0.25));
  pointer-events: none;
}
.t1 { left: 28%; top: 7%;  width: 9%; }
.t2 { left: 64%; top: 11%; width: 7%; }
.t3 { left: 25%; top: 44%; width: 8%; }
.t4 { left: 66%; top: 63%; width: 9%; }
.t5 { left: 27%; top: 75%; width: 7%; }

/* --- 案内役うちゅうさん --- */
.uchu-guide {
  position: absolute;
  left: 63%;
  top: 49%;
  width: 13%;
  z-index: 4;
  pointer-events: none;
}

.uchu-guide img {
  filter: drop-shadow(0 6px 8px rgba(40, 60, 20, 0.3));
  animation: yurayura 3.2s ease-in-out infinite;
}

@keyframes yurayura {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2.5deg) translateY(-3px); }
}

.balloon {
  position: absolute;
  bottom: 96%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--brown);
  font-size: clamp(0.6rem, 1.8vw, 0.85rem);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 16px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(40, 60, 20, 0.25);
}

.balloon::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #fff;
  border-bottom-width: 0;
}

.hero-hint {
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-shadow: 0 2px 4px rgba(40, 60, 20, 0.5);
  padding: 14px 0 12px;
}

/* ================================================
   2. セクション（クレイ風カード）
   ================================================ */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.card {
  background: #fffdf6;
  border: 3px solid #f0e6d2;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 28px 24px 30px;
  scroll-margin-top: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.card-icon {
  width: 74px;
  height: 74px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 5px rgba(91, 70, 54, 0.2));
}

.card-icon.small { width: 56px; height: 56px; }

.card h2 {
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  font-weight: 900;
  line-height: 1.5;
}

.card h3 {
  font-size: clamp(1rem, 4vw, 1.15rem);
  font-weight: 700;
  line-height: 1.5;
}

.card p { margin-bottom: 6px; }

/* --- 粘土ボタン --- */
.btn {
  display: inline-block;
  margin-top: 14px;
  background: var(--grass);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  box-shadow: 0 5px 0 var(--grass-deep), 0 9px 14px rgba(91, 70, 54, 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--grass-deep), 0 3px 6px rgba(91, 70, 54, 0.2);
}

.btn.ghost {
  background: var(--cream);
  color: var(--brown);
  box-shadow: 0 5px 0 #d9cbaf, 0 9px 14px rgba(91, 70, 54, 0.15);
}

.btn.ghost:active {
  box-shadow: 0 1px 0 #d9cbaf, 0 3px 6px rgba(91, 70, 54, 0.15);
}

/* スナック李だけ提灯の朱色ボタン */
#snack .btn {
  background: var(--aka);
  box-shadow: 0 5px 0 #a83c28, 0 9px 14px rgba(91, 70, 54, 0.2);
}

#snack .btn:active {
  box-shadow: 0 1px 0 #a83c28, 0 3px 6px rgba(91, 70, 54, 0.2);
}

/* うちゅうさんひとこと */
.uchu-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.uchu-note img { width: 64px; height: 64px; object-fit: contain; }

.uchu-note p {
  font-size: 0.85rem;
  color: var(--brown-light);
  font-weight: 700;
  margin: 0;
}

/* サブカード（フルーツギフト） */
.subcard {
  margin-top: 22px;
  background: var(--cream);
  border: 2px dashed #dccfae;
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  scroll-margin-top: 24px;
}

.subcard .card-head { margin-bottom: 8px; }
.subcard p { font-size: 0.95rem; margin: 0; }

/* --- スクロールでふわっと --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================
   3. フッター
   ================================================ */

.footer {
  margin-top: 28px;
  background-image: url("assets/grass.png");
  background-repeat: repeat;
  background-size: 420px;
  border-top: 6px solid var(--grass-deep);
  text-align: center;
  padding: 34px 16px 26px;
}

.footer-uchu { width: 110px; margin: 0 auto 4px; }

.footer-msg {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(40, 60, 20, 0.5);
  margin-bottom: 16px;
}

.sns {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sns .btn { margin-top: 0; }

.copyright {
  margin-top: 24px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(40, 60, 20, 0.5);
}

/* ================================================
   トースト（準備中のお知らせ）
   ================================================ */

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--brown);
  color: var(--cream);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 26px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99;
  max-width: 90vw;
  text-align: center;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================================================
   スマホ（〜640px）：森を縦長に
   ================================================ */

@media (max-width: 640px) {

  .hero { padding: 18px 8px 4px; }

  .village {
    aspect-ratio: 10 / 17;   /* 縦に伸ばして全建物を視認 */
  }

  /* 上段 */
  .b-yakuba    { left: 0%;  top: 2%;  width: 31%; }
  .b-hachibei  { left: 34%; top: 4%;  width: 30%; }
  .b-gift      { left: 68%; top: 2%;  width: 31%; }
  /* 中段 */
  .b-hosokyoku { left: 0%;  top: 34%; width: 30%; }
  .b-snack     { left: 31%; top: 31%; width: 38%; }
  .b-parfait   { left: 70%; top: 35%; width: 29%; }
  /* 下段 */
  .b-hachihug  { left: 1%;  top: 66%; width: 30%; }
  .b-kyujin    { left: 36%; top: 68%; width: 29%; }
  .b-keijiban  { left: 69%; top: 66%; width: 30%; }

  .t1 { left: 26%; top: 22%; width: 12%; }
  .t2 { left: 66%; top: 25%; width: 10%; }
  .t3 { left: 4%;  top: 53%; width: 11%; }
  .t4 { left: 75%; top: 55%; width: 11%; }
  .t5 { left: 40%; top: 88%; width: 10%; }

  .uchu-guide { left: 56%; top: 53%; width: 19%; }

  .card { padding: 22px 18px 24px; }
  .card-icon { width: 60px; height: 60px; }
}

/* ================================================
   動きを控えたい人へ
   ================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .building:hover img,
  .building:focus-visible img,
  .building:active img,
  .uchu-guide img { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
