/* Big Bad Bankroll — slot machine.
   Sits on table-chrome.css for the page frame and starfield. */

.sl-main { max-width: 760px; }

.sl-bankroll {
  display: flex; align-items: baseline; gap: 10px;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 6px 16px;
}
.sl-bankroll-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.35);
}
.sl-bankroll-val {
  font-family: var(--font-heading); font-weight: 600; font-size: 20px; color: #fff;
}
.sl-bankroll-val::before { content: '$'; font-size: 14px; opacity: .5; }

/* — Cabinet — */
.sl-machine {
  position: relative; z-index: 1; width: 100%;
  border: 1px solid rgba(145,132,217,.2);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(64,44,120,.6), rgba(18,16,34,.94) 65%),
    #0c0d16;
  box-shadow: 0 18px 60px rgba(0,0,0,.55), inset 0 0 90px rgba(145,132,217,.05);
  padding: 22px 20px 26px;
  overflow: hidden;
}
/* Lift content above the starfield. The overlay is excluded because it needs
   to stay absolutely positioned over the whole cabinet, and this selector
   out-specifies .sl-overlay. */
.sl-machine > *:not(.starfield):not(.sl-overlay) { position: relative; z-index: 1; }

.sl-title {
  font: 400 30px var(--neon-font, 'Lobster', cursive);
  text-align: center; margin: 0 0 14px;
  color: #f0d79a;
  text-shadow: 0 0 14px rgba(216,180,90,.6), 0 0 40px rgba(216,180,90,.25);
}

/* The whole cabinet lights up when a jackpot lands. */
.sl-machine.is-jackpot { animation: cabinetFlash 1.2s ease; }
@keyframes cabinetFlash {
  0%, 100% {
    box-shadow: 0 18px 60px rgba(0,0,0,.55), inset 0 0 90px rgba(145,132,217,.05);
    border-color: rgba(145,132,217,.2);
  }
  15% {
    box-shadow: 0 0 0 3px rgba(240,215,154,.9), 0 0 70px rgba(240,215,154,.7),
                inset 0 0 130px rgba(240,215,154,.32);
    border-color: rgba(240,215,154,.95);
  }
  45% {
    box-shadow: 0 0 0 2px rgba(240,215,154,.45), 0 0 44px rgba(240,215,154,.4),
                inset 0 0 100px rgba(240,215,154,.14);
    border-color: rgba(240,215,154,.5);
  }
}

