:root {
  --green: #9ccb48;
  --green-deep: #7fae2e;
  --grey: #636466;
  --ink: #1d2023;
  --sym: clamp(68px, 21vw, 96px);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[lang="ar"] { --font: "Tajawal", "Nunito", system-ui, sans-serif; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: #fff;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(156, 203, 72, .22), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(156, 203, 72, .08), transparent 60%),
    var(--ink);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overflow-x: hidden;
}

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; width: 100%; height: 100%; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 520px; margin: 0 auto; padding: 18px 16px 4px;
}
.logo { height: 38px; width: auto; }
.top-actions { display: flex; gap: 8px; }
.chip {
  font: 700 14px var(--font); color: #fff; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 7px 12px; cursor: pointer;
}
.chip:hover { background: rgba(255, 255, 255, .14); }

main { max-width: 520px; margin: 0 auto; padding: 0 16px; }

.hero { text-align: center; margin: 18px 0; }
.hero h1 {
  margin: 0; font-weight: 900; font-size: clamp(40px, 12vw, 58px); letter-spacing: -.02em; line-height: 1.05;
  background: linear-gradient(180deg, #fff 30%, #d9ecb4); -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[lang="ar"] .hero h1 { letter-spacing: 0; }
.hero p { margin: 10px auto 0; max-width: 340px; color: #c9cccf; font-size: 16px; line-height: 1.45; }

/* ---------- machine ---------- */
.machine { position: relative; margin: 0 auto; }
.marquee {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, #43484d, #2f3337);
  border: 2px solid var(--green); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 10px 12px; margin: 0 40px 0 14px;
}
html[dir="rtl"] .marquee { margin: 0 14px 0 40px; }
.marquee strong { font-weight: 900; letter-spacing: .18em; color: var(--green); font-size: 15px; white-space: nowrap; }
html[lang="ar"] .marquee strong { letter-spacing: 0; }
.bulbs {
  flex: 1; height: 8px; max-width: 110px;
  background-image: radial-gradient(circle, #fff6c9 0 3px, transparent 3.5px);
  background-size: 14px 8px; background-repeat: repeat-x; background-position: center;
  animation: bulbs .9s steps(2) infinite;
}
@keyframes bulbs { 50% { background-image: radial-gradient(circle, #9ccb48 0 3px, transparent 3.5px); } }
.spinning .bulbs { animation-duration: .25s; }

.cabinet {
  position: relative;
  background: linear-gradient(180deg, #3a3f44 0%, #262a2e 100%);
  border: 3px solid var(--green);
  border-radius: 26px;
  padding: 14px;
  box-shadow: 0 0 0 6px rgba(156, 203, 72, .12), 0 24px 60px rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .08);
  margin-right: 26px;
}
html[dir="rtl"] .cabinet { margin-right: 0; margin-left: 26px; }

.reels {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: #15181a; border-radius: 16px; padding: 8px;
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, .8);
  direction: ltr;
}
.reel {
  position: relative; height: calc(var(--sym) * 3); overflow: hidden; border-radius: 10px;
  background: linear-gradient(180deg, #d9dbdc 0%, #fff 22%, #fff 78%, #d9dbdc 100%);
}
.reel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 28%, transparent 72%, rgba(0,0,0,.35));
}
.strip { will-change: transform; }
.symbol { height: var(--sym); display: grid; place-items: center; }
.symbol img, .symbol svg { width: 60%; height: 60%; object-fit: contain; }
.symbol.win img { animation: pop .6s ease-in-out 3; }
@keyframes pop { 50% { transform: scale(1.2); filter: drop-shadow(0 0 10px rgba(156, 203, 72, .9)); } }

.payline {
  position: absolute; left: 4px; right: 4px; top: 50%; height: 3px; transform: translateY(-50%);
  background: rgba(156, 203, 72, .5); border-radius: 3px; pointer-events: none;
  box-shadow: 0 0 10px rgba(156, 203, 72, .6);
}
.reels.won .payline { background: var(--green); animation: flash .35s 6 alternate; }
@keyframes flash { to { opacity: .15; } }

/* lever */
.lever {
  position: absolute; right: -31px; top: 50%; width: 28px; height: 136px; transform: translateY(-62%);
  background: none; border: 0; padding: 0; cursor: pointer;
}
html[dir="rtl"] .lever { right: auto; left: -31px; }
.lever .arm {
  position: absolute; left: 50%; bottom: 0; width: 8px; height: 112px; margin-left: -4px;
  background: linear-gradient(90deg, #8d9093, #e3e5e6, #8d9093); border-radius: 4px;
  transform-origin: 50% 100%; transition: transform .22s ease-in;
}
.lever .knob {
  position: absolute; left: 50%; top: 0; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d4f08f, var(--green) 45%, var(--green-deep));
  box-shadow: 0 4px 10px rgba(0, 0, 0, .5); transition: transform .22s ease-in;
}
.lever.pulled .arm { transform: scaleY(.25); }
.lever.pulled .knob { transform: translateY(84px); }
.lever:disabled { cursor: default; }

.paytable {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 14px 26px 0 0; color: #d7dadc; font-weight: 800; font-size: 15px;
}
html[dir="rtl"] .paytable { margin: 14px 0 0 26px; }
.trio { display: inline-flex; gap: 3px; }
.trio img { height: 24px; background: #fff; border-radius: 6px; padding: 3px; }

/* ---------- form ---------- */
.play {
  margin: 26px auto 0; padding: 20px; border-radius: 22px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
}
.play > label:first-child { display: block; font-weight: 800; font-size: 15px; margin-bottom: 8px; color: #e8eaeb; }
.phone {
  display: flex; align-items: stretch; background: #fff; border-radius: 14px; overflow: hidden;
  border: 2px solid transparent; transition: border-color .2s; direction: ltr;
}
.phone:focus-within { border-color: var(--green); }
.phone.bad { border-color: #ff8a65; }
.cc { display: grid; place-items: center; padding: 0 12px; background: #eef0f1; color: var(--grey); font-weight: 800; font-size: 17px; }
.phone input {
  flex: 1; min-width: 0; border: 0; outline: 0; padding: 14px 12px; font: 800 20px "Nunito", system-ui, sans-serif;
  color: var(--ink); letter-spacing: .04em; background: transparent;
}
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 16px; color: #c3c7ca; font-size: 14px; line-height: 1.4; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 0; accent-color: var(--green); flex: none; }

.spin {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 58px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font: 900 22px var(--font); letter-spacing: .12em; color: var(--ink);
  background: linear-gradient(180deg, #b6e065, var(--green) 55%, var(--green-deep));
  box-shadow: 0 6px 0 #5f8a1c, 0 14px 30px rgba(156, 203, 72, .35);
  transition: transform .08s, box-shadow .08s, filter .2s;
}
html[lang="ar"] .spin { letter-spacing: 0; }
.spin:active { transform: translateY(4px); box-shadow: 0 2px 0 #5f8a1c, 0 8px 20px rgba(156, 203, 72, .3); }
.spin:disabled { filter: grayscale(.7) brightness(.8); cursor: default; }
.spin:focus-visible, .chip:focus-visible, .lever:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.msg { min-height: 22px; margin: 12px 0 0; text-align: center; font-weight: 700; color: #ffc98a; }
.saved { display: block; text-align: center; color: var(--green); font-weight: 800; text-decoration: none; margin-top: 4px; }

.rules { text-align: center; color: #8c9195; font-size: 12.5px; line-height: 1.5; margin: 18px 8px 0; }

.contact {
  max-width: 520px; margin: 26px auto 0; padding: 18px 16px 30px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px;
  border-top: 1px dotted rgba(255, 255, 255, .2); color: #a4a8ab; font-size: 13px;
}
.contact a { color: #a4a8ab; text-decoration: none; }
.contact a:hover { color: #fff; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 12, 13, .72); backdrop-filter: blur(4px); animation: fade .25s ease;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal .card {
  width: min(400px, 100%); background: #fff; color: var(--ink); border-radius: 24px; padding: 26px 22px 16px;
  text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: rise .35s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes rise { from { transform: translateY(30px) scale(.94); opacity: 0; } }
.burst { font: 900 60px/1 "Nunito", sans-serif; color: var(--green-deep); margin-bottom: 4px; }
.burst img { width: 64px; display: block; margin: 0 auto 6px; }
.modal h2 { margin: 6px 0; font-weight: 900; font-size: 26px; color: var(--grey); }
.modal p { margin: 0 0 18px; color: #555; font-size: 16px; line-height: 1.5; }
.modal .serial { display: inline-block; margin-top: 8px; font: 800 18px ui-monospace, Menlo, monospace; letter-spacing: .06em; color: var(--ink); background: #f1f3ef; padding: 6px 10px; border-radius: 8px; direction: ltr; }
.modal .spin { font-size: 19px; letter-spacing: .02em; }
.ghost { margin-top: 10px; background: none; border: 0; color: #777; font: 700 15px var(--font); padding: 8px 14px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .bulbs, .symbol.win img, .reels.won .payline { animation: none; }
}
@media (max-width: 360px) {
  .cabinet { padding: 10px; }
  .logo { height: 30px; }
}
