/* 本棚に戻るボタン */
.back-to-shelf {
  background: linear-gradient(180deg, #e2c48d 60%, #bfa76f 100%);
  color: #5a3c1a;
  border: 2px solid #bfa76f;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: bold;
  padding: 0.7rem 2.2rem;
  margin: 1.2rem auto 0 auto;
  display: block;
  box-shadow: 0 2px 8px rgba(80,60,30,0.08);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.back-to-shelf:hover {
  background: linear-gradient(180deg, #bfa76f 60%, #e2c48d 100%);
  box-shadow: 0 4px 16px rgba(80,60,30,0.16);
}
/* 紹介ページ用 本詳細レイアウト（表紙を上・情報を下に中央揃え） */
.book-detail-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 2.5rem auto 2.5rem auto;
  max-width: 400px;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(80,60,30,0.08);
  padding: 2rem 2rem 2rem 2rem;
}
.book-detail-cover {
  width: 140px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
  box-shadow: 0 2px 8px rgba(80,60,30,0.10);
  display: block;
  margin: 0 auto;
}
.book-detail-cover.empty {
  background: repeating-linear-gradient(135deg, #e2c48d 0 20px, #bfa76f 20px 40px);
  border: 2px dashed #bfa76f;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bfa76f;
  font-size: 1.1rem;
}
.book-detail-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.7rem;
  align-items: center;
}
.book-detail-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #5a3c1a;
  margin-bottom: 0.2rem;
  text-align: center;
}
.book-detail-author {
  font-size: 1.05rem;
  color: #333;
  text-align: center;
}
.book-detail-publisher {
  font-size: 0.98rem;
  color: #8b7a5a;
  text-align: center;
}
.book-detail-isbn {
  font-size: 0.92rem;
  color: #555;
  text-align: center;
}
/* 紹介ページ用 本詳細レイアウト */
.book-detail {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin: 2.5rem auto 2.5rem auto;
  max-width: 600px;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(80,60,30,0.08);
  padding: 2rem 2rem 2rem 2rem;
}
.book-detail-cover {
  width: 140px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
  box-shadow: 0 2px 8px rgba(80,60,30,0.10);
}
.book-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.7rem;
}
.book-detail-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #5a3c1a;
  margin-bottom: 0.2rem;
}
.book-detail-author {
  font-size: 1.05rem;
  color: #333;
}
.book-detail-publisher {
  font-size: 0.98rem;
  color: #8b7a5a;
}
.book-detail-isbn {
  font-size: 0.92rem;
  color: #555;
}
/* タイトルプレート中央揃え用 */
.page-title-center {
  text-align: center;
}
/* ログハウス風ウッドテクスチャ背景 */
body {
  background: repeating-linear-gradient(
      180deg,
      #7b4a1e 0px, #6b3f1a 40px, #4e2c13 60px, #3a2410 70px
    ),
    linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.08) 100%);
  background-size: 100% 70px, 100% 100%;
  background-blend-mode: multiply;
}
/* ページタイトル中央揃え */
.page-title-center {
  text-align: center;
}
h1, .page-title {
    /* margin-left/right: auto; は不要 */
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  color: #fdf2df;
    text-shadow: 0 2px 8px #4e2c13, 0 1px 0 #bfa76f;
    background: #e2c48d;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(78,44,19,0.18);
  padding: 1.2rem 1.0rem;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.book-item {
  margin: 1rem;
  padding: 1rem;
  background-color: aliceblue;
  border: 1px solid #ccc;
}
.title {
  font-weight: bold;
  font-size: 1.2rem;
}
.publisher {
  color: #555;
  font-size: 0.9rem;
}

/* 本棚レイアウト */
#bookshelf {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  margin: 3rem auto 2rem auto;
  width: 100%;
  max-width: 900px;
  min-height: 260px;
  position: relative;
}

.book-item {
  width: 110px;
  min-width: 40px;
  max-width: 40px;
  height: 180px;
  background: #f8f4e6;
  border: 2px solid #bfa76f;
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 4px 12px rgba(80,60,30,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0.5rem 0.5rem 1.2rem 0.5rem;
  position: relative;
  transition: transform 0.2s;
}
.book-item:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 8px 24px rgba(80,60,30,0.18);
}
.book-cover {
  width: 90px;
  height: 130px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  background: #eee;
}
.title {
  font-size: 0.90rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.2rem;
  color: #5a3c1a;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: pre-line;
  letter-spacing: 0.05em;
  line-height: 1.2;
  height: 180px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  padding-top: 0;
}
.publisher {
  color: #8b7a5a;
  font-size: 0.85rem;
  text-align: center;
}

/* 棚板 */
#bookshelf::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  background: linear-gradient(180deg, #e2c48d 60%, #bfa76f 100%);
  border-radius: 0 0 12px 12px;
  z-index: 0;
}

@media (max-width: 600px) {
  #bookshelf {
    max-width: 100%;
    gap: 0.5rem;
    padding: 0 0.5rem;
    overflow-x: auto;
  }
  .book-item {
    width: 70px;
    min-width: 40px;
    max-width: 40px;
    height: 180px;
  }
  .book-cover {
    width: 55px;
    height: 100px;
  }
  .title {
    font-size: 0.9rem;
    height: 1400px;
  }
}