/* Barlow font */
@font-face {
  font-family: 'Barlow-Medium';
  src: url('./assets/Barlow-Medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Barlow-Bold';
  src: url('./assets/Barlow-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}


body {
  background-color: black;
  margin: 0;
  font-family: 'Barlow-Medium', Arial, Helvetica, sans-serif;
  overflow: hidden;
  user-select: none;
  color: #525f6b;
}

.fit169{
  /*16:9, centered vertically and horizontally*/
  width: min(100vw, 177.77vh);
  height: min(100vh, 56.29vw);
  left: calc(50vw - min(50vw, 88.88vh));
  top: calc(50vh - min(50vh, 28.14vw));
}
/*for small screen, zoom in, make the 3d view larger than the width so we fully fill it with paintable*/
@media screen and (max-width: 1000px) {
  .fit169{
    width: min(160vw, 177.77vh);
    height: min(100vh, 90.06vw);
    left: calc(50vw - min(80vw, 88.88vh));
    top: calc(50vh - min(50vh, 45.03vw));
  }
}
#container {
  position: absolute;
  /* top: 0px; */
  /* left: 0px; */
  /* width: 100vw;
  height: 56.29vw; */
  overflow: visible;
  
  -webkit-user-select: none;  /* prevent text selection */
  -webkit-touch-callout: none; /* disable iOS context menu */
  touch-action: none;          /* disable default gestures */
  user-select: none;
}
.containerBG{
  position: absolute;
  top:    -101%;
  left:   -101%;
  right:  -101%;
  bottom: -101%;
  background: url(data/BGwide0000.jpg);
  background-size: cover;
  background-position: center center;
  z-index: -2;
}
#viewOverlay{
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

#loading{
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 2000;
  background-color: #eee;
  background-image: url(./assets/bg.jpg);
  background-size: cover;
  background-position: center center;
  color: white;
  padding: 20px
}

#loadingBar{
  background-color: #222;
  width: 80vw;
  position: absolute;
  z-index: 2001;
  transform: translate(-50%, -50%);
  height: 10px;
  left: 50%;
  bottom: 100px
}

#innerLoadingBar{
  background-color: #009fe3;
  width: 0%;
  height: 100%;
  transition: width .2s;
}
#paintCanvas{
  position: absolute;
  border: 2px solid red;
  display: none;
}

