* {
  box-sizing: border-box;
}

:root {
  --shelf-back: rgba(13, 8, 5, 0.3);
  --text: #f4ead9;
  --muted: #cdbda7;
  --wood-top: #765035;
  --wood-mid: #563720;
  --wood-dark: #2f1c10;
}

html {
  min-height: 100%;
  color: #f4ead9;
  background:
    radial-gradient(circle at 50% -10%, rgba(151, 105, 65, 0.2), transparent 42%),
    #211711;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-width: 0;
  margin: 0;
}

.public-shelf-shell {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 48px 0 72px;
}

.public-shelf-header {
  margin-bottom: 36px;
}

.public-shelf-eyebrow,
.public-shelf-summary {
  margin: 0;
  color: #cdbda7;
}

.public-shelf-eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.public-shelf-header h1 {
  margin: 8px 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.2;
}

.public-shelf-navigation {
  margin-top: 18px;
}

.public-shelf-navigation a {
  color: #f2d69f;
  text-underline-offset: 4px;
}

.public-view-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.public-view-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.public-view-controls select,
.public-view-controls button {
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid rgba(222, 202, 172, 0.26);
  border-radius: 5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
}

.public-view-controls button {
  cursor: pointer;
}

.public-shelf-row {
  min-width: 0;
}

.public-shelf-books {
  overscroll-behavior-inline: contain;
}

.public-book {
  --book-width: 34px;
  --book-height: 204px;
  --spine-bg: #73543e;
  --spine-fg: #f7f2e9;
  --band-color: rgba(239, 227, 204, 0.82);
  --accent-color: rgba(255, 255, 255, 0.24);
  --band-offset: 56px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: flex-end;
  width: var(--book-width);
  height: var(--book-height);
  overflow: hidden;
  border-radius: 1px 1px 0 0;
  color: var(--spine-fg);
  background: var(--spine-bg);
  box-shadow:
    inset 3px 0 6px rgba(255, 255, 255, 0.18),
    inset -4px 0 8px rgba(0, 0, 0, 0.4),
    -3px 0 5px -1px rgba(0, 0, 0, 0.26),
    4px 0 6px -1px rgba(0, 0, 0, 0.34),
    0 4px 6px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--spine-lean, 0deg));
  transform-origin: bottom;
  cursor: default;
  user-select: none;
}

.public-book.has-spine-spec::before {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 12%),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.2) 0%,
      rgba(0, 0, 0, 0.06) 8%,
      rgba(255, 255, 255, 0.12) 20%,
      transparent 40%,
      transparent 68%,
      rgba(0, 0, 0, 0.06) 88%,
      rgba(0, 0, 0, 0.18) 100%
    );
  pointer-events: none;
  content: "";
}

.public-book.has-spine-spec .spine-spec {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.public-shelf-name-shell {
  position: absolute;
  left: 12px;
  top: -11px;
  z-index: 2;
  pointer-events: none;
}

.public-shelf-name-label {
  display: block;
  padding: 1px 7px 1px 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.public-shelf-empty {
  margin: 36px 0 0;
  padding: 26px;
  border: 1px solid rgba(222, 202, 172, 0.18);
  border-radius: 10px;
  color: #cdbda7;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

@media (max-width: 600px) {
  .public-shelf-shell {
    width: min(100% - 20px, 1120px);
    padding: 32px 0 48px;
  }

  .public-shelf-header {
    margin-bottom: 24px;
  }

}
