.dungeon-journal {
  margin: 0;
  color: #432b18;
  font-family: Georgia, "Times New Roman", serif;
  background:
    linear-gradient(#30201544, #2b2018b8),
    url("/static/assets/hero-background.jpg") center/cover fixed;
  min-height: 100dvh;
}
.dungeon-nav {
  height: 76px;
  padding: 10px 5vw;
  display: flex;
  align-items: center;
  gap: 40px;
  color: #f5dfb3;
  background: linear-gradient(#27190eee, transparent);
}
.dungeon-nav > a {
  width: 180px;
  flex-shrink: 0;
}
.dungeon-nav img {
  width: 100%;
  height: auto;
}
.dungeon-nav nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
}
.dungeon-nav nav a {
  padding: 8px 0;
}
.dungeon-nav [aria-current] {
  border-bottom: 1px solid #d6ae64;
  color: #ffdfa3;
}
.dungeon-shell {
  max-width: 1480px;
  margin: auto;
  padding: 0 24px 18px;
}
.dungeon-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #ead7b6;
  font:
    10px/1.5 Arial,
    sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 12px 12px;
}
.dungeon-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
}
/* Scale the whole spread uniformly; page coordinates remain inside the artwork. */
.dungeon-book {
  position: relative;
  flex: none;
  width: min(calc(100% - 240px), calc((100dvh - 122px) * 1.24955));
  aspect-ratio: 1402/1122;
  background: url("/static/assets/dungeons/book-clean.png") center/contain
    no-repeat;
  filter: drop-shadow(0 14px 12px #180c0766);
}
.dungeon-portrait {
  position: absolute;
  left: 9%;
  top: 13%;
  width: 36%;
  bottom: 17%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 0;
}
.dungeon-portrait-art {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* Mask the image's own box, not a letterboxed full-page element. */
.dungeon-portrait img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 2/3;
  object-fit: contain;
  mix-blend-mode: multiply;
  mask-image: radial-gradient(
    ellipse at center,
    #000 48%,
    #000c 65%,
    transparent 75%
  );
}
.dungeon-portrait h1 {
  font-size: clamp(24px, 2.2vw, 36px);
  line-height: 1.12;
  margin: 12px 0 10px;
}
.dungeon-portrait p {
  font-size: 13px;
  font-style: italic;
  color: #785c3a;
  margin: 0;
  line-height: 1.5;
}
.dungeon-details {
  position: absolute;
  left: 55%;
  right: 12%;
  top: 14%;
  bottom: 18%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #a28351 transparent;
  padding: 0 10px 12px 0;
  line-height: 1.65;
  font-size: 14px;
}
.dungeon-details h2 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 400;
  margin: 0 0 14px;
}
.dungeon-kicker {
  font:
    9px/1.5 Arial,
    sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #866536;
  margin: 0 0 12px;
}
.dungeon-introduction {
  font-size: 15px;
}
.dungeon-section {
  border-top: 1px solid #ac875c66;
  margin-top: 24px;
  padding-top: 20px;
}
.dungeon-section p {
  margin: 0 0 12px;
}
.dungeon-section ul {
  list-style: disc;
  padding-left: 18px;
  margin: 10px 0;
}
.dungeon-section li {
  padding-left: 3px;
  margin: 9px 0;
}
.dungeon-note {
  font-size: 12px;
  font-style: italic;
  color: #785c3a;
  margin-top: 28px;
}
.dungeon-journal :focus-visible {
  outline: 2px solid #a77b37;
  outline-offset: 4px;
}
/* A parchment index, rather than a stretched half of the decorated book. */
.dungeon-library {
  width: 220px;
  flex: none;
  margin-top: 32px;
  padding: 28px 14px;
  color: #f2dfb8;
  border-top: 1px solid #c5a06466;
  border-bottom: 1px solid #c5a06444;
  background: linear-gradient(90deg, #24170c66, #24170c22);
  border-radius: 2px;
}
.dungeon-library h2 {
  font-size: 27px;
  font-weight: 400;
  margin: 0 0 8px;
}
.dungeon-library .chapter-number,
.dungeon-library .library-heading p:not(.chapter-number) {
  color: #d7bc8e;
}
.dungeon-library .ornament {
  margin: 18px 0;
}
.dungeon-list {
  overflow: auto;
  max-height: 55dvh;
  scrollbar-width: thin;
}
.dungeon-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: #e5cda1;
  border-bottom: 1px solid #bc955b44;
}
.dungeon-list-item[aria-current="page"] {
  color: #ffe2a4;
}
.dungeon-list-item img {
  width: 48px;
  height: 66px;
  object-fit: cover;
  mask-image: radial-gradient(ellipse, #000 50%, transparent 76%);
}
.dungeon-list-item strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 400;
}
.dungeon-list-item small {
  display: block;
  font:
    10px/1.5 Arial,
    sans-serif;
  color: #d1b78e;
  margin-top: 7px;
}
.dungeon-library-note {
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
  font-style: italic;
  color: #d7bc8e;
}
@media (min-width: 1001px) and (max-height: 650px) {
  .dungeon-book {
    width: min(calc(100% - 240px), 850px);
  }
}
@media (max-width: 1000px) {
  .dungeon-layout {
    display: block;
  }
  .dungeon-library {
    width: auto;
    margin: 0 12px 10px;
    padding: 6px 14px;
  }
  .dungeon-library .library-heading,
  .dungeon-library .ornament,
  .dungeon-library-note {
    display: none;
  }
  .dungeon-list {
    display: flex;
  }
  .dungeon-list-item {
    border: 0;
    padding: 4px 0;
  }
  .dungeon-list-item img {
    width: 32px;
    height: 44px;
  }
  .dungeon-list-item strong {
    font-size: 17px;
  }
  .dungeon-list-item small {
    margin-top: 2px;
  }
  .dungeon-book {
    width: 100%;
    max-width: 920px;
    margin: auto;
  }
}
@media (max-width: 650px) {
  .dungeon-nav {
    height: auto;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 24px;
  }
  .dungeon-nav > a {
    width: 150px;
  }
  .dungeon-nav nav {
    gap: 20px;
    font-size: 13px;
  }
  .dungeon-shell {
    padding: 8px 10px 24px;
  }
  .dungeon-heading {
    font-size: 8px;
    letter-spacing: 0.04em;
  }
  .dungeon-book {
    background: none;
    aspect-ratio: auto;
    filter: none;
  }
  .dungeon-portrait,
  .dungeon-details {
    position: relative;
    inset: auto;
    width: auto;
    background: #eddfbd;
    padding: 28px;
    margin: 0 8px;
    border-radius: 3px;
    box-shadow: 0 5px 15px #170d0744;
  }
  .dungeon-portrait-art {
    height: 360px;
    flex: none;
  }
  .dungeon-portrait img {
    max-height: 360px;
  }
  .dungeon-portrait h1 {
    font-size: 32px;
  }
  .dungeon-details {
    margin-top: 12px;
    max-height: 65dvh;
    font-size: 15px;
  }
  .dungeon-details h2 {
    font-size: 25px;
  }
}
@media (min-width: 1001px) {
  .dungeon-library {
    aspect-ratio: 701/1122;
    min-height: 0;
    padding: 35px 22px 40px;
    color: #432b18;
    border: 0;
    background: url("/static/assets/dungeons/book-clean.png") left center/200%
      100% no-repeat;
    filter: drop-shadow(0 8px 8px #180c0755);
  }
  .dungeon-library .chapter-number,
  .dungeon-library .library-heading p:not(.chapter-number) {
    color: #785c3a;
  }
  .dungeon-library .ornament {
    margin: 14px 0;
  }
  .dungeon-list {
    max-height: 150px;
  }
  .dungeon-list-item,
  .dungeon-list-item[aria-current="page"] {
    color: #573717;
  }
  .dungeon-list-item small,
  .dungeon-library-note {
    color: #785c3a;
  }
  .dungeon-list-item strong {
    font-size: 18px;
  }
  .dungeon-library-note {
    display: none;
  }
}
/* Match the character journal's navigation, shell and column origins.
   Keep the larger dungeon logo and the undistorted book artwork. */
@media (min-width: 1100px) and (min-height: 650px) {
  .dungeon-nav {
    height: 70px;
    min-height: 70px;
    padding: 8px 4vw;
    gap: 42px;
  }
  .dungeon-nav > a {
    width: 180px;
  }
  .dungeon-nav nav {
    gap: 30px;
  }
  .dungeon-shell {
    max-width: 1440px;
    width: 100%;
    padding: 0 3vw 12px;
    margin: 0 auto;
  }
  .dungeon-heading {
    padding: 0;
    margin-bottom: 0;
    min-height: 25px;
    align-items: center;
  }
  .dungeon-layout {
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
    gap: 0;
    align-items: start;
  }
  .dungeon-library {
    width: auto;
    margin: 15px -8px 12px 0;
    padding: 40px 23px 35px;
  }
  .dungeon-book {
    width: min(100%, calc((100dvh - 125px) * 1.24955));
    margin: 0;
    justify-self: start;
  }
}
