:root {
  --color0: red;
  --color1: red;
  --color2: red;
  --color3: red;
  --color4: red;
  --color5: red;
  --color6: red;
  --color7: red;
}

html, body {
  margin: 0;
  padding: 0;
}
body {
  background: #000;
  line-height: 1.2em;
  font-family: sans-serif;
  color: #000;
}
button,
input[type=number] {
  all: unset;
  cursor: pointer;
}

body, input, button {
  font-size: 14px;
}

canvas {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  height: 100vh !important;
  width: 100vw !important;
  object-fit: contain;
  image-rendering: pixelated;
}

body.noMove {
  nav {
    display: none;
  }
}

h3 {
  font-size: 100%;
  margin: 1.3em 0 0.5em;
  &:first-child {
    margin-top: 0;
  }
}

nav {
  position: fixed;
  left: 2vw;
  top: 2vw;
  background: #fff;
  padding: 20px 20px 23px;
  z-index: 2;
  width: 250px;
}

input[type=range] {
  display: block;
  width: 100%;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #ddd;
  &:hover, &:focus {
    background: #bbb;
  }
  &::-webkit-slider-thumb {
    background: #000;
    -webkit-appearance: none;
    appearance: none;
    width: 6px;
    height: 6px;
    cursor: pointer;
  }
  &::-moz-range-thumb {
    background: #000;
    width: 6px;
    height: 6px;
    cursor: pointer;
  }
}

button {
  display: inline-block;
  background: #ddd;
  padding: 2px 4px;
  margin: 0 2px 2px 0;
  cursor: pointer;
  &:hover {
    background-color: #bbb;
  }
  &[active="true"] {
    background-color: rgb(20,255,0);
  }
  &[disable="true"] {
    cursor: default;
    background-color: #eee !important;
    color: #bbb;
  }
}

input[type=number] {
  text-align: center;
  border-bottom: 1px solid #bbb;
}

.size {
  display: flex;
  gap: 5px;
  align-items: center;
  button {
    background: none;
    font-size: 160%;
    opacity: 0;
    &:hover {
      color: rgb(0,100,0);
    }
  }
  &:hover button {
    opacity: 1;
  }
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 20px;
  height: 20px;
  cursor: pointer;
  box-shadow: 1px rgba(0,0,0,0.1) inset;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: none;
}

.colors {
  font-size: 0;
  .color {
    display: inline-block;
    position: relative;
    margin: 0 2px 2px 0;
    input {
      position: relative;
      z-index: 1;
      vertical-align: top;
    }
    button {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 0;
      transition: transform 0.2s ease;
      transform: translateY(0);
    }
    &:hover {
      button {
        transform: translateY(20px);
      }
    }
  }
  button {
    width: 20px;
    height: 18px;
    padding: 0;
    font-size: 14px;
    line-height: 0;
    vertical-align: top;
    text-align: center;
    padding-bottom: 2px;
    &.remove {
      color: rgba(255,255,255,0);
      &:after {
        display: inline-block;
        color: #000;
        font-size: 14px;
        content: '×';
      }
      &:hover {
        color: #fff;
      }
    }
  }
}

#fps {
  color: #bbb;
}



#text {
  font-size: 2vh;
  line-height: 1.3em;
  height: 100vh;
  p {
    display: inline;
  }
  p span:last-child {
    margin-right: 1em;
  }
  span {
    padding: 0.05em 0.2em 0.05em;
    margin: 0 1px 1px 0;
    background-color: #888;
  }
  &[margin="1"] {
    span {
      margin: 0 1px 1px 0;
    }
  }
  &[margin="2"] {
    span {
      margin: 0 2px 2px 0;
    }
  }
  &[margin="3"] {
    span {
      margin: 0 3px 3px 0;
    }
  }
  &[margin="4"] {
    span {
      margin: 0 4px 4px 0;
    }
  }
  &[margin="5"] {
    span {
      margin: 0 5px 5px 0;
    }
  }
  &[margin="6"] {
    span {
      margin: 0 6px 6px 0;
    }
  }
  span, font {
    display: inline-block;
    vertical-align: middle; 
  }
}

[decor="1"] {
  border-radius: 1em;
  padding-left: 0.3em !important;
  padding-right: 0.3em !important;
}
[decor="2"] {
  background-color: #000 !important;
  color: #fff;
}
[decor="3"] {
  text-transform: uppercase;
}
[decor="4"] {
  font-style: italic;
}

[bg="0"] {
  background-color: var(--color0) !important;
}
[bg="1"] {
  background-color: var(--color1) !important;
}
[bg="2"] {
  background-color: var(--color2) !important;
}
[bg="3"] {
  background-color: var(--color3) !important;
}
[bg="4"] {
  background-color: var(--color4) !important;
}
[bg="5"] {
  background-color: var(--color5) !important;
}
[bg="6"] {
  background-color: var(--color6) !important;
}
[bg="7"] {
  background-color: var(--color7) !important;
}
[whitetext="true"] {
  color: #fff;
}

#p5_loading {
  color: #fff;
}

#submit {
  position: fixed;
  left: 1.25vw;
  bottom: 1.25vw;
  font-size: ~"max(60px, 6vw)";
  @media (max-aspect-ratio: 1/1) {
    font-size: 7vh;
  }
  line-height: 1em;
  color: #00f;
  &:hover {
    text-decoration: underline;
  }
}