:root {
  --pink: #f21d7a;
  --aqua: aqua;
  --car: url(./assets/car.png);
  --borderAnimation: border 1s linear infinite;
  --animationTime: 1.5s;
}

* {
  box-sizing: border-box;
}

body {
  padding: 0;
  margin: 0;
  overflow-x: hidden;
}

body::-webkit-scrollbar {
  width: 14px;
}

body::-webkit-scrollbar-track {
  background: #d4d4d4;
}

body::-webkit-scrollbar-thumb {
  background: #8d8d8d;
  border-radius: 7px;
  border-left: 4px solid #d4d4d4;
  border-right: 4px solid #d4d4d4;
  width: 24px;
}

a {
  text-decoration: none;
}

#game-container {
  width: 100vw;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 600px;
  font-family: monospace;
  color: white;
  transform: scale(1);
}

.hero-text {
  color: white;
  position: relative;
  font-family: monospace;
  text-align: center;
}

#game-box {
  width: 900px;
  height: 525px;
  min-height: 525px;
  border: 2px solid white;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  font-size: 0px;
  text-align: center;
  perspective: 600px;
  box-shadow: 0 0 50px 10px black;
  margin: 25px 0;
}

#game-box::after {
  content: '';
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-image: var(--car);
  background-size: 100% 100%;
  background-position: 0% 50%;
  background-repeat: no-repeat;
  z-index: 1;
}

.ouch::after {
  background-color: rgba(255, 0, 0, 0.25);
  animation: ouch 0.5s linear forwards !important;
}

@keyframes ouch {
  25% {
    transform: rotate(1deg);
  }

  50% {
    transform: rotate(-1deg);
  }

  75% {
    transform: rotate(1deg);
  }
}

#lanes {
  width: 66%;
  height: 200%;
  margin-top: -35%;
  background-size: 100% 200px;
  background-position: 0% 0%;
  margin-left: calc(17%);
  position: relative;
  transform: rotateX(75deg);
  background-size: 100% 10%;
  transition: 0.25s;
}

#lanes::before {
  width: 110%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 255, 255, 0.75) 10%,
    transparent 10%,
    transparent 90%,
    rgba(0, 255, 255, 0.75) 90%
  );

  background-size: 100% 100px;
  content: '';
  position: absolute;
  top: 0;
  left: -5%;
  z-index: -1;
  animation: var(--borderAnimation);
}

#lanes::after {
  width: 100%;
  height: 100%;
  background: transparent;
  background: linear-gradient(
      to right,
      transparent 33.33%,
      rgba(255, 255, 255, 0.05) 33.33%,
      rgba(255, 255, 255, 0.05) 66.33%,
      transparent 66.33%
    ),
    linear-gradient(to bottom, #000f1e, #00143e);
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
}

@keyframes border {
  100% {
    background-position: 0 600px;
  }
}

#score-box {
  position: absolute;
  width: 100%;
  text-align: center;
  text-transform: uppercase;
  top: 64%;
  font-size: 12px;
  z-index: 2;
  pointer-events: none;
}

#score {
  font-family: sans-serif;
  font-size: 60px;
  line-height: 100%;
}

#car {
  width: 100px;
  height: 100px;
  background: red;
  position: absolute;
  bottom: 5%;
  left: calc(50% - 50px);
  clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
}

.left {
  left: calc(33% - 50px) !important;
}

.right {
  left: calc(66% - 50px) !important;
}

.right + #lanes {
  margin-left: calc(0%);
}

.left + #lanes {
  margin-left: calc(34%);
}

.enemy {
  width: 25px;
  height: 15px;
  border-radius: 50%;
  position: absolute;
  transform-style: preserve-3d;
  background: #f21d7a;
  box-shadow: 0 0 0 1px aqua, inset 0 3px 0 3px rgba(0, 155, 155, 1),
    inset 0 8px 0 8px rgba(0, 100, 100, 1);
}

.enemy0 {
  top: 5%;
  left: 15%;
  animation: enemy1 var(--animationTime) steps(5) forwards;
}

