:root {
  color-scheme: dark;
  --bg: #11142a;
  --panel: #1b2144;
  --panel-light: #252d5c;
  --gold: #ffd24a;
  --red: #ff4d5a;
  --blue: #4cc9f0;
  --green: #8fff9f;
  --text: #f7f8ff;
  --muted: #bac3ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(76, 201, 240, 0.28), transparent 28rem),
    radial-gradient(circle at 80% 10%, rgba(255, 210, 74, 0.22), transparent 24rem),
    linear-gradient(145deg, #090b18, var(--bg));
}

.machine {
  width: min(1100px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 64px);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.eyebrow {
  width: fit-content;
  margin: 0 0 18px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 210, 74, 0.5);
  border-radius: 999px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.08em;
}

.intro {
  max-width: 34rem;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.cabinet {
  position: relative;
  padding: clamp(18px, 3vw, 32px);
  border: 8px solid #0a0d20;
  border-radius: 34px;
  background: linear-gradient(180deg, var(--panel-light), var(--panel));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.cabinet::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed rgba(255, 210, 74, 0.35);
  border-radius: 22px;
  pointer-events: none;
}

.marquee {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border-radius: 18px;
  color: #171717;
  background: linear-gradient(90deg, var(--gold), #fff1a3, var(--gold));
  text-align: center;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.16);
}

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

.reel {
  min-height: 180px;
  margin: 0;
  padding: 18px 10px;
  display: grid;
  place-items: center;
  border: 4px solid #090b18;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 30%, #ffffff 0 22%, #d9f4ff 23% 42%, #93b6ff 43% 100%);
  color: #15182a;
  overflow: hidden;
}

.reel.spinning img {
  animation: bounce 0.16s linear infinite;
}

.reel img {
  width: min(120px, 24vw);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 16px 10px rgba(0, 0, 0, 0.22));
}

.reel h2 {
  margin: 4px 0 0;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.stats div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(9, 11, 24, 0.58);
  text-align: center;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stats strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 1.55rem;
}

.controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(180deg, #ff6a73, var(--red));
  box-shadow: 0 10px 0 #9f1f2a, 0 22px 28px rgba(0, 0, 0, 0.32);
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

button.secondary {
  min-width: 132px;
  color: #10152b;
  background: linear-gradient(180deg, #fff1a3, var(--gold));
  box-shadow: 0 10px 0 #a66d00, 0 22px 28px rgba(0, 0, 0, 0.32);
}

button:active:not(:disabled) {
  transform: translateY(6px);
  box-shadow: 0 4px 0 #9f1f2a, 0 12px 22px rgba(0, 0, 0, 0.32);
}

button.secondary:active:not(:disabled) {
  box-shadow: 0 4px 0 #a66d00, 0 12px 22px rgba(0, 0, 0, 0.32);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.rules {
  position: relative;
  z-index: 1;
  margin: 20px 0 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.payment {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 18, 0.78);
  backdrop-filter: blur(10px);
}

.payment[hidden] {
  display: none;
}

.payment-card {
  position: relative;
  width: min(480px, 100%);
  padding: clamp(22px, 5vw, 34px);
  border: 3px solid rgba(255, 210, 74, 0.55);
  border-radius: 28px;
  background: linear-gradient(180deg, #252d5c, #141936);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.payment-card h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.payment-card p:not(.eyebrow),
.payment-card small {
  color: var(--muted);
  line-height: 1.5;
}

.payment-card label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--gold);
  font-weight: 800;
}

.payment-card input {
  width: 100%;
  min-height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(9, 11, 24, 0.72);
  font: inherit;
}

.money {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--text);
}

.payment-card button[type="submit"] {
  margin-top: 18px;
}

.payment-card .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  min-height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  font-size: 1rem;
  letter-spacing: 0;
}

.payment-card .close:active:not(:disabled) {
  transform: none;
  box-shadow: none;
}

@keyframes bounce {
  0% { transform: translateY(-12px) rotate(-5deg) scale(0.9); }
  50% { transform: translateY(12px) rotate(5deg) scale(1.08); }
  100% { transform: translateY(-12px) rotate(-5deg) scale(0.9); }
}

@media (max-width: 820px) {
  .machine {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .reel {
    min-height: 138px;
  }
}

@media (max-width: 540px) {
  .machine {
    padding: 18px;
  }

  .reels,
  .stats {
    gap: 8px;
  }

  .reel {
    min-height: 118px;
    padding: 12px 4px;
  }

  .reel h2 {
    font-size: 0.74rem;
  }

  .controls {
    grid-template-columns: 1fr;
  }
}
