.bookshelf {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 40px 0;
  padding-inline: 24px; /* ⬅ 좌우에 여유를 줌 */
  box-sizing: border-box;
  max-width: 100%;
}


.book {
  flex: 0 0 auto;
  width: 120px;
  max-width: 100%;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.book:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.book img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
  background-color: #fff;
}

/* 책 제목은 hover 시에만 툴팁처럼 표시 */
.book-title {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.book:hover .book-title {
  opacity: 1;
}

@media (max-width: 480px) {
  .book {
    width: 100px;
  }
}