/* Isolated schematic one-armed bandit. Colours come from app.css tokens.
   Contour of a cartoon cabinet: dome, well, circular windows, plinth, lever.
   Root class is .bandit — the timeline already uses .slot. */

.bandit {
  --slot-cell: 16px;
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  min-height: 44px;
  padding-top: 6px;
}

.slot-boom {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
}
.bandit.is-boom .slot-boom {
  visibility: visible;
  opacity: 1;
}
.slot-blast {
  display: block;
  width: 108px;
  height: auto;
  pointer-events: none;
}
.slot-boom-label {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--now);
  background: var(--now-soft);
  color: var(--now);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1;
  white-space: nowrap;
}

.slot-hit {
  display: inline-flex;
  align-items: flex-end;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  line-height: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.slot-hit:disabled { cursor: default; opacity: 1; }
.slot-hit:focus { outline: none; }
.slot-hit:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 18px;
}
.slot-hit:active:not(:disabled) .slot-figure { transform: scale(.98); }

.slot-figure {
  position: relative;
  width: 132px;
  height: 58px;
  color: var(--border-2);
}
.bandit.is-jackpot .slot-figure { color: var(--now); }

.slot-shell {
  display: block;
  width: 120px;
  height: 58px;
}
.slot-shell svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.slot-shell path,
.slot-shell rect {
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.slot-shell .slot-well { fill: var(--surface-2); }

.slot-windows {
  position: absolute;
  left: 26px;
  top: 23px;
  display: flex;
  gap: 4px;
}

.slot-window {
  box-sizing: content-box;
  width: var(--slot-cell);
  height: var(--slot-cell);
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 0;
  box-shadow: inset 0 0 0 1.25px currentColor;
  background: var(--surface);
  position: relative;
  line-height: 0;
}

.slot-reel {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.slot-sym {
  box-sizing: border-box;
  width: var(--slot-cell);
  height: var(--slot-cell);
  flex: 0 0 var(--slot-cell);
  display: grid;
  place-items: center;
  color: var(--text-2);
}
.slot-sym svg {
  display: block;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.slot-arm {
  position: absolute;
  left: 104px;
  top: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16px;
  height: 34px;
  transform-origin: 8px 32px;
}
.bandit.is-spinning .slot-arm { animation: slot-pull 720ms var(--ease) both; }
.slot-knob {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.6px solid currentColor;
  background: var(--surface);
}
.slot-stem {
  width: 2px;
  flex: 1 1 auto;
  min-height: 8px;
  margin-top: -1px;
  background: currentColor;
  border-radius: 1px;
}

@keyframes slot-pull {
  0% { transform: rotate(0deg); }
  38% { transform: rotate(42deg); }
  100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .slot-reel { transition: none !important; }
  .slot-arm { animation: none !important; }
  .bandit.is-spinning .slot-arm { animation: none !important; transform: none; }
  .slot-hit:active:not(:disabled) .slot-figure { transform: none; }
  .slot-blast { display: none !important; }
  .bandit.is-boom .slot-boom {
    opacity: 1 !important;
    visibility: visible;
    bottom: calc(100% + 2px);
    transform: translateX(-50%);
  }
}

/* Quiet easter egg at the bottom of «Моё». */
.my-slot {
  display: flex;
  justify-content: center;
  margin: 40px 0 4px;
}
.my-slot .bandit:not(.is-jackpot) .slot-figure {
  opacity: 0.55;
  transition: opacity var(--dur) var(--ease);
}
.my-slot:hover .slot-figure,
.my-slot:focus-within .slot-figure {
  opacity: 1;
}
