* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #170d22;
  color: #fff;
  font-family: "Yu Gothic", "Meiryo", sans-serif;
}

/* ページ全体 */
.profile-page {
  min-height: 100vh;
  padding: 0;

  background-image:
    linear-gradient(rgba(20, 10, 30, 0.30), rgba(20, 10, 30, 0.58)),
    url("../img/bg/top-main.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* 最初の一枚絵 */
.profile-opening {
  display: block;
  position: relative;

  width: 100%;
  min-height: 100svh;
  padding: 0;

  border: none;
  background-image:
    linear-gradient(rgba(20, 10, 30, 0.05), rgba(20, 10, 30, 0.15)),
    url("../img/bg/top-main.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* 最初のScrollボタン */
.scroll-button {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);

  display: inline-block;
  padding: 10px 22px;

  border-radius: 999px;
  background: rgba(20, 10, 30, 0.72);
  color: #fff;
  text-decoration: none;

  font-size: 15px;
  letter-spacing: 0.08em;

  box-shadow: 0 0 18px rgba(0,0,0,0.45);
  text-shadow: 0 0 6px rgba(0,0,0,0.8);

  animation: scroll-float 1.7s ease-in-out infinite;
}

/* 本文側の各シーン */
.profile-scene:not(.profile-opening) {
  display: block;
  position: relative;

  width: 100%;
  min-height: auto;
  margin: 0;
  padding: 0 22px;

  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

/* imgは背景としては使わないので非表示 */
.profile-character {
  display: none;
}

/* 本文ウィンドウ */
.profile-message {
  position: relative;

  width: min(760px, 100%);
  min-height: auto;
  margin: 0 auto;
  padding: 18px 26px;

  border: none;
  border-radius: 0;
  background: rgba(226, 234, 244, 0.72);
  color: #2a2430;

  box-shadow: none;
  backdrop-filter: blur(1px);
}

/* 最初の本文だけ上を丸くする */
#scene-01 .profile-message {
  margin-top: 32px;
  border-radius: 20px 20px 0 0;
  padding-top: 30px;
}

/* 最後の本文だけ下を丸くして、Scrollボタン分の余白を作る */
#scene-13 .profile-message {
  margin-bottom: 40px;
  padding-bottom: 82px;
  border-radius: 0 0 20px 20px;
}

/* 話者名 */
.speaker {
  display: inline-block;
  margin: 18px 0 8px;
  padding: 5px 14px;

  border-radius: 999px;
  background: rgba(255, 175, 220, 0.72);
  color: #fff;

  font-size: 13px;
  font-weight: bold;
}

/* 最初の話者名だけ上の余白を減らす */
#scene-01 .speaker {
  margin-top: 0;
}

/* 本文 */
.profile-message p {
  margin: 8px 0 18px;
  color: #2a2430;
  font-size: 16px;
  font-weight: 600;
  line-height: 2;
  text-shadow: none;
}

/* 途中の▼は使わない */
.next-mark {
  display: none;
}

/* 最後のScrollボタン */
#scene-13 .ending-scroll-button {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);

  display: inline-block;
  padding: 10px 22px;

  border-radius: 999px;
  background: rgba(20, 10, 30, 0.72);
  color: #fff;
  text-decoration: none;

  font-size: 15px;
  letter-spacing: 0.08em;

  box-shadow: 0 0 18px rgba(0,0,0,0.45);
  text-shadow: 0 0 6px rgba(0,0,0,0.8);

  animation: scroll-float 1.7s ease-in-out infinite;
  z-index: 5;
}

#scene-13 .ending-scroll-button:hover,
.scroll-button:hover {
  background: rgba(40, 20, 55, 0.82);
}

/* Scrollのふわふわ動作：style.css / omake.css と同じ系統 */
@keyframes scroll-float {
  0% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.75;
  }

  50% {
    transform: translateX(-50%) translateY(6px);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.75;
  }
}

/* TOPへ戻るエリア */
.back-area {
  min-height: 100svh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 80px 22px;

  background: #050505;
}

/* 現実を見るエリア */
.reality-area {
  min-height: 100svh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 120px 22px;

  background: #050505;
}

