@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap");

* {
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  -moz-tap-highlight-color: transparent;
  -o-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  padding-top: 50px;
  background: linear-gradient(to left, #a8bdbb 10%, #eee 195%);
  background-repeat: repeat;
  background-size: cover;
  background-position: center;
  font-family: "Oswald", sans-serif;
  animation: fadeIn 1.5s ease-in-out;
  position: relative;
  z-index: 1;
}

body::before {
  content: "";
  position: fixed;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

h1 {
  animation: fadeIn 1.5s ease-in-out;
  text-align: center;
  width: 220px;
  margin: auto;
  margin-bottom: 0px;
  padding-left: 4px;
  padding-bottom: 9px;
  padding-top: 5px;
  margin-top: 20px;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(90deg, #0e0000, #6ea4a8 50%, #278289);
  letter-spacing: 8px;
  font-weight: 900;
  border-radius: 15px;
}
#coin {
  position: relative;
  margin: 0 auto;
  width: 200px;
  height: 200px;
  cursor: pointer;
  transition: transform 1s ease-in-out;
  transform-style: preserve-3d;
}

#coin div {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
}

.side-a {
  background-image: url("../imgs/heads.png");
  background-size: 137%;
  background-position: center;
}

.side-b {
  background-image: url("../imgs/tails.png");
  background-size: 140%;
  background-position: center;
  transform: rotateY(180deg);
}

#coin.heads .side-a {
  transform: rotateY(0deg); /* Show heads */
}

#coin.heads .side-b {
  transform: rotateY(180deg); /* Hide tails */
}

#coin.tails .side-a {
  transform: rotateY(180deg); /* Hide heads */
}

#coin.tails .side-b {
  transform: rotateY(0deg); /* Show tails */
}

#coin.heads {
  -webkit-animation: flipHeads 3s ease-out forwards;
  -moz-animation: flipHeads 3s ease-out forwards;
  -o-animation: flipHeads 3s ease-out forwards;
  animation: flipHeads 3s ease-out forwards;
}
#coin.tails {
  -webkit-animation: flipTails 3s ease-out forwards;
  -moz-animation: flipTails 3s ease-out forwards;
  -o-animation: flipTails 3s ease-out forwards;
  animation: flipTails 3s ease-out forwards;
}
@keyframes flipCoin {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(1800deg);
  }
}

#coin.heads {
  animation: flipCoin 3s ease-out forwards;
}

#coin.tails {
  animation: flipCoin 3s ease-out forwards;
}

#coin.heads .side-b,
#coin.tails .side-a {
  transform: rotateY(180deg);
}

.result-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.result-content {
  background: linear-gradient(to bottom right, #fff 5%, #a8bdbb 55%);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  box-shadow: rgba(38, 57, 77, 0.5) 0px 10px 20px 5px;
  max-width: 80%;
  width: 300px;
}

.result-content h2 {
  margin-top: 0;
  font-size: 24px;
  background-image: linear-gradient(90deg, #0e0000, #6ea4a8 50%, #278289);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glowing-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-content p {
  font-size: 18px;
  margin-bottom: 10px;
  color: #2a2a2a;
}

.result-content .winner {
  font-weight: bold;
  font-size: 20px;
}

.result-content .winner.tails {
  /* color: #ff6b6b;  */
  color: #2a2a2a;
}

.result-content .winner.heads {
  /* color: #4ecdc4;  */
  color: #2a2a2a;
}

.result-content .count {
  font-size: 16px;
  color: #667;
  margin-top: 5px;
}
#close-popup {
  margin-top: 15px;
  font-size: 16px;
  padding: 8px 15px;
}

.btn-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.btnAll {
  margin: auto;
  width: 100px;
  margin-bottom: 12px;
}
.btn3 {
  margin: auto;
  width: 100px;
}

.glowing-btn {
  margin: auto;
  text-align: center;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(90deg, #5f5f5f, #5f5f5f 50%, #5f5f5f);
  cursor: pointer;
  border: none;
  border-radius: 0.45em;
  font-family: "Oswald", sans-serif;
  width: 200px;
  letter-spacing: 3px;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 0px;
  box-shadow: rgba(0, 0, 0, 0.3) 0px 10px 22px, rgba(0, 0, 0, 0.22) 0px 6px 9px;
  outline: none;
  transition: 0.3s ease-out;
}

.glowing-btn:hover {
  box-shadow: rgba(0, 0, 0, 0.3) 0px 9.5px 19px, rgba(0, 0, 0, 0.22) 0px 4px 3px;
  opacity: 80%;
}

.footerText {
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(40deg, #000000, #6ea4a8 1%, #2f0505);
  display: flex;
  justify-content: center;
  margin-top: 50px;
  font-size: 30px;
}

@media (width > 150px) {
  h1 {
    width: 300px;
    margin-bottom: 0px;
    padding-left: 15px;
    padding-bottom: 9px;
    padding-top: 5px;
    letter-spacing: 8px;
    font-weight: 900;
    font-size: 60px;
  }
  #game-wrap {
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: auto;
    border-radius: 30px;
    background: linear-gradient(to bottom right, #fff 5%, #a8bdbb 55%);
    box-shadow: rgba(38, 57, 77, 0.5) 50px 30px 100px 25px;
  }
  .outer-wrap {
    display: flex;
    justify-content: space-between;
    border-bottom: 2.4px solid #939393;
    padding-bottom: 10px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 1px,
      rgba(0, 0, 0, 0.3) 0px 7px 13px -3px,
      rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
  }

  .inner-wrap1 {
    display: flex;
    flex-direction: row;
    padding-top: 8px;
    padding-left: 10px;
    gap: 10px;
    margin-left: 5px;
    margin-top: 5px;
  }
  .inner-wrap2 {
    display: flex;
    flex-direction: row;
    padding-top: 8px;
    padding-right: 10px;
    gap: 10px;
    margin-top: 5px;
    margin-right: 5px;
  }

  .circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: inset 0px 2px 3px rgba(0, 0, 0, 0.2);
  }

  .apple-button {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1),
      inset 0px 2px 4px rgba(255, 255, 255, 0.25); /* Apple-like look */
  }

  .red {
    background-color: #ff605c;
  }

  .yellow {
    background-color: #ffbd44;
  }

  .green {
    background-color: #00ca4e;
  }

  .grey {
    background-color: #3a3a3a;
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5),
      inset 0px 2px 4px rgba(255, 255, 255, 0.15); /* Slight shadow for grey buttons */
  }

  .glowing-btn {
    width: 160px;
    font-size: 25px;
  }
}