@keyframes enemy1 {
  100% {
    opacity: 1;
    left: 25%;
    top: 110%;
    width: 100px;
    height: 60px;
    transform: translatex(-50%);
  }
}

.enemy1 {
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  animation: enemy2 var(--animationTime) steps(5) forwards;
}

@keyframes enemy2 {
  100% {
    opacity: 1;
    top: 110%;
    transform: translateX(-17.5%);
    width: 100px;
    height: 60px;
  }
}

.enemy2 {
  top: 5%;
  left: 75%;
  animation: enemy3 var(--animationTime) steps(5) forwards;
}

@keyframes enemy3 {
  100% {
    opacity: 1;
    left: 75%;
    top: 110%;
    width: 100px;
    height: 60px;
  }
}

#game-box::before {
  content: '';
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-size: 100% 100%;
  background-position: 0% 50%;
  background-repeat: no-repeat;
  z-index: 1;
  opacity: 0.5;
}

.cracked-one::before {
  background-image: url(./assets/cracked-one.png);
}

.cracked-two::before {
  background-image: url(./assets/cracked-two.png);
}

.cracked-three:before {
  background-image: url(./assets/cracked-three.png);
}

.cracked-four::before {
  background-image: url(./assets/cracked-four.png);
}

.cracked-five::before {
  background-image: url(./assets/cracked-five.png);
}

#gauge {
  width: 111px;
  height: 140px;
  position: absolute;
  bottom: -3.5%;
  left: 50%;
  transform: translateX(-50%) scale(0.75);
  z-index: 2;
}

.gauge-one {
  background-image: url(./assets/gauge-one.png);
}

.gauge-two {
  background-image: url(./assets/gauge-two.png);
  animation: wha 1s linear forwards;
}

.gauge-three {
  background-image: url(./assets/gauge-three.png);
  animation: wha2 1s linear forwards;
}

.gauge-four {
  background-image: url(./assets/gauge-four.png);
  animation: wha3 1s linear forwards;
}

.gauge-five {
  background-image: url(./assets/gauge-five.png);
  animation: wha4 1s linear infinite;
}

@keyframes wha {
  50% {
    transform: translateX(-50%) scale(0.65);
  }
}

@keyframes wha2 {
  50% {
    transform: translateX(-50%) scale(0.65);
  }
}

@keyframes wha3 {
  50% {
    transform: translateX(-50%) scale(0.65);
  }
}

@keyframes wha4 {
  50% {
    filter: invert(1);
  }
}

#end-dead,
#end-finish,
#game-over {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  padding: 10px 20px 10px 15px;
  color: black;
  font-size: 60px;
  line-height: 100%;
  font-family: 'Titillium Web', sans-serif;
  font-style: italic;
  cursor: pointer;
  background: white;
  border-radius: 10px;
  box-shadow: 4px 4px #f008b7;
  text-shadow: 2px 2px aqua;
  max-width: 275px;
}

#end-finish,
#game-over {
  font-size: 50px;
  width: 100%;
  max-width: 320px;
  top: 50%;
}

.finish-h3 {
  font-size: 28px;
  line-height: 36px;
  text-shadow: none;
  text-transform: uppercase;
}

.finish-h2 {
  font-size: 36px;
  line-height: 36px;
}

.offer-btn {
  color: black;
  background: var(--pink);
  display: block;
  padding: 10px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 28px;
  text-shadow: 1px 1px white;
}

.offer-btn:hover {
  background: var(--aqua);
}

.offer-disc {
  font-size: 11px;
  line-height: 100%;
  letter-spacing: 0;
  font-family: sans-serif;
}

.end-p {
  font-size: 24px;
  line-height: 30px;
  letter-spacing: -2px;
  font-family: monospace;
  text-shadow: none;
  color: black;
}

.finish-strong {
  font-size: 60px;
}

#end-dead,
#end-finish,
#game-over {
  display: none;
  cursor: inherit;
}

.end-on {
  display: block !important;
  animation: end 1s linear forwards;
}

