:root {
  --bg: #04261b;
  --green: #0c6b45;
  --gold: #ffc93c;
  --gold-deep: #d98a00;
  --coral: #ff5a5f;
  --pink: #ff3d8b;
  --sky: #3cc8ff;
  --text: #fffaf0;
  --muted: #b9dcc9;
  --display: "Luckiest Guy", Impact, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  --cell: clamp(74px, 22vw, 112px);
}

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

html,
body {
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(90% 60% at 50% 0%, #0f7a4f 0%, transparent 60%),
    radial-gradient(60% 50% at 100% 100%, rgba(255, 61, 139, 0.25), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.5;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
}

/* ——— Background leaves ——— */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.leaf {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, #12915c, #064e33);
  opacity: 0.45;
  filter: blur(1px);
}

.leaf--1 {
  top: -120px;
  left: -140px;
  transform: rotate(20deg);
}

.leaf--2 {
  bottom: -160px;
  right: -120px;
  transform: rotate(-30deg);
  background: linear-gradient(135deg, #ff3d8b, #a3135a);
  opacity: 0.3;
}

.leaf--3 {
  top: 30%;
  right: -200px;
  width: 300px;
  height: 300px;
  transform: rotate(60deg);
}

/* ——— Header ——— */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 16px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.logo b {
  font-weight: 400;
  color: var(--gold);
}

.logo__seven {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff2b3, var(--gold) 50%, var(--gold-deep));
  color: #b3001b;
  font-size: 26px;
  box-shadow: 0 4px 0 #8a5600;
  transform: rotate(-8deg);
}

.age {
  padding: 5px 11px;
  border: 2px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 900;
  font-size: 13px;
}

/* ——— Layout ——— */
.stage {
  flex: 1;
  display: grid;
  gap: 24px;
  justify-items: center;
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 4px 0 40px;
}

@media (min-width: 1000px) {
  .stage {
    grid-template-columns: auto 420px;
    grid-template-areas:
      "machine copy"
      "machine meter";
    grid-template-rows: auto 1fr;
    column-gap: 64px;
    row-gap: 22px;
    justify-content: center;
    align-items: start;
    padding: 12px 0 56px;
  }

  .copy {
    grid-area: copy;
    text-align: left;
  }

  .lead {
    margin: 0;
  }

  .machine {
    grid-area: machine;
  }

  .meter {
    grid-area: meter;
  }
}

/* ——— Copy ——— */
.copy {
  text-align: center;
}

.kicker {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--pink);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-2deg);
  box-shadow: 0 4px 0 #a3135a;
}

h1 {
  margin: 14px 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 9vw, 72px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 0 5px 0 #02160f;
}

h1 span {
  color: var(--gold);
  text-shadow:
    0 5px 0 #8a5600,
    0 0 40px rgba(255, 201, 60, 0.45);
}

.lead {
  max-width: 40ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 600;
}

.lead b {
  color: #fff;
}

/* ——— Machine ——— */
.machine {
  position: relative;
  width: min(100%, calc(var(--cell) * 3 + 76px));
}

.machine__marquee {
  position: relative;
  margin: 0 18px;
  padding: 14px 10px 12px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, var(--coral), #c81d44);
  border: 4px solid var(--gold);
  border-bottom: 0;
  text-align: center;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.15);
}

.machine__marquee p {
  font-family: var(--display);
  font-size: clamp(24px, 6vw, 34px);
  letter-spacing: 0.06em;
  text-shadow: 0 3px 0 #7a0024;
}

.machine__marquee b {
  font-weight: 400;
  color: var(--gold);
}

.bulbs {
  position: absolute;
  inset: 6px 10px auto;
  height: 8px;
  background: radial-gradient(circle, #fff6c4 0 3px, transparent 3.5px) 0 0 / 18px 8px repeat-x;
  animation: chase 0.5s steps(2) infinite;
}

@keyframes chase {
  to {
    background-position: 18px 0;
  }
}

.machine__body {
  position: relative;
  padding: 18px 16px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, #ffd96b, var(--gold) 30%, var(--gold-deep));
  box-shadow:
    0 10px 0 #8a5600,
    0 24px 50px rgba(0, 0, 0, 0.45),
    inset 0 3px 0 rgba(255, 255, 255, 0.6);
}

.window {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, var(--cell));
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: #3b1d00;
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.6);
}

.reel {
  position: relative;
  height: calc(var(--cell) * 3);
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #d9d4c7, #fffdf6 20%, #fffdf6 80%, #d9d4c7);
}

.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.strip {
  will-change: transform;
}

.cell {
  display: grid;
  place-items: center;
  height: var(--cell);
}

.cell svg {
  width: 72%;
  height: 72%;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.25));
}

.reel.is-blur .strip {
  filter: blur(1.5px);
}

.cell.is-win {
  animation: winPulse 0.55s ease-in-out infinite alternate;
}

