html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #EE99C7;
}

.canvas {
  position: relative;
  width: min(100%, 1400px);
  aspect-ratio: 2160 / 2768;
  margin-inline: auto;
}

.drawing {
  position: absolute;
  left: calc(var(--x) * 100% / 2160);
  top: calc(var(--y) * 100% / 2768);
  width: calc(var(--width) * 100% / 2160);
  transform: translate(-50%, -50%) rotate(var(--rotation));
  transform-origin: center;
  user-select: none;
  -webkit-user-drag: none;
}

.drawing img {
  display: block;
  width: 100%;
}

.layout-mode .drawing {
  cursor: grab;
  outline: 1px dashed rgb(70 70 70 / 45%);
}

.layout-mode .drawing:active {
  cursor: grabbing;
}

.transform-handle {
  position: absolute;
  right: -11px;
  bottom: -11px;
  display: none;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  border: 2px solid white;
  border-radius: 50%;
  background: #222;
  box-shadow: 0 0 0 1px #222;
  cursor: nwse-resize;
}

.layout-mode .transform-handle {
  display: block;
}
