@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap");
.btn {
  width: 120px;
  height: 40px;
  border-radius: 10px;
  background-color: #fff0e8;
  color: #f69893;
  border: none;
  font-size: 22px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.5s ease;
}
.btn:hover {
  background-color: #ffd2da;
  font-size: 23px;
}

html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  box-sizing: border-box;
  font-family: "Montserrat", sans-serif;
}
* a {
  text-decoration: none;
}
*::before {
  box-sizing: border-box;
}
*::after {
  box-sizing: border-box;
}

body {
  background: #faf8ef;
}

.container {
  margin: 0 auto;
  max-width: 1280px;
  padding: 0 40px;
}

.header {
  height: 85px;
  background: #f69893;
  color: #fff0e8;
}
.header_wrapper {
  position: relative;
  padding: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header_wrapper a {
  color: #fff0e8;
  transition: all 0.5s;
}
.header_wrapper a:hover {
  color: #ffd2da;
}
.header_logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  column-gap: 5px;
}
.header_logo h1 {
  font-size: 50px;
}
.header_logo h2 {
  font-size: 11px;
  font-weight: 400;
}
.header_score {
  height: 40px;
  border-radius: 10px;
  background-color: #fff0e8;
  color: #f69893;
  padding: 5px;
  font-size: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.header_info {
  position: absolute;
  left: 150px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 100%;
  border: none;
  background-color: #fff0e8;
  color: #f69893;
  font-size: 22px;
  font-weight: 500;
}

.game {
  position: relative;
  padding: 30px 0;
  min-height: calc(100vh - 172px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.game_wrapper {
  width: 460px;
  height: 460px;
  display: flex;
  flex-wrap: wrap;
  position: relative;
  background-color: #bbada0;
  border-radius: 10px;
  padding: 10px;
}
.game_block {
  width: 90px;
  height: 90px;
  background-color: #cdc1b4;
  margin: 10px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  color: #776e65;
  transition: 0.5s all ease;
}
.game_block.replace {
  opacity: 0.5;
  transform: scale(1.15);
}
.game_description {
  position: absolute;
  right: 5px;
  bottom: 5px;
  font-size: 8px;
  color: #f69893;
  font-weight: 200;
}
.game_controls {
  display: none;
  margin: 15px auto 0 auto;
  width: 150px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.game_controls #up {
  order: 1;
}
.game_controls-sides {
  order: 2;
  display: flex;
  justify-content: space-between;
  width: 100%;
}
.game_controls #down {
  order: 3;
}
.game_controls > .btn, .game_controls-sides > .btn {
  font-size: 30px;
  width: 50px;
  height: 50px;
  text-align: center;
  line-height: 50px;
}
.game_modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}
.game_modal_wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  row-gap: 10px;
  padding: 15px;
  border: 1px solid #b1b1b1;
  width: 80%;
  max-width: 460px;
  border-radius: 10px;
  background-color: #faf8ef;
}
.game_modal_wrapper_high-score {
  color: #ffd2da;
  font-weight: normal;
  font-size: 22px;
}
.game_modal_wrapper_high-score span {
  font-weight: bold;
  font-size: 28px;
}
.game_modal_wrapper_stats {
  margin: 0 auto;
}
.game_modal_wrapper_close-button {
  color: #b1b1b1;
  float: right;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
  cursor: pointer;
  transition: all 0.5s ease;
}
.game_modal_wrapper_close-button:hover, .game_modal_wrapper_close-button :focus {
  color: black;
  text-decoration: none;
}
.game_modal_wrapper p {
  font-size: 18px;
  margin: 10px 0;
}
.game_modal_wrapper button {
  width: 150px;
}
.game_popup {
  transition: 0.3s all ease;
  position: absolute;
  bottom: 15px;
  right: 50%;
  opacity: 0;
  transform: translateX(50%);
  width: 460px;
  margin-top: 20px;
}
.game_popup_wrapper {
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-color: #f69893;
  width: 100%;
  border-radius: 10px;
  color: #faf8ef;
}

.active {
  transition: 0.5s all ease;
}
.active:hover {
  transform: scale(1.1);
}

.controls {
  display: flex;
}

