.saved-monster-card:is([data-open-saved-character], [data-open-saved-monster]) {
  background:
    radial-gradient(ellipse at 45% 42%, #b59b8194, #8c6a49aa),
    #d1ae7f url("../backgrounds/parchment-folds-v1.webp") center / cover no-repeat;
}

.creature-illustration {
  --engraved-parchment: url("../backgrounds/parchment-engraving-wide-v2.webp");
  display: grid;
  place-items: center;
  min-height: 156px;
  margin: 0 0 16px;
  padding: 22px 10px;
  border: 1px solid #957145;
  border-radius: 12px;
  background:
    linear-gradient(#6a4a3024, #6a4a3024),
    #d1ae7f var(--engraved-parchment) center / 100% 100% no-repeat;
  box-shadow: inset 0 0 24px #5c341a28;
}

.creature-illustration img {
  display: block;
  width: 54%;
  max-height: min(272px, 40vh);
  object-fit: contain;
}

.creature-illustration img,
.creature-card-art img {
  filter: grayscale(1) sepia(1) saturate(1.32) hue-rotate(-11deg) contrast(1.04) brightness(1.02);
}

@media (max-width: 650px) {
  .creature-illustration {
    --engraved-parchment: url("../backgrounds/parchment-engraving-square-v2.webp");
    aspect-ratio: 1.16;
    padding-block: 10px;
  }

  .creature-illustration img {
    max-height: min(252px, 62vw, 40vh);
  }
}

.saved-monster-card:is([data-open-saved-character], [data-open-saved-monster]) {
  --ink: #fff2df;
  --muted: #efdbc1;
  isolation: isolate;
  overflow: hidden;
  border-color: #99754c;
  color: var(--ink);
  height: 164px;
  min-height: 164px;
  max-height: 164px;
  padding: 10px 38px 10px 12px;
  gap: 4px;
}

.saved-monster-card:is([data-open-saved-character], [data-open-saved-monster])::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, #21170ff2, #21170fe0 44%, #21170fc7 58%, transparent 85%);
  pointer-events: none;
}

@media (min-width: 901px) {
  .character-library-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.saved-monster-card:has(> .creature-card-art) {
  padding-inline-end: max(38px, 35%);
}

.saved-monster-card > .creature-card-art {
  position: absolute;
  inset-block: 6px;
  inset-inline: 42% 6px;
  z-index: -2;
  pointer-events: none;
}

.creature-card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right top;
}

.saved-monster-card:is([data-open-saved-character], [data-open-saved-monster]) > :is(span, em, small) {
  font-size: 13px;
}

.saved-monster-card:is([data-open-saved-character], [data-open-saved-monster]) > strong {
  font-size: 18px;
}

.library-card-preview[data-open-saved-monster] > strong {
  max-height: 4.05em;
}

.saved-monster-card:is([data-open-saved-character], [data-open-saved-monster]) > .card-remove {
  top: auto;
  right: 8px;
  bottom: 8px;
  background: #382719d9;
  color: #fff0d6;
}

.saved-monster-card:is([data-open-saved-character], [data-open-saved-monster]) > .card-remove:hover {
  background: #853a2d;
}

.creature-illustration {
  position: relative;
}

.creature-illustration .creature-class-sigil,
.creature-card-art .creature-class-sigil {
  position: absolute;
  inset: 0 0 auto auto;
  width: 36px;
  height: 36px;
  filter: none;
}

.creature-illustration .creature-class-sigil {
  inset: 10px 10px auto auto;
  width: 52px;
  height: 52px;
}

.map-hero-card-art {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 12px;
  border: 1px solid #ae9a634d;
  border-radius: 9px;
  background: radial-gradient(ellipse at 46% 40%, #5e4934, #24201f 72%);
}

.map-hero-card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-hero-card-art .map-class-sigil {
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 32px;
  height: 32px;
}
