.lucky-machine {
  --lucky-gold: #e8c783;
  --lucky-cell: 112px;
  width: min(100%, 36rem);
  margin-inline: auto;
  color: #fcf3e5;
}

.lucky-machine[hidden],
.lucky-machine [hidden],
[data-lucky-open][hidden] { display: none; }

.lucky-machine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .6rem;
}

.lucky-machine-header p,
.lucky-back {
  margin: 0;
  padding: .25rem .6rem;
  border: 1px solid rgb(255 255 255 / .65);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: .72rem;
}

.lucky-back { min-height: 44px; cursor: pointer; }

.lucky-cabinet {
  padding: 1.7rem 1.5rem 1.4rem;
  border: 1px solid var(--lucky-gold);
  border-radius: 1.8rem;
  background: #52262c;
  box-shadow: inset 0 0 0 5px #52262c, inset 0 0 0 6px rgb(232 199 131 / .45), var(--shadow);
  text-align: center;
}
.lucky-machine:not([hidden]) .lucky-cabinet { animation: lucky-open 240ms var(--ease) both; }

.lucky-marquee {
  margin: 0 0 .45rem;
  color: var(--lucky-gold);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .18em;
}

.lucky-cabinet h2 {
  margin: 0 0 1.4rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: 1.15;
}

.lucky-game { display: grid; grid-template-columns: minmax(0, 1fr) 52px; align-items: center; gap: .65rem; }

.lucky-reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  padding: .7rem;
  border: 1px solid rgb(232 199 131 / .6);
  border-radius: 1.1rem;
  background: #36191f;
}

.lucky-reel {
  position: relative;
  height: var(--lucky-cell);
  overflow: hidden;
  border-radius: .6rem;
  background: #fcfaf6;
  box-shadow: inset 0 2px 7px rgb(43 37 33 / .1);
}

.lucky-reel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgb(82 38 44 / .09), transparent 25% 75%, rgb(82 38 44 / .09));
}

.lucky-symbol { display: grid; height: var(--lucky-cell); place-items: center; }
.lucky-symbol > svg { display: block; width: 54px; height: 54px; overflow: visible; }
.lucky-symbol .equalizer { transform: scale(1.4); }
.is-spinning .lucky-strip { will-change: transform; }

.lucky-lever {
  position: relative;
  width: 52px;
  height: 136px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--lucky-gold);
  cursor: grab;
  touch-action: none;
}

.lucky-lever::before {
  content: "";
  position: absolute;
  left: 17px;
  bottom: 35px;
  width: 18px;
  height: 18px;
  border: 1px solid #b58b4a;
  border-radius: 50%;
  background: var(--lucky-gold);
}

.lucky-lever-arm {
  position: absolute;
  left: 23px;
  bottom: 43px;
  width: 7px;
  height: 66px;
  border-radius: 8px;
  background: var(--lucky-gold);
  transform-origin: center bottom;
}

.lucky-knob {
  position: absolute;
  top: -13px;
  left: -12px;
  width: 31px;
  height: 31px;
  border: 1px solid #f2c891;
  border-radius: 50%;
  background: #c75444;
  box-shadow: inset 3px 3px 0 rgb(255 255 255 / .16), 0 3px 5px rgb(0 0 0 / .2);
}

.lucky-lever-label { position: absolute; right: 0; bottom: 3px; left: 0; font-size: .65rem; }
.lucky-lever:disabled { cursor: default; }
.lucky-lever.is-dragging { cursor: grabbing; }
.is-spinning .lucky-lever-arm { animation: lucky-pull 440ms cubic-bezier(.2,.8,.2,1); }
.lucky-cabinet :focus-visible { outline-color: var(--lucky-gold); }

.lucky-status { margin: 1.2rem 0 0; min-height: 1.5em; color: #e3c6b3; font-size: .8rem; }
.has-jackpot .lucky-status { color: var(--lucky-gold); }
.has-jackpot .lucky-jackpot { animation: lucky-win 280ms var(--ease) both; }
.lucky-jackpot { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: .7rem; padding: .55rem 1rem; border: 1px solid var(--lucky-gold); border-radius: 999px; color: #fcf3e5; font-size: .9rem; }
.site-footer { flex-wrap: wrap; }
.site-footer [data-lucky-open] { min-height: 44px; border-bottom: 0; color: var(--accent); cursor: pointer; }

@keyframes lucky-pull { 0% { transform: rotate(var(--lever-start, 0deg)); } 35% { transform: rotate(28deg); } 100% { transform: rotate(0deg); } }
@keyframes lucky-open { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lucky-win { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 440px) {
  .lucky-machine { --lucky-cell: 86px; }
  .lucky-cabinet { padding: 1.4rem 1rem 1.2rem; }
  .lucky-reels { gap: .35rem; padding: .45rem; }
  .lucky-game { grid-template-columns: minmax(0, 1fr) 44px; gap: .25rem; }
  .lucky-lever { width: 44px; }
  .lucky-symbol > svg { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-spinning .lucky-lever-arm,
  .lucky-machine:not([hidden]) .lucky-cabinet,
  .has-jackpot .lucky-jackpot { animation: none; }
}