@keyframes winPulse {
  to {
    transform: scale(1.12);
    filter: drop-shadow(0 0 12px rgba(255, 201, 60, 0.9));
  }
}

.payline {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: calc(var(--cell) + 4px);
  transform: translateY(-50%);
  border: 3px solid rgba(255, 61, 139, 0.85);
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 18px rgba(255, 61, 139, 0.5);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.window.is-win .payline {
  border-color: #fff;
  box-shadow:
    0 0 0 3px var(--pink),
    0 0 30px rgba(255, 201, 60, 0.9);
  animation: lineFlash 0.3s steps(2) 6;
}

@keyframes lineFlash {
  50% {
    border-color: var(--gold);
  }
}

.machine__msg {
  min-height: 28px;
  margin: 14px 0 12px;
  color: #4a2a00;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.04em;
  text-align: center;
}

.spin {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 12px 10px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ff6b8f, var(--pink) 50%, #c4115f);
  box-shadow:
    0 7px 0 #7d0a3c,
    0 12px 22px rgba(125, 10, 60, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.spin:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow:
    0 2px 0 #7d0a3c,
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.spin:disabled {
  filter: grayscale(0.4) brightness(0.9);
  cursor: default;
}

.spin:focus-visible,
.claim:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.spin__label {
  font-family: var(--display);
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #7d0a3c;
}

.spin__count {
  font-weight: 800;
  font-size: 14px;
}

.machine__base {
  height: 18px;
  margin: 0 28px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #8a5600, #5a3800);
}

.lever {
  position: absolute;
  top: 120px;
  right: -26px;
  width: 16px;
  height: 120px;
  border-radius: 8px;
  background: linear-gradient(90deg, #8f8f8f, #e8e8e8, #8f8f8f);
  transform-origin: 50% 100%;
  transition: transform 0.3s ease;
}

.lever span {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 35% 30%, #ff9aa2, #e3172e 60%, #8f0016);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.machine.is-pull .lever {
  transform: scaleY(-0.6);
}

@media (max-width: 520px) {
  .lever {
    display: none;
  }
}

/* ——— Bonus meter ——— */
.meter {
  width: min(100%, 420px);
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 201, 60, 0.35);
  backdrop-filter: blur(6px);
}

.meter__title {
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}

.meter > ul:first-of-type {
  display: grid;
  gap: 10px;
  list-style: none;
}

.meter li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.meter__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--display);
  font-size: 22px;
  color: var(--muted);
}

.meter__icon svg {
  width: 34px;
  height: 34px;
}

.meter__text {
  font-weight: 800;
  color: var(--muted);
}

.meter li.is-filled {
  background: linear-gradient(90deg, rgba(255, 201, 60, 0.22), rgba(255, 61, 139, 0.15));
  border: 2px solid var(--gold);
  animation: fill 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.meter li.is-filled .meter__icon {
  background: #fff;
}

.meter li.is-filled .meter__text {
  color: #fff;
  font-size: 17px;
}

@keyframes fill {
  from {
    transform: scale(0.9);
  }
}

.claim {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  margin-top: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff2b3, var(--gold) 45%, var(--gold-deep));
  box-shadow:
    0 6px 0 #8a5600,
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  color: #3b1d00;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.claim:hover:not(:disabled) {
  transform: translateY(-2px);
}

.claim:disabled {
  filter: grayscale(1) opacity(0.45);
  cursor: default;
}

.claim:not(:disabled) {
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  80%,
  100% {
    transform: none;
  }
  85% {
    transform: rotate(-2deg) scale(1.03);
  }
  90% {
    transform: rotate(2deg) scale(1.03);
  }
}

.trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 16px;
  list-style: none;
}

.trust li {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.trust li::before {
  content: "✓ ";
  color: var(--gold);
}

/* ——— Footer ——— */
.foot {
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.foot p + p {
  margin-top: 6px;
}

.foot .demo {
  opacity: 0.75;
}

/* ——— Coins ——— */
.coins {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ——— Modal ——— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 18, 12, 0.75);
  backdrop-filter: blur(6px);
  animation: fade 0.3s ease;
}

.modal[hidden] {
  display: none;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal__card {
  position: relative;
  width: min(420px, 100%);
  padding: 32px 24px 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #0f7a4f, #064e33);
  border: 4px solid var(--gold);
  box-shadow:
    0 10px 0 #8a5600,
    0 30px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes pop {
  from {
    transform: scale(0.6) rotate(-6deg);
    opacity: 0;
  }
}

.modal__card h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 4px 0 #8a5600;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal__kicker {
  margin-bottom: 6px;
  color: var(--pink);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.modal__sub {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 600;
}

.modal__prize {
  margin: 16px 0 6px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 20px;
  font-weight: 800;
}

.modal__prize b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  color: var(--gold);
}

.modal__prize .plus {
  color: var(--pink);
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
}

.claim--big {
  margin-top: 18px;
}

.modal__fine {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.modal__link {
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
