/* One strip step is one cell. Each window exposes five consecutive steps. */
.slot-machine {
  --cell: clamp(32px, min(10.5vw, 7vh), 54px);
  --brass: linear-gradient(110deg, #80502d, #f9db96 21%, #a66a34 36%, #ffe2a0 67%, #81502c);
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(44px, 10%, 52px);
  align-items: stretch;
  width: min(100%, 444px);
  margin-block: 8px 12px;
  user-select: none;
  -webkit-user-select: none;
}

.slot-body {
  position: relative;
  isolation: isolate;
  padding: 7px clamp(8px, 2vw, 16px) 6px;
  background:
    linear-gradient(170deg, #e84834, #af0512 18%, #821122 67%, #580a13) padding-box,
    var(--brass) border-box;
  border: 3px solid transparent;
  border-radius: 23px 23px 16px 16px;
  box-shadow: inset 0 2px 1px #ffb77d, inset 0 -5px 1px #4b0712, 0 5px 0 #340711, 0 12px 18px -8px #090104;
}

.slot-marquee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 2vw, 13px);
  min-height: 36px;
  padding-bottom: 4px;
  line-height: 1;
}

.slot-marquee::before, .slot-marquee::after {
  content: "";
  flex: 1 1 0;
  max-width: 64px;
  height: 5px;
  border-block: 1px solid #edb568;
  opacity: .9;
  transform: skewX(-22deg);
}

.slot-star {
  color: #ffdc83;
  font: 700 13px/1 Georgia, serif;
  text-shadow: 0 1px 2px #802710;
}

.slot-frame {
  padding: clamp(3px, .8vw, 7px);
  background: linear-gradient(180deg, #190c10, #6a3a28 50%, #23121a) padding-box, var(--brass) border-box;
  border: 2px solid transparent;
  border-radius: 11px;
  box-shadow: 0 2px 0 #e36145, 0 -2px 0 #800511;
}

.slot-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border-radius: 5px;
  background: #523629;
}

.slot-window {
  position: relative;
  min-width: 0;
  height: calc(var(--cell) * 5);
  overflow: hidden;
  isolation: isolate;
  border-inline: 1px solid #745239;
  background: linear-gradient(90deg, #e4d0ab, #fff4d9 12%, #fff6dd 82%, #dfc8a3);
}

.slot-window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(#644a3d40, transparent 9% 91%, #65422f50);
  box-shadow: inset 1px 0 2px #815c3d66, inset -1px 0 2px #815c3d55;
  pointer-events: none;
}

.slot-strip {
  display: flex;
  flex-direction: column;
  height: var(--cell);
}

.slot-symbol {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  height: var(--cell);
  flex: 0 0 var(--cell);
  border-block-end: 1px solid #aa895f80;
  font: 800 calc(var(--cell) * .70)/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  text-shadow: 0 1px 1px #5d3c1f38;
}

.slot-symbol[data-symbol=seven] {
  color: #c41924;
  font: italic 900 calc(var(--cell) * .87)/1 Georgia, serif;
  text-shadow: 1px 1px #fff3bf, 2px 2px #871a21;
}

.slot-strip .slot-symbol[data-symbol=chip] {
  background-size: auto 78%;
}

.slot-symbol.matched::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 3px;
  border: 2px solid #dc9708;
  box-shadow: inset 0 0 0 1px #fff9c6, inset 0 0 8px #efa91a70;
  pointer-events: none;
}