/* — Jackpot ladder — */
.sl-jackpots {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px;
}
.sl-jp {
  text-align: center; padding: 7px 4px; border-radius: 9px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
}
.sl-jp-name {
  display: block; font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(233,233,237,.45);
}
.sl-jp-val {
  display: block; margin-top: 3px;
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.sl-jp-mini  .sl-jp-val { color: #9fc4e8; }
.sl-jp-minor .sl-jp-val { color: #4aeabc; }
.sl-jp-major .sl-jp-val { color: #f0d79a; }
.sl-jp-grand {
  border-color: rgba(216,180,90,.4);
  background: rgba(216,180,90,.07);
}
.sl-jp-grand .sl-jp-val {
  color: #fff; text-shadow: 0 0 12px rgba(216,180,90,.8);
}

/* — Houses — */
.sl-houses {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px;
}
.sl-house {
  padding: 8px 6px; border-radius: 9px; text-align: center;
  border: 1px solid rgba(145,132,217,.28);
  background: rgba(145,132,217,.07);
  transition: opacity .4s, transform .4s, filter .4s;
}
.sl-house-name {
  display: block; font-family: var(--font-heading); font-weight: 600;
  font-size: 13px; color: #e9e9ed;
}
.sl-house-effect {
  display: block; margin-top: 2px; font-size: 10px;
  color: rgba(233,233,237,.5);
}
.sl-house-name b {
  font-size: 12px; margin-left: 4px; padding: 1px 6px; border-radius: 20px;
  background: rgba(0,0,0,.35); font-variant-numeric: tabular-nums;
}
/* each tier carries the colour its squares use on the board */
.sl-house-straw { border-color: rgba(216,208,106,.3); }
.sl-house-straw .sl-house-name { color: #d8d06a; }
.sl-house-wood  { border-color: rgba(201,141,90,.3); }
.sl-house-wood  .sl-house-name { color: #e0a877; }
.sl-house-brick { border-color: rgba(216,117,106,.35); }
.sl-house-brick .sl-house-name { color: #ec8d80; }
.sl-house.is-active {
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 22px rgba(255,255,255,.04);
}

/* — Reels — */
.sl-reels {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  padding: 10px; border-radius: 12px;
  background: rgba(0,0,0,.42);
  border: 1px solid rgba(255,255,255,.05);
}
.sl-reel { display: grid; grid-template-rows: repeat(3, 1fr); gap: 6px; }

.sl-cell {
  aspect-ratio: 1 / 1;
  position: relative;          /* anchors the shockwave ring */
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.06);
  font-family: var(--font-heading); font-weight: 600;
  font-size: 22px; color: rgba(233,233,237,.75);
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.sl-glyph { line-height: 1; }

.sl-low   { color: rgba(233,233,237,.6); }
.sl-straw { color: #d8d06a; }
.sl-wood  { color: #c98d5a; }
.sl-brick { color: #d8756a; }
.sl-pig   { color: #f0a8c0; text-shadow: 0 0 10px rgba(240,168,192,.5); }
.sl-wolf  {
  color: #9184d9;
  text-shadow: 0 0 12px rgba(145,132,217,.85);
  border-color: rgba(145,132,217,.45);
}
.sl-blank { opacity: .28; }

.sl-coin {
  color: #0d0e16;
  background: linear-gradient(180deg, #f2d488 0%, #d8b45a 100%);
  border-color: rgba(216,180,90,.7);
  box-shadow: 0 0 14px rgba(216,180,90,.35);
}
/* One size for every figure. The widest the game can produce — an 80x coin
   doubled at the $100 stake — is well inside the square at this size, so
   there is no reason to shrink the big wins. */
.sl-coin-val {
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.sl-cell.is-locked { box-shadow: 0 0 18px rgba(216,180,90,.6), inset 0 0 0 2px rgba(255,255,255,.35); }

/* Bonus tiers — a square visibly climbs Straw to Wood to Brick as it is
   hit again, so the upgrade is legible without reading the number. */
.sl-cell.is-tier-straw {
  background: linear-gradient(180deg, #e8dc9a 0%, #cfc069 100%);
  border-color: rgba(216,208,106,.75);
  box-shadow: 0 0 12px rgba(216,208,106,.3);
}
.sl-cell.is-tier-wood {
  background: linear-gradient(180deg, #e0a877 0%, #b8763f 100%);
  border-color: rgba(224,168,119,.8);
  box-shadow: 0 0 16px rgba(201,141,90,.45);
  color: #221208;
}
.sl-cell.is-tier-brick {
  background: linear-gradient(180deg, #ec8d80 0%, #c4483a 100%);
  border-color: rgba(236,141,128,.85);
  box-shadow: 0 0 22px rgba(216,117,106,.6), inset 0 0 0 2px rgba(255,255,255,.4);
  color: #2a0d08;
}
.sl-cell.is-tier-brick .sl-coin-val { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* Mid-bonus a square names its tier instead of its value; the figures all
   appear together at the reveal. */
.sl-tier-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; opacity: .85;
}
.sl-cell.is-tier-brick .sl-tier-label { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.45); }

/* The tally: figures flip up across the board in sequence. */
/* A square that won a jackpot names it instead of showing a figure. It sits
   over the tier colour, so it carries its own plate to stay legible. */
.sl-jp-won {
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; line-height: 1;
  padding: 4px 6px; border-radius: 5px;
  background: rgba(12,10,20,.82);
  border: 1px solid currentColor;
  animation: jpBadge 1.6s ease-in-out infinite;
}
.sl-jp-won-mini  { color: #9fc4e8; }
.sl-jp-won-minor { color: #4aeabc; }
.sl-jp-won-major { color: #f0d79a; }
.sl-jp-won-grand { color: #fff; }
@keyframes jpBadge {
  0%, 100% { box-shadow: 0 0 8px currentColor; }
  50%      { box-shadow: 0 0 18px currentColor, 0 0 30px currentColor; }
}

.sl-cell.is-revealing {
  animation: valueReveal .6s cubic-bezier(.2,.9,.3,1.4) backwards;
  animation-delay: calc(var(--rev, 0) * 45ms);
  z-index: 2;
}
@keyframes valueReveal {
  0%   { transform: scale(1) rotateX(70deg); filter: brightness(2); }
  55%  { transform: scale(1.16) rotateX(0);  filter: brightness(1.5); }
  100% { transform: scale(1) rotateX(0);     filter: brightness(1); }
}

/* Winning squares breathe rather than sitting statically lit. */
.sl-cell.is-win {
  border-color: rgba(74,234,188,.8);
  animation: winPulse 1s ease-in-out infinite;
  z-index: 2;
}
@keyframes winPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(74,234,188,.4);  transform: scale(1.03); }
  50%      { box-shadow: 0 0 28px rgba(74,234,188,.85); transform: scale(1.09); }
}

/* Reels streak downward out of frame, staggered left to right... */
.sl-cell.is-spinning {
  animation: reelStreak .46s cubic-bezier(.5,0,.85,.4) both;
  animation-delay: calc(var(--reel, 0) * 80ms);
}
@keyframes reelStreak {
  0%   { transform: translateY(0);     filter: blur(0);   opacity: 1; }
  20%  { transform: translateY(-14%);  filter: blur(2px); }
  100% { transform: translateY(190%);  filter: blur(9px); opacity: .15; }
}

/* ...then drop back in and bounce, one reel after another. This stagger is
   what makes it read as a slot machine instead of a grid repainting. */
.sl-cell.is-settling {
  animation: reelDrop .44s cubic-bezier(.18,.86,.32,1.4) backwards;
  animation-delay: calc(var(--reel, 0) * 80ms);
}
@keyframes reelDrop {
  0%   { transform: translateY(-165%); filter: blur(7px); opacity: 0; }
  55%  { transform: translateY(7%);    filter: blur(0);   opacity: 1; }
  75%  { transform: translateY(-4%); }
  90%  { transform: translateY(2%); }
  100% { transform: translateY(0); }
}

/* — A new square slams down and throws off a shockwave — */
.sl-cell.is-landing { animation: coinSlam .5s cubic-bezier(.2,.9,.3,1.5); z-index: 3; }
@keyframes coinSlam {
  0%   { transform: scale(.35) rotate(-22deg); opacity: 0; }
  45%  { transform: scale(1.28) rotate(5deg);  opacity: 1; filter: brightness(1.7); }
  70%  { transform: scale(.94)  rotate(-2deg); filter: brightness(1.1); }
  100% { transform: scale(1)    rotate(0); }
}
.sl-cell.is-landing::after,
.sl-cell.is-upgrading::after {
  content: ''; position: absolute; inset: -5px;
  border-radius: 13px; border: 2px solid rgba(255,255,255,.85);
  pointer-events: none;
  animation: shockRing .6s ease-out forwards;
}
@keyframes shockRing {
  0%   { transform: scale(.55); opacity: .95; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* — An upgrade rattles itself into its next form — */
.sl-cell.is-upgrading { animation: tierBuild .6s ease; z-index: 3; }
@keyframes tierBuild {
  0%, 100% { transform: translateX(0) scale(1); }
  12%      { transform: translateX(-5px) scale(1.07); filter: brightness(1.5); }
  28%      { transform: translateX(5px)  scale(1.12); filter: brightness(1.9); }
  44%      { transform: translateX(-4px) scale(1.08); filter: brightness(1.4); }
  60%      { transform: translateX(4px)  scale(1.05); }
  78%      { transform: translateX(-2px) scale(1.02); }
}

/* — Bonus start overlay — */
.sl-overlay {
  position: absolute; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: rgba(9,10,16,.9);
  backdrop-filter: blur(3px);
  border-radius: 20px;
  animation: overlayIn .3s ease;
}
.sl-overlay.hidden { display: none; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.sl-overlay-card {
  width: min(400px, 88%); text-align: center; padding: 8px 16px;
  animation: cardIn .5s cubic-bezier(.2,.9,.3,1.35);
}
@keyframes cardIn {
  0%   { transform: scale(.82) translateY(24px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.sl-overlay-kicker {
  display: block; font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--brass, #d8b45a);
  margin-bottom: 8px;
}
.sl-overlay-title {
  font: 400 40px var(--neon-font, 'Lobster', cursive);
  margin: 0 0 12px; color: #f0d79a;
  animation: titleGlow 2s ease-in-out infinite;
}
@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 18px rgba(216,180,90,.7), 0 0 50px rgba(216,180,90,.3); }
  50%      { text-shadow: 0 0 30px rgba(216,180,90,1),  0 0 78px rgba(216,180,90,.55); }
}
.sl-overlay-btn { animation: ctaBreathe 2.2s ease-in-out infinite; }
@keyframes ctaBreathe {
  0%, 100% { box-shadow: 0 3px 14px rgba(108,84,184,.5); }
  50%      { box-shadow: 0 3px 22px rgba(140,120,230,.85), 0 0 34px rgba(140,120,230,.4); }
}
.sl-overlay-body {
  font-size: 13px; line-height: 1.65;
  color: rgba(233,233,237,.65); margin: 0 0 22px;
}
.sl-overlay-body strong {
  color: #f0d79a; font-family: var(--font-heading); font-size: 16px;
}
.sl-overlay-btn { width: 100%; }

/* — Bonus bar — */
.sl-bonus-bar {
  display: flex; justify-content: center; gap: 28px;
  margin-top: 12px; padding: 9px 14px; border-radius: 9px;
  background: rgba(216,180,90,.1);
  border: 1px solid rgba(216,180,90,.32);
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(233,233,237,.6);
}
.sl-bonus-bar strong {
  font-family: var(--font-heading); font-size: 16px; color: #f0d79a;
  margin-left: 6px; font-variant-numeric: tabular-nums;
}
/* the withheld total, shown as a dash until the reveal */
.sl-bonus-bar strong.is-hidden-total { color: rgba(233,233,237,.35); letter-spacing: .1em; }

.sl-msg {
  min-height: 22px; margin: 14px 0 0; text-align: center;
  font-size: 14px; color: rgba(233,233,237,.7);
}
.sl-msg.win  { color: #4aeabc; text-shadow: 0 0 12px rgba(74,234,188,.4); }
.sl-msg.lose { color: #e08787; }

/* — Controls — */
.sl-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-top: 16px; width: 100%;
}
.sl-bet-group { display: flex; align-items: center; gap: 8px; }
.sl-bet-label {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(233,233,237,.4);
}
.sl-bet-btn {
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  font-family: var(--font-heading); font-weight: 600; font-size: 13px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(233,233,237,.7);
  transition: all .15s;
}
.sl-bet-btn:hover:not(:disabled) { border-color: rgba(145,132,217,.5); color: #e9e9ed; }
.sl-bet-btn.active {
  background: rgba(145,132,217,.16);
  border-color: rgba(145,132,217,.6);
  color: var(--accent-soft);
}
.sl-bet-btn:disabled { opacity: .4; cursor: not-allowed; }
.sl-bet-current {
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  color: #f0d79a; margin-left: 4px; font-variant-numeric: tabular-nums;
}

.sl-spin-btn {
  min-width: 160px; padding: 13px 32px; border-radius: 12px; cursor: pointer;
  font-family: var(--neon-font, 'Lobster', cursive); font-size: 21px;
  color: #fff; border: none;
  background: linear-gradient(180deg, #7c6dd8 0%, #5c4ea8 100%);
  box-shadow: 0 3px 14px rgba(108,84,184,.5);
  transition: all .15s;
}
.sl-spin-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #8d7ee4 0%, #6b5cc0 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(108,84,184,.6);
}
.sl-spin-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.sl-broke { margin-top: 14px; }
.sl-earn-link {
  display: inline-flex; padding: 9px 18px; border-radius: 9px;
  text-decoration: none; font-size: 13px;
  border: 1px solid rgba(216,180,90,.45); color: var(--neon-brass, #f0d79a);
}
.sl-earn-link:hover { background: rgba(216,180,90,.1); }

/* — Paytable — */
.sl-paytable {
  width: 100%; margin-top: 22px;
  border-top: 1px solid rgba(233,233,237,.08); padding-top: 14px;
}
.sl-paytable summary {
  cursor: pointer; font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(233,233,237,.45);
}
.sl-paytable summary:hover { color: rgba(233,233,237,.75); }
.sl-paytable-body { margin-top: 12px; }
.sl-paytable-body p {
  font-size: 13px; line-height: 1.6; color: rgba(233,233,237,.6);
  margin: 0 0 10px; max-width: 62ch;
}
.sl-paytable-note { font-size: 12px !important; color: rgba(233,233,237,.4) !important; }
.sl-wolf-inline { color: #9184d9; font-weight: 600; }
.sl-t-straw { color: #d8d06a; font-weight: 600; }
.sl-t-wood  { color: #e0a877; font-weight: 600; }
.sl-t-brick { color: #ec8d80; font-weight: 600; }

/* Respect a stated preference for less motion: keep the state changes, drop
   the movement. */
@media (prefers-reduced-motion: reduce) {
  .sl-cell.is-spinning, .sl-cell.is-settling, .sl-cell.is-landing,
  .sl-cell.is-upgrading, .sl-cell.is-revealing, .sl-cell.is-win,
  .sl-machine.is-jackpot, .sl-overlay-card, .sl-overlay-title,
  .sl-overlay-btn, .sl-overlay {
    animation: none !important;
  }
  .sl-cell.is-landing::after, .sl-cell.is-upgrading::after { display: none; }
  .sl-cell.is-win { box-shadow: 0 0 18px rgba(74,234,188,.6); }
  .sl-jp-won { animation: none !important; box-shadow: 0 0 10px currentColor; }
}

/* — Responsive — */
@media (max-width: 640px) {
  .sl-title { font-size: 24px; }
  .sl-jackpots { gap: 5px; }
  .sl-jp-val { font-size: 13px; }
  .sl-jp-name { font-size: 8px; }
  .sl-houses { gap: 5px; }
  .sl-house-effect { display: none; }
  .sl-reels { gap: 4px; padding: 7px; }
  .sl-reel { gap: 4px; }
  .sl-cell { font-size: 16px; border-radius: 7px; }
  .sl-coin-val { font-size: 11px; }
  .sl-jp-won { font-size: 8px; padding: 3px 4px; letter-spacing: .06em; }
  .sl-tier-label { font-size: 8px; }
  .sl-controls { justify-content: center; }
  .sl-spin-btn { width: 100%; }
}
