@font-face {
    font-family: "Replica";
    src: url("assets/fonts/ReplicaLLWeb-Regular.woff") format("woff");
  }
  @font-face {
    font-family: "Replica";
    src: url("assets/fonts/ReplicaLLWeb-Regular.woff2") format("woff2");
  }
  @font-face {
    font-family: "Replica";
    font-weight: 700;
    src: url("assets/fonts/ReplicaLLWeb-Bold.woff") format("woff");
  }
  @font-face {
    font-family: "Replica";
    font-weight: 700;
    src: url("assets/fonts/ReplicaLLWeb-Bold.woff2") format("woff2");
  }

  body {
    padding: 0;
    margin: 0;
    background-color: #fff;
    font-family: "Replica", sans-serif;
  }

  .logo {
    float: left;
    clear: none;
    max-height: 3rem;
    margin: 0;
  }

  .controls {
    background-color: #ffffff;
    padding: 0;
    width: 100%;
    height: 3rem;
    float: left;
    z-index: 999;
    position: sticky;
    top: 0;
  }

  svg {
    margin: auto;
    display: block;
  }


  .controls div {
    margin-right: .5rem;
    float: left;
    height: 100%;
  }
  .controls button:last-child, #saveSVG, #savePNG {
    float: right;
  }
  .controls .group {
    border-right: 2px solid #E8F2EE;
    margin-right: 1rem;
  }
  .group div {
    display: inline-flex;
  }
  .group span, .group div span {
    display: inline-block;
    margin-right: 1rem;
    display: inline-flex;
    margin-right: 1rem;
    flex-direction: column;
    justify-content: center;
  }

  main {
    min-height: 100vh;
    background-color: #f2fbf8;
    display: grid;
  }

  canvas, .p5Canvas {
    display: block;
    margin: auto;
    width: 100% !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin-top: -.5rem;
    object-fit: contain;
    cursor: grab;
  }
  canvas:active {
    cursor: grabbing;
  }
  .p5Canvas { 
    cursor: auto;
  }
  .p5Canvas svg {
    width: 100%;
    float: left;
  }


  select {
    appearance: none;
    -webkit-appearance: none;
    padding: .25rem .5rem;
    font-family: "Replica", sans-serif;
    font-size: 1rem;
    background-color: #fff;
    color: #000;
    border: 0;
  }
  select:hover {
    color: #f00000;
  }
  select:hover label {
    color: #ffffff;
  }

  button {
    color: white;
    background: black;
    border: 0;
    padding: 0.5rem 1rem;
    font-weight: 700;
    height: 100%;
  }

  button:hover {
    background: #f00000;
  }
  #toggleColors {
    visibility: hidden;
  }
  label[for=toggleColors] {
    background-color: #ffffff;
    color: rgba(128, 128, 128, 0.25);
    font-size: 1rem;
    pointer-events: initial;
    position: relative;
    display: inline-flex;
  }
  label[for=toggleColors]:hover {
    color: rgba(128, 128, 128, 1);
  }
  #toggleColors:checked + label {
    color: #000000;
  }


  .inputfile {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
  }
  label {
      display: inline-flex;
      font-size: .65rem;
      position: absolute;
      align-items: center;
      margin: .05rem .25rem 0 .45rem;
      pointer-events: none;
      z-index: 999;
      color: #707070;
  }
  .inputfile + label {
      position: relative;
      color: #000;
      background-color: #ffffff;
      display: inline-flex;
      padding: auto 1rem;
      margin: 0 1rem;
      align-items: center;
      font-size: 1rem;
      pointer-events: initial;
      height: 100%;
      cursor: pointer;
  }
  .inputfile:focus + label,
  .inputfile + label:hover {
      color: #f00000;
  }


  input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    width: 5rem;
  }
  input[type="range"]:focus {
    outline: none;
  }
  input[type="range"]::-webkit-slider-runnable-track {
    background-color: #E8F2EE;
    border-radius: 0.5rem;
    height: 0.5rem;
  }
  input[type="range"]::-webkit-slider-runnable-track:hover {
    background-color: #d7e2dd;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -4px;
    background-color: #000000;
    border-radius: 0.5rem;
    height: 1rem;
    width: 1rem;
  }
  input[type="range"]::-webkit-slider-thumb:hover {
    background-color: #f00000;
  }
  input[type="range"]:focus::-webkit-slider-thumb {
    outline: 3px solid #f00000;
    outline-offset: 0.125rem;
  }
  #invert {
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.75rem 0 0 0;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    background: url("assets/invert-icon.svg");
    background-size: contain;
    background-repeat: no-repeat;
  }
  #invert:checked {
    transform: rotate(180deg);
  }

  .right {
    text-align: right;
    margin-right: 0 !important;
    padding-right: 0 !important;
  }



  .clr-picker {
    border-radius: 0;
    box-shadow: 0 0 5px rgb(0 0 0 / 40%), 0 5px 20px rgba(0, 0, 0, .2);
  }
  .clr-field input {
    border-radius: 0;
    border: 0;
    padding: .25rem 1.75rem;
    font-size: 1rem;
    font-family: "Replica", sans-serif;
    max-width: 4rem;
  }
  .clr-field input:hover {
    color: #f00000;
  }
  input.clr-color {
    font-family: "Replica", sans-serif;
    border: 0;
    border-radius: 0;
  }
  .clr-segmented label {
    position: relative;
    pointer-events: initial;
  }
  .clr-field button {
    border-radius: 999px;
    width: 1rem;
    height: 1rem;
    left: .5rem;
    right: auto;
  }



  .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f00000;
    padding: 1rem;
    height: 4rem;
    width: 4rem;
    display: grid;
    align-items: stretch;
    justify-content: center;
  }
  .loading img {
    height: auto;
    width: 100%;
  }
  .hide {
    display: none !important;
  }

  input[type="number"] {
    appearance: none;
    height: 100%;
    border: 0;
    border-radius: 0;
    font-family: "Replica", sans-serif;
    font-size: 1rem;
    padding: 0;
    width: auto;
    max-width: 3rem;
  }
  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  .scale input[type="number"], .offset input[type="number"] {
    padding: 0 .5rem;
    appearance: auto;
  }

  .offset input[type="number"] {
    width: 2rem;
  }



  .tippy-box[data-theme~='efla'] {
    background-color: #000000;
    color: #ffffff;
    border-radius: 0;
  }
  .tippy-box[data-theme~='efla'][data-placement^='top'] > .tippy-arrow::before {
    border-top-color: #000000;
  }
  .tippy-box[data-theme~='efla'][data-placement^='bottom'] > .tippy-arrow::before {
    border-bottom-color: #000000;
  }
  .tippy-box[data-theme~='efla'][data-placement^='left'] > .tippy-arrow::before {
    border-left-color: #000000;
  }
  .tippy-box[data-theme~='efla'][data-placement^='right'] > .tippy-arrow::before {
    border-right-color: #000000;
  }



  @media screen and (max-width: 1210px) {
    .controls {
        position: fixed;
        top: auto;
        bottom: 0;
        height: auto;
        box-shadow: 0 8px 50px 10px #00000050;
    }
    canvas, .p5Canvas {
        margin-top: 0;
        object-position: center 5%;
    }
    .controls div, .controls button {
      height: auto;
      float: left;
      clear: both;
    }
    .controls .group {
        width: 100%;
        border-right: 0;
        border-bottom: 2px solid black;
        margin: 1rem 0;
    }
    .controls .group div {
        width: 100%;
        clear: both;
        margin: .5rem 0;
    }
    button {
        width: 100%;
        padding: 1.5rem;
    }
    input[type="range"] {
        width: 100%;
    }
    label {
        margin-top: -1rem;
    }
    .clr-field input {
        max-width: none;
        width: 100%;
    }
  }