body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top, #f7f7ff, #eef1f6);
}

main {
  text-align: center;
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: min(520px, calc(100vw - 2rem));
}

h1 {
  margin: 0 0 0.25rem 0;
  color: #1f2937;
}

.subtitle {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
}

.coin {
  width: 180px;
  height: 180px;
  border-radius: 999px;
  margin: 0 auto 1.25rem auto;
  background: linear-gradient(145deg, #f5d06f, #d6a93b);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.35),
    inset 0 -6px 16px rgba(0, 0, 0, 0.25), 0 10px 25px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  position: relative;
  user-select: none;
}

.coin::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  border: 3px dashed rgba(255, 255, 255, 0.35);
}

.face {
  font-weight: 800;
  font-size: 4rem;
  color: rgba(31, 41, 55, 0.9);
  letter-spacing: 0.05em;
}

.result {
  position: absolute;
  bottom: -0.75rem;
  background: #111827;
  color: white;
  font-size: 0.9rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.coin[data-side="heads"] {
  background: linear-gradient(145deg, #7dd3fc, #2563eb);
}

.coin[data-side="tails"] {
  background: linear-gradient(145deg, #a7f3d0, #059669);
}

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

@keyframes flip {
  0% {
    transform: rotateY(0deg) scale(1);
  }
  50% {
    transform: rotateY(720deg) scale(1.06);
  }
  100% {
    transform: rotateY(1440deg) scale(1);
  }
}

.controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

button {
  font-size: 1rem;
  padding: 0.75rem 1.1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.primary {
  background-color: #2563eb;
  color: #fff;
}

.primary:hover {
  background-color: #1d4ed8;
}

.secondary {
  background-color: #e5e7eb;
  color: #111827;
}

.secondary:hover {
  background-color: #d1d5db;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.stat {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
}

.label {
  color: #6b7280;
  font-size: 0.85rem;
}

.value {
  color: #111827;
  font-weight: 800;
  font-size: 1.4rem;
}
