* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 59, 59, 0.18), transparent 35%),
    radial-gradient(circle at bottom right, rgba(88, 101, 242, 0.16), transparent 35%),
    #080810;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
}

.coinflip-page {
  padding: 60px 7% 90px;
}

.coinflip-hero {
  margin-bottom: 36px;
}

.coinflip-tagline {
  color: #ff3b3b;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.coinflip-hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1;
  margin-bottom: 18px;
}

.coinflip-hero p {
  color: #b8b8c8;
  line-height: 1.7;
}

.coinflip-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 25px;
  align-items: stretch;
}

.coin-stage-card,
.bet-card {
  background: rgba(17, 17, 29, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 26px;
  padding: 28px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.28);
}

.coin-stage {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.coin {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.6s cubic-bezier(0.17, 0.67, 0.26, 1.2);
}

.coin.flipping {
  animation: coinFlipSpin 1.6s ease-in-out;
}

.coin.result-heads {
  transform: rotateY(0deg);
}

.coin.result-tails {
  transform: rotateY(180deg);
}

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  border: 8px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 0 35px rgba(255, 255, 255, 0.18),
    0 25px 70px rgba(0, 0, 0, 0.4);
}

.coin-heads {
  background:
    radial-gradient(circle, #ffe08a, #c98d14);
  color: #080810;
}

.coin-tails {
  background:
    radial-gradient(circle, #9ca5ff, #3943b7);
  color: #ffffff;
  transform: rotateY(180deg);
}

@keyframes coinFlipSpin {
  0% {
    transform: rotateY(0deg) rotateX(0deg);
  }

  50% {
    transform: rotateY(900deg) rotateX(180deg);
  }

  100% {
    transform: rotateY(1800deg) rotateX(360deg);
  }
}

.result-box {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  color: #b8b8c8;
  font-weight: 900;
}

.result-box.win {
  color: #4dff9d;
  background: rgba(77, 255, 157, 0.1);
  border-color: rgba(77, 255, 157, 0.24);
}

.result-box.lose {
  color: #ff6b6b;
  background: rgba(255, 59, 59, 0.12);
  border-color: rgba(255, 59, 59, 0.24);
}

.bet-card h2 {
  font-size: 2rem;
  margin-bottom: 22px;
}

.bet-card label {
  display: block;
  color: #aaaabb;
  font-size: 0.9rem;
  font-weight: 900;
  margin: 18px 0 8px;
}

.bet-card input {
  width: 100%;
  background: #080810;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 15px 16px;
  outline: none;
  font-weight: 900;
}

.bet-card input:focus {
  border-color: #5865f2;
}

.quick-bets,
.side-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.side-buttons {
  grid-template-columns: repeat(2, 1fr);
}

.quick-bets button,
.side-btn {
  border: none;
  border-radius: 14px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
}

.quick-bets button:hover,
.side-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.side-btn.active {
  background: #5865f2;
}

.flip-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  background: #ff3b3b;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  margin-top: 22px;
  transition: 0.2s ease;
}

.flip-btn:hover {
  background: #ff5a5a;
  transform: translateY(-2px);
}

.flip-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.bet-info {
  margin-top: 24px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 18px;
  overflow: hidden;
}

.bet-info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bet-info div:last-child {
  border-bottom: none;
}

.bet-info span {
  color: #aaaabb;
}

.bet-info strong {
  color: #ffffff;
}

@media (max-width: 1000px) {
  .coinflip-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .coinflip-page {
    padding: 40px 5% 70px;
  }

  .coin-stage {
    min-height: 280px;
  }

  .coin {
    width: 145px;
    height: 145px;
  }

  .quick-bets {
    grid-template-columns: repeat(2, 1fr);
  }
}