* {
  box-sizing: border-box;
}

#drawingWrapper {
  width: 100%;
  position: relative;
  color: white;
  left: 0;
}

.phoneRotate {
  position: absolute;
  width: 6rem;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#background {
  width: 100%;
  position: relative;
}

#backgroundMask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  visibility: hidden;
}

#controls {
  position: absolute;
  display: none;
  left: calc(var(--passepartout-width));
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  background: black;
  border-radius: 10px;
  border: 1px solid white;
}

#mover {
  width: 100%;
  height: 12px;
  border-bottom: 1px solid white;
  cursor: grab;
}

#mover > div {
  width: 80%;
  left: 50%;
  top: 50%;
  position: relative;
  height: 1px;
  background: white;
  transform: translate(-50%, -50%);
}
#save.disabled {
  opacity: 0.5;
}
#save:not(.disabled):hover {
  background-color: darkgray;
}
#save.success {
  background-color: green;
}
#save.error {
  background-color: red;
}
#save {
  background-image: url(/assets/icons/save.png);
  opacity: 1;
  height: 30px;
  background-size: auto 60%;
  border-bottom: 1px solid white;

  background-position: center center;
  background-repeat: no-repeat;
  cursor: pointer;
}

#drawing {
  width: 100%;
  height: 100%;
}

#brushCanvas {
  width: 100%;
  background: white;
  display: none;

  background-color: white;
  background-image: linear-gradient(45deg, #808080 25%, transparent 25%),
    linear-gradient(-45deg, #808080 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #808080 75%),
    linear-gradient(-45deg, transparent 75%, #808080 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

#tools {
  height: 40px;
  border-bottom: 1px solid white;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(2, 50%);
}

.tool {
  opacity: 0.3;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  margin-right: 3px;
  cursor: pointer;
}

.tool.selected {
  opacity: 1;
}

#brush {
  background-image: url("../icons/brush.png");
}

#eraser {
  background-image: url("../icons/eraser.png");
}

#toolSettings {
  border-bottom: 1px solid white;
  margin-bottom: 10px;
  padding: 6px;
}

.settings.selected {
  display: block;
}

.settings {
  display: none;
}

.shapeSetting {
  height: 20px;
  display: grid;
  grid-template-columns: repeat(2, 50%);
  margin-bottom: 7px;
}

.shape {
  opacity: 0.3;
  cursor: pointer;
}

.shape.selected {
  opacity: 1;
}

.circle {
  border: 2px dotted white;
  border-radius: 50%;
  margin-right: 3px;
}

.square {
  border: 2px dotted white;
  margin-left: 3px;
  margin-top: 1px;
  margin-right: 1px;
  margin-bottom: 1px;
}

.setting {
  position: relative;
  width: 100%;
  transition: width, 0.1s;
  cursor: ew-resize;
}

.setting:hover {
  width: 400%;
}

.setting .settingBorder {
  background: #222221;
  border: 1px solid lightgray;
  margin-bottom: 5px;
  font-size: 13px;
  font-family: arial;
  text-align: center;
  padding: 1px;
  padding-top: 2px;
  user-select: none;
}

.setting:last-child .settingBorder {
  margin-bottom: 0px;
}

.setting .settingPercent {
  background: #ffffff;
  position: absolute;
  top: 0px;
  left: 0px;
  height: 100%;
  opacity: 0.2;
}

#colors {
  padding-bottom: 10px;
  display: grid;
  grid-template-columns: repeat(2, 50%);
  padding-left: 6px;
}

.colorBox {
  width: 20px;
  height: 20px;
  border: 2px solid #555555;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 5px;
}

.color-picker.no-alpha .color-picker\:a {
  display: none;
}

.colorBox.selected {
  border: 2px solid white;
}

#drawing {
  position: absolute;
  top: 0px;
  left: 0px;
  cursor: crosshair;
}

#cursor.circle {
  border-radius: 50%;
}

#cursor {
  width: 50px;
  height: 50px;
  mix-blend-mode: difference;
  border: 2px dashed white;
  position: absolute;
  cursor: crosshair;
  top: 0px;
  left: 0px;
  pointer-events: none;
}

@media screen and (min-width: 550px) {
  #controls {
    display: block;
  }
  .phoneRotate {
    display: none;
  }
}

@media screen and (max-width: 600px) {
  .colorBox:nth-last-child(1),
  .colorBox:nth-last-child(2) {
    display: none;
  }
}

@media screen and (max-width: 550px) {
  .colorBox:nth-last-child(3),
  .colorBox:nth-last-child(4) {
    display: none;
  }
}

@media screen and (max-width: 500px) {
  .colorBox:nth-last-child(5),
  .colorBox:nth-last-child(6) {
    display: none;
  }
}

@media screen and (max-width: 460px) {
  .colorBox:nth-last-child(7),
  .colorBox:nth-last-child(8) {
    display: none;
  }
}

@media screen and (max-width: 400px) {
  .setting:nth-child(3),
  .setting:nth-child(4) {
    display: none;
  }
}

/* */

@media screen and (max-height: 580px) {
  .colorBox:nth-last-child(1),
  .colorBox:nth-last-child(2) {
    display: none;
  }
}

@media screen and (max-height: 550px) {
  .colorBox:nth-last-child(3),
  .colorBox:nth-last-child(4) {
    display: none;
  }
}

@media screen and (max-height: 520px) {
  .colorBox:nth-last-child(5),
  .colorBox:nth-last-child(6) {
    display: none;
  }
}

@media screen and (max-height: 490px) {
  .colorBox:nth-last-child(7),
  .colorBox:nth-last-child(8) {
    display: none;
  }
}

@media screen and (max-height: 460px) {
  .setting:nth-child(3),
  .setting:nth-child(4) {
    display: none;
  }
}

@media screen and (max-height: 430px) {
  .setting:nth-child(5),
  .setting:nth-child(6) {
    display: none;
  }
}
