/* =========================
   小説本文ページ 全体
========================= */

.novel-body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "BIZ UDPGothic",
    "Meiryo",
    "Yu Gothic",
    "Hiragino Maru Gothic ProN",
    sans-serif;

  color: #2f261f;

  background:
    linear-gradient(
      rgba(40, 31, 24, 0.20),
      rgba(40, 31, 24, 0.20)
    ),
    url("kabe2.png");

  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}

/* =========================
   ヘッダー
========================= */

.novel-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 34px 20px 18px;
  text-align: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 22px;
  padding: 10px 20px;

  color: #6a4b35;
  background: rgba(255, 252, 242, 0.78);
  border: 1px solid rgba(142, 105, 74, 0.35);
  border-radius: 999px;

  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.08em;

  box-shadow: 0 4px 14px rgba(80, 50, 30, 0.12);
  transition: 0.25s ease;
}

.back-link:hover {
  background: rgba(255, 245, 220, 0.96);
  transform: translateY(-2px);
}

.novel-header h1 {
  margin: 0;
  font-size: 34px;
  font-weight: normal;
  letter-spacing: 0.14em;
  color: #4d3728;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.9);
}

.novel-subtitle {
  margin-top: 12px;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: #7b5c45;
}


/* =========================
   本文エリア
========================= */

.novel-main {
  padding: 20px;
}

.novel-paper {
  max-width: 760px;
  margin: 0 auto 60px;
  padding: 56px 52px;

  background: rgba(14, 24, 48, 0.94);
  border: 1px solid rgba(188, 174, 126, 0.28);
  border-radius: 24px;

  box-shadow:
    0 14px 38px rgba(18, 28, 22, 0.42),
    inset 0 0 35px rgba(255, 245, 200, 0.08);

  backdrop-filter: blur(4px);
}

/* =========================
   小説本文
========================= */

.novel-paper p {
  margin: 0 0 1.65em;

  font-size: 16px;
  line-height: 2.15;
  letter-spacing: 0.05em;

  color: #eee7dc;
  font-weight: 500;
  text-align: left;
}

.novel-title {
  text-align: center !important;
  font-size: 22px !important;
  font-weight: bold;
  letter-spacing: 0.16em !important;
  margin-bottom: 2.4em !important;
}

.chapter-mark {
  text-align: center !important;
  margin: 3.2em 0 2.4em !important;

  font-size: 20px !important;
  letter-spacing: 0.18em !important;
}

.novel-sign {
  text-align: right !important;
  margin-top: 2.4em !important;
  margin-bottom: 3.2em !important;
}


/* =========================
   フッター
========================= */

