body {
  cursor: crosshair;
  background: rgb(180, 180, 180);
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-image: url(../bg.svg);
  background-size: 100px 100px;
}

canvas {
  image-rendering: -moz-crisp-edges;
  image-rendering: -o-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
  width: 100%;
  height: 100%;
}

#c {
  box-shadow: 4px 4px 16px black;
}

#o {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.5;
  pointer-events: none;
}

#p {
  position: absolute;
  bottom: 0;
  right: 0;
  opacity: 1.0;
  pointer-events: none;
  width: 512px;
  height: 512px;
}

#upnext {
  pointer-events: none;
  position: absolute;
  top: 64px;
  left: 64px;
}

#tools {
  position: absolute;
  top: 0px;
  left: 0px;
  /*height: 96px;/*
  background-color: clear;
  font-size: 0;
  overflow-y: hidden;
  white-space: nowrap;
  /* overflow-x: scroll;
  -webkit-overflow-scrolling: touch; */
  user-select: none;
  -webkit-user-select: none;
  border: 4px outset;
  background-color: rgb(230, 230, 230);
  padding: 8px;
  box-sizing: border-box;
  cursor: default;
  box-shadow: 0px 0px 16px black;
  display: none;
}

#tools div {
  font-family: Arial;
  display: inline-block;
  width: 96px;
  height: 96px;
  background: white;
  font-size: 64px;
  text-align: center;
  line-height: 96px;
  border: 4px outset;
  box-sizing: border-box;
  margin: auto;
  outline: 1px solid rgb(100, 100, 100);
  margin-right: 12px;
  color: rgba(0, 0, 0, 1.0);
  cursor: pointer;
}

#tools-lock {
  position: absolute;
  top: 0px;
  width: 48px;
  height: 48px;
  background-color: rgb(230, 230, 230);
  border: 4px outset;
  box-shadow: 0px 0px 2px black;
  font-size: 32px;
  text-align: center;
  line-height: 50px;
  cursor: pointer;
  outline: 1px solid rgb(100, 100, 100);
  left: 337px;
  box-shadow: 0px 0px 4px black;
  -webkit-user-select: none;
}

#tools-lock:active {
  line-height: 56px;
  border: 4px inset;
  outline: none;
}

#tools-lock.unlocked {
}

#tools-lock.locked {
  /*left: 0px;*/
}

#tools div:last-child {
  margin-right: 0px;
}

#tools div:active {
  color: rgba(0, 0, 0, 0.7);
  background: rgb(180, 180, 180);
  border: 4px inset;
  outline: none;
}

#tools div.active {
  color: rgba(0, 0, 0, 0.8);
  background: rgb(200, 200, 200);
  border: 4px inset;
  outline: none;
}

#cam {
  position: absolute;
  top: 30px;
  left: 50vw;
  margin-left: -50px;
  width: 164px;
  height: 164px;
  border-radius: 100%;
  object-fit: cover;
  pointer-events: none;
  border: 8px solid white;
  display: none;
}

#softy-anchor, #rotate-anchor, #pan-anchor {
  cursor: -webkit-grab;
  position: absolute;
  top: 0px;
  left: 0px;
  border: 2px solid black;
  display: none;
  box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.5);
  transition: display 1s;
}

#mini-anchor {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 12px;
  background-color: rgb(40, 40, 40);
  border: 2px solid rgb(120, 120, 120);
  box-sizing: border-box;
  display: none;
  opacity: 1;
}

#mini-anchor.fade {
  opacity: 1;
  animation: fade 4s;
  animation-fill-mode: forwards;
}

@keyframes fade {
  from {opacity: 1;}
  to {opacity: 0;}
}

#softy-anchor:active, #rotate-anchor:active, #pan-anchor:active {
  cursor: -webkit-grabbing;
}

#rotate-anchor {
  background-color: rgba(128, 128, 128, 1.0);
  transform: translate3d(-32px, -32px, 0px);
  width: 64px;
  height: 64px;
  margin-left: -32px;
  margin-top: -32px;
  border-radius: 64px;
  border: 16px outset;
  box-sizing: border-box;
}

#pan-anchor {
  background-color: rgb(200, 200, 200);
  transform: translate3d(-48px, -48px, 0px);
  width: 96px;
  height: 96px;
  margin-left: -48px;
  margin-top: -48px;
  border-radius: 96px;
}

#softy-anchor {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translate3d(-64px, -64px, 0px);
  width: 128px;
  height: 128px;
  margin-left: -64px;
  margin-top: -64px;
  border-radius: 128px;
}

#right-preview, #left-preview, #bottom-preview {
  position: absolute;
  border-radius: 24px;
  width: 8px;
  height: 8px;
  top: calc(64px - 4px);
  left: calc(64px - 4px);
  display: none;
}

#right-preview {
  margin-left: 40px;
}

#left-preview {
  margin-left: -40px;
}

#bottom-preview {
  margin-top: 40px;
}

#preview-border {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 256px;
  height: 256px;
  outline: 2px solid black;
  pointer-events: none;
  display: none;
}
