/* ベーシックリセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: auto;
}
body {
  background-color: #f6f3e6;
  /* PC/タブレット用背景画像 */
  background-image: url("../images/bg_A.png");
  background-repeat: no-repeat;
  background-position: top right;
  background-size: 40% auto;
  font-family: sans-serif;
}
/* スマホ用背景画像 */
@media (max-width: 767px) {
  body {
    background-color: #faf8f1;
    background-image: url("../images/bg_modal.png");
    background-size: 80% auto;
    padding-top: 40px;
    padding-bottom: 80px;
  }
}

/* バックボタン */
.back-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1010;
  background-color: #5c8167;
  display: inline-block;
  transition: background-color 0.3s ease, transform 0.3s ease;
  border-radius: 5px;
  width: 40px;
  height: 40px;
}
.back-button:hover {
  background-color: #ffcc02;
  transform: translateY(-3px);
}
.back-button img {
  width: 40px;
  height: auto;
  border-radius: 8px;
}
@media (max-width: 767px) {
  .back-button {
    top: 0;
    left: 0;
    border-radius: 0;
    width: 100%;
  }
}

/* スライドショー全体 */
.slideshow {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: none;
  transform: translateX(0);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}
.slide.active {
  display: block;
  opacity: 1;
}
@media (max-width: 767px) {
  .slide {
    overflow-y: auto;
  }
}

/* 画像表示用スタイル */
.content-svg {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.svg-pc {
  display: block;
}
.svg-mobile {
  display: none;
}
@media (max-width: 767px) {
  .content-svg {
    /* スマホ表示時は上部に配置 */
    justify-content: flex-start;
  }
  .svg-pc { display: none; }
  .svg-mobile { display: block; }
  /* スマホ表示時、.svg-mobile内のimg要素を横幅に合わせる */
  .svg-mobile img { width: 100%; height: auto; }
  /* スマホ用8ページ目は上下センターに配置 */
  .slide[data-index="7"] .content-svg {
    justify-content: center!important;
  }
  .slide[data-index="7"] .svg-mobile img { 
    display: block;
    margin: 0 auto;
  }
  .slide[data-index="7"] .svg-mobile img {
    transform: translateY(-50px);
  }
}

/* PC表示時の画像スタイル */
@media (min-width: 768px) {
  .content-svg {
    padding-top: 20px;
    padding-bottom: 100px;
    box-sizing: border-box;
  }
  .svg-pc img {
    width: 100%;
    max-width: 1100px;
    height: auto;
    max-height: calc(100vh - 200px);
    border: 3px solid #64846d;
    border-radius: 20px;
  }
  /* オーバーレイ画像は罫線なし */
  .svg-pc .overlay-seq {
    border: none;
    border-radius: 0;
  }
}

/* オーバーレイ共通スタイル：初期状態は透明・非表示、かつ下から上がる動きを追加 */
.overlay-seq {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: transform 0.5s ease, opacity 0.5s ease;
}
/* 「float-animation」が付いている場合は初期状態で位置のずれをなくす */
.overlay-seq.float-animation {
  /* JS側で上書きしていますが、念のためCSSでも指定 */
  transform: translateY(0);
}
/* ★スライド1のオーバーレイ画像は常に表示★ */
.slide.active[data-index="0"] .overlay-seq {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* ナビゲーションボタン */
.nav-buttons {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;  /* z-index を大きくして最前面に表示 */
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 90%;
  max-width: 500px;
}
@media (max-width: 767px) {
  .nav-buttons { bottom: 20px; background-color: transparent; }
  .nav-background {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #5b8067;
    z-index: 5;
  }
}
.btn {
  flex: 1 1 0;
  max-width: 150px;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Zen Maru Gothic', sans-serif;
}
.btn-large {
  width: 200px;
  max-width: 200px;
}
.btn-green {
  background-color: #64866c;
  color: white;
  border: 1px solid #faf8f1;
}
.btn-green:hover {
  background-color: #ffcc02;
  color: black;
  transform: translateY(-3px);
}
.btn-gray {
  background-color: #e3ddd9;
  color: black;
  border: 1px solid #faf8f1;
}
.btn-gray:hover { transform: translateY(-3px); }

/* 進捗バー */
.progress-bar-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 12px;
  background: #e3dcd9;
  border-radius: 6px;
  overflow: visible;
  z-index: 10;
}
.progress-bar {
  width: 0;
  height: 100%;
  background: #64866c;
  border-radius: 6px;
  transition: width 0.5s ease;
}
#progressCharacter {
  position: absolute;
  bottom: 100%;
  transform: translateX(-50%);
  width: 40px;
  height: auto;
  transition: left 0.5s ease;
}
#progressCharacter img { width: 100%; height: auto; }
@media (max-width: 767px) {
  .progress-bar-container { display: none; }
}

