/*
 * Main style for BattleWave
 */

@font-face {
  font-family: 'DiscoDiva';
  font-style: normal;
  font-weight: 400;
  src: local('DiscoDiva'), local('Disco-Diva'), local('Disco Diva'), url('../fonts/DiscoDiva.ttf') format('truetype');
}

@font-face {
  font-family: 'Neon';
  font-style: normal;
  font-weight: 400;
  src: local('Neon'), local('NEON'), local('NEON____'), url('../fonts/Neon.ttf') format('truetype');
}

html, body {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #111;
}

#target {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;

  cursor: none;

  animation-name: crtIn;
  animation-duration: .4s;
  animation-delay: 0s;
  animation-fill-mode: forwards;
  animation-timing-function: linear;
  animation-iteration-count: 1;

  filter: brightness(100%) grayscale(0%);
}

#target:after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: -webkit-linear-gradient(top, transparent 0%, rgba(0,0,0,0.4) 100%);
  background: -moz-linear-gradient(top, transparent 0%, rgba(0,0,0,0.4) 100%);
  background: -o-linear-gradient(top, transparent 0%, rgba(0,0,0,0.4) 100%);
  background: -ms-linear-gradient(top, transparent 0%, rgba(0,0,0,0.4) 100%);
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 100%);
  -webkit-background-size: 100% 4px;
  -moz-background-size: 100% 4px;
  background-size: 100% 4px;
  background-repeat: repeat;

  pointer-events: none;
  z-index: 999;

  animation-name: flicker;
  animation-duration: .1s;
  animation-delay: 0s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

#target.off {
  animation-name: crtOut;
  animation-duration: .4s;
  animation-delay: 0s;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(0.230, 1.000, 0.320, 1.000);
  animation-iteration-count: 1;
  filter: brightness(100%) grayscale(0%);
}

#target > canvas {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}

#message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scaleX(0);
  font-size: 14vh;
  width: 100vh;
  opacity: 0;

  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;

  transition: transform .4s, opacity .4s;

  z-index: 900;
}

#message.visible {
  transform: translate(-50%, -50%) scaleX(1);
  opacity: 1;
}

#message:before {
  content: '';
  display: block;
  position: absolute;

  top: 0;
  left: 0;

  width: 0;
  height: 0;
  border-style: solid;
  border-width: 40vh 70vh 20vh 0;
  border-color: transparent #34a5cf transparent transparent;
  transform: translate(4vh, -12vh) scale(1.05);
  filter: blur(20px);

  z-index: -1;
}

#message:after {
  content: '';
  display: block;
  position: absolute;

  top: 0;
  left: 0;

  width: 0;
  height: 0;
  border-style: solid;
  border-width: 40vh 70vh 20vh 0;
  border-color: transparent #28052f transparent transparent;
  transform: translate(4vh, -12vh);

  z-index: -1;
}

#message > span {
  display: block;
}

#message > span.two {
  font-family: "Yellowtail", sans-serif;
  line-height: 1em;
  color: #af2599;
  text-shadow: 2px 2px 0 #e4bbf0,
              0 0 20px rgba(210, 47, 183, 1);
  transform: scale(1.25) rotateZ(-16deg);
}

#message > span.one, #message > span.three {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  color: transparent;

  background: -webkit-linear-gradient(top, #151C60, #C6CBF5 40%, black 40%, #E1A0CE 65%, white);
  background: -moz-linear-gradient(top, #151C60, #C6CBF5 40%, black 40%, #E1A0CE 65%, white);
  background: -o-linear-gradient(top, #151C60, #C6CBF5 40%, black 40%, #E1A0CE 65%, white);
  background: -ms-linear-gradient(top, #151C60, #C6CBF5 40%, black 40%, #E1A0CE 65%, white);
  background: linear-gradient(to bottom, #151C60, #C6CBF5 40%, black 40%, #E1A0CE 65%, white);

  background-clip: text;
  -moz-background-clip: text;
  -webkit-background-clip: text;

  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-width: 3px;
  -webkit-text-stroke-color: white;
}

#gui {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 900;
  pointer-events: none;
}

.hp {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  padding: .5em;
  font-size: 60px;
  font-weight: 400;
  font-family: 'Neon', sans-serif;

  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.hp > span {
  display: inline-block;
  position: relative;
  padding: 0;
  margin: 0;
  text-shadow: 0 0 20px rgba(232, 116, 155, 0.8);
  color: #E91E63;
  opacity: .8;
  z-index: 900;
}

.hp > span.out {
  animation-name: burnout;
  animation-duration: 1s;
  animation-delay: .5s;
  animation-fill-mode: forwards;
  animation-timing-function: linear;
  animation-iteration-count: 1;
}

.hp:before {
  content: 'WAVES';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  padding: .5em;
  font-size: 60px;
  font-weight: 400;
  font-family: 'Neon', sans-serif;
  color: #222;
  text-shadow: 0 0 2px #000,
               0 0 30px rgba(255, 255, 255, .1);
  z-index: 0;
}

@keyframes flicker {
  from {
    opacity: .7;
  }
  to {
    opacity: 1;
  }
}

@keyframes burnout {
  from {
    opacity: .8;
  }
  19% {
    opacity: .4;
  }
  20% {
    opacity: 0;
  }
  21% {
    opacity: .7;
  }
  40% {
    opacity: .7;
  }
  41% {
    opacity: 0;
  }
  42% {
    opacity: .5;
  }
  60% {
    opacity: .5;
  }
  62% {
    opacity: 0;
  }
  to {
    opacity: 0;
  }
}

@keyframes crtIn {
  from {
    transform: scale(0, 0);
    filter: brightness(500%) grayscale(100%);

  }
  50% {
    transform: scale(.01, .01);
    filter: brightness(500%) grayscale(100%);
  }
  99% {
    transform: scale(.8, .01);
    filter: brightness(500%) grayscale(100%);
  }
  to {
    transform: scale(1, 1);
    filter: brightness(100%) grayscale(0%);
  }
}

@keyframes crtOut {
  from {
    transform: scale(1, 1);
    filter: brightness(100%) grayscale(0%);
  }
  50% {
    transform: scale(.8, .01);
    filter: brightness(500%) grayscale(100%);
  }
  99% {
    transform: scale(.01, .01);
    filter: brightness(500%) grayscale(100%);
  }
  to {
    transform: scale(0, 0);
    filter: brightness(500%) grayscale(100%);
  }
}
