* {
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  background: radial-gradient(#1e1e1e, #111111);
}

.main {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
}

.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.background-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  filter: grayscale(40%) brightness(90%);
}

.dark-background-color {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/*h1 {
  text-align: center;
  font-size: 48px;
  padding: 10px 0 20px;
}
*/

.game-menu-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
}

.game-menu-modal.active {
  display: none;
}

.game-menu-container {
  height: fit-content;
  padding: 0 10px;
}

.game-menu-content {
  padding: 3vw 4vw 6vw;
  border: none;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, .4);
  backdrop-filter: blur(8px);
}

.game-header {
  text-align: center;
}

.game-header h1 {
  font-family: Tahoma, sans-serif;
  font-size: 15vw;
  color: #fff;
}

.btn-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  padding-top: 3vw;
}

.btn-outer-wrapper {
  position: relative;
  height: 4vw;
  width: max(0%, 20vw);
  display: flex;
}

.btn-outer-wrapper::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10%;
  height: 100%;
  width: 100%;
  background-color: #45753C;
  border-radius: 5px;
}

.btn-outer-wrapper:nth-child(2)::before {
  background-color: #1b1a18;
}

.btn {
  font-family: Tahoma;
  font-weight: bold;
  padding: 1vw 0;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  height: 100%;
  width: 100%;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}

.play-btn {
  font-size: 2vw;
  background-color: #81B64C;
}

.time-btn {
  font-size: 2vw;
  background-color: rgb(55, 54, 51);
  color: #fff;
  display: flex;
}

.time-container-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4;
  animation: upward .4s;
}

