/* Unified library and three primary activities. Scoped to avoid the editor/3D UI. */
.hatchling-v2 #collections .collection-books {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1130px;
  margin-inline: auto;
}
.book-library {
  --book-ink: #285462;
  box-sizing: border-box;
  width: min(1210px, 96vw);
  max-width: 96vw;
  height: min(920px, 94dvh);
  max-height: 94dvh;
  padding: 0;
  border: 1px solid #d7c69c;
  border-radius: 25px;
  color: var(--book-ink);
  background: #fffaf0;
  box-shadow: 0 22px 100px #193e5a55;
  overflow: hidden;
  font: inherit;
  overscroll-behavior: contain;
}
.book-library[open] {
  display: flex;
  flex-direction: column;
}
.book-library::backdrop {
  background: #1a3e5c99;
  backdrop-filter: blur(5px);
}
.book-library * {
  box-sizing: border-box;
}
.book-library button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.book-library button:focus-visible,
.book-library summary:focus-visible,
.book-library input:focus-visible {
  outline: 3px solid #287c98;
  outline-offset: 3px;
}
.book-library-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px 12px;
  background: #fffaf0;
  flex-shrink: 0;
}
.book-library-header h2 {
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.15;
  margin: 0 0 9px;
}
.book-library-header p {
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  color: #587268;
  max-width: 720px;
}
.book-close {
  position: static !important;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 1px solid #c8d5c2;
  border-radius: 50%;
  background: white;
  font-size: 28px !important;
}
.book-search {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 28px 18px;
  position: relative;
  flex-shrink: 0;
}
.book-search input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 10px 15px;
  border: 1px solid #c2d0c3;
  border-radius: 14px;
  background: white;
  color: #285462;
  font: inherit;
  font-size: 16px;
}
.book-search button {
  height: 44px;
  min-width: 44px;
  border: 1px solid #c2d0c3;
  border-radius: 13px;
  background: white;
}
.book-results {
  margin: 0 0 0 8px;
  white-space: nowrap;
  font-size: 13px;
  color: #587268;
}
.book-search [hidden] {
  display: none;
}
.book-library-body {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 23px;
  padding: 0 28px 26px;
  overflow-y: auto;
  min-height: 0;
  align-items: start;
  scrollbar-gutter: stable;
}
.book-tree {
  position: sticky;
  top: 0;
  max-height: 100%;
  font-size: 14px;
  background: #f0f2e4;
  border: 1px solid #dce2cc;
  border-radius: 16px;
  padding: 10px;
}
.book-tree details {
  margin: 3px 0 8px;
}
.book-tree summary {
  cursor: pointer;
  font-weight: 800;
  padding: 10px 6px;
  min-height: 40px;
}
.book-tree button {
  display: block;
  min-height: 40px;
  width: 100%;
  font-size: 13px;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: transparent;
  line-height: 1.35;
}
.book-tree button:hover,
.book-tree [aria-current="page"] {
  background: #fffdf6;
  box-shadow: 0 1px 3px #9ea98c44;
}
.book-tree .book-show-all {
  font-weight: 800;
  font-size: 14px;
  border: 1px solid #c2d0b4;
  background: #fffdf6;
  margin-bottom: 9px;
}
.book-shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}
.book-cover {
  position: relative;
  min-width: 0;
  padding: 0 0 14px;
  text-align: left;
  border: 1px solid #d9d6b8;
  border-radius: 18px;
  background: #fffef9;
  box-shadow: 0 4px 0 #dfe2cf;
  overflow: hidden;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.book-cover:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 #d3dfc7;
}
.book-cover:active {
  transform: translateY(1px);
}
.book-cover-image {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  height: 176px;
  margin: 6px 6px 12px;
  background: radial-gradient(ellipse, #fff 35%, #f0f4e7);
  border-radius: 13px;
  overflow: hidden;
}
.book-cover-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.book-cover strong {
  font-size: 17px;
  line-height: 1.25;
  display: block;
  padding: 0 13px;
  margin: 0 0 6px;
}
.book-cover small {
  display: block;
  font-size: 13px;
  color: #55756b;
  padding: 0 13px;
}
.book-current {
  position: absolute;
  bottom: 11px;
  right: 12px;
  font-size: 15px;
  color: #267c66;
}
.book-badge {
  position: absolute;
  left: 6px;
  top: 6px;
  background: #fff1d6;
  border: 1px solid #ddbc7a;
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: bold;
  color: #80552b;
}
.book-empty {
  grid-column: 1/-1;
  padding: 30px;
  line-height: 1.6;
  border: 1px dashed #b9c6b2;
  border-radius: 16px;
}
.book-empty button {
  background: white;
  border: 1px solid #c0ccb6;
  border-radius: 14px;
  padding: 12px 20px;
  min-height: 44px;
}
.book-breadcrumb {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1200px;
  margin: 10px auto 16px;
  padding-inline: 18px;
  color: #315c64;
}
.book-breadcrumb button {
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  color: inherit;
  background: #fffdf5;
  border: 1px solid #b6c6b0;
  border-radius: 14px;
  padding: 8px 15px;
  cursor: pointer;
}
.book-breadcrumb strong {
  font-size: 18px;
  line-height: 1.2;
}
@media (max-width: 900px) {
  .book-library-body {
    grid-template-columns: 175px minmax(0, 1fr);
    gap: 14px;
    padding-inline: 18px;
  }
  .book-library-header {
    padding: 20px 18px 10px;
  }
  .book-search {
    padding-inline: 18px;
  }
  .book-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
  .book-cover-image {
    height: 164px;
  }
  .book-cover strong {
    font-size: 16px;
  }
}
@media (max-width: 600px) {
  .hatchling-v2 #collections .collection-books {
    grid-template-columns: 1fr;
    max-width: 470px;
  }
  .hatchling-v2 #collections .hub-card {
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
    border-radius: 21px;
  }
  .hatchling-v2 #collections .hub-card-image {
    aspect-ratio: auto;
    height: 100%;
    min-height: 134px;
  }
  .hatchling-v2 #collections .hub-card-image img {
    object-fit: cover;
    height: 100%;
  }
  .hatchling-v2 #collections .hub-card-copy {
    min-height: 134px;
    align-self: center;
    padding: 20px 12px;
  }
  .hatchling-v2 #collections .hub-card-copy strong {
    font-size: 19px;
    padding-right: 0;
  }
  .hatchling-v2 #collections .hub-card-copy small {
    font-size: 12px;
    line-height: 1.5;
    padding-right: 15px;
  }
  .hatchling-v2 #collections .hub-play {
    top: auto;
    bottom: 10px;
    right: 10px;
  }
  .book-library {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .book-library-header {
    padding: 16px 15px 9px;
  }
  .book-library-header h2 {
    font-size: 24px;
  }
  .book-library-header p {
    font-size: 13px;
  }
  .book-search {
    padding: 7px 15px 14px;
    flex-wrap: wrap;
    gap: 7px;
  }
  .book-results {
    flex: 0 0 100%;
    margin: 0;
    font-size: 12px;
  }
  .book-library-body {
    display: flex;
    flex-direction: column;
    padding: 0 15px 25px;
    gap: 15px;
  }
  .book-tree {
    position: static;
    width: 100%;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: flex-start;
    background: #edf1e3;
  }
  .book-tree .book-show-all {
    width: auto;
    font-size: 13px;
    min-height: 40px;
    margin: 0;
  }
  .book-tree details {
    margin: 0;
    flex: 1 0 auto;
  }
  .book-tree summary {
    font-size: 12px;
    padding: 10px 8px;
  }
  .book-tree details[open] {
    flex-basis: 100%;
    border-top: 1px solid #d6dec9;
  }
  .book-tree details[open] button {
    display: inline-block;
    width: auto;
    padding: 8px 10px;
    margin: 2px;
    border: 1px solid #d3ddc7;
    font-size: 12px;
  }
  .book-shelf {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
  .book-cover-image {
    height: 149px;
    margin-bottom: 10px;
  }
  .book-cover strong {
    font-size: 15px;
    padding-inline: 10px;
  }
  .book-cover small {
    padding-inline: 10px;
    font-size: 12px;
  }
  .book-breadcrumb {
    gap: 11px;
    padding-inline: 12px;
    margin: 8px auto;
  }
  .book-breadcrumb button {
    font-size: 13px;
    padding: 8px 11px;
    flex-shrink: 0;
  }
  .book-breadcrumb strong {
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .book-cover {
    transition: none;
  }
}
#game[data-coloring-view="mine"] .book-breadcrumb strong {
  display: none;
}
#game [data-filter][hidden] {
  display: none;
}
