/* Library, catalog and existing interactive books. */
[hidden]#rp-library-continue, [hidden]#rp-library-empty, [hidden]#library-all-empty { display: none !important; }
.rp-door-book, .rp-door-portal { position: relative; flex: none; width: 72px; aspect-ratio: 2/3; box-shadow: var(--shadow-soft); }
.rp-door-book { display: flex; align-items: center; justify-content: center; border-radius: 5px 9px 9px 5px; background: linear-gradient(105deg, rgba(255,255,255,.09), transparent 26%), #32473a; color: var(--cover-ink); font-size: 11px; letter-spacing: .35em; padding-left: .35em; }
.rp-door-book::before, .rp-door-portal::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(239,230,210,.28); border-radius: 3px 6px 6px 3px; }
.rp-door-portal { display: block; margin-bottom: 12px; border-radius: 50% 50% 6px 6px / 33.4% 33.4% 6px 6px; background: radial-gradient(120% 55% at 50% 0%, rgba(255,255,255,.16), transparent 60%), linear-gradient(180deg, #443047, color-mix(in oklab, #443047 58%, black)); }
.rp-door-portal::before { inset: 5px; border-radius: 50% 50% 4px 4px / 33% 33% 4px 4px; }
.rp-world-chips .cat-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.rp-kind-chips [data-rp-kind] { display: inline-flex; align-items: center; gap: 5px; }
#rp-library { display: block; margin-top: 20px; }
.rp-library-empty { padding: 52px 24px; text-align: center; }
.rp-library-empty h2 { font-family: var(--font-serif); font-size: 28px; font-weight: 500; }
.rp-library-empty p { color: var(--ink2); }
#rp-library-empty .rp-empty-portal { position: relative; margin-inline: auto; }
#rp-library-empty .rp-empty-portal::after { content: "+"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--gold-text); font-family: var(--font-serif); font-size: 28px; }
.rp-library-all-empty { max-width: 620px; margin: 10px auto 0; padding: 30px 0 10px; }
.rp-library-all-empty h2 { margin: 24px 0 14px; font-size: 26px; font-weight: 600; }
.rp-library-all-empty > p { max-width: 460px; margin: 0 auto 20px; font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.rp-empty-doors { display: flex; align-items: flex-end; justify-content: center; gap: 16px; }
.rp-empty-doors > span { width: 64px; }
.rp-empty-doors .rp-door-portal { margin: 0; }
.rp-empty-door-plus { position: absolute; bottom: -11px; left: 50%; margin-left: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px dashed var(--line2); color: var(--ink2); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.rp-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rp-catalog-kicker { margin-bottom: 10px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); }
.rp-catalog-steps { margin: 10px 0 0; font-size: 12.5px; color: var(--ink3); }
.rp-catalog-shelf .rp-shelf-all { min-height: 44px; margin-top: 16px; padding: 12px 24px; border: 0; border-radius: 10px; background: var(--gold); color: var(--on-gold, #241d12); font-size: 15px; font-weight: 600; }
body.rp-book:has(.rp-first-waiting) .rp-book-role { display: none; }
.rp-first-waiting .gen-first-title { font-family: var(--font-serif); }
.rp-first-waiting .gen-first-status { margin-top: 28px; }
@media (min-width: 720px) {
  /* Keep the last builder action inside the viewport after nearest scrolling. */
  #view-new #create-manual { scroll-margin-bottom: 2px; }
}
@media (min-width: 960px) {
  #view-roleplay[data-rp-screen="shelf"] { margin-top: -4px; }
}
@media (max-width: 719.9px) {
  #view-roleplay[data-rp-screen="shelf"] { margin-inline: calc(14px - clamp(12px, 4vw, 40px)); }
}
@media (max-width: 719px) {
  #view-roleplay .rp-shell { padding: 14px 0 68px; }
}
