.shelf {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  width: 500px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
  .bookshelf-top {
    width: 100%;
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
  }
 .bookshelf-bottom {
    width: 100%;
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row-reverse;
  }
  .book {
    width: 50px;
    height: 280px;
    position: relative;
    margin-left: 1px;
    transform-style: preserve-3d;
    transform: translateZ(0) rotateY(0);
    transition: transform 1s;
  }
  
  .side {
    position: absolute;
    border: 2px solid black;
    border-radius: 3px;
    font-weight: bold;
    color: black;
    text-align: center;
    transform-origin: center left;
  }
  
  .spine {
    position: relative;
    width: 50px;
    height: 280px;
    transform: rotateY(0) translateZ(0);
  }
  
  .spine-title {
    margin: 2px;
    position: absolute;
    top: 0;
    left: 0;
    font-family: CelticTime;
    font-size: 24px;
    color: white;
    letter-spacing: 0.07rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
  }
  
  .spine-author {
    position: absolute;
    color: goldenrod;
    bottom: 0;
    left: 20%; /* no idea why 20% centers it */
  }
  
  .top {
    width: 50px;
    height: 190px;
    top: -2px;  /* hmm, why -2 and not 0? */
    background-image: linear-gradient(90deg, white 90%, gray 10%);
    background-size: 5px 5px;
    transform: rotateX(90deg) translateZ(95px) translateY(-95px);
  }
  
  .cover {
    width: 190px;
    height: 280px;
    top: 0;
    background-image: url("https://picsum.photos/190/280");
    background-size: contain;
    background-repeat: round;
    left: 50px;
    transform: rotateY(90deg) translateZ(0);
    transition: transform 1s;
  }
  
  .book:hover {
    z-index: 1;
    transform: rotateX(-25deg) rotateY(-40deg) rotateZ(-15deg) translateY(50px)
      translateX(-30px);
  }

.bookcontainer {
  grid-row: 1;
  grid-column: 1;
  z-index: 10;
  margin-left: 60px;
  position: absolute;
  top: -100%;
  transition: all 200ms ease-in;
}
.bookcontainer.reading {
  top: 20%;
  transition: all 200ms ease-out;
}
.openbook {
	width: 350px;
	height: 450px;
	position: absolute;
	transition-duration: 1s;
	perspective: 1500;
}
.pagecheck {
	display: none;
}
.front-cover, .back-cover {
	background-image:url(../images/bookcover.png);
	background-size:100% 100%;
  width: 100%;
	height: 100%;
	box-shadow: 0 0 5px rgba(41, 41, 41, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	transform-origin: center left;
}
.front-cover {
	position: absolute;
	z-index: 100;
	transition: transform 1s, z-index 1s 0.2s;
}
.front-cover label {
	width: 100%;
	height: 100%;
	cursor: pointer;
}
.back-cover {
	position: relative;
	z-index: -1;
}
.page {
	position: absolute;
    color: black;
  background-size: cover;
  font-family: CelticTime;
	width: 337px;
	height: 430px;
	margin-top: 10px;
	transform-origin: left;
	transform-style: preserve-3d;
	transform: rotateY(0deg);
	transition-duration: 0.5s;
}
.page h3 {
  margin-bottom: 0;
}
.toc {
  color:black;
  list-style-type:none;
  font-family:CelticTime;
  font-size: 24px;
  padding:0;
}
.toc li {
  text-decoration: none;
  display: grid;
  grid-template-columns: auto max-content;
  align-items: end;
}
.toc .charname {
  text-align: left;
  position:relative;
  overflow: hidden;
}
.toc .leaders::after {
  position: absolute;
  padding-left: .25ch;
  padding-right: 1ch;
  content: " . . . . . . . . . . . . . . . . . . . ";
  text-align: right;
}
.toc li:hover {
  cursor: pointer;
}
.page {
  background-size:100% 100%;
}
.page p {
  margin: 0;
  font-size: 22px;
  padding: 5px 15px;
  text-align: justify;
}
.page .class {
  text-align: center;
  text-indent: 0;
}
.page .traits-list {
  margin: 0;
  margin-top: -5px;
  padding-left: 5px;
  list-style-type: none;
  list-style-position: inside;
  font-family: TinyUnicode;
}
.page .traits-list li {
  margin: 0;
  padding: 0;
}
.profile-summary {
  display: flex;
  margin-top: 5px;
  justify-content: center;
  height:110px;
}
.page .profile {
  width: 110px;
  height: 110px;
}
.page img {
  width: 152px;
  height: 240px;
  background-color: black;
  clip-path: polygon(0% 15%, 15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%);
}
.page .personality img {
  clip-path: polygon(0% 10%, 15% 0%, 85% 0%, 100% 10%, 100% 90%, 85% 100%, 15% 100%, 0% 90%);
}
.photo {
  background-image:url(../images/photoframe.webp);
  background-size: 100% 100%;
  margin-right: 5px;
  box-shadow: 0 0 5px rgba(99, 98, 98, 0.2);
}
.personality .photo {
  float: right;
  margin-left: 10px;
  height:240px;
  background-size: 100% 50%;
}
.page .personality {
  margin-left: -15px;
}
.season-title, .date {
  margin: 0;
  padding: 0;
  margin-top: 15px;
}
.page .date {
  text-align: left;
  margin-left: 10px;
  font-family: BitFantasy;
  font-size: 28px;
}
.dv-list, .dv-list li{
  margin:0;
  padding:0;
  margin-right: 5px;
  line-height: 20px
}
.dv-list {
  margin-left: 40px;
}
.front-page {
	position: absolute;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	box-sizing: border-box;
	padding: 1rem;
}
.back-page {
	transform: rotateY(180deg);
	position: absolute;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	z-index: 99;
}
.closebook {
  position: absolute;
  transform: translate(135px, -40px);
  transition-duration: 1s;
}
.next, .prev {
	position: absolute;
	bottom: 10px;
	cursor: pointer;
}
.next {
	right: 1em;
}
.prev {
	left: 1em;
}
.page1 {
	z-index: 7;
  background-image:url(../images/page.webp);
}
.page2 {
	z-index: 6;
  background-image:url(../images/pageflip.webp);
}
.page3 {
	z-index: 5;
  background-image:url(../images/page.webp);
}
.page4 {
	z-index: 4;
  background-image:url(../images/pageflip.webp);
}
.page5 {
	z-index: 3;
  background-image:url(../images/page.webp);
}
.page6 {
	z-index: 2;
  background-image:url(../images/pageflip.webp);
}
.page7 {
	z-index: 1;
  background-image:url(../images/page.webp);
}
.checkbox-cover:checked ~ .openbook{
	transform: translateX(200px);
}
.checkbox-cover:checked ~ .openbook .front-cover {
	transition: transform 1.5s, z-index 1s;
	transform: rotateY(-180deg);
	z-index: 1;
}
.checkbox-cover:checked ~ .openbook .page {
	box-shadow: 0 0 5px rgba(99, 98, 98, 0.2);
}
.checkbox-page1:checked ~ .openbook .page1 {
	transform: rotateY(-180deg);
	z-index: 2;
}
.checkbox-page1:checked ~ .openbook .front-cover {
  pointer-events: none;
}
.checkbox-page2:checked ~ .openbook .page2 {
	transform: rotateY(-180deg);
	z-index: 3;
}
.checkbox-page3:checked ~ .openbook .page3 {
	transform: rotateY(-180deg);
	z-index: 4;
}
.checkbox-page4:checked ~ .openbook .page4 {
	transform: rotateY(-180deg);
	z-index: 5;
}
.checkbox-page5:checked ~ .openbook .page5 {
	transform: rotateY(-180deg);
	z-index: 6;
}
.checkbox-page6:checked ~ .openbook .page6 {
	transform: rotateY(-180deg);
	z-index: 7;
}
.checkbox-page7:checked ~ .openbook .page7 {
	transform: rotateY(-180deg);
	z-index: 8;
}