.character-guide {
  overflow-x: hidden;
}

.modal-open {
  overflow: hidden;
}

.character-sheet img,
.character-hero-sheet img,
.slice-card img {
  cursor: zoom-in;
}

.character-sheet img:focus,
.character-hero-sheet img:focus,
.slice-card img:focus {
  outline: 3px solid rgba(242, 75, 67, .45);
  outline-offset: 4px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 18, 28, .82);
  backdrop-filter: blur(10px);
}

.image-modal[aria-hidden="false"] {
  display: flex;
}

.image-modal-frame {
  position: relative;
  display: grid;
  gap: 12px;
  max-width: min(1440px, 96vw);
  max-height: 92vh;
  margin: 0;
}

.image-modal-frame img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .36);
}

.image-modal-frame figcaption {
  min-height: 22px;
  color: #fff;
  text-align: center;
  font-weight: 850;
}

.image-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  background: rgba(20, 24, 32, .72);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.image-modal-close:hover {
  border-color: var(--primary);
  background: var(--primary);
}

@media (max-width: 640px) {
  .image-modal {
    padding: 14px;
  }

  .image-modal-frame img {
    max-height: 82vh;
    border-radius: 12px;
  }

  .image-modal-close {
    top: 10px;
    right: 10px;
  }
}

.character-subnav-inner {
  flex-wrap: wrap;
  overflow-x: visible;
}

.character-hero-grid > *,
.character-hero-sheet {
  min-width: 0;
}

.character-hero-copy h1 {
  overflow-wrap: anywhere;
}

.character-hero-copy p {
  overflow-wrap: anywhere;
}

.character-hero-sheet {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.character-hero-sheet img,
.character-sheet img {
  display: block;
  max-width: 100%;
  height: auto;
}

.character-system-section,
.character-sheet-section,
.character-slice-section {
  scroll-margin-top: 176px;
}

@media (max-width: 760px) {
  .character-subnav-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    max-width: 100%;
  }

  .character-hero-copy h1 {
    font-size: 32px;
    line-height: 1.16;
  }

  .character-system-section,
  .character-sheet-section,
  .character-slice-section {
    scroll-margin-top: 126px;
  }
}
