html {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  width: 100%;
  height: 100vh;
  font-family: "Kanit", sans-serif;
  font-weight: 900;
  font-style: normal;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span {
  margin: 0;
}

a {
  text-decoration: none;
}

ul {
  list-style: none;
  padding: 0;
}

body {
  padding: 0;
  margin: 0;
}

.game {
  display: flex;
  gap: 8vw;
  margin-top: 25px;
  margin-bottom: 20px;
  position: relative;
}

.main {
  width: 100%;
  height: 100vh;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
}

.loader {
  position: absolute;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.6s cubic-bezier(0.32, 0.66, 0.58, 1);
}

section {
  position: relative;
  width: 250px;
  height: 250px;
  /* background: aliceblue; */
  overflow: hidden;
}

section .wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: url(water.svg);
  background-size: 416px 140px;
  animation: animate 3.5s linear infinite;
  z-index: 1000;
  opacity: 1;
  animation-delay: 0s;
}

@keyframes animate {
  from {
    background-position-x: 416px;
  }

  to {
    background-position-x: 0;
  }
}

section .ship {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 158px;
  height: 120px;
  background: url(ship.svg);
  background-repeat: no-repeat;
  background-size: contain;
  transform: translate(-50%, 50%);

  animation: ship 1.3s infinite cubic-bezier(0.64, 0.3, 0.51, 0.96) alternate;

  opacity: 1;
  animation-delay: 0s;
}

@keyframes ship {
  from {
    transform: rotate(-15deg);
    bottom: 26%;
    left: 18%;
  }

  to {
    transform: rotate(10deg);
    bottom: 24%;
    left: 18%;
  }
}

.board {
  display: flex;
  flex-direction: column;
  gap: 2vw;
}

.menu {
  display: flex;
  gap: 10px;
  justify-content: center; /* Центрируем кнопки */
}

