html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

img {
  pointer-events: none;
}

.touchable {
  pointer-events: auto;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#desktop {
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform:translate(-50%,-50%);
}

#video {
  position: absolute;
  z-index: 10;
}

.frame {
  position: absolute;
  z-index: 13;
}

.movable {
  position: absolute;
  z-index: 14;
}

.font {
  position: absolute;
  z-index: 15;
}

#license {
    position: absolute;
    z-index: 16;
}

#toucharea {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 16;
}

.footer-button {
  position: absolute;
  z-index: 20;
  text-decoration: none;
  color: #FFF;
  line-height: 120px;
  vertical-align: middle;
  overflow: hidden;
}

.modalWrapper {
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform:translate(-50%,-50%);
  background-color: #fff;
  border: solid 10px #888;
  border-radius: 1em;
}

.modalContents {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.modalContents > img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
}

#result {
  border: solid 2px #888;
}

.modalArea {
  display: none;
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.modalBg {
  width: 100%;
  height: 100%;
  background-color: rgba(30,30,30,0.9);
}

#progress {
  position: relative;
  top: 50%;
  left: 50%;
  transform:translate(-50%,-50%);
  pointer-events: none;
}

#return {
  height: auto;
  position: absolute;
  z-index: 20;
}

#video-loading {
  top: 50%;
  left: 50%;
}

.loading {
  z-index: 50;
  position: absolute;
  pointer-events: none;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
}
.loading-item {
  z-index: 50;
  pointer-events: none;
  -webkit-animation: loading 1s linear infinite;
          animation: loading 1s linear infinite;
}

@media screen and (orientation: portrait) {
  #capture {
    width: 20vw;
    left: 40vw;
    height: auto;
  }
  #flip {
    width: 12vw;
    left: 65vw;
    height: auto;
    margin-top: 4vh;
  }
  #return {
    width: 15vw;
    left: 2vw;
    top: 2vw;
  }
  .modalWrapper {
    width: 70%;
    height: 80%;
    padding: 10px 30px;
  }
  .modalContents {
    position: relative;
    width: 85%;
    height: 85%;
    top: 25px;
    margin: 0 auto;
  }
  .modalHeader {
    position: relative;
    width: 100%;
    height: 5%;
    top: 10px;
  }
  .closeModal {
    position: absolute;
    cursor: pointer;
    width: 9%;
    height: auto;
    pointer-events: auto;
  }
  #progress {
    width: 40vw;
    height: auto;
  }
  #description {
    margin: 0;
    font-size: 6vw;
  }
  #save-description {
    width: 100%;
  }
  #notice {
    width: 90vw;
    top: 30vh;
    left: 5vw;
    z-index: 30;
  }
  #save-button {
    width: 30vw;
    padding-bottom: 15vh;
    pointer-events: none;
  }
  #save-text {
    width: 80vh;
    padding-top: 20vh;
    pointer-events: none;
  }
  .loading-item {
    width: 30vw;
  }
}
@media screen and (orientation: landscape) {
  #capture {
    height: 20vh;
    right: 5vw;
    top: 40vh;
    width: auto;
  }
  #flip {
    height: 12vh;
    right: 6.25vw;
    top: 65vh;
    width: auto;
  }
  #return {
    width: 15vh;
    left: 2vh;
    top: 2vh;
  }
  #return {
    height: 15vh;
    max-height: 50px;
    width: auto;
  }
  .modalWrapper {
    width: 80%;
    height: 70%;
    padding: 10px 30px;
  }
  .modalContents {
    margin: 10% 10px 10px;
  }
  .closeModal {
    position: absolute;
    cursor: pointer;
    width: 7%;
    top: 2%;
    height: auto;
    pointer-events: auto;
  }
  #progress {
    width: 40vh;
    height: auto;
  }
  #description {
    margin: 0;
    font-size: 6vh;
  }
  #save-description {
    width: 60%;
  }
  #notice {
    width: 50vw;
    top: 10vh;
    left: 25vw;
    z-index: 30;
  }
  #save-button {
    width: 30vh;
    padding-bottom: 10vw;
    pointer-events: none;
  }
  #save-text {
    width: 80vh;
    padding-top: 15vw;
    pointer-events: none;
  }
  .loading-item {
    width: 30vh;
  }
}

.loading-animation {
  -webkit-animation: loading 1s linear infinite;
          animation: loading 1s linear infinite;
}
.fade-animation {
  -webkit-animation: fade 1s linear infinite;
          animation: fade 1s linear infinite;
}

#flash {
  position:absolute;
  top:0px;
  left:0px;
  width:100vw;
  height:100vh;
  background-color:#ffffff;
  opacity:0;
  z-index:100;
  pointer-events: none;
}

#canvasCover {
  position:absolute;
  top:0px;
  left:0px;
  width:100vw;
  height:100vh;
  background-color:#ffffff;
  opacity:1;
  z-index:0;
  pointer-events: none;
}

.flash-animation {
  -webkit-animation: flash 1.0s ease-out;
          animation: flash 1.0s ease-out;
}

@-webkit-keyframes flash {
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes flash {
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@-webkit-keyframes loading {
  50% {
    opacity: .6;
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
    -webkit-transform-origin: 50% 50%;
            transform-origin: 50% 50%;
    opacity: .3;
  }
}
@keyframes loading {
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
    -webkit-transform-origin: 50% 50%;
            transform-origin: 50% 50%;
  }
}

@-webkit-keyframes fade {
  50% {
    opacity: .6;
  }
  100% {
    opacity: .3;
  }
}
@keyframes fade {
  50% {
    opacity: .6;
  }
  100% {
    opacity: .3;
  }
}
