* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-y: auto;
  overflow-x: hidden;
}

html::-webkit-scrollbar {
  display: none;
}

html {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body {
  font-family: "Inter", sans-serif;
  background-color: #0f0f0f;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zm20.97 0l9.315 9.314-1.414 1.414L34.828 0h2.83zM22.344 0L13.03 9.314l1.414 1.414L25.172 0h-2.83zM32 0l12.142 12.142-1.414 1.414L30 .828 17.272 13.556l-1.414-1.414L28 0h4zM.284 0l28 28-1.414 1.414L0 2.544V0h.284zM0 5.373l25.456 25.455-1.414 1.415L0 8.2V5.374zm0 5.656l22.627 22.627-1.414 1.414L0 13.86v-2.83zm0 5.656l19.8 19.8-1.415 1.413L0 19.514v-2.83zm0 5.657l16.97 16.97-1.414 1.415L0 25.172v-2.83zM0 28l14.142 14.142-1.414 1.414L0 30.828V28zm0 5.657L11.314 44.97 9.9 46.386l-9.9-9.9v-2.828zm0 5.657L8.485 47.8 7.07 49.212 0 42.143v-2.83zm0 5.657l5.657 5.657-1.414 1.415L0 47.8v-2.83zm0 5.657l2.828 2.83-1.414 1.413L0 53.456v-2.83zM54.627 60L30 35.373 5.373 60H8.2L30 38.2 51.8 60h2.827zm-5.656 0L30 41.03 11.03 60h2.828L30 43.858 46.142 60h2.83zm-5.656 0L30 46.686 16.686 60h2.83L30 49.515 40.485 60h2.83zm-5.657 0L30 52.343 22.343 60h2.83L30 55.172 34.828 60h2.83zM32 60l-2-2-2 2h4zM59.716 0l-28 28 1.414 1.414L60 2.544V0h-.284zM60 5.373L34.544 30.828l1.414 1.415L60 8.2V5.374zm0 5.656L37.373 33.656l1.414 1.414L60 13.86v-2.83zm0 5.656l-19.8 19.8 1.415 1.413L60 19.514v-2.83zm0 5.657l-16.97 16.97 1.414 1.415L60 25.172v-2.83zM60 28L45.858 42.142l1.414 1.414L60 30.828V28zm0 5.657L48.686 44.97l1.415 1.415 9.9-9.9v-2.828zm0 5.657L51.515 47.8l1.414 1.413 7.07-7.07v-2.83zm0 5.657l-5.657 5.657 1.414 1.415L60 47.8v-2.83zm0 5.657l-2.828 2.83 1.414 1.413L60 53.456v-2.83zM39.9 16.385l1.414-1.414L30 3.658 18.686 14.97l1.415 1.415 9.9-9.9 9.9 9.9zm-2.83 2.828l1.415-1.414L30 9.313 21.515 17.8l1.414 1.413 7.07-7.07 7.07 7.07zm-2.827 2.83l1.414-1.416L30 14.97l-5.657 5.657 1.414 1.415L30 17.8l4.243 4.242zm-2.83 2.827l1.415-1.414L30 20.626l-2.828 2.83 1.414 1.414L30 23.456l1.414 1.414zM56.87 59.414L58.284 58 30 29.716 1.716 58l1.414 1.414L30 32.544l26.87 26.87z' fill='%23161616' fill-opacity='1' fill-rule='evenodd'/%3E%3C/svg%3E");
  color: #fff;
  font-weight: bold;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.coin {
  width: 500px;
  height: 500px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin: auto;
}

.heads,
.tails {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.heads img,
.tails img {
  width: 100%;
  height: 100%;
  display: block;
}

.tails {
  transform: rotateY(180deg);
}

.controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  width: 600px;
  margin: auto;
  transform: translateX(-50px);
}

button {
  width: 100%;
  background: #00e385;
  border: none;
  padding: 26px;
  font-size: 26px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: bold;
  font-family: inherit;
}

button:hover {
  background: #00ff99;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#resetButton {
  background: rgba(0, 227, 133, 0.7);
  border: 1px solid #00e385;
  background: rgba(22, 22, 22, 0.7);
  padding: 16px;
  font-size: 19px;
  border-radius: 16px;
  color: #fff;
}

#resetButton:hover {
  background: rgba(44, 44, 44, 0.7);
}

.result {
  font-size: 31px;
  color: #00e385;
  text-align: center;
  height: 42px;
  opacity: 0;
  transition: opacity 0.3s;
}

.result.show {
  opacity: 1;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 21px;
}

.stats > div {
  background: rgba(22, 22, 22, 0.7);
  padding: 31px 21px;
  border-radius: 16px;
  border: 1px solid #00e385;
  text-align: center;
}

.stats > div > span:first-child {
  display: block;
  font-size: 18px;
  margin-bottom: 10px;
}

.stats > div > span:last-child {
  display: block;
  font-size: 42px;
  color: #00e385;
}

@media (max-width: 1324px) {
  body {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px;
  }

  .coin {
    width: 400px;
    height: 400px;
  }

  .controls {
    width: 100%;
    max-width: 400px;
    padding: 0;
    transform: translateX(0px);
  }
}

@media (max-width: 768px) {
  body {
    padding: 24px 16px;
    gap: 24px;
  }

  .coin {
    width: min(280px, 80vw);
    height: min(280px, 80vw);
  }

  .controls {
    gap: 24px;
    max-width: 100%;
  }

  button {
    padding: 16px;
    font-size: 18px;
  }

  .result {
    font-size: 24px;
    height: 32px;
  }

  .stats {
    gap: 12px;
  }

  .stats > div {
    padding: 20px 12px;
  }

  .stats > div > span:first-child {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .stats > div > span:last-child {
    font-size: 28px;
  }

  #resetButton {
    padding: 12px;
    font-size: 16px;
  }
}
