* {
  box-sizing: border-box;
  
}

body, html {
  width: 100vw;
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-image: linear-gradient(to bottom, rgb(78, 139, 231), rgb(145, 231, 46));
}
.board {
  background-color: rgba(0,0,0,0.1);
  width: 80vw;
  height: 95vh;
  box-sizing: border-box;
  display: none;
  grid-template-columns: 3fr 4fr 3fr;
  justify-items: center;
  align-items: center;
  gap: 1vh;
  border-radius: 50px 0px;
  box-shadow: 5px 5px 10px black ;
  margin: 10px auto;
}

h1, h2 {
  font-size: 2rem;
  align-content: center;
  text-align: center;
}
.btnAndCube {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  
}


.result {
  width: 35vw;
  box-sizing: content-box;
  margin-top: 2%;
  box-shadow: 5px 5px 27px;
  height: 10vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 35px;
  margin-top: 3%;
  width: 20vw;
}

.result * {
  margin: 5px;
}


.btn {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn button {
  background-color: rgb(1, 247, 255);
  width: 30vw;
  height: 8vh;
  border-radius: 13px;
  box-shadow: 5px 5px 25px;
  display: none;
  margin-bottom: 5%;
  transition: background-color 0.2s ease;
}

.hronicle {
  width: 50vw;
  height: 20vh;
  margin-bottom: 2%;
  border: 1px solid gray;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
}

#startBot:hover {
    background-color: #0056b3;
    border: 1px solid black;
    cursor: pointer;
}

#startBot:active {
    transform: translateY(1px);
}

#startPlayer:hover {
    background-color: #0056b3;
    border: 1px solid black;
    cursor: pointer;
}

#startPlayer:active {
    transform: translateY(1px);
}


.player {
  width: 90%;
  height: 35%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-left: 10%;
  box-shadow: 5px 5px 50px black;
  border-radius: 10px;
  transition: transform 1s ease-in-out;
} 
.computer {
  width: 90%;
  height: 35%;
  margin-right: 10%;
  box-shadow: 5px 5px 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  transition: transform 1s ease-in-out;
} 
img {
    width: 100px;
    margin: 5px;
}
.cubes {
  display: flex;
  flex-direction: row;
  justify-content: center;
  padding: 5%;
}

.dice {
    width: 100px;
    height: 100px;
    background-color: #fff;
    border: 5px solid #333;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.1s ease-out;
}

.dice svg {
    width: 100%;
    height: 100%;
    display: block;
}

.dice.rolling {
    animation: shake 0.5s infinite alternate;
}
.line {
  width: 30vw;
  height: 3px;
  background-color: black;
}
.firstCube {
  width: 100px;
  height: 100px;
  margin-right: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
  
}

.firstCubeBot {
  width: 100px;
  height: 100px;
  margin-right: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
}

.secondCube {
  width: 100px;
  height: 100px;
  margin-left: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
}

.secondCubeBot {
  width: 100px;
  height: 100px;
  margin-left: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
}

.hearts {
  width: 3em;
}

.brokenHearts {
  width: 1em;
  padding-bottom: 3px;
}
/*  MODAL   */
#showChoice {
  min-width: 35vw;
  min-height: 65vh;
  max-height: 100vh;
  max-width: 100vw;
  position: fixed; /* Фиксирует относительно viewport */
  align-items: center;
  left: 0;
  top: 20%;
  background-image: linear-gradient(to right, rgb(78, 139, 231), rgb(145, 231, 46));
  z-index: 1000; /* Чтобы было поверх всего */
  align-content: center;
  text-align: center;
  border: none;
  border-radius: 25px 0px;
  box-shadow: 5px -5px 120px;
}

#showChoice button {
  background-color: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.5em;
}

#showEndGame {
  background-color: rgba(0,0,0,0.7);
}
.showEndGameContent {
  width: 30vw;
  height: 30vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  font-size: 2em;
  opacity: 1;
  color: #fff;
}

.showEndGameBtn {
  display: flex;
  flex-direction: row;
  justify-content:center;
  align-items: center;
}
.showEndGameBtn * {
  width: 10vw;
  height: 5vh;
  width: 12vw;
  height: 5vh;
  margin: 10px;
  background-color: rgba(0,0,0,0.1);
  font-size: 1em;
  color: #fff;
  background-color: rgba(0,0,0,0.1);
}
.showEndGameBtn:hover {
  transform: scale(0.9);
}
.showEndGameBtn :first-child:hover {
  transform: scale(1.2);
  box-shadow: 0px 0px 10px red;
}
.showEndGameBtn :last-child:hover  {
  transform: scale(1.2);
  box-shadow: 0px 0px 10px red;
}

.showEndGameBtn:active {
  transform: scale(0.9);
}
.showEndGameBtn :first-child:active {
  transform: scale(1.2);
  box-shadow: 0px 0px 10px red;
}
.showEndGameBtn :last-child:active {
  transform: scale(1.2);
  box-shadow: 0px 0px 10px red;
}

.modalContent {
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  gap: 20px;
  justify-content: center;
}

.modalContent * {
  max-width: 200px;
}

#showChoice > p {
  color: white;
  font-size: 2.5em;
  font-style: italic;
}
/*    MEDIA    */
@media screen and (max-device-width: 480px) {
  .board {
    display: none;
    justify-content: space-between;
    width: 95vw;
    height: 70vh;
    /* position: relative;
    top: 15%; */
  }
  .modalContent {
    width: 80vw;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .modalContent > button {
    width: 50vw;
    height: 5vh;
    font-size: 1.2em;
  }
  .modalContent > h2 {
    width: 50vw;
    height: 5vh;
    font-size: 1.5em;
  }
  #showChoice {
    min-width: 55vw;
    min-height: 30vh;
  }

  .result {
    width: 50vw;
  }
  .btnAndCube {
    justify-content: space-between;
  }
  .btn button {
    margin-bottom: 25%;
  }
  .player {
    width: 20vw;
    height: 17%;
  }
  .computer {
    width: 20vw;
    height: 17%;
  }

  .showEndGameContent {
    width: 70vw;
    font-size: 2.5em;
  }
  .showEndGameBtn * {
  width: 20vw;
  height: 5vh;
}
}


@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}