* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: linear-gradient(180deg, #2c1810 0%, #1a0f0a 100%);
  color: #e8e8e8;
  min-height: 100vh;
  padding: 2rem;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #d4a574;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-family: 'Georgia', serif;
  letter-spacing: 0.05em;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 1rem;
  color: #a08060;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.bookshelf {
  background: linear-gradient(180deg, #5c3d2e 0%, #4a3020 50%, #3d2518 100%);
  border-radius: 4px;
  padding: 1.5rem 1.5rem 0 1.5rem;
  margin-bottom: 2rem;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  position: relative;
}

.shelf {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 1rem;
  min-height: 220px;
}

.shelf-base {
  height: 20px;
  background: linear-gradient(180deg, #6d4c3d 0%, #4a3020 40%, #3d2518 100%);
  margin: 0 -1.5rem;
  border-radius: 0 0 4px 4px;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.4),
    inset 0 2px 2px rgba(255, 255, 255, 0.1);
}

.book {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  padding: 1rem 0.5rem;
  border-radius: 3px 6px 6px 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    2px 2px 8px rgba(0, 0, 0, 0.4),
    inset -2px 0 4px rgba(0, 0, 0, 0.2),
    inset 2px 0 4px rgba(255, 255, 255, 0.1);
  position: relative;
  min-width: 45px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.book::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0%, transparent 100%);
  border-radius: 3px 0 0 3px;
}

.book::after {
  content: '';
  position: absolute;
  right: 0;
  top: 5%;
  bottom: 5%;
  width: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
}

.book:hover {
  transform: rotate(180deg) translateY(10px);
  box-shadow:
    4px 4px 12px rgba(0, 0, 0, 0.5),
    inset -2px 0 4px rgba(0, 0, 0, 0.2),
    inset 2px 0 4px rgba(255, 255, 255, 0.15);
}

/* Fantasy books - warm, aged colors */
.book.fantasy-1 {
  background: linear-gradient(90deg, #8b4513 0%, #a0522d 50%, #8b4513 100%);
  color: #ffd700;
  height: 180px;
}

.book.fantasy-2 {
  background: linear-gradient(90deg, #722f37 0%, #8b3a3a 50%, #722f37 100%);
  color: #ffefd5;
  height: 195px;
}

.book.fantasy-3 {
  background: linear-gradient(90deg, #2f4f4f 0%, #3d5c5c 50%, #2f4f4f 100%);
  color: #98fb98;
  height: 170px;
}

/* Sci-fi books - cooler, metallic colors */
.book.scifi-1 {
  background: linear-gradient(90deg, #1a1a3e 0%, #2a2a5e 50%, #1a1a3e 100%);
  color: #00ffff;
  height: 185px;
}

.book.scifi-2 {
  background: linear-gradient(90deg, #2d2d2d 0%, #3d3d3d 50%, #2d2d2d 100%);
  color: #ff6b6b;
  height: 175px;
}

/* Decorative books (non-clickable) */
.book.decorative {
  cursor: default;
  opacity: 0.6;
}

.book.decorative:hover {
  transform: rotate(180deg);
}

.book.deco-1 {
  background: linear-gradient(90deg, #3d3d1a 0%, #4a4a2a 50%, #3d3d1a 100%);
  color: #8b8b6b;
  height: 160px;
  min-width: 35px;
}

.book.deco-2 {
  background: linear-gradient(90deg, #4a3728 0%, #5a4738 50%, #4a3728 100%);
  color: #9a8778;
  height: 175px;
  min-width: 30px;
}

.book.deco-3 {
  background: linear-gradient(90deg, #1f3d3d 0%, #2f4d4d 50%, #1f3d3d 100%);
  color: #6f8d8d;
  height: 165px;
  min-width: 38px;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .book {
    min-width: 35px;
    font-size: 0.8rem;
    padding: 0.75rem 0.4rem;
  }

  .shelf {
    min-height: 180px;
    flex-wrap: wrap;
  }

  .book.fantasy-1 {
    height: 150px;
  }
  .book.fantasy-2 {
    height: 160px;
  }
  .book.fantasy-3 {
    height: 140px;
  }
  .book.scifi-1 {
    height: 155px;
  }
  .book.scifi-2 {
    height: 145px;
  }
  .book.deco-1 {
    height: 130px;
  }
  .book.deco-2 {
    height: 145px;
  }
  .book.deco-3 {
    height: 135px;
  }
}
