@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap");
@import url("https://fonts.googleapis.com/css?family=Kiwi%20Maru");
html {
  font-size: 3vh;
}
@media (orientation: portrait) {
  html {
    font-size: 2.9vw;
  }
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  color: #fff;
  background-color: #000038;
  overflow: hidden;
  font-family: "Archivo Black", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
}

.level {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
}
@media (min-height: 500px), (orientation: portrait) {
  .level {
    top: 0.5rem;
  }
}

.refresh,
.fullscreen {
  position: absolute;
  padding: 0.2rem 0.6rem;
  border: 1px solid #fff;
  font-weight: 500;
  background-color: #000038;
  cursor: pointer;
  text-transform: uppercase;
}
.refresh:hover,
.fullscreen:hover {
  color: #000038;
  background-color: #fff;
}
@media (min-height: 500px), (orientation: portrait) {
  .refresh,
.fullscreen {
    font-size: 1rem;
  }
}

.refresh {
  top: 0.5rem;
  right: 1rem;
}

.fullscreen {
  top: 0.5rem;
  left: 4rem;
}

.controls {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  height: 100%;
}
.controls__arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.controls__arrow:after {
  content: "";
  width: 0;
  height: 0;
  margin: 1rem;
  opacity: 0.3;
}
.controls__arrow--top, .controls__arrow--bottom {
  width: 100%;
  height: 40vh;
}
.controls__arrow--left, .controls__arrow--right {
  flex-direction: column;
  width: 50%;
  height: 20vh;
}
.controls__arrow--top, .controls__arrow--left {
  align-items: flex-start;
}
.controls__arrow--bottom, .controls__arrow--right {
  align-items: flex-end;
}
.controls__arrow--top:after {
  border-left: 1rem solid transparent;
  border-right: 1rem solid transparent;
  border-bottom: 1rem solid #fff;
}
.controls__arrow--left:after {
  border-top: 1rem solid transparent;
  border-right: 1rem solid #fff;
  border-bottom: 1rem solid transparent;
}
.controls__arrow--right:after {
  border-top: 1rem solid transparent;
  border-left: 1rem solid #fff;
  border-bottom: 1rem solid transparent;
}
.controls__arrow--bottom:after {
  border-left: 1rem solid transparent;
  border-right: 1rem solid transparent;
  border-top: 1rem solid #fff;
}

.timer {
  position: absolute;
  top: 55%;
  font-size: 3rem;
}

.title-screen {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 56, 0.8);
}
.title-screen--hidden {
  display: none;
}
.title-screen__title {
  position: relative;
  font-size: 12vw;
  color: #fff;
}
.title-screen__word {
  color: #eb80b1;
}
.title-screen__button {
  position: relative;
  border: 1px solid #fff;
  color: #fff;
  padding: 0.3rem 0.6rem;
  background-color: transparent;
  font-size: 3vw;
  font-family: "Archivo Black", sans-serif;
  text-transform: uppercase;
  cursor: pointer;
}
.title-screen__button:hover {
  color: #000038;
  background-color: #fff;
}
@media (orientation: portrait) {
  .title-screen__title {
    font-size: 18vw;
  }
  .title-screen__button {
    font-size: 4.5vw;
  }
}

.game {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  width: 29.03rem;
}
.game--tutorial:before {
  position: absolute;
  bottom: -4rem;
  content: "Use arrow keys (recommended) or click the arrows to play";
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
}
@media (max-width: 767px) {
  .game--tutorial:before {
    display: none;
  }
}
.game--win:after, .game--lose:after, .game--final-win:after {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  background-color: rgba(0, 0, 56, 0.5);
  font-size: 2rem;
  text-transform: uppercase;
}
.game--win:after {
  content: "You win! Next level";
}
.game--lose:after {
  content: "You lose! Try again!";
}
.game--final-win:after {
  content: "Game completed!";
}
.game__player {
  position: absolute;
  width: var(--cell);
  height: var(--cell);
  background-color: #eb80b1;
  top: calc(var(--positionTop) * var(--cell));
  left: calc(var(--positionLeft) * var(--cell));
  transition-property: top, left;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
@media (max-width: 767px) {
  .game__player {
    transition-duration: 0.1s;
  }
}
.game__cell {
  width: var(--cell);
  height: var(--cell);
  background-color: #fff;
}
.game__cell--rock {
  background: #000038;
}
.game__cell--lava {
  background: linear-gradient(45deg, orange, #ff7d66 150%);
}
.game__cell--stop {
  position: relative;
  background: linear-gradient(45deg, #78d6c6 -50%, #fff 100%);
}
.game__cell--end {
  background: #80c0a1;
}
