* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
    font-family: "Elvish";
    src: url("../fonts/elvish.otf");
}

@font-face {
  font-family: 'icons';
  src: url('../fonts/icons.eot?66750086');
  src: url('../fonts/icons.eot?66750086#iefix') format('embedded-opentype'),
       url('../fonts/icons.woff?66750086') format('woff'),
       url('../fonts/icons.ttf?66750086') format('truetype'),
       url('../fonts/icons.svg?66750086#icons') format('svg');
  font-weight: normal;
  font-style: normal;
}

/*
  font-family: 'Caveat', cursive;
  font-family: 'Dancing Script', cursive;
  font-family: 'Roboto', sans-serif;
  font-family: 'Yellowtail', cursive;
*/

body {
  padding: 0;
  margin: 0;
  background-color: #eeeeee;
  overflow: hidden;
  height: 100vh;
  font-size: 14px;
}

#font-preload-container {
  position: fixed;
  bottom: 0;
  right: 150%;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.4rem;
}

#loading-screen {
  position: absolute;
  z-index: 1000 !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  background-color: #eee;
  opacity: 1;
  transition: 200ms opacity;
}

#loading-screen.fade-out {
  display: none;
}

#percent {
  font-size: 26px;
  position: fixed;
  top: calc(50vh);
  left: calc(50vw);
  transform: translateX(-50%) translateY(-50%);
  color: #888;
}

#loader {
  display: block;
  position: fixed;
  top: calc(50vh - 50px);
  left: calc(50vw - 50px);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #ccc;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}

#loader:before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #999;
  -webkit-animation: spin 3s linear infinite;
  animation: spin 3s linear infinite;
}

#loader:after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #ddd;
  -webkit-animation: spin 1.5s linear infinite;
  animation: spin 1.5s linear infinite;
}

#threejs-container {
  position: absolute;
  right: 0;
  top: 0px;
  width: 66%;
  height: 100%;
  z-index: 1;
}

canvas {
  display: block;
}

.drawing-canvas {
  margin: 10px;
  z-index: 3;
  box-shadow: 0 0 20px 4px #ccc;
  max-height: 12vw;
  max-width: 12vw;
  display: inline-block;
}

#autorotate-container {
  position: absolute;
  right: 2vw;
  top: 2vw;
  display: flex;
  align-items: center;
  z-index: 100;
}

#autorotate-container .switch {
  margin-left: 10px;
}

#controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  left: 0;
  top: 0;
  width: 34%;
  height: 100vh;
  z-index: 100;
}

.input-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
  width: 100%;
  padding: 1vw;
  background-color: #f6f6f6;
  box-shadow: 0 0 10px 1px #ddd;
  position: relative;
}

.input-container .collapse {
  width: 100%;
  flex-basis: 60vh;
  overflow: hidden;
  transition: all 0.4s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.input-container .collapse.collapsed {
  flex-basis: 0;
}

.collapse-arrow {
  cursor: pointer;
  position: absolute;
  right: 1vw;
  top: 1vw;
  transform: rotateZ(-90deg);
  transform-origin: center;
  transition: transform 0.4s;
}

.collapse-arrow.collapsed {
  transform: rotateZ(0);
}

.collapse-arrow, .arrow {
  font-size: 24px;
}

.value-container {
  padding: 0.5vw;
  display: flex;
  flex-direction: column;
}

.move-button-container {
  width: 30px;
  height: 30px;
  position: absolute;
  overflow: visible;
  bottom: calc(1vw + 30px);
  right: calc(1vw + 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  padding: 0;
}

.move-button {
  position: absolute;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  opacity: 0;
  background-color: transparent;
  transition: all 0.3s ease-in, opacity 0.2s ease-in;
}

.move-button:hover {
  border: solid 1px #888;
}

.move-button .arrow {
  transform-origin: center;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.move-button-container:hover .move-button,
.move-button-container:active .move-button,
.move-button-container:focus .move-button {
  opacity: 1;
}

.move-top {
  bottom: 0%;
  left: 0;
}

.move-button-container:hover .move-top,
.move-button-container:active .move-top,
.move-button-container:focus .move-top {
  bottom: 100%;
}

.move-right {
  top: 0;
  left: 0%;
}

.move-button-container:hover .move-right,
.move-button-container:active .move-right,
.move-button-container:focus .move-right {
  left: 100%;
}

.move-bottom {
  left: 0;
  top: 0%;
}

.move-button-container:hover .move-bottom,
.move-button-container:active .move-bottom,
.move-button-container:focus .move-bottom {
  top: 100%;
}

.move-left {
  top: 0;
  right: 0%;
}

.move-button-container:hover .move-left,
.move-button-container:active .move-left,
.move-button-container:focus .move-left {
  right: 100%;
}

.move-top .arrow {
  transform: rotateZ(90deg);
}

.move-right .arrow {
  transform: rotateZ(180deg);
}

.move-bottom .arrow {
  transform: rotateZ(-90deg);
}

input, select {
  padding: 0.3vw;
  margin: 5px 0;
}

.symbols span {
  font-family: "icons";
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  background-color: rgba(50,50,50,0.1);
  margin: 0 1px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.symbols span:hover {
  background-color: rgba(50,50,50,0.2);
}

#material-selection, #pattern-selection-int, #pattern-selection-ext {
  display: inline-block;
  border: none;
  background-color: #fff;
}

#text-input-ext, #text-input-int {
  font-family: "icons";
  width: 100%;
  border: none;
  background-color: #fff;
}

#size-input-ext, #size-input-int {
  max-width: 80px;
  border: none;
  background-color: #fff;
}

#font-selection-ext, #font-selection-int {
  border: none;
  background-color: #fff;
}

 /* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #333;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

@-webkit-keyframes spin {
  0%   {
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes spin {
  0%   {
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@media screen and (max-device-width: 1280px) and (orientation: landscape) {

  .drawing-canvas, .input-container:last-child {
    display: none;
  }

}

/*@media screen and (max-device-width: 800px) and (orientation: portrait) {*/
@media screen and (max-device-width: 800px) {

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1rem;
  }

  .drawing-canvas {
    display: none;
  }

  #threejs-container {
    top: -30%;
    width: 100%;
  }

  #drawing-canvas, .input-container:last-child {
    display: none;
  }

  #controls-container {
    width: 100%;
    height: auto;
    top: auto;
    bottom: 0;
    padding: 0;
  }

  .input-container {
    padding: 6px;
  }

  .input-container input, .input-container select {
    padding: 6px !important;
    margin: 3px!important;
    font-size: 12px;
  }

  .input-container .collapse {
    flex-basis: 50vh;
  }

  .symbols span {
    font-size: 3.5vw;
  }

  .switch {
    width: 40px;
    height: 22px;
  }

  .slider:before {
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
  }

  input:checked + .slider:before {
    -webkit-transform: translateX(18px);
    -ms-transform: translateX(18px);
    transform: translateX(18px);
  }

}