/* ============================================================
   BuildSpin — the machine: cabinet, marquee, reels, handle
   ============================================================ */

.hall { position: relative; z-index: 2; padding-top: clamp(18px, 3vh, 40px); }

.machine-zone {
  position: relative;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding-right: 88px; /* room for the handle */
}

/* ================= CABINET ================= */
.machine {
  position: relative;
  border-radius: 30px 30px 18px 18px;
  background:
    linear-gradient(90deg,
      var(--metal-lo) 0%, var(--metal) 5%, var(--metal-hi) 9%,
      var(--metal) 16%, var(--metal) 84%,
      var(--metal-hi) 91%, var(--metal) 95%, var(--metal-lo) 100%),
    var(--metal);
  border: 1px solid rgba(150,140,200,.22);
  box-shadow:
    inset 0 2px 0 rgba(210,200,255,.16),
    inset 0 -3px 0 rgba(0,0,0,.5),
    inset 4px 0 14px rgba(0,0,0,.35),
    inset -4px 0 14px rgba(0,0,0,.35),
    0 34px 70px rgba(0,0,0,.6),
    0 8px 26px rgba(0,0,0,.5);
  padding: 22px 26px 0;
}
/* bolted trim dots on the cabinet corners */
.machine::before, .machine::after {
  content: ""; position: absolute; top: 40px; bottom: 40px; width: 7px;
  background:
    radial-gradient(circle 3.5px at 50% 8px, #9a91bd 0 2.2px, #3a3355 2.6px, transparent 3.6px) repeat-y;
  background-size: 7px 74px;
  opacity: .8;
}
.machine::before { left: 9px; }
.machine::after { right: 9px; }

.machine__base {
  margin: 26px -26px 0;
  height: 30px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #141021, #0a0714);
  border-top: 1px solid rgba(150,140,200,.14);
  box-shadow: inset 0 6px 12px rgba(0,0,0,.55);
}

.machine__reflection {
  height: 60px; margin: 4px auto 0; width: 86%;
  background: radial-gradient(52% 100% at 50% 0%, rgba(139,92,246,.13), transparent 72%);
  filter: blur(12px);
}

/* ================= MARQUEE ================= */
.machine__marquee {
  position: relative;
  border-radius: 22px;
  padding: 12px;
  background:
    linear-gradient(180deg, #1d1633 0%, #120d22 100%);
  border: 1px solid rgba(150,140,200,.25);
  box-shadow:
    inset 0 0 34px rgba(20,10,40,.9),
    inset 0 1px 0 rgba(210,200,255,.12),
    0 6px 18px rgba(0,0,0,.45);
}
.marquee__inner {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 26px);
  border-radius: 14px;
  padding: 18px clamp(12px, 3vw, 30px);
  background:
    radial-gradient(120% 150% at 50% -20%, rgba(255,59,92,.12), transparent 60%),
    linear-gradient(180deg, #0d0918, #0a0714);
  border: 1px solid rgba(255,59,92,.14);
  overflow: hidden;
}
.marquee__inner::after { /* glass streak */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(112deg, transparent 26%, rgba(255,255,255,.05) 36%, rgba(255,255,255,.012) 46%, transparent 55%);
  pointer-events: none;
}

.marquee__lobster { width: clamp(84px, 13vw, 128px); flex: none; }
.lob__core { stroke-width-adjust: none; }
.marquee__lobster .lob__glow { animation: lobster-hum 4.5s ease-in-out infinite; }
@keyframes lobster-hum {
  0%, 100% { opacity: .5; }
  8%  { opacity: .62; }
  11% { opacity: .38; }
  13% { opacity: .6; }
  50% { opacity: .55; }
}

.marquee__wordmark { text-align: center; }
.marquee__title {
  font-family: var(--font-display);
  font-size: clamp(38px, 7.4vw, 74px);
  line-height: 1;
  letter-spacing: .015em;
  color: #ffe9ec;
  text-shadow:
    0 0 4px rgba(255,120,145,.8),
    0 0 16px rgba(255,59,92,.85),
    0 0 42px rgba(255,59,92,.5),
    0 0 90px rgba(255,59,92,.3),
    0 3px 0 rgba(90,8,26,.85);
  animation: neon-flicker 7s linear infinite;
}
@keyframes neon-flicker {
  0%, 100% { opacity: 1; }
  3.2% { opacity: 1; } 3.4% { opacity: .62; } 3.6% { opacity: 1; }
  7.1% { opacity: 1; } 7.2% { opacity: .78; } 7.4% { opacity: 1; }
  54% { opacity: 1; } 54.2% { opacity: .85; } 54.4% { opacity: 1; }
}
.marquee__tag {
  margin-top: 10px;
  font-weight: 700; font-size: clamp(10px, 1.5vw, 13.5px);
  letter-spacing: .34em; color: var(--teal);
  text-shadow: var(--glow-teal);
}
.marquee__dot { color: var(--gold); text-shadow: var(--glow-gold); margin: 0 2px; }

/* bulbs around the marquee */
.bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe7b0 0%, #a8842e 55%, #4c3a10 100%);
  box-shadow: inset 0 0 2px rgba(0,0,0,.5);
  transform: translate(-50%, -50%);
  transition: box-shadow .12s, background .12s;
}
.bulb.is-lit {
  background: radial-gradient(circle at 35% 30%, #fffbe8 0%, var(--gold-hot) 45%, var(--gold-deep) 100%);
  box-shadow: 0 0 8px 2px rgba(255,205,80,.85), 0 0 18px 5px rgba(255,194,51,.4);
}
.bulb--red.is-lit {
  background: radial-gradient(circle at 35% 30%, #ffe6ea 0%, var(--red-hot) 45%, var(--red-deep) 100%);
  box-shadow: 0 0 8px 2px rgba(255,80,110,.9), 0 0 18px 5px rgba(255,59,92,.45);
}

/* ================= LED TICKER ================= */
.ticker {
  margin: 16px 2px 0;
  border-radius: 10px;
  background: #050308;
  border: 1px solid rgba(255,59,92,.22);
  box-shadow: inset 0 0 14px rgba(0,0,0,.9), inset 0 0 34px rgba(255,59,92,.06);
  padding: 8px 0;
  overflow: hidden;
}
.ticker__mask {
  overflow: hidden; white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}
.ticker__text {
  display: inline-block; white-space: nowrap; padding-left: 100%;
  font-family: var(--font-mono); font-weight: 600;
  font-size: 13.5px; letter-spacing: .22em;
  color: var(--red-hot);
  text-shadow: 0 0 8px rgba(255,59,92,.8), 0 0 20px rgba(255,59,92,.35);
  animation: ticker-scroll var(--ticker-dur, 18s) linear infinite;
  animation-delay: calc(var(--ticker-dur, 18s) * -0.3);
}
.ticker--alert { border-color: rgba(255,194,51,.5); }
.ticker--alert .ticker__text { color: var(--gold-hot); text-shadow: 0 0 8px rgba(255,194,51,.8), 0 0 20px rgba(255,194,51,.35); }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ================= REEL BANK ================= */
.bank { margin-top: 18px; position: relative; }
.bank__frame {
  position: relative;
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, #3b3356 0%, #201a36 12%, #16112a 88%, #0e0a1d 100%);
  border: 1px solid rgba(160,150,210,.3);
  box-shadow:
    inset 0 2px 0 rgba(220,210,255,.18),
    inset 0 -2px 0 rgba(0,0,0,.6),
    0 8px 22px rgba(0,0,0,.45);
}
.bank__glass {
  position: absolute; inset: 12px; z-index: 6; border-radius: 10px;
  background:
    linear-gradient(118deg, transparent 30%, rgba(255,255,255,.075) 38%, rgba(255,255,255,.02) 45%, transparent 52%),
    linear-gradient(180deg, rgba(255,255,255,.06) 0%, transparent 12%, transparent 88%, rgba(255,255,255,.04) 100%);
  pointer-events: none;
}
.payline {
  position: absolute; left: 6px; right: 6px; top: 50%; z-index: 5; height: 2px;
  transform: translateY(14px); /* offset below labels; JS refines */
  background: linear-gradient(90deg, transparent, rgba(255,59,92,.9) 12%, rgba(255,59,92,.9) 88%, transparent);
  box-shadow: 0 0 10px rgba(255,59,92,.8), 0 0 26px rgba(255,59,92,.4);
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.payline.is-on { opacity: .95; animation: payline-pulse 1.4s ease-in-out infinite; }
@keyframes payline-pulse { 0%,100% { opacity: .95; } 50% { opacity: .45; } }

.reels {
  position: relative;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
}

.reel { position: relative; min-width: 0; }
.reel__plaque {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #2c2547, #1d1735);
  border: 1px solid rgba(160,150,210,.22);
  border-bottom: none;
  font-size: 9.5px; font-weight: 700; letter-spacing: .18em;
  color: var(--ink-dim);
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden;
}
.reel__plaque span { overflow: hidden; text-overflow: ellipsis; }
.reel__plaque svg { width: 11px; height: 11px; flex: none; color: var(--gold); filter: drop-shadow(0 0 4px rgba(255,194,51,.6)); }

.reel__window {
  position: relative;
  height: calc(var(--tile-h, 78px) * 3);
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  border: 1px solid rgba(160,150,210,.22);
  border-top: none;
  background: linear-gradient(180deg, #cfc9dd 0%, #f2eef8 18%, #ffffff 50%, #f2eef8 82%, #cfc9dd 100%);
  box-shadow:
    inset 0 10px 16px rgba(20,12,40,.45),
    inset 0 -10px 16px rgba(20,12,40,.45);
}
.reel__strip {
  position: absolute; left: 0; right: 0; top: 0;
  will-change: transform;
}
.reel.is-spinning .reel__strip { filter: blur(0.5px); }
.reel.is-fast .reel__strip { filter: blur(2px); }

.tile {
  height: var(--tile-h, 78px);
  display: grid; place-items: center;
  padding: 4px 6px;
  text-align: center;
  font-weight: 700;
  font-size: var(--tile-fs, 14.5px);
  line-height: 1.15;
  color: #2a2140;
  border-bottom: 1px solid rgba(42,33,64,.12);
  background:
    linear-gradient(180deg, rgba(42,33,64,.05) 0%, transparent 18%, transparent 82%, rgba(42,33,64,.07) 100%);
  overflow: hidden;
}
.tile span {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere; hyphens: auto;
}

/* the winning row flash */
.reel.is-locked .reel__window { animation: reel-lock .42s var(--ease-snap); }
@keyframes reel-lock {
  0% { box-shadow: inset 0 10px 16px rgba(20,12,40,.45), inset 0 -10px 16px rgba(20,12,40,.45), inset 0 0 0 rgba(255,194,51,0); }
  35% { box-shadow: inset 0 10px 16px rgba(20,12,40,.45), inset 0 -10px 16px rgba(20,12,40,.45), inset 0 0 0 3px rgba(255,194,51,.85), inset 0 0 30px rgba(255,194,51,.5); }
  100% { box-shadow: inset 0 10px 16px rgba(20,12,40,.45), inset 0 -10px 16px rgba(20,12,40,.45); }
}
.reel.is-hit .tile--won {
  background: linear-gradient(180deg, #fff5d6, #ffe9ad);
  box-shadow: inset 0 0 0 2px rgba(185,130,26,.5), inset 0 0 22px rgba(255,194,51,.55);
  color: #402c05;
}

/* LED strip under the bank */
.bank__lights {
  display: flex; justify-content: center; gap: 10px; margin-top: 10px;
}
.bank__led {
  width: 34px; height: 6px; border-radius: 3px;
  background: #241d3d;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.6);
  transition: background .15s, box-shadow .15s;
}
.bank__led.is-lit {
  background: var(--teal);
  box-shadow: 0 0 10px rgba(45,226,198,.8), 0 0 22px rgba(45,226,198,.35);
}

/* ================= CONSOLE ================= */
.console {
  margin-top: 18px;
  border-radius: 16px;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, #1b1530 0%, #120d22 100%);
  border: 1px solid rgba(160,150,210,.2);
  box-shadow: inset 0 1px 0 rgba(220,210,255,.1), inset 0 -8px 20px rgba(0,0,0,.35);
}
.console__label {
  display: block;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3em;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255,194,51,.5);
  margin-bottom: 10px;
}
.console__row { display: flex; gap: 14px; align-items: stretch; }
.console__inputwrap { position: relative; flex: 1; min-width: 0; }
.console__input {
  width: 100%; height: 100%;
  min-height: 58px;
  background: #060409;
  border: 1px solid rgba(45,226,198,.35);
  border-radius: 12px;
  color: var(--teal);
  font-family: var(--font-mono); font-size: 16px; font-weight: 500; /* >=16px: no iOS focus zoom */
  padding: 8px 18px;
  outline: none;
  text-shadow: 0 0 6px rgba(45,226,198,.45);
  box-shadow: inset 0 0 18px rgba(0,0,0,.8), inset 0 0 40px rgba(45,226,198,.04);
  transition: border-color .2s, box-shadow .2s;
  caret-color: var(--teal);
}
.console__input::placeholder { color: rgba(45,226,198,.34); text-shadow: none; }
.console__input:focus {
  border-color: rgba(45,226,198,.8);
  box-shadow: inset 0 0 18px rgba(0,0,0,.8), 0 0 0 3px rgba(45,226,198,.14), 0 0 24px rgba(45,226,198,.18);
}
.console__inputwrap.is-error .console__input {
  border-color: rgba(255,59,92,.8); color: var(--red-hot); caret-color: var(--red-hot);
  box-shadow: inset 0 0 18px rgba(0,0,0,.8), 0 0 0 3px rgba(255,59,92,.16), 0 0 24px rgba(255,59,92,.22);
}

.pullbtn {
  position: relative; flex: none;
  width: 118px; border-radius: 14px;
  background: linear-gradient(180deg, var(--red-hot) 0%, var(--red) 42%, var(--red-deep) 100%);
  box-shadow:
    0 5px 0 #6f0f24,
    0 12px 26px rgba(255,59,92,.4),
    inset 0 2px 0 rgba(255,255,255,.5),
    inset 0 -6px 12px rgba(120,10,32,.6);
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.pullbtn__face {
  font-family: var(--font-display); font-size: 21px; color: #fff;
  text-shadow: 0 2px 0 rgba(90,8,26,.8), 0 0 14px rgba(255,255,255,.35);
  letter-spacing: .04em;
}
.pullbtn__ring {
  position: absolute; inset: -5px; border-radius: 18px;
  border: 2px solid rgba(255,59,92,.0);
  pointer-events: none;
  transition: border-color .3s;
}
.pullbtn.is-ready .pullbtn__ring { animation: ring-pulse 1.6s ease-out infinite; }
@keyframes ring-pulse {
  0% { border-color: rgba(255,59,92,.75); transform: scale(.99); opacity: 1; }
  70% { border-color: rgba(255,59,92,0); transform: scale(1.09); opacity: 0; }
  100% { opacity: 0; }
}
.pullbtn:hover { filter: brightness(1.07); }
.pullbtn:active, .pullbtn.is-down {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #6f0f24, 0 5px 14px rgba(255,59,92,.3), inset 0 2px 0 rgba(255,255,255,.5), inset 0 -6px 12px rgba(120,10,32,.6);
}
.pullbtn:disabled { filter: saturate(.35) brightness(.75); cursor: not-allowed; }

.console__meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.console__coinslot { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.coinslot__slit {
  width: 26px; height: 8px; border-radius: 4px;
  background: #060409;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.95), 0 1px 0 rgba(220,210,255,.14);
}
.coinslot__label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: var(--ink-faint); }
.console__hint { font-size: 12.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* flying coin (JS positions it) */
.flycoin {
  position: fixed; z-index: 70; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff3c8 0%, var(--gold) 42%, var(--gold-deep) 100%);
  box-shadow: inset 0 0 0 2.5px rgba(185,130,26,.65), 0 0 14px rgba(255,194,51,.7);
  pointer-events: none;
}

/* ================= TRAY ================= */
.tray { margin-top: 18px; position: relative; }
.tray__slot {
  position: relative;
  width: min(440px, 82%);
  margin: 0 auto;
  height: 14px;
  border-radius: 7px;
  background: #05030a;
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,.95),
    0 1px 0 rgba(220,210,255,.12);
  overflow: visible;
}
.tray__paper {
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  width: 78%; height: 0;
  background:
    repeating-linear-gradient(180deg, var(--paper) 0 22px, var(--paper-shade) 22px 23px);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -4px 18px rgba(246,239,223,.14);
  transition: none;
}
.tray__lip {
  width: min(520px, 92%);
  margin: 10px auto 0; height: 26px;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, #251e3e, #131024);
  border: 1px solid rgba(160,150,210,.18); border-top: none;
  box-shadow: inset 0 -7px 12px rgba(0,0,0,.5), inset 0 4px 8px rgba(0,0,0,.55);
}
.tray__plate {
  margin-top: 14px; text-align: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: .3em; color: var(--ink-faint);
}
.tray__plate span { color: var(--red); opacity: .7; margin: 0 4px; }

/* ================= HANDLE ================= */
.handle {
  position: absolute;
  right: -86px; top: 190px;
  width: 110px; height: 300px;
  z-index: 4;
  touch-action: none;
}
.handle__mount {
  position: absolute; left: 0; top: 118px;
  width: 46px; height: 96px;
  border-radius: 10px 22px 22px 10px;
  background: linear-gradient(90deg, #241d3d, #37305a 45%, #1c1631);
  border: 1px solid rgba(160,150,210,.28);
  box-shadow: 0 8px 22px rgba(0,0,0,.5), inset 0 2px 0 rgba(220,210,255,.16);
}
.handle__mount::after { /* pivot cap */
  content: ""; position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #cfc8ea 0%, #7d74a8 40%, #37305a 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,.55), inset 0 -2px 4px rgba(0,0,0,.4);
}
.handle__arm {
  position: absolute; left: 34px; top: 166px;
  width: 56px; height: 10px;
  transform-origin: 6px 5px;
  transform: rotate(var(--arm-deg, -64deg));
  will-change: transform;
}
.handle__shaft {
  position: absolute; left: 0; top: 0;
  width: 148px; height: 10px; border-radius: 5px;
  background: linear-gradient(180deg, #e8e3f6 0%, #9a91bd 45%, #55496b 100%);
  box-shadow: 0 3px 8px rgba(0,0,0,.45);
}
.handle__knob {
  position: absolute; left: 132px; top: -21px;
  width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #ff9dae 0%, var(--red) 45%, #8e1230 100%);
  box-shadow:
    0 6px 16px rgba(0,0,0,.55),
    0 0 24px rgba(255,59,92,.35),
    inset 0 -5px 10px rgba(110,8,30,.7),
    inset 0 4px 6px rgba(255,255,255,.4);
  cursor: grab;
  outline-offset: 4px;
}
.handle__knob:active { cursor: grabbing; }
.handle.is-hot .handle__knob { animation: knob-glow 1.8s ease-in-out infinite; }
@keyframes knob-glow {
  0%, 100% { box-shadow: 0 6px 16px rgba(0,0,0,.55), 0 0 24px rgba(255,59,92,.35), inset 0 -5px 10px rgba(110,8,30,.7), inset 0 4px 6px rgba(255,255,255,.4); }
  50% { box-shadow: 0 6px 16px rgba(0,0,0,.55), 0 0 44px rgba(255,59,92,.75), inset 0 -5px 10px rgba(110,8,30,.7), inset 0 4px 6px rgba(255,255,255,.4); }
}

/* machine excitement states */
.machine.is-spinning .machine__marquee { box-shadow: inset 0 0 34px rgba(20,10,40,.9), inset 0 1px 0 rgba(210,200,255,.12), 0 6px 18px rgba(0,0,0,.45), 0 0 40px rgba(255,59,92,.12); }
.machine.is-jackpot { animation: cab-rumble .12s linear infinite; }
@keyframes cab-rumble {
  0% { transform: translate(0.6px, -0.4px); }
  25% { transform: translate(-0.5px, 0.5px); }
  50% { transform: translate(0.5px, 0.4px); }
  75% { transform: translate(-0.6px, -0.5px); }
  100% { transform: translate(0.4px, 0.3px); }
}