.active_popup {
  opacity: 1;
}

.footer {
  background: #f69893;
  color: #fff0e8;
}
.footer_wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 28px;
}
.footer_wrapper a {
  color: #fff0e8;
  transition: all 0.5s;
}
.footer_wrapper a:hover {
  color: #ffd2da;
}
.footer_wrapper svg, .footer_wrapper img {
  transition: all 0.5s;
}
.footer_wrapper svg:hover, .footer_wrapper img:hover {
  transform: scale(1.2);
}
.footer_logo {
  height: 40px;
}
.footer_logo img {
  height: 100%;
}

.c2 {
  background-color: #eee4da;
}

.c4 {
  background-color: #ede0c8;
}

.c8 {
  background-color: #f2b179;
}

.c16 {
  background-color: #f59563;
}

.c32 {
  background-color: #f67c5f;
}

.c64 {
  background-color: #f65e3b;
}

.c128 {
  background-color: #edcf72;
}

.c256 {
  background-color: #edcc61;
}

.c512 {
  background-color: #edc850;
}

.c1024 {
  background-color: #edc53f;
}

.c2048 {
  background-color: #edc22e;
}

.c4096 {
  background-color: #a3d4ff;
}

.c8192 {
  background-color: #8fb3ff;
}

.c16384 {
  background-color: #7d91ff;
}

.c32768 {
  background-color: #6b70ff;
}

.c65536 {
  background-color: #5955ff;
}

.c131072 {
  background-color: #4739ff;
}

.c262144 {
  background-color: #361dff;
}

.c524288 {
  background-color: #2400ff;
}

@media (max-width: 768px) {
  .container {
    max-width: 710px;
  }
  .header {
    height: 60px;
  }
  .header_logo h1 {
    font-size: 30px;
  }
  .header_logo h2 {
    font-size: 10px;
    font-weight: 300;
  }
  .header_score, .header .btn {
    height: 35px;
    font-size: 20px;
  }
  .game {
    min-height: calc(100vh - 115px);
    padding: 15px 0;
  }
  .game_wrapper {
    width: 350px;
    height: 350px;
    align-content: center;
    justify-content: center;
    overflow: hidden;
  }
  .game_block {
    width: 60px;
    height: 60px;
    font-size: 16px;
  }
  .game_controls {
    display: flex;
  }
  .game_popup {
    width: 350px;
  }
  .footer_wrapper {
    padding: 10px 20px;
    font-size: 20px;
  }
  .footer_wrapper svg, .footer_wrapper img {
    width: 30px;
    height: 30px;
  }
  .footer_logo {
    height: 30px;
  }
}
@media (max-width: 640px) {
  .container {
    max-width: 600px;
  }
  .header {
    height: 45px;
  }
  .header_wrapper {
    padding: 5px 0;
  }
  .header_logo h1 {
    font-size: 20px;
  }
  .header_logo h2 {
    font-size: 7px;
    font-weight: 200;
  }
  .header_score, .header .btn {
    height: 30px;
    width: 75px;
    font-size: 12px;
  }
  .header_info {
    left: 100px;
  }
  .game {
    min-height: calc(100vh - 100px);
    padding: 15px 0;
  }
  .game .container {
    padding: 0;
  }
  .game_wrapper {
    width: 300px;
    height: 300px;
    align-content: center;
    justify-content: center;
    overflow: hidden;
  }
  .game_block {
    width: 50px;
    height: 50px;
  }
  .game_controls {
    width: 130px;
  }
  .game_controls > .btn, .game_controls-sides > .btn {
    font-size: 30px;
    width: 40px;
    height: 40px;
    line-height: 40px;
  }
  .game_popup {
    width: 300px;
  }
}
@media (max-width: 340px) {
  .container {
    margin: 0 10px;
    max-width: 100%;
    padding: 0;
  }
  .header_info {
    left: 70px;
  }
  .game {
    min-height: calc(100vh - 100px);
    padding: 15px 0;
  }
  .game_wrapper {
    width: 250px;
    height: 250px;
  }
  .game_block {
    width: 37px;
    height: 37px;
    font-size: 13px;
  }
  .game_popup {
    width: 250px;
  }
}
