.dungeon-cover-stage {
  width: min(100%, calc((100dvh - 140px) * 1.24955));
  aspect-ratio: 1402/1122;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  view-transition-name: dungeon-volume;
}
.atlas-cover {
  width: 55%;
  height: 80%;
  padding: 22px 20px 22px 30px;
  border: 2px solid #a37a3e;
  border-left: 12px solid #382113;
  border-radius: 8px 16px 16px 8px;
  background:
    radial-gradient(ellipse at 35% 25%, #71482c66, transparent 70%),
    repeating-linear-gradient(12deg, #ffffff03 0 1px, transparent 1px 4px),
    #422818;
  box-shadow:
    inset 5px 0 10px #130b08aa,
    inset 0 0 0 5px #24170f,
    5px 3px 0 #b89d6b,
    8px 6px 0 #4a301c,
    0 20px 28px #130b0866;
  color: #e4be7c;
}
.atlas-cover-frame {
  height: 100%;
  border: 1px solid #bc925655;
  outline: 1px solid #bc925644;
  outline-offset: 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding: 16px;
}
.atlas-cover-frame img {
  width: 90%;
  height: auto;
}
.atlas-cover-frame h1 {
  font:
    clamp(24px, 3vw, 40px)/1.2 Georgia,
    serif;
  letter-spacing: 0.03em;
}
.atlas-cover-frame p {
  font:
    12px/1.7 Georgia,
    serif;
  color: #cda972;
}
.atlas-cover-frame > p:first-child {
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.18em;
}
.atlas-flourish {
  font-size: 32px;
}
.atlas-invitation {
  font:
    14px/1.6 Georgia,
    serif;
  color: #f2dbb1;
  text-align: center;
  padding: 0 20px;
}
@view-transition {
  navigation: auto;
}
.dungeon-book {
  view-transition-name: dungeon-volume;
}
::view-transition-old(dungeon-volume) {
  animation: atlas-out 0.18s ease both;
}
::view-transition-new(dungeon-volume) {
  animation: atlas-in 0.3s ease both;
}
@keyframes atlas-out {
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}
@keyframes atlas-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(dungeon-volume),
  ::view-transition-new(dungeon-volume) {
    animation: none;
  }
}
@media (max-width: 1000px) {
  .dungeon-cover-stage {
    width: 100%;
    max-width: 920px;
    margin: auto;
  }
}
@media (max-width: 650px) {
  .dungeon-cover-stage {
    aspect-ratio: auto;
    min-height: 480px;
  }
  .atlas-cover {
    width: min(85%, 340px);
    height: 410px;
    padding: 20px;
  }
  .atlas-cover-frame {
    gap: 18px;
  }
  .atlas-cover-frame h1 {
    font-size: 32px;
  }
  .atlas-invitation {
    font-size: 13px;
  }
}

/* Illustrated cover; lettering stays editable and separate from the artwork. */
.atlas-cover {
  position: relative;
  width: auto;
  height: 87%;
  aspect-ratio: 2/3;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 15px 12px #130b0877);
}
.atlas-cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: polygon(
    4% 7%,
    7% 5%,
    90% 5%,
    93% 6%,
    96% 8%,
    96% 41%,
    99% 42%,
    99% 52%,
    96% 54%,
    96% 92%,
    94% 94%,
    7% 94%,
    3% 92%,
    3% 8%
  );
}
.atlas-cover-frame {
  position: absolute;
  inset: 17% 19% 20% 20%;
  height: auto;
  border: 0;
  outline: 0;
  padding: 0;
  gap: 14px;
  color: #e4be7c;
  text-shadow: 0 2px 2px #170c07;
}
.atlas-cover-frame img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 2px #170c07);
}
.atlas-cover-frame h1 {
  font-size: clamp(23px, 2.5vw, 37px);
  line-height: 1.15;
}
.atlas-cover-frame p {
  font-size: 11px;
}
.atlas-cover-frame > p:first-child {
  font-size: 8px;
  letter-spacing: 0.14em;
}
.atlas-flourish {
  font-size: 24px;
}
.dungeon-cover-stage {
  gap: 8px;
}
.atlas-invitation {
  font-size: 13px;
}
@media (max-width: 650px) {
  .atlas-cover {
    width: min(100%, 340px);
    height: auto;
    aspect-ratio: 2/3;
  }
  .atlas-cover-frame {
    gap: 14px;
  }
  .atlas-cover-frame h1 {
    font-size: 30px;
  }
}
/* Match the visible cover to the open spread's vertical extent.
   The cover image has 5% top and 6% bottom margins within its canvas. */
@media (min-width: 651px) {
  .dungeon-cover-stage {
    position: relative;
    display: block;
  }
  .atlas-cover {
    position: absolute;
    height: 104%;
    top: -1.6%;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    aspect-ratio: 2/3;
  }
  .atlas-invitation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 4px 16px 16px;
  }
}