.move-ship__btn,
.start__btn {
  font-family: "Kanit", sans-serif;
  font-weight: 900;
  font-size: 1.2rem; /* Размер текста кнопки */
  padding: 1vw 2vw; /* Пространство внутри кнопок */
  background-color: #61c6ff; /* Цвет фона */
  color: white; /* Цвет текста */
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.move-ship__btn:hover,
.start__btn:hover {
  background-color: #47a9e0; /* Цвет фона при наведении */
}

.move-ship__btn:active,
.start__btn:active {
  background-color: #318bbf; /* Цвет фона при клике */
}

.start__btn {
  background-color: #ff7f50; /* Индивидуальный цвет для кнопки START */
}

.start__btn.disable {
  pointer-events: none;
}

.start__btn:hover {
  background-color: #e76a41; /* Цвет фона при наведении для START */
}

.start__btn:active {
  background-color: #c45635; /* Цвет фона при клике для START */
}

.move-ship__btn {
  background-color: #61c6ff; /* Цвет для RANDOMISE */
}

.disable {
  background-color: #9d9d9d;
}

.move-ship__btn.disable {
  pointer-events: none;
}

.move-ship__btn:hover {
  background-color: #47a9e0;
}

.move-ship__btn:active {
  background-color: #318bbf;
}

.sound__icon {
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 3vw;
}

.sound__icon__inner {
  position: relative;
}

.sound__on {
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease-out;
}

.sound__off {
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease-out;
}

/* .sound__off.hidden {
  visibility: hidden;
  transition: all 0.9s ease;
} */

.sound-tern__el-1 {
  position: absolute;
  content: "";
  top: 42%;
  left: 27px;
  transform: translate(-35%, -30%);
}

.sound-tern__el-2 {
  position: absolute;
  content: "";
  top: 42%;
  left: 30px;
  transform: translate(-50%, -38%);
}

.sound-off-1,
.sound-off-1 {
  position: absolute;
  content: "";
  top: 42%;
  left: 30px;
  transform: translate(-45%, -26%);
}

.hidden {
  visibility: hidden;
  opacity: 0;
}

.icon__body {
  position: relative;
  transform: translate(0%, 10%);
}

.game-board {
  position: relative;
}

.game-board__inner {
  display: grid;
  grid-template-rows: repeat(10, 1fr); /* Each cell can grow to fit space */
  grid-template-columns: repeat(10, 1fr);
  width: 35vw; /* Adjusts to the viewport width */
  height: 35vw; /* Matches the width to ensure square sections */
  max-width: 75vh; /* Keeps it responsive and prevents the board from exceeding viewport height */
  max-height: 75vh; /* Ensures the board stays within the viewport */
  /* border: 1px solid #000; */
  margin: 0 auto; /* Centers the game board */
}

.sections {
  aspect-ratio: 1 / 1; /* Keeps each section square */
  position: relative;
  background-color: rgba(97, 198, 255, 0.2);
  margin: 1px;
  border-radius: 10%;
  transition: all 0.1s ease;
}

.sections:hover {
  background-color: rgba(97, 198, 255, 0.4);
}

@media (pointer: coarse) {
  .sections:hover {
    background-color: rgba(97, 198, 255, 0.2);
  }
  .git__icon:hover {
    transform: scale(1.5);
  }

  .btn__easy:hover {
    transform: scale(1.1);
  }

  .btn__hard:hover {
    transform: scale(1.1);
  }

  .start__btn:hover {
    background-color: #e76a41; /* Цвет фона при наведении для START */
  }

  .move-ship__btn:hover {
    background-color: #47a9e0;
  }
}

.ship-part {
  width: 100%;
  height: 100%;
  background-color: rgba(157, 157, 157, 0.6);
  border-radius: 10%;
}

.boom {
  width: 100%;
  height: 100%;
  background-color: rgba(97, 198, 255, 0.4);
  border-radius: 10%;
}

.destroy {
  width: 100%;
  height: 100%;
  background-color: rgba(97, 198, 255, 0.4);
  border-radius: 10%;
  position: relative;
}

.destroy:before,
.destroy:after {
  opacity: 90%;
  content: "";
  z-index: 100;
  position: absolute;
  background-color: #ff0055;
}

.destroy:before {
  height: 3.8vw;
  width: 0.3vw;
  background-color: #ff0055;
  top: -6%;
  left: 45%;
  border-radius: 20px;
  rotate: 45deg;
}

.destroy:after {
  height: 3.8vw;
  width: 0.3vw;
  background-color: #ff0055;
  top: -5%;
  left: 44%;
  border-radius: 20px;
  rotate: -45deg;
}

.info__blure {
  position: absolute;
  top: 0;
  z-index: 999;
  visibility: hidden;
  height: 100vh;
  width: 100%;
}

.info {
  height: 150px;
  width: 300px;
  background-color: azure;
  border-radius: 5px;
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  margin-top: -150px;
  visibility: hidden;
  transition: all 0.3s ease;
}

.vis {
  visibility: visible;
  z-index: 999;
  backdrop-filter: blur(3px);
  transition: all 0.2s ease-in;
}

.open {
  height: 150px;
  width: 300px;
  background-color: azure;
  border-radius: 5px;
  display: flex;
  text-align: center;
  align-items: center;
  margin: 0 auto;
  visibility: visible;
  margin-top: 100px;
}

.letter {
  text-align: center;
  width: 3.5vw;
}

.number {
  height: 3vw;
}

.number__side {
  position: absolute;
  top: 0.2vw;
  left: -3vw;
  display: flex;
  flex-direction: column;
  gap: 0.5vw;
  font-size: 2vw;
  color: #717c96;
  opacity: 70%;
}

.letters__side {
  display: grid;
  grid-template-rows: repeat(1, 30px); /* Each cell can grow to fit space */
  grid-template-columns: repeat(10, 1fr);
  position: absolute;
  top: -4vw;
  z-index: 100;
  font-size: 2vw;
  color: #717c96;
  opacity: 70%;
}

.footer__inner {
  color: #717c96;
  opacity: 70%;

  align-content: center;
}

.creator {
  margin: 0 auto;
  width: max-content;
  display: flex;
  gap: 0.5rem;
  font-size: 1rem;
}

.github-logo {
  display: block;
  align-content: center;
  display: flex;
  flex-wrap: wrap;
}

.git__icon {
  transition: all 0.2s ease;
}

.git__icon:hover {
  transform: scale(1.5);
}

.choose__dif {
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  z-index: 200;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2vw;
  padding-bottom: 3vw;
  padding-left: 6vw;
  padding-right: 6vw;
  border-radius: 10px;
  transition: all 0.4s ease-in;
  transform: translate(-50%, -50%);
  text-wrap: nowrap;
}

.choose__title {
  line-height: 3vw;
  font-size: 3vw;
  font-weight: 500;
  color: #717c96;
}

.choose__container-btn {
  display: flex;
  flex-direction: column;
  margin-top: 3vw;
  gap: 1vw;
}

.btn__easy {
  cursor: pointer;
  padding: 0.5vw 2vw 0.5vw 2vw;
  background-color: inherit;
  border: 4px solid #61c6ff;
  border-radius: 10px;
  color: #61c6ff;
  font-size: 2vw;
  font-weight: 600;
  transition: all 0.2s ease-out;
}

.btn__easy:hover {
  transform: scale(1.1);
}

.btn__hard:hover {
  transform: scale(1.1);
}

.btn__easy:active {
  color: #f9f9f9;
  background-color: #61c6ff;
}

.btn__hard:active {
  color: #f9f9f9;
  background-color: #ff7f50;
}

.btn__hard {
  cursor: pointer;
  padding: 0.5vw 2vw 0.5vw 2vw;
  background-color: inherit;
  border: 4px solid #ff7f50;
  border-radius: 10px;
  color: #ff7f50;
  font-size: 2vw;
  font-weight: 600;
  transition: all 0.2s ease-in;
}

@media screen and (max-width: 768px) {
  .main {
    justify-content: space-evenly;
  }

  button {
    font-family: "Kanit", sans-serif;
    font-weight: 900;
    font-size: 1rem; /* Размер текста кнопки */
    padding: 1vw 2vw; /* Пространство внутри кнопок */
    background-color: #61c6ff; /* Цвет фона */
    color: white; /* Цвет текста */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }

  .icon__body {
    width: 18px;
    height: 26px;
  }

  .sound__icon {
    width: 6vw;
  }

  .sound-tern__el-1 {
    position: absolute;
    content: "";
    top: 42%;
    left: 23px;
    width: 4px;
    height: 12px;
    transform: translate(-35%, -30%);
  }

  .sound-tern__el-2 {
    position: absolute;
    content: "";
    top: 42%;
    left: 25px;
    width: 8px;
    height: 20px;
    transform: translate(-50%, -38%);
  }

  .sound-off-1,
  .sound-off-1 {
    position: absolute;
    content: "";
    top: 42%;
    left: 25px;
    transform: translate(-45%, -26%);
  }

  .destroy:before {
    height: 3.3vw;
    width: 0.3vw;
    background-color: #ff0055;
    top: -4%;
    left: 50%;
    border-radius: 20px;
    rotate: 45deg;
  }

  .destroy:after {
    height: 3.3vw;
    width: 0.3vw;
    background-color: #ff0055;
    top: -4%;
    left: 50%;
    border-radius: 20px;
    rotate: -45deg;
  }

  .choose__title {
    line-height: 6vw;
    font-size: 5vw;
    font-weight: 500;
    color: #717c96;
  }

  .choose__container-btn {
    display: flex;
    flex-direction: column;
    margin-top: 4vw;
    gap: 1vw;
  }

  .btn__easy {
    line-height: 15px;
    cursor: pointer;
    padding: 1vw 2.5vw 1vw 2.5vw;

    font-size: 4vw;
  }

  .btn__easy:hover {
    transform: scale(1.1);
  }

  .btn__hard:hover {
    transform: scale(1.1);
  }

  .btn__easy:active {
    color: #f9f9f9;
    background-color: #61c6ff;
  }

  .btn__hard:active {
    color: #f9f9f9;
    background-color: #ff7f50;
  }

  .btn__hard {
    line-height: 15px;
    cursor: pointer;
    padding: 1vw 2.5vw 1vw 2.5vw;

    font-size: 4vw;
  }
}

@media screen and (max-width: 425px) {
  .game {
    flex-direction: column;
  }

  .game-board__inner {
    width: 75vw;
    height: 75vw;
    max-width: 90vh;
    max-height: 90vh;
  }

  .number__side {
    top: 1vw;
    left: -5vw;
    gap: 4.6vw;
    text-align: right;
    font-size: 3vw;
  }

  .sound__icon {
    width: 8vw;
  }

  .letters__side {
    display: grid;
    grid-template-rows: repeat(1, 30px);
    grid-template-columns: repeat(10, 1fr);
    position: absolute;
    top: -5vw;
    z-index: 100;
    font-size: 3vw;
    color: #717c96;
    opacity: 70%;
  }

  .letter {
    text-align: center;
    width: 7.5vw;
  }

  .main {
    margin-top: 10px;
    justify-content: space-evenly;
  }

  button {
    font-family: "Kanit", sans-serif;
    font-weight: 900;
    font-size: 1rem; /* Размер текста кнопки */
    padding: 1vw 2vw; /* Пространство внутри кнопок */
    background-color: #61c6ff; /* Цвет фона */
    color: white; /* Цвет текста */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }

  .destroy:before {
    height: 7vw;
    width: 0.6vw;
    top: 0%;
    left: 47%;
  }

  .destroy:after {
    height: 7vw;
    width: 0.6vw;
    top: 0%;
    left: 47%;
  }

  .choose__dif {
    padding-top: 4vw;
    padding-bottom: 4vw;
  }

  .choose__title {
    font-size: 7vw;
  }

  .choose__container-btn {
    margin-top: 6vw;
    gap: 2vw;
  }

  .btn__easy {
    border: 3px solid #61c6ff;
    padding: 2vw 4vw 2vw 4vw;
    border-radius: 2px;
    font-size: 6vw;
    border-radius: 8px;
  }
  .btn__hard {
    border: 3px solid #ff7f50;
    padding: 2vw 4vw 2vw 4vw;
    border-radius: 2px;
    font-size: 6vw;
    border-radius: 8px;
  }

  section {
    position: relative;
    width: 120px;
    height: 120px;
    /* background: aliceblue; */
    overflow: hidden;
  }

  section .wave {
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 56px;
    background: url(water.svg);
    background-size: 260px 90px;
    animation: animate 3.5s linear infinite;
    z-index: 1000;
    opacity: 1;
    animation-delay: 0s;
  }

  @keyframes animate {
    from {
      background-position-x: 260px;
    }

    to {
      background-position-x: 0;
    }
  }

  section .ship {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 100px;
    height: 70px;
    background: url(ship.svg);
    background-repeat: no-repeat;
    background-size: contain;
    transform: translate(-50%, 50%);

    animation: ship 1.3s infinite cubic-bezier(0.64, 0.3, 0.51, 0.96) alternate;

    opacity: 1;
    animation-delay: 0s;
  }

  @keyframes ship {
    from {
      transform: rotate(-15deg);
      bottom: 31%;
      left: 14%;
    }

    to {
      transform: rotate(10deg);
      bottom: 31%;
      left: 14%;
    }
  }
}
