body,
input,
button,
#console {
  font-family: "Lucida Console", "Consolas", monospace;
}

.box input,
.box span {
  background: none;
  border: none;
  font-size: 24px;
  min-width: 1ch;
  text-align: center;
}

button {
  width: 50px;
  height: 30px;
  font-size: 18px;
  background: #ffa726;
  border: none;
}

button:focus {
  outline: none;
  filter: brightness(1.2);
}

button:active {
  filter: brightness(.8);
}

#statementButton {
  background: #ba68c8;
}

#conditionalButton {
  background: #64b5f6;
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
}

#inputButton {
  background: #81c784;
  clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%);
}

#outputButton {
  background: #81c784;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
}

#stopButton {
  width: unset;
}

.box {
  position: absolute;
  padding: 1em;
  filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.2));
  background: #ba68c8;
  height: 25px;
  cursor: pointer;
  user-select: none;
  z-index: 1;
}

.arrowDragging .box {
  cursor: pointer;
}

.box.selected {
  filter: brightness(1.2);
}

.box.conditional {
  padding-bottom: 30px;
  padding-left: 2em;
  padding-right: 2em;
  background: #64b5f6;
}

.box.conditional:before,
.box.conditional:after,
.box.input:before,
.box.input:after,
.box.output:before,
.box.output:after {
  width: 0;
  height: 0;
  top: 0;
  content: "";
  border-style: solid;
  position: absolute;
}

.box.conditional:before {
  left: -30px;
  border-color: transparent #64b5f6 transparent transparent;
  border-width: 35.5px 30px 35.5px 0;
}

.box.conditional:after {
  right: -30px;
  border-color: transparent transparent transparent #64b5f6;
  border-width: 35.5px 0 35.5px 30px;
}

.box.input, .box.output {
  background: #81c784;
}

.box.input:before {
  left: -30px;
  border-color: transparent #81c784 transparent transparent;
  border-width: 0 30px 57px 0;
}

.box.input:after {
  right: -30px;
  border-color: #81c784 transparent transparent transparent;
  border-width: 57px 30px 0 0;
}

.box.output:before {
  left: -30px;
  border-color: transparent transparent #81c784 transparent;
  border-width: 0 0 57px 30px;
}

.box.output:after {
  right: -30px;
  border-color: transparent transparent transparent #81c784;
  border-width: 57px 0 0 30px;
}

.box.conditional .yesno {
  display: flex;
  justify-content: space-around;
  position: absolute;
  width: 100%;
  bottom: 0.5em;
  left: 0;
}

.box span {
  display: block;
  width: 100%;
  text-align: center;
}

.box.start,
.box.end {
  background: #ffa726;
  width: 100px;
  border-radius: 25%/50%;
}

.dotrow {
  position: absolute;
  bottom: -7.5px;
  display: inline-flex;
  width: 100%;
  height: 15px;
  left: 0;
  justify-content: space-around;
  pointer-events: none;
}

.dotrow.top {
  top: -7.5px;
}

.dotrow.bottom {
  bottom: -7.5px;
}

.dot {
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  left: 0;
  right: 0;
  width: 15px;
  height: 15px;
  background: #3d5afe;
  border-radius: 50%;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
}

.box:hover .dot, .dot:hover {
  opacity: 1;
}

.dot.in {
  top: -7.5px;
}

.dot.out {
  bottom: -7.5px;
}

.arrow .arrowPart, .arrow .arrowEnd {
  position: absolute;
  background: black;
  pointer-events: auto;
  cursor: pointer;
}

.arrow .arrowPart:nth-child(2), .arrow .arrowPart:nth-child(3), .arrow .arrowPart:nth-child(4) {
  z-index: auto;
}

.arrow .arrowEnd {
  height: 3px;
}

.arrow.selected * {
  background: #3d5afe;
}

.arrowDragging .arrow * {
  pointer-events: none;
}

.arrow .arrowEnd:before, .arrow .arrowPart:before {
  content: "";
  position: absolute;
  border-radius: 9px;
  z-index: -1;
}

.arrow .arrowEnd:before, .arrow .arrowPart:nth-child(2):before, .arrow .arrowPart:nth-child(4):before {
  width: 100%;
  height: 20px;
  top: -9px;
}

.arrow .arrowPart:nth-child(1):before, .arrow .arrowPart:nth-child(3):before {
  height: calc(100% + 8px);
  width: 20px;
  left: -9px;
}

.arrow .arrowPart:nth-child(4):before {
  width: calc(18px + 100%);
  left: -9px;
}

.arrow .arrowEnd:before {
  width: calc(9px + 100%);
  left: -9px;
}

.arrow .arrowEnd:after {
  border: 7.5px solid transparent;
  border-left: 15px solid black;
  content: "";
  position: absolute;
  top: -6px;
  right: -9px;
}

.arrow.selected .arrowEnd:after {
  border-left-color: #3d5afe;
}

#console {
  background: black;
  color: white;
  height: 10em;
  width: 15em;
  overflow-y: auto;
  font-size: 18px;
  padding: 1em;
}

table {
  border-collapse: collapse;
}
td {
  border: 2px solid #ccc;
  padding: .5em 1em;
  min-width: 3em;
  text-align: right;
}