.ui{
  pointer-events: all;
}
.ui .btn{
  background-color: #009fe3;
  cursor: pointer;
  transition: transform .1s;
  text-decoration: none;
}
.ui .btn:hover{
  background-color: #00b3ff;
  transform: scale(1.1);
}
#continue{
  position: absolute;
  bottom: 5vh;
  left: calc(50vw - 40px);
  width: 60px;
  height: 20px;
  padding: 30px 10px;
  border-radius: 50%;
  background: #00b3ff;
  color: white;
  box-shadow: 0px 0px 10px 5px #ffff;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  /* background-color: #009fe3;
  color: white; */
}
#continue.clickme{
  animation: clickmeAnim 3.5s infinite; /*prominent but not annoying*/
}
#continue.disabled{
  pointer-events: none;
  background-color: #777;
  opacity: .3;
  animation: none;
  transform: scale(.8);
}
#continue:hover{
  animation: none;
  transform: scale(1.01);
  box-shadow: 0px 0px 20px 5px #ffff;
}
#introprompt{
  position: absolute;
  background: url(./assets/prompt.svg);
  background-repeat: no-repeat;
  background-position: bottom center;
  width: 35%;
  height: 15%;
  left: calc(26%);
  top: calc(40%);
  pointer-events: none;
  animation: clickmeAnim 2s infinite;
  transform-origin: bottom center;
}
@keyframes clickmeAnim {
    0% { transform: scale(1.0);}
    7% { transform: scale(0.85);}
   10% { transform: scale(0.85);}
   20% { transform: scale(1.03);}
   25% { transform: scale(1.0);}
}
#introprompt .text{
  margin-top: 60px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  text-align: center;
}
#summary, #levelScreen, #colorselect{
  position: fixed;
  width: 360px;
  left: calc(50vw - 180px);
  top: 40%;
  transform: translate(0, -40%);
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: white;
  box-sizing: border-box;
  padding: 30px;
  color: #525f6b;
  filter: drop-shadow(0px 10px 40px #000);
  /*pointer-events: none;*/
}
#summary .header{
  font-size: 24px;
  margin-bottom: 30px;
}
#summary .stat{
  display: flex;
  align-items: flex-end;
  margin: 10px 0 10px 0;
  animation: fadeIn .3s;
  animation-fill-mode: both;
}
#summary .stat.hidden{
  display: none;
}
#summary .stat:nth-of-type(1){ animation-delay:  .0s; }
#summary .stat:nth-of-type(2){ animation-delay:  .5s; }
#summary .stat:nth-of-type(3){ animation-delay: 1.0s; }
#summary .stat:nth-of-type(4){ animation-delay: 1.5s; }
#summary .stat .text{
  width: 150px;
}
#summary .stat .number{
  font-size: 24px;
  width: 100px;
  text-align: right;
  /* color: #009fe3; */
}
#summary .stat .scr{
  width: 50px;
  text-align: right;
  animation: popIn .4s;
  animation-fill-mode: both;
  color: var(--score-color);
}
#summary .stat:nth-of-type(1) .scr{ animation-delay:  .2s; }
#summary .stat:nth-of-type(2) .scr{ animation-delay:  .7s; }
#summary .stat:nth-of-type(3) .scr{ animation-delay: 1.2s; }
#summary .stat:nth-of-type(4) .scr{ animation-delay: 1.7s; }
#summary .score{
  border-top: 1px solid #525f6b;
  margin-top: 20px;
  padding-top: 10px;
  font-weight: bold;
  animation: fadeIn .3s;
  animation-fill-mode: both;
  animation-delay: 2.0s;
}
@keyframes fadeIn {
    0% {opacity: 0.0;}
  100% {opacity: 1.0;}
}
@keyframes popIn{
    0% {transform: scaleX( .7) scaleY( .7); opacity: 0.0;}
   50% {transform: scaleX(1.1) scaleY(1.2); opacity: 1.0;}
  100% {transform: scaleX(1.0) scaleY(1.0); opacity: 1.0;}
}
@keyframes popopopIn{
    0% {transform: scaleX( .7) scaleY( .7); opacity: 0.0;}
   30% {transform: scaleX(1.1) scaleY(1.2); opacity: 1.0;}
   60% {transform: scaleX( .7) scaleY( .7); opacity: 1.0;}
  100% {transform: scaleX(1.0) scaleY(1.0); opacity: 1.0;}
}
#summary .score .text{
  width: 250px;
  font-size: 18px;
}
#summary .score .scr{
  width: 50px;
  text-align: right;
  font-size: 24px;
  animation: popIn .3s;
  animation-fill-mode: both;
  animation-delay: 2.0s;
  color: #009fe3; 
}

.buttons{
  display: flex;
}
.buttons .btncontainer{
  position: relative;
}
.buttons .btn{
  display: block;
  background: #009fe3;
  padding: 10px;
  color: white;
  text-align: center;
  border-radius: 10px;
  box-shadow: 0px 5px 10px #0005;
}
.buttons .btn.first{
  width: 100px;
  margin-right: 10px;
}
.buttons .btn.sharebtntoggle{
  width: 150px;
}
.share{
  margin: 20px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.share .text{
  flex-grow: 1;
}
.sharebtn{
  background: #009fe3;
  padding: 10px;
  width: 18px;
  line-height: 18px;
  color: white;
  text-align: center;
  border-radius: 10px;
  margin-left: 10px;
}
.sharetarget{
  position: absolute;
  bottom: 39px;
  width: 150px;
  height: auto;
  box-shadow: 0px 5px 10px #0005;
  border-radius: 10px;
}
.sharetarget a.btn{
  display: block;
  width: 100%;
  box-shadow: none;
  margin: 0;
  border-radius: 0;
  border-bottom: 1px solid #fff;
}
.sharetarget a.btn:first-child{
  border-radius: 10px 10px 0 0;
}
.sharetarget a.btn:last-child{
  border-radius: 0 0 10px 10px;
  border-bottom: none;
}

#summary .nextBtn,
#levelScreen .nextBtn{
  background: #009fe3;
  box-sizing: border-box;
  padding: 10px;
  text-align: center;
  border-radius: 10px;
  color: white;
  font-weight: bold;
  margin: 20px 40px 0 40px;
  filter: drop-shadow(0px 3px 5px #0004);
  cursor: pointer;
  transition: all .2s;
}
#summary .nextBtn:hover,
#levelScreen .nextBtn:hover{
  filter: drop-shadow(0px 5px 5px #0006);
  background: #00b3ff;
  transition: all .02s;
}
#summary .nextBtn.disabled{
  background: #e3e6e5;
  opacity: .5;
}
.hidden{
  display: none;
}