@keyframes end {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
  }

  75% {
    transform: translate(-50%, -50%) scale(1.15);
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

#end-dead {
  color: #f008b7;
  text-shadow: 2px 2px black;
}

.wrapper {
  background: radial-gradient(
      ellipse at center,
      rgba(0, 0, 0, 0.6) 80%,
      rgba(0, 0, 0, 1) 100%
    ),
    url(./assets/background.jpg);
  background-size: cover;
  min-height: 100vh;
  overflow: hidden;
  perspective: 1200px;
}

#hero {
  position: relative;
  transform: scale(0.65);
  z-index: 1;
}

.chrome {
  position: relative;
  color: white;
  font-size: 200px;
  font-family: 'Titillium Web', sans-serif;
  font-style: italic;
  margin: 0;
  line-height: 1;
  text-shadow: 5px 5px aqua;
  text-transform: uppercase;
}

.dreams {
  position: absolute;
  margin: 0px;
  font-family: 'Mr Dafoe', cursive;
  font-size: 100px;
  color: #f008b7;
  margin-left: 400px;
  margin-top: -80px;
  text-shadow: 2px 2px white;
  z-index: 20;
}

#left-btn,
#right-btn {
  width: 50%;
  height: 100%;
  position: absolute;
  bottom: 0;
  background-color: transparent;
  z-index: 3;
  opacity: 0;
  display: none;
}

#left-btn {
  left: 0;
}

#right-btn {
  right: 0;
}

#left-btn::after,
#right-btn::after {
  content: '<';
  position: absolute;
  font-size: 100px;
  display: block;
  text-align: right;
  right: 50px;
  top: 60%;
}

#right-btn::after {
  content: '>';
  text-align: left;
  left: 50px;
}

#finish-line {
  width: 100%;
  height: 30px;
  background-image: linear-gradient(45deg, var(--pink) 25%, transparent 25%),
    linear-gradient(-45deg, var(--pink) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--pink) 75%),
    linear-gradient(-45deg, transparent 75%, var(--pink) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  position: absolute;
  top: 0;
  opacity: 0;
}

.finish-line {
  animation: finish 2s linear forwards;
}

@keyframes finish {
  0% {
    opacity: 1;
  }

  100% {
    top: 100%;
    opacity: 1;
  }
}

#start-btn {
  position: relative;
  z-index: 2;
  padding: 10px 20px 10px 15px;
  color: black;
  line-height: 100%;
  font-family: 'Titillium Web', sans-serif;
  font-style: italic;
  background: white;
  border-radius: 10px;
  box-shadow: 4px 4px #f008b7;
  text-shadow: 2px 2px aqua;
  text-align: center;
  white-space: nowrap;
}

.start-text {
  margin: 0 0 10px 0;
  font-size: 18px;
  text-shadow: none;
  font-family: monospace;
  letter-spacing: 0px;
}

.difficulty {
  font-size: 24px;
  text-transform: uppercase;
  line-height: 28px;
  background: #efefef;
  padding: 10px;
  border-radius: 5px;
  display: inline-block;
  cursor: pointer;
  margin: 0 5px;
}

.start-off {
  opacity: 0.15;
  pointer-events: none;
  user-select: none;
}

.github-corner:hover .octo-arm {
  animation: octocat-wave 560ms ease-in-out;
}
@keyframes octocat-wave {
  0%,
  100% {
    transform: rotate(0);
  }
  20%,
  60% {
    transform: rotate(-25deg);
  }
  40%,
  80% {
    transform: rotate(10deg);
  }
}
@media (max-width: 500px) {
  .github-corner:hover .octo-arm {
    animation: none;
  }
  .github-corner .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
  }
}

@media screen and (max-width: 900px) {
  #game-box {
    transform: scale(0.45) translateY(-25px);
    margin: 0;
  }

  .hero-text {
    margin-top: -25px;
  }

  #hero {
    transform: scale(0.3);
  }

  #left-btn,
  #right-btn {
    opacity: 0.25;
    display: block;
  }
}
