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

body {
  font-family: "Roboto", sans-serif;
  background: #000;
  color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  text-align: center;
  max-width: 600px;
  width: 100%;
}

/* h1 {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 2rem;
  color: rgb(87, 195, 231);
  text-shadow: 0 0 20px rgba(100, 255, 210, 0.3);
} */

.coin-container {
  margin: 3rem 0;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coin {
  width: 150px;
  height: 150px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 2s ease-in-out;
  cursor: pointer;
}

.coin.flipping {
  animation: flip 2s ease-in-out;
}

@keyframes flip {
  0% {
    transform: rotateY(0deg) rotateX(0deg);
  }
  25% {
    transform: rotateY(450deg) rotateX(180deg);
  }
  50% {
    transform: rotateY(900deg) rotateX(360deg);
  }
  75% {
    transform: rotateY(1350deg) rotateX(540deg);
  }
  100% {
    transform: rotateX(1800deg) rotateX(720deg);
  }
}

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: bold;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 3px solid #00ffd5;
}

.heads {
  background: #ffffff;
  color: #000;
  transform: rotateY(0deg);
}

.tails {
  background: #000;
  color: #fff;
  transform: rotateY(180deg);
}

.flip-button {
  background: transparent;
  width: 150px;
  color: #fff;
  letter-spacing: 2px;
  border: 1px solid #545454;
  padding: 10px 40px;
  font-size: 1.2rem;
  font-weight: 400 !important;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  /* box-shadow: 0 5px 15px rgba(100, 255, 218, 0.3); */
  margin: 2rem 0;
}

.flip-button:hover {
  background: rgb(232, 230, 230);
  color: #000;
  /* transform: translateY(-2px); */
  box-shadow: 0 8px 25px rgba(100, 255, 218, 0, 4);
}

.flip-button:disabled {
  background: #555;
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
}

.clear-button {
  background: transparent;
  color: #555;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  font-weight: 200;
  letter-spacing: 1px;
}

.history h3 {
  color: #555;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 1px;
}

.clear-button:hover {
  background: rgb(232, 230, 230);
  color: #000;
  /* transform: translateY(-2px); */
  /* box-shadow: 0 8px 25px rgba(100, 255, 218, 0, 4); */
}

.result {
  font-size: 1.3rem;
  margin: 1rem 0;
  min-height: 2rem;
  color: #fff;
  font-weight: 300;
  letter-spacing: 1px;
  /* border: 1px solid white; */
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 3rem 0;
}

.stat-card {
  background: transparent;
  /* border-radius: 15px; */
  padding: 1.5rem;
  backdrop-filter: blue(10px);
  /* border: 1px solid rgba(255, 255, 255, 0.1); */
}

.stat-card h3 {
  color: #545454;
  margin-top: 0.5rem;
  font-size: 1.3rem;
  font-weight: 300;
}

.stat-value {
  font-size: 8rem;
  font-weight: bold;
}

.history-div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  /* border: 1px solid white; */
}

.history {
  background: transparent;
  border-radius: 6px;
  padding: 1.5rem;
  margin: 2rem 0;
  backdrop-filter: blue(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-height: 100px;
  overflow-y: auto;
}

.history-item {
  padding: 0.3rem 0.6rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 400;
}

.history-item.heads {
  background: white;
  color: #000;
  border: 1px solid #ffffff;
}

.history-item.tails {
  background: black;
  color: white;
  border: 1px solid #fff;
}

@media (max-width: 640px) {
  h1 {
    font-size: 1rem;
  }
  .coin {
    width: 120px;
    height: 120px;
  }
  .coin-face {
    font-size: 3rem;
  }
  .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    overflow-x: auto; /* optional for horizontal scroll */
  }
  .stat-card {
    background: transparent;
    /* border-radius: 15px; */
    padding: 1.5rem;
    backdrop-filter: blue(10px);
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
  }
  .stat-card h3 {
    color: #545454;
    margin-top: 0.5rem;
    font-size: 1.3rem;
    font-weight: 300;
  }

  .stat-value {
    font-size: 8rem;
    font-weight: bold;
  }
}