#levelScreen .upgradeHeader{
  font-size: 24px;
  color: #009fe3;
  margin-bottom: 10px;
}
#levelScreen .upgradetext{
  font-weight: bold;
}
#levelScreen .upgrades{
  display: flex;
  justify-content: space-between;
  margin: 30px 40px 20px 40px;
  /* justify-content: space-around; */
}
#levelScreen .upgrade{
  /* box-sizing: border-box; */
  position: relative;
  width: 200px;
  height: 300px;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0px 0px 10px 0px #009fe3ff;
  transition: all .2s;
  background-color: #fff;
  border: 3px solid #eee;
}
@keyframes dropGlow {
    0%{ box-shadow: 0px 0px 10px 0px #009fe3ff; }
   50%{ box-shadow: 0px 0px 40px 0px #009fe3ff; }
  100%{ box-shadow: 0px 0px 10px 0px #009fe3ff; }
}
#levelScreen .upgrade:hover{
  filter: drop-shadow(0px 3px 5px #0003);
  transition: all .2s;
  background-color: white;
  transform: scale(1.1);
}
#levelScreen .upgrade.selected{
  border: 3px solid #009fe3;
  animation: upgradeAnim 1s, dropGlow 3s infinite;
  animation-fill-mode: both;
  z-index: 10;
}
@keyframes upgradeAnim{
    0%{ transform: scaleX(1.0) scaleY(1.0); }
   40%{ transform: scaleX(1.2) scaleY(1.2); }
   60%{ transform: scaleX(0.0) scaleY(1.2); }
   80%{ transform: scaleX(1.2) scaleY(1.2); }
  100%{ transform: scaleX(1.2) scaleY(1.2); }
}
@keyframes upgradeAppear{
    0%{ opacity: 0.0; pointer-events: none;}
   60%{ opacity: 0.0; pointer-events: none; }
   61%{ opacity: 1.0; pointer-events: all; }
  100%{ opacity: 1.0; pointer-events: all; }
}
#levelScreen .upgrade .backside{
  position: absolute;
  overflow: hidden;
  border-radius: 15px;
  width: 100%;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
  background-color: #009fe3;
}
#levelScreen .upgrade .backside .text{
  font-size: 20px;
  color: #fff;
  margin-top: 50px;
  margin-left: 20px;
  animation: upgradetext 3s infinite;
}
@keyframes upgradetext {
    0% {transform: rotate(-00deg) scale(1.0);}
   20% {transform: rotate(-02deg) scale(1.2);}
   40% {transform: rotate(-00deg) scale(0.9);}
   60% {transform: rotate(-00deg) scale(1.0);}
  100% {transform: rotate(-00deg) scale(1.0);}
  
}
#levelScreen .upgrade .backside .shine{
  position: absolute;
  height: 120%;
  top: -10%;
  width: 30%;
  transform: rotate(-25deg);
  background-color: #ffffff55;
  animation: shine 3s infinite;
}
@keyframes shine {
    0% {left: -50%}
   50% {left: 150%}
  100% {left: 150%}
}