.novel-footer {
  text-align: center;
  padding: 30px 20px 42px;
  color: #7c644f;
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* =========================
   本文カード内タイトル
========================= */

.novel-paper {
  position: relative;
}

.novel-card-title {
  position: absolute;
  top: 18px;
  right: 24px;

  padding: 6px 14px;

  color: #d8ccb8;
  background: rgba(38, 58, 45, 0.72);
  border: 1px solid rgba(216, 204, 184, 0.28);
  border-radius: 999px;

  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-decoration: none;

  box-shadow: 0 4px 12px rgba(15, 25, 18, 0.24);
}

.novel-card-title:hover {
  background: rgba(50, 76, 58, 0.9);
}


/* =========================
   前へ・目次・次へナビ
========================= */

.novel-page-nav {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;

  margin: 0 0 36px;
  padding-top: 18px;
}

.novel-page-nav a {
  display: inline-block;
  padding: 9px 18px;

  color: #e4d8c4;
  background: rgba(39, 58, 46, 0.78);
  border: 1px solid rgba(218, 205, 180, 0.32);
  border-radius: 999px;

  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-decoration: none;

  box-shadow: 0 4px 12px rgba(15, 25, 18, 0.22);
  transition: 0.25s ease;
}

.novel-page-nav a:hover {
  background: rgba(58, 84, 64, 0.95);
  transform: translateY(-2px);
}

.bottom-nav {
  margin: 48px 0 0;
  padding-top: 28px;
  border-top: 1px solid rgba(224, 211, 186, 0.22);
}


/* =========================
   スマホ対応
========================= */

@media (max-width: 768px) {
  .novel-header {
    padding-top: 24px;
  }

  .novel-header h1 {
    font-size: 26px;
    letter-spacing: 0.08em;
  }

  .novel-main {
    padding: 12px;
  }

  .novel-paper {
    padding: 34px 22px;
    border-radius: 18px;
  }

  .novel-paper p {
    font-size: 15px;
    line-height: 2.05;
    letter-spacing: 0.03em;
  }

  .novel-title {
    font-size: 19px !important;
  }

  .novel-card-title {
    position: static;
    display: block;
    width: fit-content;
    margin: 0 auto 20px;
  }

  .novel-page-nav {
    gap: 10px;
  }

  .novel-page-nav a {
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* =========================
   読了後のおまけボタン
========================= */

.novel-bonus {
  margin: 48px auto 24px;
  text-align: center;
}

.novel-bonus-message {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.8;
  color: #5b493c;
  text-align: center;
}

.novel-bonus-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: min(100%, 460px);
  min-height: 64px;
  padding: 14px 28px;

  box-sizing: border-box;
  border: 3px solid #c9a84c;
  border-radius: 18px;

  color: #8a6a22;

  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #fffdf7 55%,
      #f8f0d8 100%
    );

  font-size: 18px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-decoration: none;

  box-shadow:
    0 5px 0 #9f7e2f,
    0 10px 20px rgba(96, 73, 23, 0.20),
    inset 0 0 0 2px rgba(255, 255, 255, 0.9);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.novel-bonus-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);

  box-shadow:
    0 7px 0 #9f7e2f,
    0 14px 24px rgba(96, 73, 23, 0.24),
    inset 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.novel-bonus-button:active {
  transform: translateY(4px);

  box-shadow:
    0 2px 0 #9f7e2f,
    0 5px 10px rgba(96, 73, 23, 0.18),
    inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.novel-bonus-button:focus-visible {
  outline: 4px solid rgba(201, 168, 76, 0.35);
  outline-offset: 4px;
}

.novel-bonus-note {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: #806f64;
}

@media (max-width: 600px) {
  .novel-bonus {
    margin-top: 36px;
  }

  .novel-bonus-button {
    width: 100%;
    min-height: 58px;
    padding: 12px 18px;
    font-size: 16px;
  }
}

.novel-bonus .novel-bonus-message {
  display: block;
  width: 100%;
  margin: 0 auto 16px;
  text-align: center !important;
}

.novel-bonus-button {
  display: inline-block;
  padding: 12px 22px;
  margin: 16px auto;
  background: #fffdf7;
  color: #6b4c2e;
  border: 2px solid #c9a85d;
  border-radius: 999px;
  text-decoration: none;
  font-weight: bold;
  line-height: 1.4;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .novel-bonus-button {
    display: inline-block !important;
    padding: 11px 18px !important;
    background: #fffdf7 !important;
    border: 2px solid #c9a85d !important;
    border-radius: 999px !important;
  }
}

/* =========================
   読書しおり機能
========================= */

.reading-tools {
  max-width: 760px;
  margin: 24px auto 36px;
  padding: 18px 20px;

  /* 少し濃い落ち着いた茶色 */
  background: #6f5843;

  border: 1px solid rgba(75, 54, 36, 0.45);
  border-radius: 14px;

  box-shadow:
    0 6px 18px rgba(62, 44, 29, 0.18);

  text-align: center;
}

.reading-status {
  margin: 0 0 14px;

  /* 茶色背景でも読みやすいクリーム色 */
  color: #fff8eb;

  font-size: 0.95rem;
  line-height: 1.7;
}

.reading-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.reading-button {
  appearance: none;

  padding: 10px 16px;

  background: #fffaf2;
  color: #554637;

  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;

  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;

  cursor: pointer;

  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.reading-button:hover {
  background: #f7ead7;

  transform: translateY(-1px);

  box-shadow:
    0 5px 12px rgba(49, 34, 23, 0.2);
}

.reading-button:focus-visible {
  outline: 3px solid rgba(255, 232, 188, 0.6);
  outline-offset: 3px;
}

.resume-button {
  background: #3f3025;
  color: #ffffff;

  border-color: #3f3025;
}

.resume-button:hover {
  background: #2f241c;
}

.clear-button {
  color: #6b5949;
  font-size: 0.84rem;
}

.reading-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 1000;

  max-width: calc(100% - 40px);
  padding: 11px 18px;

  background: rgba(54, 46, 38, 0.94);
  color: #ffffff;

  border-radius: 999px;

  font-size: 0.9rem;
  text-align: center;

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2);

  opacity: 0;
  pointer-events: none;

  transform: translate(-50%, 12px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.reading-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 600px) {
  .reading-tools {
    margin: 18px 12px 30px;
    padding: 16px 14px;
  }

  .reading-buttons {
    flex-direction: column;
  }

  .reading-button {
    width: 100%;
  }
}

/* =========================
   読書進捗バー
========================= */

.reading-progress {
  width: 100%;
  max-width: 480px;
  height: 8px;

  margin: 0 auto 16px;

  /* 茶色カード上で見えるよう明るめに */
  background: rgba(255, 248, 235, 0.28);

  border-radius: 999px;

  overflow: hidden;
}

.reading-progress-bar {
  width: 0;
  height: 100%;

  /* 金茶色のアクセント */
  background: #e0bd86;

  border-radius: inherit;

  transition: width 0.35s ease;
}

.restart-button {
  background: #fffaf2;
  color: #554637;
}