/* TOPへ戻る／現実を見る 共通ボタン */
.reality-button {
  display: block;
  width: fit-content;
  margin: 40px auto;
  padding: 18px 56px;

  border: 2px solid rgba(255, 235, 250, 0.95);
  border-radius: 999px;

  background: linear-gradient(#ff9bd5, #e84fa5);
  color: #fff;
  text-decoration: none;

  font-size: 20px;
  font-weight: bold;

  box-shadow:
    0 0 18px rgba(255, 160, 220, 0.75),
    0 0 42px rgba(255, 120, 200, 0.45);

  text-shadow: 0 0 8px rgba(0,0,0,0.45);
}

.reality-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(#ffb1df, #f260b3);
  box-shadow:
    0 0 24px rgba(255, 190, 235, 0.95),
    0 0 56px rgba(255, 120, 200, 0.62);
}

/* スマホ横：本文が横に広がりすぎないように少し詰める */
@media (max-width: 1200px) and (orientation: landscape) {
  .profile-scene:not(.profile-opening) {
    padding: 0 18px;
  }

  .profile-message {
    width: min(720px, 86%);
    padding: 14px 22px;
  }

  .profile-message p {
    font-size: 14px;
    line-height: 1.8;
  }
}

/* スマホ縦 */
@media (max-width: 768px) and (orientation: portrait) {
  .profile-scene:not(.profile-opening) {
    padding: 0 22px;
  }

  .profile-message {
    width: 100%;
    padding: 18px 24px;
  }

  #scene-01 .profile-message {
    margin-top: 26px;
    border-radius: 18px 18px 0 0;
    padding-top: 28px;
  }

  #scene-13 .profile-message {
    padding-bottom: 82px;
    border-radius: 0 0 18px 18px;
  }

  .profile-message p {
    font-size: 16px;
    line-height: 2;
  }

  .reality-button {
    width: 100%;
    max-width: 320px;
    text-align: center;
    margin: 0 auto;
    padding: 16px 24px;
    font-size: 18px;
  }
}

/* ここから追加：はじめからページの深掘りパート */

/* 新しい会話ブロックの最初・最後 */
.profile-message.block-start {
  margin-top: 32px;
  border-radius: 20px 20px 0 0;
  padding-top: 30px;
}

.profile-message.block-end {
  margin-bottom: 40px;
  padding-bottom: 82px;
  border-radius: 0 0 20px 20px;
}

.profile-message.block-single {
  margin: 32px auto 40px;
  padding-bottom: 82px;
  border-radius: 20px;
}

/* scene-13以外でもScrollボタンを使えるようにする */
.ending-scroll-button {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);

  display: inline-block;
  padding: 10px 22px;

  border-radius: 999px;
  background: rgba(20, 10, 30, 0.72);
  color: #fff;
  text-decoration: none;

  font-size: 15px;
  letter-spacing: 0.08em;

  box-shadow: 0 0 18px rgba(0,0,0,0.45);
  text-shadow: 0 0 6px rgba(0,0,0,0.8);

  animation: scroll-float 1.7s ease-in-out infinite;
  z-index: 5;
}

.ending-scroll-button:hover {
  background: rgba(40, 20, 55, 0.82);
}

/* 自分語りパートの背景 */
/* 画像ファイルを用意したら、img/bg/profile-talk.jpg という名前で保存してください */
.scene-talk-opening,
.profile-scene.scene-talk {
  background-image:
    linear-gradient(rgba(20, 10, 30, 0.06), rgba(20, 10, 30, 0.22)),
    url("../img/bg/profile-talk.jpg");

  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #2a1638;
}

.profile-scene.scene-talk {
  background-attachment: fixed;
}

/* 笑顔差分の一枚絵 */
/* 画像ファイルを用意したら、img/bg/profile-smile.jpg という名前で保存してください */
.scene-smile,
.profile-scene.scene-smile-message {
  background-image:
    linear-gradient(rgba(20, 10, 30, 0.10), rgba(20, 10, 30, 0.34)),
    url("../img/bg/profile-smile.jpg");
  background-size: auto 100%;
  background-position: center top;
  background-repeat: no-repeat;
  background-color: #f5cadc;
}

.profile-scene.scene-smile-message {
  background-attachment: fixed;
}

/* 最後のボタンを縦に並べる */
.final-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.sub-button {
  background: linear-gradient(#7a6b8f, #4b3d5f);
  box-shadow:
    0 0 14px rgba(180, 160, 220, 0.50),
    0 0 32px rgba(120, 100, 170, 0.35);
}

/* スマホ縦の追加調整 */
@media (max-width: 768px) and (orientation: portrait) {
  .profile-message.block-start {
    margin-top: 26px;
    border-radius: 18px 18px 0 0;
    padding-top: 28px;
  }

  .profile-message.block-end {
    padding-bottom: 82px;
    border-radius: 0 0 18px 18px;
  }

  .profile-message.block-single {
    margin: 26px auto 40px;
    padding-bottom: 82px;
    border-radius: 18px;
  }

  .scene-talk-opening,
  .profile-scene.scene-talk,
  .scene-smile,
  .profile-scene.scene-smile-message {
    background-size: auto 100%;
    background-position: center top;
  }

  .final-buttons {
    width: 100%;
  }
}

/* 最後の笑顔ADV画面 */
.smile-adv-screen {
  position: relative;
  width: 100%;
  min-height: 100svh;

  background-image:
    linear-gradient(rgba(20, 10, 30, 0.00), rgba(20, 10, 30, 0.16)),
    url("../img/bg/profile-smile.jpg");

  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #f5cadc;

  overflow: hidden;
}

/* 笑顔ADV画面のメッセージウィンドウ */
.smile-adv-message {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);

  width: min(760px, 86%);
  min-height: 150px;
  padding: 24px 32px 78px;

  border: 2px solid #d99bd0;
  border-radius: 18px;

  background: rgba(20, 10, 30, 0.78);
  color: #fff;

  box-shadow: 0 0 24px rgba(255, 160, 220, 0.28);
  backdrop-filter: blur(8px);
}