/* #levelScreen .upgrade .backglow{
  display: none;
  position: absolute;
  width: 300px;
  height: 300px;
  left: -50px;
  top: -0px;
  background: radial-gradient(circle,rgba(0, 159, 227, 1) 30%, rgba(0, 159, 227, 0) 70%);
}
@keyframes backglow{
    0%{ transform: rotate(  0deg) scale(100%,  90%) ; }
   50%{ transform: rotate(180deg) scale(100%,  90%) ; }
  100%{ transform: rotate(360deg) scale(100%,  90%) ; }
} */
#levelScreen .upgrade .frontside{
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 15px;
  padding: 10px;
  box-sizing: border-box;
  background-color: #e3e6e5;
}
#levelScreen .upgrade.notselected{
  opacity: .3;
}
#levelScreen .upgrade .image{
  width: 200px;
  height: 150px;
  margin: -10px;
  margin-bottom: -5px;
  background: #0002;
  border-radius: 15px 15px 0 0;
  /* border-radius: 50%; */
  background-size: cover;
  background-position: 50% 50%;
}
#levelScreen .upgrade .text{
  font-weight: bold;
  font-size: 12px;
  /* text-align: center; */
  margin: 20px 0 2px 0;
}
#levelScreen .upgrade .subtitle{
  font-size: 18px;
  /* font-weight: bold; */
  color: #009fe3;
}
#levelScreen .upgrade .description{
  font-size: 12px;
  margin: 4px 0 3px 0;
}
#levelScreen .upgrade .frontside{
  display: none;
}
#levelScreen .upgrade.selected .frontside{
  display: block;
  animation: upgradeAppear 1s;
  animation-fill-mode: both;
}
#levelScreen .nextBtn{
  font-size: 14px;
  padding: 7px;
  margin: 15px 0 0 0;
}

#levelScreen .level{
  display: flex;
  animation: fadeIn .3s;
  animation-fill-mode: both;
  animation-delay: .3s;
}
#levelScreen .level:nth-of-type(1){ animation-delay: 0.0s; }
#levelScreen .level:nth-of-type(2){ animation-delay: 0.4s; }
#levelScreen .level:nth-of-type(3){ animation-delay: 0.8s; }
#levelScreen .level:nth-of-type(4){ animation-delay: 1.2s; }
#levelScreen .level:nth-of-type(5){ animation-delay: 1.6s; }

#levelScreen .level .name{
  flex-grow: 1;
}
#levelScreen .level .score{
  padding: 3px 0;
  animation: popIn .3s;
  animation-fill-mode: both;
}
#levelScreen .level:nth-of-type(1) .score{ animation-delay: 0.2s; }
#levelScreen .level:nth-of-type(2) .score{ animation-delay: 0.6s; }
#levelScreen .level:nth-of-type(3) .score{ animation-delay: 1.0s; }
#levelScreen .level:nth-of-type(4) .score{ animation-delay: 1.4s; }
#levelScreen .level:nth-of-type(5) .score{ animation-delay: 1.8s; }

#levelScreen .level.total .score{
  color: #009fe3;
  font-weight: bold;
  animation: popopopIn 1.0s;
  animation-fill-mode: backwards;
  animation-delay: 4.0s;
}
#levelScreen .level.total{
  border-top: 1px solid #525f6b;
  margin-top: 10px;
  margin-bottom: 10px;
  padding-top: 10px;
  /* font-weight: bold; */
  font-size: 22px;
  animation-delay: 0.0s;
}
#levelScreen .shareimage{
  width: 100%;
  margin-top: 20px;
  margin-bottom: 15px;
  border-radius: 10px;
  animation: shareImageAppear .6s;
  animation: shareImageAppear .6s, dropGlow 3s infinite;
  animation-delay: 2.3s;
  animation-fill-mode: backwards;
  box-shadow: 0px 0px 20px 0px #009fe3;
}
@keyframes shareImageAppear{
    0% {transform: scale(0.30) rotate(0deg); opacity: 0;}
   40% {transform: scale(1.10) rotate(2deg); opacity: 1;}
   60% {transform: scale(1.05) rotate(0deg); opacity: 1;}
   80% {transform: scale(1.10) rotate(-2deg); opacity: 1;}
  100% {transform: scale(1.00) rotate(0deg); opacity: 1;}
}

#dxq{
  position: absolute;
  top: 0px;
  left: 30px;
  background: #fff;
  color: #777;
  padding: 5px;
  max-width: 100vh;
  overflow-x: auto;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
