/* Spin uses the same palette as the Drop stage. */
#spin {
  max-width: 650px;
  margin: 0 auto 20px;
  padding: 0 0 12px;
  color: var(--design-paper, #f7ecdf);
}

body.soft-velvet #spin > .unav-back {
  min-height: 36px;
  margin: 0 0 5px;
}

.spin-heading {
  display: none;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 14px;
  margin: 0 0 14px;
}

.spin-kicker {
  margin: 0 0 3px;
  color: var(--design-muted, #c3aebc);
  font-size: .66rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
}

#spin-title {
  margin: 0;
  color: var(--design-paper, #f7ecdf);
  font: 400 clamp(2rem, 9vw, 3.2rem)/.98 Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
}

#spin .spin-stage {
  display: grid;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--design-line, #604757);
  border-radius: 16px;
  background: linear-gradient(155deg, var(--design-raised, #2a202b), var(--design-panel, #201822) 65%);
  box-shadow: inset 0 1px #f7ecdf13, 0 14px 28px #100a1460;
}

.spin-cabinet {
  padding: 5px 4px 6px;
  border: 1px solid #876449;
  border-radius: 10px;
  background: linear-gradient(180deg, #211923, var(--design-ink, #120e17) 40%);
  box-shadow: inset 0 0 0 1px #f0ce9d1c;
}

.spin-cabinet-index,
#spin .spin-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.spin-cabinet-index {
  margin: 0 0 5px;
  color: var(--design-gold, #f0ce9d);
  font: 400 .62rem/1 Georgia, serif;
  letter-spacing: .08em;
  text-align: center;
}

#spin .spin-cards {
  min-height: 0;
  margin: 0;
}

#spin .spin-card {
  aspect-ratio: .67;
  border: 1px solid #ad8866;
  border-radius: 6px;
  background: repeating-linear-gradient(135deg, #f0ce9d0e 0 1px, transparent 1px 8px),
    radial-gradient(ellipse at center, #603342, #291d28 88%);
  box-shadow: inset 0 0 0 2px #100a1460;
}

#spin .spin-card > span {
  display: grid;
  width: 56%;
  aspect-ratio: 1;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid #f0ce9d55;
  border-radius: 4px;
  color: var(--design-gold, #f0ce9d);
  font-size: clamp(.9rem, 4vw, 1.45rem);
}

#spin .spin-result {
  display: grid;
  min-height: 25px;
  place-items: center;
  margin: 0;
  color: var(--design-paper, #f7ecdf);
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

#spin .spin-motion-notice {
  margin: 0;
  border-color: var(--design-line, #604757);
  background: var(--design-ink, #120e17);
}

#spin .spin-motion-notice p,
#spin #spin-enable-motion {
  color: var(--design-gold, #f0ce9d);
}

#spin #spin-go {
  min-height: 48px;
  margin: 0;
  border: 1px solid #ffe6bd;
  border-radius: 10px;
  background: linear-gradient(112deg, #f6deb9, var(--design-gold, #f0ce9d));
  color: #301b20;
  font-weight: 750;
  scroll-margin-block-end: 90px;
}

#spin #spin-go:disabled {
  border-color: #715768;
  background: #40313e;
  color: #cfbcc9;
  opacity: 1;
}

#spin .spin-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

#spin .spin-bottom .unified-small {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  border-color: var(--design-line, #604757);
  border-radius: 10px;
  background: var(--design-panel, #201822);
  color: var(--design-paper, #f7ecdf);
  font-size: .78rem;
  scroll-margin-block-end: 90px;
}

#spin .spin-bottom svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--design-gold, #f0ce9d);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#spin .unified-history {
  border-color: var(--design-line, #604757);
  background: var(--design-panel, #201822);
}

#spin button:focus-visible {
  outline: 2px solid var(--design-gold, #f0ce9d);
  outline-offset: 3px;
}

@media (max-height: 610px) and (orientation: portrait) {
  .spin-heading { margin-bottom: 8px; }
  #spin .spin-stage { gap: 6px; }
  #spin .spin-result { min-height: 20px; }
}

/* The receipt spells out the same four cards shown in the reels. */
#spin .spin-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
#spin .spin-hand-card {
  min-width: 2.55em;
  padding: 3px 6px;
  border: 1px solid var(--design-line, #604757);
  border-radius: 5px;
  background: #f1e1cb;
  color: #211b26;
  text-align: center;
  font-weight: 700;
}
#spin .spin-hand-card:is([data-suit="hearts"],[data-suit="diamonds"]) { color: #a0263e; }
#spin .spin-payout { margin-top: 4px; color: var(--design-gold, #f0ce9d); }
#spin .spin-receipt-summary { margin-top: 3px; color: var(--design-muted, #c3aebc); font-size: .72rem; }

/* Larger cards in portrait: four independent reels, arranged two by two. */
@media (max-width: 699px) and (orientation: portrait) {
  #spin .spin-cards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  #spin .spin-cabinet { width:min(100%,420px); justify-self:center; }
  #spin .spin-cabinet-index { display:none; }
}
/* Where height permits, keep all four enlarged cards above the bottom navigation. */
@media (max-width: 699px) and (min-height: 700px) and (orientation: portrait) {
  #spin .spin-cabinet { width:min(100%,420px,calc(67vh - 212px)); width:min(100%,420px,calc(67dvh - 212px)); }
}
@media (min-width: 700px) { #spin { max-width:800px; } }