/* 笑顔ADV画面の話者名 */
.smile-adv-message .speaker {
  margin: 0 0 14px;
  background: rgba(255, 175, 220, 0.82);
  color: #fff;
}

/* 笑顔ADV画面の本文 */
.smile-adv-message p {
  color: #fff;
  font-size: 20px;
  line-height: 1.8;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
}

/* 笑顔ADV画面のScroll位置 */
.smile-adv-message .ending-scroll-button {
  bottom: 22px;
}

/* スマホ縦でもADV画面にする */
@media (max-width: 768px) and (orientation: portrait) {
  .smile-adv-screen {
    min-height: 100svh;
    background-size: cover;
    background-position: center center;
  }

  .smile-adv-message {
    left: 20px;
    right: 20px;
    bottom: 28px;
    transform: none;

    width: auto;
    min-height: 130px;
    padding: 18px 22px 74px;
    border-radius: 16px;
  }

  .smile-adv-message p {
    font-size: 17px;
    line-height: 1.8;
  }
}

/* 最後の笑顔ADV画面：テキストウィンドウを小さくする */
.smile-adv-message {
  width: min(560px, 72%);
  min-height: 105px;

  bottom: 34px;
  padding: 16px 26px 56px;

  border-radius: 16px;
}

.smile-adv-message .speaker {
  margin-bottom: 10px;
  padding: 5px 14px;
  font-size: 13px;
}

.smile-adv-message p {
  font-size: 17px;
  line-height: 1.6;
}

.smile-adv-message .ending-scroll-button {
  bottom: 14px;
  padding: 8px 20px;
  font-size: 14px;
}

@media (max-width: 768px) and (orientation: portrait) {
  .smile-adv-message {
    left: 18px;
    right: 18px;
    bottom: 24px;

    width: auto;
    min-height: 100px;
    padding: 14px 18px 54px;
  }

  .smile-adv-message p {
    font-size: 16px;
    line-height: 1.6;
  }

  .smile-adv-message .ending-scroll-button {
    bottom: 12px;
    padding: 8px 18px;
    font-size: 13px;
  }
}

/* 最後の笑顔ADV画面：横幅はそのまま、縦幅だけ小さくする */
.smile-adv-message {
  width: min(760px, 86%);
  min-height: 0;

  bottom: 34px;
  padding: 14px 32px 48px;
}

.smile-adv-message .speaker {
  margin: 0 0 8px;
  padding: 4px 14px;
  font-size: 13px;
}

.smile-adv-message p {
  margin: 6px 0;
  font-size: 18px;
  line-height: 1.45;
}

.smile-adv-message .ending-scroll-button {
  bottom: 10px;
  padding: 7px 18px;
  font-size: 13px;
}

/* スマホ横：最後の笑顔ADV画面もPCと同じ横長・薄め表示にする */
@media (max-width: 950px) and (orientation: landscape) {
  .smile-adv-message {
    width: min(760px, 86%);
    min-height: 0;

    bottom: 18px;
    padding: 10px 24px 40px;
  }

  .smile-adv-message .speaker {
    margin: 0 0 6px;
    padding: 3px 12px;
    font-size: 12px;
  }

  .smile-adv-message p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.35;
  }

  .smile-adv-message .ending-scroll-button {
    bottom: 8px;
    padding: 6px 16px;
    font-size: 12px;
  }
}

/* スマホ横：最後の笑顔ADV画面のウィンドウ横幅だけ短くする */
@media (max-width: 950px) and (orientation: landscape) {
  .smile-adv-message {
    width: min(620px, 72%);
  }
}


/* スマホ縦：最後の笑顔ADVウィンドウを中央揃えに固定 */
@media (max-width: 768px) and (orientation: portrait) {
  .smile-adv-message {
    left: 50%;
    right: auto;
    transform: translateX(-50%);

    width: calc(100% - 48px);
    max-width: 340px;
  }
}