#dxq:hover{
  opacity: .5;
}
#dxq .logo{
  display: none;
  width: 200px;
  height: 40px;
  margin: 5px 0 7px 0;
  background-image: url(./assets/duerr-logo-dxq-analyze.png);
  background-size: contain;
  background-repeat: no-repeat;
}
#dxq .metrics{
  display: flex;
}
#dxq .metric{
  position: relative;
  width: 100px;
  margin: 10px 15px;
}
#dxq .metric .text{
  width: 120px;
  font-size: 16px;
  text-align: center;
  margin: 0 -10px;
}
#dxq .metric .number{
  position: absolute;
  top: 42px;
  width: 100px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #009fe3;
  color: var(--score-color);
  flex-grow: 1;
}
#dxq .metBar{
  position: relative;
  width:100px;
  height: 100px;
  border-radius: 50%;
  background: #eee;
  overflow: hidden;
}
#dxq .metBar .fill{
  position: absolute;
  width: 50%;
  height: 50.5%;
  background-color: #009fe3;
  background-color: var(--score-color);
  top:50%;
  left: 0;
  transform-origin: top right;
}
#dxq .metBar .f2{
  transform: rotate(45deg);
}
#dxq .metBar .f3{
  transform: rotate(135deg);
}
#dxq .metBar .inner{
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: white;
  top: 20px;
  left: 20px;
}
#dxq .lower{
  position: absolute;
  top:-3px;
  left:-2px;
  border: 52px solid transparent;
  border-bottom-color: white;
}
.guy{
  position: absolute;
  right: 0px;
  bottom: 0px;
  width: 60vmin;
  height: 60vmin;
  background: url(./assets/guy.png);
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  transition: all .7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.guy.hidden{
  display: block;
  opacity: 0;
  right: -60vmin;
  transform: rotate(45deg);
}
.guy .speech{
  position: absolute;
  bottom: 80%;
  left: 0%;
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0px 3px 5px #0003;
  width: 150px;
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  animation: speechAnim 3s infinite;
}
.guy .speech::after{
  content: "";
  position: absolute;
  bottom: -20px;
  right: 30px;
  width: 0;
  height: 0;
  border: 20px solid transparent;
  border-right-color: white;
  border-top-color: white;
}

.topbar .logo{
  position: absolute;
  top: 30px;
  right: 30px;
  width: 120px;
  height: 60px;
  background-image: url("./assets/duerrlogo_blau.svg");
  background-size: contain;
  background-repeat: no-repeat;
  display: none;
}

/*small screen: dxq is too big to fit, scale it down to 75%*/
@media screen and ( (max-width: 550px) or (max-height: 700px) ){
  #dxq{
    transform-origin: top center;
    transform: translate(-50%, 0) scale(.75);
    max-width: 133%;
  }
  #continue{
    /* bottom: 0; */
  }
}
/*make dxq bigger on bigger screens*/
@media screen and (min-width: 1000px) and (min-height: 700px) {
  #summary, #levelScreen, #colorselect{
    transform: translate(0, -40%) scale(1.2);
    max-height: 80%;
  }
  .topbar .logo{
    display: block;
  }
}
/*make dxq and level up bigger*/
@media screen and (min-width: 1600px) and (min-height: 900px) {
  #summary, #levelScreen, #colorselect{
    transform: translate(0, -40%) scale(1.5);
    max-height: 66%;
  }
  #dxq{
    transform-origin: top center;
    transform: translate(-50%, 0) scale(1.2);
    max-width: 80%;
  }
}
/*small screen landscape: finish button will be over the paintable, so we move it to the corner*/
@media screen and (orientation: landscape) and (max-height: 500px) {
  #continue{
    left: auto;
    right: 5vw;
  }
}

#colorselect .header{
  font-size: 32px;
  margin-bottom: 30px;
  color: #009fe3;
}
#colorselect .pigs{
  display: flex;
  justify-content: space-between;
}

#colorselect .pig{
  position: relative;
  overflow: hidden;
  height: 256px;
  width: 64px;
  cursor: pointer;
}
#colorselect .pigimage{
  position: absolute;
  height: 512px;
  width: 64px;
  top: 0;
  background-size: cover;
  transition: top .6s;
}
#colorselect.hasSelected{
  animation: fadeOutDelay 1s;
  animation-fill-mode: forwards;
}
@keyframes fadeOutDelay{
    0% {opacity: 1.0;}
   50% {opacity: 1.0;}
  100% {opacity: 0.0;}
}
#colorselect .pig:hover .pigimage{
  top: -64px;
}
#colorselect .pig.selected .pigimage{
  top: -256px;
}