@keyframes upward {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.hidden {
  display: none;
}

.time-container {
  background-color: #262421;
  padding: 50px 60px;
  border-radius: 5px;
  width: 300px;
  position: relative;
}

.close-btn-container {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 20px;
  width: 20px;
  overflow: hidden;
  cursor: pointer;
}

.close-btn {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: rotate(45deg);
}

.close-btn::before,
.close-btn::after {
  content: '';
  position: absolute;
  background-color: #fff;
}

.close-btn::before {
  height: 100%;
  width: 5px;
}

.close-btn::after {
  height: 5px;
  width: 100%;
}

.close-btn:hover::before, 
.close-btn:hover::after {
  background-color: red;
}

.time-header {
  font-size: 30px;
  font-weight: bold;
  color: #fff;
  text-align: center;
  margin-bottom: 15px;
}

/* 
  Hello, I'm a front-end web developer, a full-stack web developer 
  but i prefer to be in the front because art is my passion(i have talent in arts, that's where i get my ideas)
  I'm very passionate in interaction, animation and UI Effects
*/

.time-container ul {
  display: flex;
  flex-direction: column;
  gap: 20px;
  list-style-type: none;
}

.time-container ul li {
  flex: 1;
  background-color: #3c3a38;
  padding: 10px 0;
  text-align: center;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
}

.time-container ul li.active {
  background-color: rgba(255, 255, 255, .4);
}

.time-container ul li:hover {
  background-color: rgba(255, 255, 255, .2);
}

.time-container ul li:active {
  background-color: rgba(255, 255, 255, .3);
}

.game-container {
  --custom-width: min(100%, 400px);

  width: var(--custom-width);
  display: none;
  z-index: 100;
}

.game-container.active {
  display: block;
  animation: fade-In .7s;
}

@keyframes fade-In {
  from {
    transform: scale(1.1);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.player-info-container {
  display: flex;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, .5);
  border-radius: 3px;
  padding: 10px;
}

.player-info {
  display: flex;
  gap: 5px;
}

.avatar {
  width: 25px;
  height: 25px;
  background-color: rgba(255 255 255 / .4);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.white-player img {
  filter: invert(100%);
}

.player-name {
  font-size: 15px;
  font-weight: bold;
  color: #fff;
}

.time {
  font-size: 20px;
  color: #fff;
}

.chess-board {
  width: var(--custom-width);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-wrap: wrap;
  margin: 10px 0;

  position: relative;
}

.piece-promotion {
  position: absolute;
  width: 100%;
  height: calc(100% * 4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  overflow: hidden;
/*   
  display: none; */
}

.top {
  top: 0;
}

.bottom {
  bottom: 0;
}

.piece-promotion ul {
  list-style-type: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.choices {
  height: calc(100% / 4);
  width: 100%;
  z-index: 10;
  cursor: pointer;
}

.choices:nth-child(1), 
.choices:nth-child(3) {
  background-color: lightpink;
}

.choices:nth-child(2), 
.choices:nth-child(4) {
  background-color: lightblue;
}

.choices svg {
  width: 80%;
  height: 80%;
  margin: 10%;
  position: relative;
  z-index: -9;
}

.choices path {
  z-index: -10;
}

.square {
  width: calc(100% / 8);
  height: calc(100% / 8);
  position: relative;
}

.square svg {
  width: 80%;
  height: 80%;
  margin: 10%;
  position: relative;
  z-index: -9;
}

path {
  position: relative;
  z-index: -10;
}

.piece {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.white-tile {
  background-color: rgb(62, 74, 86);
}

.green-tile {
  background-color: rgb(35, 47, 59);
}

.white {
  fill: #fff;
}

.black {
  fill: #1e1e1e;
}

.piece-direction {
  position: relative;
}

.piece-direction::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%);
  background-color: rgba(173, 215, 230, .8);
}

/* .move {
  background-color: lightblue;
}

.active {
  background-color: orangered;
} */

.game-over-modal {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, .4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.game-over-modal.active {
  display: none;
}
  
.game-over-container {
  padding-inline: 15px;
  overflow: hidden
}

.game-content {
  width: fit-content;
  border-radius: 5px;
  background-color: rgb();
  overflow: hidden;
}

.game-over-header {
  text-align: center;
  padding-block: 25px;
  color: #fff;
  margin-bottom: 10px;
}

.result-info {
  font-size: 13vw;
  font-weight: bold;
  margin-bottom: 5px;
}

.result-via {
  font-size: 4vw;
}

.game-over-menu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 10px;
}

.play-again {
  position: relative;
  width: max(0%, 20vw);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.play-again-btn {
  font-size: 2vw;
  background-color: #81B64C;
  color: #fff;
  height: 4vw;
}

.play-again::before, 
.play-again::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 41%;
  border: none;
  border-radius: 5px;
  z-index: 1;
}

.game-over-time-btn {
  font-size: 2vw;
  background-color: rgb(55, 54, 51);
  color: #fff;
  height: 4vw;
  display: flex;
}

.play-again::before {
  top: 5%;
  background-color: #45753C;
}

.play-again::after {
  bottom: -5%;
  background-color: #1b1a18;
}

.btn:active {
  transform: translateY(5px);
  transition: transform .1s;
}

@media (max-width: 1000px) {
  .background-image img {
    object-position: right;
  }

  .game-menu-content {
    padding: 30px 40px 60px;
  }

  .game-header h1 {
    font-size: 150px;
  }

  .btn-container {
    gap: 15px;
  }

  .btn-outer-wrapper {
    width: 230px;
    height: 45px;
  }

  .play-again {
    width: 230px;
  }

  .play-again-btn, 
  .game-over-time-btn {
    height: 45px;
  }

  .btn {
    font-size: 22px;
  }
}

@media (max-width: 700px) {
  .game-menu-content {
    backdrop-filter: blur(0px);
    padding-inline: 0;
    background: transparent;
  }

  .time-container ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .result-info {
    font-size: 15vw;
  }

  .result-via {
    font-size: 5vw;
  }
}

@media (max-width: 510px) {
  .game-header h1 {
    font-size: 31vw;
  }

  .btn-container {
    padding-top: 40px;
  }

  .time-container {
    width: 50%;
    padding: 35px 45px;
  }

  .time-container ul {
    display: flex;
  }
}

@media (max-width: 471px) {
  .game-container {
    width: 80%;
  }

  .result-info {
    font-size: 100px;
  }
}

@media (max-width: 310px) {
  .result-info {
    font-size: 31vw;
  }
}