/* Fit the real cell ratio inside the display slot, including rectangular sheets. */
.creature-art:is(.atlas-art,.china-art,.gumiho-frame),
.map-companion .creature-art.atlas-art {
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
}

.creature-art .sprite-cell,
.creature-art.atlas-art .atlas-frame.sprite-cell,
.map-view .map-dock-head .map-companion .creature-art .atlas-frame.sprite-cell {
  position: relative;
  display: block;
  flex: none;
  width: min(100cqw, calc(100cqh * var(--cell-ratio)));
  height: auto;
  aspect-ratio: var(--cell-ratio);
  overflow: hidden;
}

.creature-art .sprite-cell > img.atlas-sheet,
.creature-art.atlas-art .atlas-frame.sprite-cell > img.atlas-sheet {
  position: absolute;
  display: block;
  width: var(--sheet-width);
  height: var(--sheet-height);
  left: var(--sheet-left);
  top: var(--sheet-top);
  max-width: none;
  max-height: none;
  object-fit: fill;
  margin: 0;
  padding: 0;
  border: 0;
  transform: none;
}

.actor.ally .rear-pose {
  display: flex;
  justify-content: center;
  align-items: end;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  container-type: size;
}

.actor.ally .rear-frame.sprite-cell {
  inset: auto;
  background: none;
  clip-path: var(--rear-cut, none);
}

