.shelf-section { padding: 20px 40px 60px; }

.shelf-frame {
  position: relative;
  padding-bottom: 16px;
  margin-bottom: 30px;
}
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 12px 10px;
  align-items: end;
  overflow: visible;
}
.shelf-frame::after {
  content: "";
  display: block;
  height: 12px;
  margin-top: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--wood-hi) 0%, var(--wood-lo) 100%);
  box-shadow: var(--shelf-shadow);
}

.load-more-wrap { display: flex; justify-content: center; margin-top: 8px; }
.load-more-btn {
  padding: 11px 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ivory);
  cursor: pointer;
  transition: all 0.15s ease;
}
.load-more-btn:hover { border-color: var(--brass); color: var(--brass); }
.load-more-btn:disabled { opacity: 0.5; cursor: default; }

.spine {
  height: 210px;
  border-radius: 3px 3px 1px 1px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 5px;
  cursor: pointer;
  position: relative;
  box-shadow: var(--spine-shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, min-width 0.22s ease, padding 0.22s ease;
  opacity: 0;
  animation: rise 0.45s ease forwards;
  overflow: hidden;
  z-index: 1;
}
.spine-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Noto Serif Ethiopic', 'Libre Caslon Display', serif;
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(236,230,214,0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 100%;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  transition: opacity 0.18s ease;
}
.spine-expanded-title {
  display: none;
  font-family: 'Noto Serif Ethiopic', 'Libre Caslon Display', serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(236,230,214,0.97);
  text-align: center;
  line-height: 1.35;
  padding: 4px 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  word-break: break-word;
  hyphens: auto;
}
@media (hover: hover) and (pointer: fine) {
  .spine:hover, .spine:focus-visible {
    transform: translateY(-12px) translateX(-6px);
    min-width: 120px;
    max-width: 220px;
    width: auto;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    z-index: 20;
    box-shadow: var(--spine-shadow-hover);
    outline: none;
  }
  .spine:hover .spine-title, .spine:focus-visible .spine-title { opacity: 0; position: absolute; pointer-events: none; }
  .spine:hover .spine-expanded-title, .spine:focus-visible .spine-expanded-title { display: block; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--dim);
}
.empty-state .display { font-size: 1.3rem; margin-bottom: 8px; color: var(--ivory); }
.empty-state .empty-icon { font-size: 2rem; margin-bottom: 12px; opacity: 0.7; }

/* Loading skeletons */
.shelf-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 12px 10px;
  align-items: end;
}
.spine-skeleton {
  height: 210px;
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-raised) 50%, var(--panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  opacity: 0.6;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