/* -------------------------------
   浮遊アニメーションの追加
   クラス "float-animation" を任意の画像に追加することで、
   フェードイン後に上下にふわふわと浮かぶアニメーションを実現
------------------------------- */
@keyframes floatUpDown {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}
.float-animation {
  animation: floatUpDown 3s ease-in-out infinite;
  animation-delay: 0.5s;
}

/* -------------------------------
   点滅アニメーションの追加
   クラス "blink-animation" を追加することで、フェードイン後にゆっくり点滅させる
------------------------------- */
@keyframes slowBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.blink-animation {
  animation: slowBlink 3s ease-in-out infinite;
}

/* ------------------------------------------
   新しいフェードインのみのアニメーション用スタイル
   （translateY を適用せず、opacity のみフェードイン）
------------------------------------------ */
.overlay-seq.fadein-only {
  transform: none !important;
  transition: opacity 0.5s ease;
}

/* -------------------------------
   アンケートボタン
------------------------------- */
.questionnaire-btn {
  position: absolute;
  top: 80%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}
.questionnaire-btn a {
  background: #64866c;
  border-radius: 9999px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  max-width: 400px;
  padding: 15px 60px;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 100%;
  line-height: 1.8;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  transition: 0.3s ease-in-out;
}
.questionnaire-btn a:hover:after {
  right: 1.4rem;
}
.questionnaire-btn a:hover {
  background: #ffcc02;
  color: #000;
  transform: translateY(-5px);
}

/* -------------------------------
   ホームボタン
------------------------------- */
.home-btn {
  position: absolute;
  top: 88%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}
.home-btn a {
  color: #64866c;
  text-decoration: none;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 16px;
  font-weight: 500;
  transition: 0.3s ease-in-out;
}
.home-btn a:hover {
  color: #ffcc02;
  transform: translateY(-2px);
}

/* スマホ用調整 */
@media (max-width: 767px) {
  .questionnaire-btn {
    position: fixed;
    top: auto !important;
    bottom: 25%!important; /* ナビゲーションボタンとの重複を避けるため位置を調整 */
    left: 50%;
    transform: translateX(-50%);
  }
  .questionnaire-btn a {
    width: 120px;
    height: 120px;
    padding: 0;
    border-radius: 50%;
    font-size: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: none;
  }
  
  .home-btn {
    position: fixed;
    top: auto !important;
    bottom: 18%!important; /* ナビゲーションボタンとの重複を避けるため位置を調整 */
    left: 50%;
    transform: translateX(-50%);
  }
  .home-btn a {
    color: #64866c;
    text-decoration: none;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s ease-in-out;
  }
  .home-btn a:hover {
    color: #ffcc02;
    transform: translateY(-2px);
  }
}

/* タブレット用調整 */
@media (min-width: 768px) and (max-width: 1024px) {
  .questionnaire-btn {
    top: 70%;
  }
  .home-btn {
    top: 85%;
  }
}

/* 小さいPC画面用調整 */
@media (min-width: 1025px) and (max-width: 1200px) {
  .questionnaire-btn {
    top: 72%;
  }
  .home-btn {
    top: 87%;
  }
}


