* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "游明朝", serif;
  background: #fff5fa;
  color: #5a3a45;
}

/* ===== 入場 ===== */
.entrance {
  position: fixed;
  inset: 0;
  background: linear-gradient(#fff0f6, #ffffff);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 1.5s ease;
  z-index: 10;
}

.fade-in { opacity: 1; }
.fade-out { opacity: 0; }

.entrance-title {
  font-size: 2rem;
  letter-spacing: 0.4em;
  border: 3px dotted #f2b6cc;
  padding: 24px 36px;
  border-radius: 32px;
  background: #fffafc;
}

.site-title {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN",
               "游明朝", "Yu Mincho", serif;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.tap-text {
  margin-top: 18px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ===== 共通 ===== */
.hidden { display: none; }

header {
  text-align: center;
  padding: 24px;
  /* 背景画像 */
  background-image: url("img/haikei2.jpg");
  background-size: cover;       /* 画面サイズに合わせて拡大縮小 */
  background-position: center;  /* 中央に配置 */
  border-bottom: 4px double #f5d4e7;
  color: #fff;                  /* 文字色も変えたい場合 */
}

header h1 {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN",
               "游明朝", "Yu Mincho", serif;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #FFFFFF;
}

.menu {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 28px;
}

.menu button {
  background: linear-gradient(#ffffff, #ffebf3);
  border: 2px solid #f5d4e3;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: #888888;
  box-shadow: 0 4px 0 #f5d4e3;
  cursor: pointer;
}

.menu button:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #e8c3d6;
}


header h1 {
  color: #FFFFFF;
}

/* ===== ボックス ===== */
.box {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 24px;
  background: #fff;
  border-radius: 28px;
  border: none;
}

.section-title {
  text-align: center;
  letter-spacing: 0.3em;
  color: #f2d5e4
}

/* ===== キャラ ===== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.char-grid img {
  width: 100%;
  border-radius: 20px;
  border: 3px solid #f2d5e4;
  cursor: pointer;
}

.char-grid img {
  border-color: #f2d5e4 !important;
}

.char-detail {
  background: #f2d5e4;
  border: none;
  padding: 18px;
  border-radius: 20px;
}

.char-text {
  color: #666666; /* 好きな色に変更 */
  white-space: pre-wrap;
}

/* ===== 小説 ===== */
.novel-title {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  margin-bottom: 28px;
  color: #888888; /* ここでグレーに */
}

.novel-text {
  white-space: pre-wrap;
  line-height: 2.2;
  background: transparent;
  padding: 22px;
  border-radius: 22px;
  border: none;
  color: #666666; /* ここでグレーに */
}

/* ===== フェード演出 ===== */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: url("img/haikei.jpg") no-repeat center center;
  background-size: cover;
  opacity: 0;
  transition: opacity 1.5s ease;
  z-index: 10;
}

.gate p {
  color: #888888; /* 好きな色に */
}

.gate.show {
  opacity: 1;
}

.gate.hide {
  opacity: 0;
  pointer-events: none;
}

/* ===== キャラ画像 ===== */
.char-grid img:hover {
  filter: brightness(1.05);
}


.gate h1 {
  color: #FFFFFF;
  font-size: 1.8rem;
  letter-spacing: 0.25em;
  padding: 24px 30px;
  text-align: center;
}


/* キャラ1人分 */
.char-item {
  text-align: center;
}

.char-item p {
  margin-top: 8px;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: #666666;
}

.section-title {
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  margin-bottom: 24px;
  color: #eacbdb;
}


.char-item {
  text-align: center;
}

.char-item img {
  width: 100%;
  display: block;
  border-radius: 22px;
  border: 3px solid #f2b6cc;
}

.char-name {
  margin-top: 8px;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: #888888;
}

/* タップ時の黒いハイライトを消す（iOS対策） */
button, a {
  -webkit-tap-highlight-color: transparent;
}


.menu button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #f2b6cc;
}