.slot-lines {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.slot-payline {
  fill: none;
  stroke: #a91029;
  stroke-width: 2.5px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 1px #fff3bd);
}
.slot-payline:nth-child(3n + 2) { stroke: #13675d; }
.slot-payline:nth-child(3n) { stroke: #684388; }

.slot-trim {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  height: 18px;
}

.slot-trim::before, .slot-trim::after {
  content: "";
  height: 5px;
  width: 40%;
  background: radial-gradient(circle, #fff2a6 0 1px, #e9a951 1.3px 2px, #6a2420 2.4px, transparent 2.6px) center / 12px 5px repeat-x;
}

.slot-lever {
  position: relative;
  align-self: center;
  height: clamp(134px, 72%, 210px);
  touch-action: none;
  appearance: none;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}

.slot-lever:active { cursor: grabbing; }
.slot-machine.pulled .slot-lever { --pull: 1; }
.slot-lever::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 68%;
  width: 61%;
  height: 17px;
  transform: translateY(-50%);
  border-radius: 0 50% 50% 0;
  background: linear-gradient(#81532b, #fbd09a 34%, #9f6a46 58%, #472920 90%);
  box-shadow: 0 2px 2px #230c14;
}

.lever-rod, .lever-knob { position: absolute; left: 53%; pointer-events: none; }
.lever-rod {
  top: 22%;
  width: 8px;
  height: 46%;
  transform-origin: 50% 100%;
  transform: translateX(-50%) scaleY(calc(1 - var(--pull, 0) * 1.35));
  border-radius: 4px;
  background: linear-gradient(90deg, #644b37, #fff0bc 35%, #cc9856 60%, #754b36);
}

.lever-knob {
  top: calc(22% + 62.1% * var(--pull, 0));
  width: clamp(26px, 7vw, 35px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 25%, #ffdfac 0 4%, #ff8c73 10%, #e12028 29%, #b00013 53%, #630b18 78%, #331021);
  box-shadow: inset -1px -2px 3px #5b0e16, 0 3px 5px #220810bb;
}

.slot-lever:disabled { cursor: default; }
.slot-machine.has-match .slot-trim { filter: drop-shadow(0 0 3px #ffc620); }

@media (prefers-reduced-motion: no-preference) {
  .slot-machine.is-spinning .slot-trim::before,
  .slot-machine.is-spinning .slot-trim::after {
    animation: cabinet-lights .9s linear infinite;
  }
  @keyframes cabinet-lights { to { background-position: calc(50% + 12px) center; } }
}

@media (max-height: 640px) and (max-width: 440px) {
  .slot-body { padding: 3px 5px; border-radius: 14px 14px 10px 10px; }
  .slot-marquee { min-height: 23px; padding-bottom: 2px; }
  .slot-trim { height: 8px; }
}

@media (max-height: 500px) and (min-width: 520px) {
  .slot-machine { --cell: clamp(20px, 6.4vh, 28px); width: min(100%, 318px); margin-block: 2px 4px; }
  .slot-body { padding: 2px 5px; border-radius: 12px; }
  .slot-frame { padding: 3px; }
  .slot-marquee { min-height: 20px; padding: 0; }
  .slot-wordmark { height: 16px; }
  .slot-trim { height: 7px; }
  .slot-lever { height: 108px; }
}

/* The whole reel is the touch target. Its numbered tab sits below all five symbols. */
.slot-machine.choosing-reels .slot-window { height:calc(var(--cell)*5 + 21px); }
.slot-machine.choosing-reels .slot-lines { height:calc(var(--cell)*5); }
.slot-hold:not([hidden]) {
  display:flex; align-items:end; position:absolute; z-index:3; inset:0;
  width:100%; padding:0; border:0; background:transparent; cursor:pointer;
}
.hold-tag {
  display:flex; align-items:center; justify-content:center; gap:3px; width:100%; height:21px;
  border-top:1px solid #d6b07c; background:#402724; color:#f6e6c9; font:700 .8rem/1 system-ui,sans-serif;
}
.slot-window.held-reel { outline:2px solid #ffe38a; outline-offset:-2px; }
.held-reel .hold-tag { background:#f2cd78; color:#392716; }
.slot-hold:disabled { cursor:default; }
.slot-hold:disabled .hold-tag { background:#362b28; color:#bfb0a3; }
.arcade-page .slot-hold:focus-visible { outline:3px solid #252c57; outline-offset:-3px; }
#slot-breakdown:not([hidden]) { display:flex; flex-wrap:wrap; gap:4px 6px; }
#slot-breakdown button { cursor:pointer; background:#2d211d; font:inherit; min-height:32px; padding:3px 9px; border:1px solid #6c5746; border-radius:5px; color:#e8d7bd; font-size:.8rem; line-height:1.45; font-variant-numeric:tabular-nums; }
#slot-breakdown .review-current { background:#ffe4a4; color:#482610; border-color:#ffe4a4; }
.reviewing-line .slot-payline:not(.review-current),.reviewing-line .matched:not(.review-current)::after { opacity:.12; }
.reviewing-line .slot-payline.review-current { stroke-width:3.5px; }
#moves .move-button[data-move=collect] { background:#493323; border-color:#987343; }
