:root {
  --purple-bg: #6424a3;
  --purple-deep: #34134f;
  --purple-panel: #7d37bf;
  --gold: #ffce4a;
  --red: #e34545;
  --cream: #fff5d6;
  --ink: #25172f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: white;
  background:
    radial-gradient(circle at top left, rgba(255, 206, 74, 0.18), transparent 28rem),
    var(--purple-bg);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 24px;
  padding: 32px 16px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 5rem);
  line-height: 1;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.18);
}

.slot-machine {
  width: min(92vw, 520px);
  padding: 22px;
  border: 8px solid var(--gold);
  border-radius: 8px 8px 22px 22px;
  background: linear-gradient(180deg, #e84d54 0%, var(--red) 54%, #bd2938 100%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    inset 0 0 0 5px rgba(255, 255, 255, 0.16);
}

.machine-top {
  width: 62%;
  height: 36px;
  margin: -48px auto 18px;
  border: 8px solid var(--gold);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--purple-deep);
}

.screen {
  position: relative;
  padding: 18px;
  border: 6px solid var(--purple-deep);
  border-radius: 8px;
  background: var(--cream);
}

.payline {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 18px;
  right: 18px;
  height: 4px;
  border-radius: 999px;
  background: rgba(227, 69, 69, 0.42);
  transform: translateY(-50%);
}

.reels {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.reel {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border: 4px solid #d7b63d;
  border-radius: 8px;
  background: white;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.16);
}

.reel img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  transition: transform 120ms ease;
}

.reel.spinning img {
  animation: bounce 120ms linear infinite;
}

.spin-button {
  width: min(270px, 100%);
  min-height: 68px;
  margin-top: 24px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe78b 0%, var(--gold) 100%);
  box-shadow: 0 8px 0 #b98217, 0 16px 24px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  font-size: 1.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.spin-button:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #b98217, 0 10px 18px rgba(0, 0, 0, 0.26);
}

.spin-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.status {
  min-height: 1.5em;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.win-message {
  max-width: min(920px, 96vw);
  margin: 0;
  color: var(--gold);
  font-size: clamp(2rem, 8vw, 5.8rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
}

@keyframes bounce {
  0% {
    transform: translateY(-10%) scale(0.92);
  }

  100% {
    transform: translateY(10%) scale(1.08);
  }
}

@media (max-width: 420px) {
  .slot-machine {
    padding: 14px;
  }

  .screen {
    padding: 10px;
  }

  .reels {
    gap: 8px;
  }

  .spin-button {
    min-height: 58px;
    font-size: 1.35rem;
  }
}