/* ===== セクションの白い箱 ===== */
.box {
  position: relative;
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 0;              /* フリルの分はここで調整しない */
  background: #fff;
  border-radius: 0;        /* 角丸なし */
  overflow: visible;       /* フリルを飛び出させる */  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;

}

.box.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* ===== フリル ===== */
.frill {
  position: absolute;
  left: 0;
  width: 100%;
  height: 40px;
  background: url("img/frill.png") repeat-x;
  background-size: auto 100%;
  z-index: 2;
  border-radius: 0; /* フリル自体は角丸なし */
}

.frill.top { top: 0; }

.frill.bottom {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 40px;               /* フリル画像の高さに合わせる */
  background: url("img/frill.png") repeat-x;
  background-size: auto 100%;
  transform: rotate(180deg);  /* 下向きに反転 */
  z-index: 2;                 /* 内側ボックスより前面に出す */
  border-radius: 0;           /* 角丸なし */
}


/* ===== 内側のボックス ===== */
.inner-box {
  background: #fff;        /* 本体の白 */
  padding: 40px 20px;      /* 文字などの余白 */
  position: relative;
  z-index: 1;
}

.top .inner-box p {
  color: #666666; /* 好きな色に変更 */
}

#top p {
  color: #666666; /* 好きな色に */
}

#char-name {
  color: #777777;
  text-align: center;
  margin-bottom: 16px;
}

.back-btn {
  margin-bottom: 60px;
  margin-left: 20px;
}

.back-btn:active {
  transform: translateY(1px);
}

.back-btn {
  background: #fff;
  border: 1.5px solid #eacbdb;
  color: #888888;

  padding: 10px 18px;
  border-radius: 20px;

  font-size: 14px;
  letter-spacing: 0.05em;

  cursor: pointer;
  transition: all 0.25s ease;

  margin-bottom: 60px;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

.yume-link {
  display: inline;
  color: #efc6db;
  cursor: pointer;
  text-decoration: underline;
}

.yume-link:hover {
  opacity: 0.7;
}



.real-back {
  position: absolute;
  left: 1.5em;
  bottom: 1.5em;
  margin: 0;
}

.real-back span {
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.8;
  font-size: 0.9em;
}

.real-back span:hover {
  opacity: 1;
}

.real-link {
  color: #efc6db;   /* 落ち着いたグレー */
  cursor: pointer;
}

.real-link:hover {
  color: #777777;   /* ホバーで少し現実寄りに */
}

.char-page-inner {
  padding-bottom: 60px;
}

.real-back {
  position: absolute;
  left: 1.5em;
  bottom: 1.5em;

  line-height: 1.6;
  padding-top: 6px;

  display: block;
  margin: 0;
  z-index: 3; /* ← フリルより前に出す */
}


/* ギャラリー全体 */
#gallery .notebook {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  max-width: 100%;  /* 横幅制限 */
  overflow: hidden;
}

/* 画像 */
#gallery-img {
  width: 100%;
  max-width: 720px; /* 画面に収まる上限 */
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 16px;
}

/* ページコントロール */
.gallery-controls {
  display: flex;
  justify-content: space-between; /* ボタン両端に配置 */
  max-width: 720px;
  margin: 16px auto 0 auto;
  gap: 16px;
  padding: 0 10px;
}

.gallery-controls button {
  background: #fff;
  border: 1.5px solid #eacbdb;
  color: #888;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.gallery-controls button:hover {
  background: #f8e6f0;
}




.menu {
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  margin: 20px auto 28px auto; /* ← 上を 20px に */
}


@media (max-width: 480px) {
  .menu {
    gap: 6px; /* ボタン間を少し詰める */
  }

  .menu button,
  .menu a {
    font-size: 12px;   /* 文字を小さく */
    padding: 6px 10px; /* ボタン自体を小さく */
  }
}