/* Bet67 games. The whole screen is the table: green felt edge to edge, a
   slim header, big cards, and a tray at the bottom that always keeps the
   same height. (The app is dark only.) */

body.in-game {
  overflow: hidden;
}

/* ------------------------------------------------------------ casino tab */

.play-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 0 8px 0 14px;
  border-radius: 17px;
  background: var(--label);
  color: var(--on-label);
  font-size: 15px;
  font-weight: 600;
}

.play-pill .icon {
  width: 18px;
  height: 18px;
}

.row.soon .name {
  color: var(--label-2);
}

/* ----------------------------------------------------------------- frame */

.game {
  --felt-1: #23935a;
  --felt-2: #14703f;
  --felt-3: #0b4b2a;
  --gold: #f5c542;
  --loss: #ffb4ab;
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: radial-gradient(130% 75% at 50% 38%, var(--felt-1) 0%, var(--felt-2) 50%, var(--felt-3) 100%);
  color: #fff;
  animation: view-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-user-select: none;
  user-select: none;
}

.game-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 16px) 4px calc(env(safe-area-inset-left) + 16px);
}

.game-round {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease-out;
}

.game-round:active {
  transform: scale(0.94);
}

.game-balance {
  display: grid;
  justify-items: center;
  line-height: 1.1;
}

.game-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.game-balance-value {
  font: 700 24px/1.15 var(--font-round);
  font-variant-numeric: tabular-nums;
}

.game-table {
  flex: 1;
  min-height: 0;
  position: relative;
  container-type: size; /* cards are sized from the space the table really has */
  display: flex;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 calc(env(safe-area-inset-right) + 12px) 0 calc(env(safe-area-inset-left) + 12px);
}

/* The tray: always the same height, so the table never jumps. */
.game-controls {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  height: calc(env(safe-area-inset-bottom) + 218px);
  padding: 16px calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 14px) calc(env(safe-area-inset-left) + 12px);
  border-radius: 36px 36px 0 0;
  background: rgba(0, 0, 0, 0.3);
}

/* Move buttons sit in the middle of the tray; the bet slider fills it. */
.game-controls:has(.round-row) {
  justify-content: center;
}

/* Whatever the tray or the middle of the table shows next fades in. */
.game-controls > *,
.bj-center > *,
.bj-seat {
  animation: appear 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.tray-note:empty {
  display: none;
}

.tray-note {
  min-height: 20px;
  font-size: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
}

.rules {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 8px 0 12px;
  font-size: 15px;
  text-align: left;
}

.rules ul {
  display: grid;
  gap: 6px;
  padding-left: 20px;
  list-style: disc;
}

.rules h3 {
  margin: 6px 0 0;
  font-size: 17px;
}

/* -------------------------------------------------------- round buttons */

.round-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.round-action {
  flex: none;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  width: 82px;
  height: 82px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease-out, opacity 0.25s ease;
}

.round-action:active {
  transform: scale(0.93);
}

.round-action .icon {
  width: 26px;
  height: 26px;
}

.round-label {
  font-size: 13px;
  font-weight: 600;
}

.round-sub {
  font-size: 11px;
  opacity: 0.75;
}

.round-action.light {
  background: #fff;
  color: var(--felt-3);
}

.round-action.stand {
  background: #d23c30;
}

.round-action:disabled {
  opacity: 0.28;
}

/* ------------------------------------------------------- playing cards */

.hand-cards {
  display: flex;
  justify-content: center;
  min-height: calc(var(--card-w) * 1.4);
}

.pcard {
  position: relative;
  flex: none;
  width: var(--card-w);
  height: calc(var(--card-w) * 1.4);
  border-radius: calc(var(--card-w) * 0.14);
  background: linear-gradient(160deg, #ffffff 0%, #f1f1f1 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32), 0 1px 2px rgba(0, 0, 0, 0.25);
  font-family: var(--font-round);
  transition: transform 0.22s cubic-bezier(0.45, 0, 0.55, 1);
}

.hand-cards .pcard + .pcard {
  margin-left: calc(var(--card-w) * -0.55);
}

.pcard.red {
  color: #e0262d;
}

.pcard.black {
  color: #16161a;
}

.card-rank {
  position: absolute;
  top: calc(var(--card-w) * 0.08);
  left: calc(var(--card-w) * 0.11);
  font-size: calc(var(--card-w) * 0.36);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
}

.card-suit {
  position: absolute;
  bottom: calc(var(--card-w) * 0.1);
  left: calc(var(--card-w) * 0.12);
  font-size: calc(var(--card-w) * 0.34);
  line-height: 1;
}

.pcard.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 10px),
    linear-gradient(160deg, #e2483b, #a8261c);
  box-shadow: inset 0 0 0 calc(var(--card-w) * 0.05) #fff, 0 6px 18px rgba(0, 0, 0, 0.32);
}

.card-back-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--card-w) * 0.34);
  color: rgba(255, 255, 255, 0.85);
}

.pcard.deal-in {
  animation: deal-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.pcard.flipping {
  transform: scaleX(0);
}

@keyframes deal-in {
  from {
    opacity: 0;
    transform: translate(30vw, -45vh) rotate(-14deg) scale(0.92);
  }
  40% {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- chips */

.chip-token {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 5px dashed rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: var(--chip, #2f6fdf);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28), inset 0 0 0 4px rgba(0, 0, 0, 0.12);
  color: #fff;
  font: 700 18px/1 var(--font-round);
}

.chip-token > span {
  display: grid;
  place-items: center;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: var(--chip, #2f6fdf);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.chip-10 { --chip: #2f6fdf; }
.chip-25 { --chip: #1f9d61; }
.chip-50 { --chip: #d63a3a; }
.chip-100 { --chip: #2a2a30; }
.chip-250 { --chip: #d6407f; }
.chip-500 { --chip: #7b3fe4; }
.chip-1000 { --chip: #d4a017; color: #1a1300; }

/* The chip slider: swipe or tap to choose, tap the middle chip to play. */
.slider {
  position: relative;
  display: grid;
  justify-items: center;
}

.slider-pointer {
  width: 0;
  height: 0;
  border-right: 9px solid transparent;
  border-left: 9px solid transparent;
  border-top: 10px solid #fff;
}

.slider-track {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 104px;
  padding: 0 calc(50% - 32px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.slider-track::-webkit-scrollbar {
  display: none;
}

.slider-chip {
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  scroll-snap-align: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.2, 1.2), opacity 0.2s;
}

.slider-chip.selected {
  transform: scale(1.32);
}

.slider-chip.too-much {
  opacity: 0.35;
}

.slider-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.side-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.side-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.side-pill b {
  font: 700 14px/1 var(--font-round);
  opacity: 0.8;
}

.side-pill[aria-pressed="true"] {
  background: var(--gold);
  color: #1a1300;
}

.side-pill[aria-pressed="true"] b {
  opacity: 1;
}

/* ------------------------------------------------------------ blackjack */

.bj-table {
  /* As big as the table allows: about 2.55 card widths of height go to the
     dealer's and your cards, about 200px to totals, the bet and padding. */
  --pw: clamp(52px, min(30vw, calc((100cqh - 200px) / 2.55)), 124px);
  --card-w: var(--pw);
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 4px;
  padding: 6px 0 18px;
}

.bj-dealer {
  --card-w: calc(var(--pw) * 0.82);
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bj-center {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-height: 0;
  text-align: center;
}

.center-big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.center-small {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.result-amount {
  font: 700 22px/1.2 var(--font-round);
}

.result-amount.up {
  color: var(--gold);
}

.result-amount.down {
  color: var(--loss);
}

.stake {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 20px/1 var(--font-round);
}

.stake .chip-token {
  width: 40px;
  height: 40px;
  border-width: 3px;
  font-size: 0;
}

.bj-player {
  display: grid;
  align-items: end;
}

.bj-hands {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
}

.bj-hands[data-count="2"] {
  --card-w: min(20vw, calc(var(--pw) * 0.75));
}

.bj-hands[data-count="3"] {
  --card-w: min(15vw, calc(var(--pw) * 0.6));
}

.bj-hands[data-count="3"] .pcard + .pcard {
  margin-left: calc(var(--card-w) * -0.62);
}

.bj-seat {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 18px;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.bj-seat.active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.seat-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 28px;
}

.bj-seat.doubled .seat-foot::after {
  content: "×2";
  font: 700 13px/1 var(--font-round);
  color: var(--gold);
}

.total-pill {
  min-width: 40px;
  padding: 4px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  font: 700 16px/1.2 var(--font-round);
  text-align: center;
}

.total-pill.bust {
  background: #c4281c;
}

.total-pill.natural {
  background: var(--gold);
  color: #1a1300;
}

.hand-result {
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  font: 700 14px/1.3 var(--font-round);
}

.hand-result.up {
  background: var(--gold);
  color: #1a1300;
}

.hand-result.down {
  color: var(--loss);
}

/* Short phones (iPhone SE and the like): a slimmer tray. */
@media (max-height: 700px) {
  .game-controls {
    height: calc(env(safe-area-inset-bottom) + 196px);
    padding-top: 12px;
    gap: 6px;
  }

  .round-action {
    width: 72px;
    height: 72px;
  }

  .slider-track {
    height: 92px;
  }

  .slider-chip.selected {
    transform: scale(1.22);
  }

  .center-big {
    font-size: 26px;
  }
}

.rules-title {
  justify-self: start;
  margin: 14px 0 0;
  font-size: 17px;
}

/* ---------------------------------------------------------------- slots */

.slot-table {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 10px;
  padding: 4px 0 14px;
}

.slot-top {
  min-height: 20px;
  font-size: 13px;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
}

/* The window: as big as the table allows, cells stay square. */
.slot-frame {
  --cell: min(calc((100cqw - 40px) / var(--reels, 3)), calc((100cqh - 170px) / var(--rows, 3)), 118px);
  position: relative;
  align-self: center;
  padding: 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1b1b22, #0e0e13);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.slot-window {
  display: flex;
  gap: 4px;
  --reels: 3;
}

.slot-frame:has(.slot-window[style*="--reels:5"]) {
  --reels: 5;
}

.slot-frame:has(.slot-window[style*="--reels:4"]) {
  --reels: 4;
}

.reel {
  position: relative;
  width: var(--cell);
  height: calc(var(--cell) * var(--rows));
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, #d9d9df 0%, #ffffff 18%, #ffffff 82%, #d9d9df 100%);
}

.reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.reel.spinning .sym {
  filter: blur(1.2px);
}

.reel.held::after {
  content: "HOLD";
  position: absolute;
  inset: auto 6px 6px;
  padding: 3px 0;
  border-radius: 8px;
  background: var(--gold);
  color: #1a1300;
  font: 800 12px/1 var(--font-round);
  letter-spacing: 0.08em;
  text-align: center;
}

.cell {
  display: grid;
  place-items: center;
  width: var(--cell);
  height: var(--cell);
  border-radius: 12px;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.cell.hit {
  background: rgba(245, 197, 66, 0.35);
  box-shadow: inset 0 0 0 3px var(--gold);
  animation: hit-pulse 0.9s ease-in-out 2;
}

.cell.sticky {
  background: rgba(123, 63, 228, 0.22);
  box-shadow: inset 0 0 0 3px #7b3fe4;
}

@keyframes hit-pulse {
  50% {
    transform: scale(0.92);
  }
}

.sym {
  font-size: calc(var(--cell) * 0.58);
  line-height: 1;
  color: #16161a;
}

/* Word symbols: BARs, 7, WILD and the like. */
.sym.seven {
  font: 900 calc(var(--cell) * 0.7) / 1 var(--font-round);
  color: #e0262d;
  text-shadow: 0 2px 0 #7a0d12;
}

.sym.bar {
  display: grid;
  gap: calc(var(--cell) * 0.03);
}

.sym.bar > span {
  padding: calc(var(--cell) * 0.025) calc(var(--cell) * 0.08);
  border-radius: calc(var(--cell) * 0.05);
  background: #16161a;
  color: #fff;
  font: 900 calc(var(--cell) * 0.16) / 1 var(--font-round);
  letter-spacing: 0.04em;
}

.sym.wild {
  position: relative;
}

.sym.wild::after {
  content: "WILD";
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 5px;
  background: #7b3fe4;
  color: #fff;
  font: 800 calc(var(--cell) * 0.13) / 1.2 var(--font-round);
  letter-spacing: 0.06em;
}

.payline {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 0;
  border-top: 3px solid rgba(224, 38, 45, 0.75);
  pointer-events: none;
}

.slot-center {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 62px;
  text-align: center;
}

.slot-center > * {
  animation: appear 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.slot-big {
  font: 700 28px/1.15 var(--font-round);
  letter-spacing: -0.01em;
}

.slot-big.up {
  color: var(--gold);
}

.slot-big.huge {
  font-size: 38px;
}

.slot-big.faint,
.center-small.faint {
  color: rgba(255, 255, 255, 0.55);
}

.slot-big.placeholder {
  visibility: hidden;
}

.slot-banner {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 18px;
  border-radius: 16px;
  background: var(--gold);
  color: #1a1300;
  text-align: center;
  animation: appear 0.32s both;
}

.slot-banner b {
  font: 800 16px/1.2 var(--font-round);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.slot-banner span {
  font: 600 13px/1.2 var(--font-round);
}

/* --------------------------------------------------- Midnight Vegas wheel */

.game-vegas {
  --felt-1: #2b2f6b;
  --felt-2: #1a1c48;
  --felt-3: #0d0e26;
}

.wheel-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  border-radius: 24px;
  background: rgba(8, 8, 20, 0.9);
  animation: appear 0.35s both;
}

.wheel {
  position: relative;
  width: min(78cqw, 62cqh, 320px);
  aspect-ratio: 1;
}

.wheel-disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(#d23c30 0 30deg, #16161a 30deg 60deg);
  box-shadow: 0 0 0 6px var(--gold), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 0;
  transform: rotate(var(--a)) translate(-50%, calc(min(78cqw, 62cqh, 320px) * -0.42));
  font: 800 15px/1 var(--font-round);
  color: #fff;
}

.wheel-label.gold {
  color: var(--gold);
}

.wheel-pointer {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: -14px;
  translate: -50% 0;
  border-right: 14px solid transparent;
  border-left: 14px solid transparent;
  border-top: 24px solid #fff;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

/* ------------------------------------------------------- Live Blackjack */
/* The solo Blackjack table with room for 4 seats: the dealer at the top, the
   others smaller above your seat, your seat big at the bottom. */

.lb-table {
  --pw: clamp(40px, min(24vw, calc((100cqh - 268px) / 2.95)), 108px);
  grid-template-rows: auto 1fr auto auto;
  gap: 6px;
}

.lb-table .bj-dealer {
  --card-w: calc(var(--pw) * 0.75);
}

.lb-center {
  gap: 4px;
  min-height: 0;
}

.lb-bar {
  width: min(220px, 60%);
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.lb-bar-fill {
  display: block;
  height: 100%;
  background: #fff;
  transform-origin: left;
  transition: transform 0.25s linear;
}

.lb-bar.low .lb-bar-fill {
  background: var(--gold);
}

.lb-others {
  /* The other seats' cards: sized from the width of their column, so two
     cards, or two split hands, always fit next to each other. */
  --n: 3;
  --mini: clamp(24px, calc((100cqw - 24px) / var(--n) / 2.7), 54px);
  --card-w: var(--mini);
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 6px;
}

.lb-others[data-count="4"] {
  --n: 4;
}

.lb-others .bj-hands {
  gap: 3px;
}

.lb-others .bj-hands[data-count="2"] {
  --card-w: calc(var(--mini) * 0.7);
}

.lb-others .bj-hands[data-count="3"] {
  --card-w: calc(var(--mini) * 0.55);
}

.lb-others .bj-seat {
  gap: 4px;
  padding: 2px;
}

.lb-others .lb-seat {
  align-content: start;
  background: rgba(0, 0, 0, 0.12);
}

.lb-others .lb-label {
  order: -1;
  min-height: 18px;
}

.lb-mine {
  display: grid;
  justify-items: center;
}

.lb-seat {
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 4px;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 16px;
  transition: background-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.lb-seat.mine {
  padding: 6px 10px 2px;
}

.lb-seat .bj-hands {
  min-height: calc(var(--card-w) * 1.4 + 34px);
  max-width: 100%;
}

.lb-others .lb-seat .bj-hands .pcard + .pcard {
  margin-left: calc(var(--card-w) * -0.62);
}

.lb-others .seat-foot {
  min-height: 22px;
}

.lb-others .total-pill {
  min-width: 30px;
  padding: 2px 8px;
  font-size: 13px;
}

.lb-seat.turn {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.lb-seat.empty {
  opacity: 0.45;
  cursor: pointer;
}

.lb-seat.leaving {
  opacity: 0.6;
}

.lb-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px 6px;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
}

.lb-seat.mine .lb-label {
  font-size: 14px;
}

.lb-name {
  overflow: hidden;
  max-width: 100%;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lb-info {
  color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
}

.lb-label .hand-result {
  padding: 1px 8px;
  font-size: 12px;
}

.lb-seat.mine .lb-label .hand-result {
  font-size: 14px;
}

/* Short phones: a smaller middle, so the cards keep their room. */
@media (max-height: 700px) {
  .lb-center .center-big {
    font-size: 22px;
  }

  .lb-center .result-amount {
    font-size: 18px;
  }

  .lb-bar {
    margin-top: 2px;
  }

  .lb-seat {
    padding: 4px;
  }

  .lb-seat .bj-hands {
    min-height: calc(var(--card-w) * 1.4 + 28px);
  }
}

/* ----------------------------------------------------------- Kokos ding */
/* A beach-bar fruit machine, built like the other slots: a hint line, the
   reels in the standard frame, the result under them, a chip slider in the
   tray. A lagoon table, bamboo frames, two amber LED meters between the
   windows. The two reel windows share one size (--c) from the space the table
   has. Bulbs light up round the top game only while it is being played. */

.game-kokos {
  --felt-1: #1e8590;
  --felt-2: #135560;
  --felt-3: #0b2d36;
  --kk-bamboo: #d9b36c;
  --kk-wood: #5b3d1e;
  --kk-amber: #ffb648;
}

.kk-table {
  gap: 8px;
}

.kk-reels {
  --c: clamp(30px, min((100cqw - 44px) / 3.3, (100cqh - 206px) / 5.76), 92px);
  position: relative;
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

/* Bamboo frame: a light cane edge round dark wood. */
.kk-frame {
  align-self: auto;
  --cell: calc(var(--c) * 1.1);
  background: linear-gradient(180deg, #2a1d10, #170f07);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.4),
    inset 0 0 0 3px var(--kk-bamboo),
    inset 0 0 0 5px var(--kk-wood);
}

.kk-hi {
  --cell: calc(var(--c) * 0.82);
  padding: 12px;
  border-radius: 24px;
}

/* The game that isn't being played rests. */
.kk-table[data-mode="base"] .kk-hi .slot-window,
.kk-table:not([data-mode="base"]) .kk-low .slot-window {
  opacity: 0.45;
  transition: opacity 0.3s;
}

.kk-hi .reel.off {
  opacity: 0.4;
}

/* Bulbs round the top window: only while the top game plays. */
.kk-bulbs {
  position: absolute;
  inset: 2px;
  padding: 6px;
  border-radius: 22px;
  pointer-events: none;
  background: radial-gradient(circle, var(--kk-amber) 0 2.3px, rgba(255, 182, 72, 0.3) 3.1px, transparent 4.3px) 0 0 / 13px 13px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.4s;
}

.kk-table:not([data-mode="base"]) .kk-bulbs,
.kk-hi.party .kk-bulbs {
  opacity: 0.85;
  animation: kk-chase 1.4s steps(2) infinite;
}

.kk-hi.party .kk-bulbs {
  opacity: 1;
  animation-duration: 0.3s;
  filter: drop-shadow(0 0 4px var(--kk-amber));
}

@keyframes kk-chase {
  to {
    background-position: 6.5px 6.5px;
  }
}

/* LED meters: Gewonnen and Win. */
.kk-leds {
  display: flex;
  gap: 8px;
}

.kk-led {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: calc(var(--c) * 1.55);
  padding: 4px 10px;
  border-radius: 8px;
  background: #0d0a06;
  box-shadow: inset 0 0 0 1px rgba(255, 182, 72, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.kk-led span {
  color: rgba(255, 182, 72, 0.6);
  font: 700 10px/1 var(--font-round);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kk-led b {
  margin-left: auto;
  color: var(--kk-amber);
  font: 700 18px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 182, 72, 0.55);
}

.kk-led.counting b {
  color: #ffe2a8;
}

.kk-banner {
  position: absolute;
  z-index: 2;
  top: calc(var(--c) * 1.25 + 12px);
  left: 50%;
  translate: -50% -50%;
  white-space: nowrap;
}

.kk-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(217, 179, 108, 0.25);
  color: #fff;
  font-weight: 600;
}

.kk-tag.wild {
  background: #c97a12;
  font-weight: 700;
}

/* Jokers: a gold tile with a coconut badge, or WILD in modes E and G. */
.sym.joker {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--cell) * 0.78);
  height: calc(var(--cell) * 0.78);
  border-radius: 22%;
  background: radial-gradient(circle at 35% 28%, #fff1b8, #f2c14e 45%, #b87d12);
  box-shadow: 0 0 10px rgba(255, 196, 70, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  font-size: calc(var(--cell) * 0.46);
}

.sym.joker::after {
  content: "🥥";
  position: absolute;
  right: -6%;
  top: -8%;
  font-size: calc(var(--cell) * 0.24);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

.kk-hi.wild .sym.joker::after {
  content: "WILD";
  top: auto;
  right: auto;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  padding: 1px 4px;
  border-radius: 4px;
  background: #c97a12;
  color: #fff;
  font: 800 calc(var(--cell) * 0.14) / 1.2 var(--font-round);
  letter-spacing: 0.05em;
  filter: none;
}

.sym.coco {
  filter: drop-shadow(0 0 6px rgba(255, 220, 150, 0.45));
}

/* Holding: the machine may offer it after a loss; tap a reel to change it. */
.kk-low.offer .reel {
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 182, 72, 0.5);
}

.game-kokos .reel.held {
  box-shadow: inset 0 0 0 3px var(--kk-amber);
}

.game-kokos .reel.held::after {
  content: "VAST";
  background: var(--kk-amber);
}

/* Crowns that pay light up. */
.cell.crown {
  background: rgba(245, 197, 66, 0.45);
  box-shadow: inset 0 0 0 3px var(--gold), 0 0 18px rgba(245, 197, 66, 0.9);
  animation: kk-crown 0.5s ease-in-out infinite alternate;
}

@keyframes kk-crown {
  to {
    background: rgba(245, 197, 66, 0.8);
    transform: scale(0.94);
  }
}

.kk-roll {
  font-size: 38px;
  font-variant-numeric: tabular-nums;
}

/* The gamble coin, in the middle of the table. */
.coin.won {
  box-shadow: 0 4px 0 #7a5a0c, 0 0 30px rgba(255, 212, 59, 0.9);
}

.coin.lost {
  background: radial-gradient(circle at 35% 30%, #8a8a8a, #4a4a4a 60%, #2a2a2a);
  box-shadow: 0 4px 0 #1a1a1a, 0 8px 18px rgba(0, 0, 0, 0.35);
  color: #ddd;
}

/* Tray: the stake chips and the pills above them. */
.kk-chip > span {
  align-content: center;
  gap: 1px;
  line-height: 1;
}

.kk-chip b {
  font: 700 18px/1 var(--font-round);
}

.kk-chip small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.game-kokos .side-pill:disabled {
  opacity: 0.35;
}

.game-kokos .side-pill[hidden] {
  display: none;
}

.kk-paytable {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.kk-paytable th,
.kk-paytable td {
  padding: 4px 6px;
  text-align: right;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.kk-paytable th:first-child,
.kk-paytable td:first-child {
  text-align: left;
}

.kk-paytable th {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
}

.coin {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe48a, #d4a017 60%, #9c7410);
  box-shadow: 0 4px 0 #7a5a0c, 0 8px 18px rgba(0, 0, 0, 0.35);
  color: #4a3600;
  font: 900 28px/1 var(--font-round);
}

/* ---------------------------------------------------- Underground Heist */

.game-heist {
  --felt-1: #3a4a55;
  --felt-2: #222d35;
  --felt-3: #0d1317;
}

.heist-frame {
  background: linear-gradient(180deg, #2a2f33, #121518);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 3px #8a96a0;
}

/* ------------------------------------------------------- board betting */

.board-tray {
  display: grid;
  gap: 8px;
}

.chip-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.pick-chip {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.2, 1.2), opacity 0.2s;
  opacity: 0.6;
}

.pick-chip .chip-token {
  width: 46px;
  height: 46px;
  border-width: 4px;
  font-size: 14px;
}

.pick-chip[aria-pressed="true"] {
  opacity: 1;
  transform: translateY(-4px) scale(1.12);
}

.round-row.compact .round-action {
  width: 66px;
  height: 66px;
}

.round-row.compact .round-action .icon {
  width: 22px;
  height: 22px;
}

.round-row.compact {
  gap: 22px;
}

.mode-pills {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.mode-pill[aria-pressed="true"] {
  background: #fff;
  color: var(--felt-3);
}

.game-controls:has(.board-tray) {
  justify-content: center;
  padding-top: 12px;
}

/* -------------------------------------------------------------- roulette */

.rl-table {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  padding: 2px 0 10px;
}

.rl-top {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 62px;
}

.rl-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
}

.rl-status > * {
  animation: appear 0.3s both;
}

.rl-result {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font: 800 18px/1 var(--font-round);
  box-shadow: 0 0 0 2px #fff;
}

.rl-history {
  display: flex;
  gap: 4px;
  min-height: 20px;
}

.rl-past {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 4px;
  border-radius: 10px;
  font: 700 11px/1 var(--font-round);
  opacity: 0.75;
}

.rl-past.last {
  opacity: 1;
  box-shadow: 0 0 0 1.5px #fff;
}

.red {
  --cell-bg: #c8322a;
}

.black {
  --cell-bg: #1d1d22;
}

.green {
  --cell-bg: #1f9d61;
}

.rl-result,
.rl-past {
  background: var(--cell-bg);
  color: #fff;
}

.rl-board {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1fr 1fr 1fr;
  grid-template-rows: repeat(14, minmax(0, 1fr));
  gap: 3px;
  min-height: 0;
  max-height: 560px;
  align-self: center;
  height: 100%;
}

.rl-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: 700 15px/1 var(--font-round);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.12s;
}

.rl-cell:active {
  transform: scale(0.96);
}

.rl-cell.num {
  background: var(--cell-bg);
}

.rl-cell.out {
  font-size: 13px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.rl-cell.out.red,
.rl-cell.out.black {
  background: var(--cell-bg);
}

.rl-cell.out:not(.col) span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.rl-cell.picked {
  box-shadow: 0 0 0 3px #fff;
}

.rl-cell.hit {
  box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(245, 197, 66, 0.8);
  animation: hit-pulse 0.9s ease-in-out 3;
}

.rl-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rl-chip {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-width: 3px;
  font-size: 10px;
  animation: chip-drop 0.25s cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
}

.rl-chip.won {
  box-shadow: 0 0 0 2px var(--gold), 0 0 12px var(--gold);
}

@keyframes chip-drop {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(1.3);
  }
}

.rl-disc {
  box-shadow: 0 0 0 10px #5b3a1f, 0 0 0 13px var(--gold), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.rl-num {
  font-size: 10px;
  transform: rotate(var(--a)) translate(-50%, calc(min(78cqw, 62cqh, 320px) * -0.47));
}

.rl-hub {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #e8c26a, #8a6a1c);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* -------------------------------------------------------------- baccarat */

.game-baccarat {
  --felt-1: #1f6f8b;
  --felt-2: #13506a;
  --felt-3: #0a2c3c;
}

.bac-table {
  --card-w: clamp(50px, min(calc((100cqw - 30px) / 3.9), calc((100cqh - 330px) / 1.4)), 100px);
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  padding: 6px 0 12px;
}

.bac-hands {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bac-seat {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 18px;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.bac-seat.winner {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 2px var(--gold);
}

.bac-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.bac-seat .hand-cards .pcard + .pcard {
  margin-left: calc(var(--card-w) * -0.45);
}

.bac-seat .total-pill[hidden] {
  display: block;
  visibility: hidden;
}

.bac-center .center-big {
  font-size: 24px;
}

.bac-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.bac-spot {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  padding: 6px 4px;
  border: 0;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
  color: #fff;
  cursor: pointer;
  transition: box-shadow 0.25s, background-color 0.25s, transform 0.12s;
}

.bac-spot:active {
  transform: scale(0.97);
}

.bac-spot.small {
  grid-column: span 2;
  min-height: 54px;
}

.bac-spot.big {
  grid-column: span 3;
  min-height: 74px;
}

.bac-spot b {
  font: 800 15px/1.1 var(--font-round);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bac-spot.big b {
  font-size: 19px;
}

.bac-spot > span:not(.bac-mark) {
  font-size: 12px;
  opacity: 0.75;
}

.bac-spot.player {
  background: rgba(47, 111, 223, 0.35);
}

.bac-spot.banker {
  background: rgba(210, 60, 48, 0.35);
}

.bac-spot.won {
  box-shadow: inset 0 0 0 3px var(--gold), 0 0 16px rgba(245, 197, 66, 0.6);
}

.bac-mark {
  position: absolute;
  top: 5px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  font: 700 11px/1 var(--font-round);
}

.bac-mark .chip-token {
  width: 20px;
  height: 20px;
  border-width: 2px;
  font-size: 0;
  animation: chip-drop 0.25s both;
}

/* ------------------------------------------------------- Jacks or Better */

.game-poker {
  --felt-1: #2a4fa0;
  --felt-2: #1b3677;
  --felt-3: #0d1c44;
}

.vp-table {
  --card-w: clamp(50px, min(calc((100cqw - 40px) / 5), calc((100cqh - 290px) / 1.4)), 96px);
  flex: 1;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 12px;
  padding: 4px 0 12px;
}

.vp-pay {
  display: grid;
  gap: 0;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
}

.vp-pay-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.8);
}

.vp-pay-row b {
  font: 700 12px/1.35 var(--font-round);
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.vp-pay-row.hit {
  background: var(--gold);
  color: #1a1300;
}

.vp-pay-row.hit b {
  color: #1a1300;
}

.vp-cards {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.vp-slot {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.vp-slot.held {
  transform: translateY(-8px);
}

.vp-slot.held .pcard {
  box-shadow: 0 0 0 3px var(--gold), 0 6px 18px rgba(0, 0, 0, 0.32);
}

.vp-slot.picked .pcard {
  box-shadow: 0 0 0 3px #fff, 0 6px 18px rgba(0, 0, 0, 0.32);
}

.vp-tag {
  min-height: 20px;
  font: 800 12px/20px var(--font-round);
  letter-spacing: 0.08em;
  color: var(--gold);
}

.vp-slot.dealer .vp-tag {
  color: rgba(255, 255, 255, 0.8);
}

.vp-center {
  align-content: center;
}

@media (max-height: 700px) {
  .vp-pay-row {
    font-size: 11px;
    line-height: 1.2;
  }

  .vp-pay-row b {
    font-size: 11px;
    line-height: 1.2;
  }
}

.sym.blank {
  font-size: calc(var(--cell) * 0.3);
  color: rgba(22, 22, 26, 0.18);
}

/* Roulette: the ball and the bet-type pictures */

.rl-ball-track {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.rl-ball {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 4.6%;
  aspect-ratio: 1;
  margin-left: -2.3%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d9d9de 55%, #8d8d96);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.mode-shape {
  display: inline-grid;
  grid-template-columns: repeat(3, 5px);
  gap: 1.5px;
  vertical-align: middle;
}

.mode-shape i {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.25;
}

.mode-shape i.on {
  opacity: 1;
}

.mode-now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 13px;
}

.mode-now b {
  font-size: 14px;
}

.mode-now > span:last-child {
  color: var(--gold);
  font: 700 13px/1 var(--font-round);
}

.rl-status:has(.mode-now) {
  flex-direction: column;
  gap: 3px;
}

.rl-cell.cover {
  animation: cover-flash 0.7s ease-out;
}

@keyframes cover-flash {
  0%,
  40% {
    box-shadow: 0 0 0 3px #fff, 0 0 14px rgba(255, 255, 255, 0.8);
  }
}

.speed-pill {
  position: absolute;
  z-index: 3;
  bottom: 4px;
  left: calc(env(safe-area-inset-left) + 12px);
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.speed-pill[aria-pressed="true"] {
  background: var(--gold);
  color: #1a1300;
}


/* Win lines, anticipation, coin shower */

.slot-window {
  position: relative;
}

.line-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.line-layer polyline {
  fill: none;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.85;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.line-layer polyline.won {
  stroke-width: 4;
  opacity: 1;
  animation: line-draw 0.6s ease-out both;
  stroke-dasharray: 1200;
}

@keyframes line-draw {
  from {
    stroke-dashoffset: 1200;
  }
}

.lines-pill {
  position: absolute;
  z-index: 3;
  bottom: 4px;
  right: calc(env(safe-area-inset-right) + 12px);
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.lines-pill[aria-pressed="true"] {
  background: #fff;
  color: #16161a;
}

.reel.tease {
  box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(245, 197, 66, 0.9);
  animation: hit-pulse 0.5s ease-in-out infinite;
}

.coin-shower {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}

.coin-shower span {
  position: absolute;
  top: -40px;
  animation: coin-fall linear both;
}

@keyframes coin-fall {
  to {
    transform: translateY(110vh) rotate(540deg);
  }
}

/* Turbo: no flourishes on results, just the outcome. */
.game.turbo .cell.hit,
.game.turbo .rl-cell.hit,
.game.turbo .rl-cell.cover,
.game.turbo .slot-center > *,
.game.turbo .bj-center > *,
.game.turbo .rl-status > *,
.game.turbo .game-controls > *,
.game.turbo .line-layer polyline.won,
.game.turbo .bj-seat {
  animation: none;
}

/* Casino tab: streak and free spins; Stand tab: big wins */

.perks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 4px 0 12px;
}

.perk {
  padding: 5px 12px;
  border-radius: 14px;
  background: var(--fill, rgba(127, 127, 127, 0.14));
  font-size: 14px;
  font-weight: 600;
}

.perk-note {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--label-2);
}

.playing-tag {
  font-weight: 700;
  color: var(--label);
}

.big-win .name {
  white-space: normal;
}

/* Slots: the free-spin button sits above the bet slider */

.slot-tray {
  display: grid;
  gap: 4px;
}

.slot-tray .side-pills {
  min-height: 36px;
}

.free-pill {
  animation: free-glow 1.6s ease-in-out infinite;
}

@keyframes free-glow {
  50% {
    box-shadow: 0 0 16px rgba(245, 197, 66, 0.9);
  }
}

.rl-hotcold {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.hc-label {
  margin: 0 2px 0 6px;
}

/* ------------------------------------------------------------- Beaver Dam */
/* Built like the other slots (plain felt, the standard reel frame), with three beavers above the
   reels, each with a log it gnaws as its coins land, and a hold-and-win bonus played on the reels.
   Beaver colours: Builder blue, Chewer red, Hoarder green. */

.game-beaver {
  --felt-1: #2b7a80;
  --felt-2: #1c5a60;
  --felt-3: #0e3438;
  --bv-5: #3d9be0;
  --bv-6: #e5533d;
  --bv-7: #47b05f;
}

.bv-table {
  grid-template-rows: auto auto auto auto auto 1fr; /* spare room goes to the result */
  gap: 6px;
  padding-top: 2px;
}

.bv-table .slot-frame {
  --cell: min(calc((100cqw - 40px) / 5), calc((100cqh - 262px) / 3), 96px);
}

.bv-table .slot-center {
  align-self: center;
}

.bv-top {
  min-height: 24px;
}

/* The jackpot heat (flames), never an amount or a chance. */
.bv-heat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.bv-flames {
  display: inline-flex;
  gap: 1px;
}

.bv-flames i {
  font-style: normal;
  filter: grayscale(1);
  opacity: 0.3;
  transition: opacity 0.4s, filter 0.4s;
}

.bv-flames i.on {
  filter: none;
  opacity: 1;
}

.bv-heat[data-level="3"],
.bv-heat[data-level="4"] {
  color: var(--gold);
}

.bv-heat[data-level="4"] .bv-flames i.on {
  animation: free-glow 1s ease-in-out infinite;
}

/* The prize ladder: Mini, Minor, Major, Grand in points at the chosen bet. */
.bv-ladder {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: min(100%, 420px);
}

.bv-jp {
  --c: #7cc4ff;
  display: grid;
  justify-items: center;
  padding: 3px 2px 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.bv-jp b {
  font: 800 10px/1.2 var(--font-round);
  letter-spacing: 0.08em;
  color: var(--c);
}

.bv-jp span {
  font: 700 14px/1.1 var(--font-round);
  font-variant-numeric: tabular-nums;
}

.bv-jp-minor {
  --c: #d4a5ff;
}

.bv-jp-major {
  --c: #ff8a7a;
}

.bv-jp-grand {
  --c: var(--gold);
}

.bv-jp.hit {
  animation: bv-jp-hit 0.35s ease-in-out 6 alternate;
}

@keyframes bv-jp-hit {
  to {
    background: var(--c);
    color: #1a1000;
  }
}

.bv-jp.hit b {
  color: inherit;
}

/* The three beavers, each with its log. */
.bv-beavers {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 8cqw, 40px);
}

.bv-beaver {
  --c: var(--bv-5);
  position: relative;
  display: grid;
  justify-items: center;
}

.bv-b6 {
  --c: var(--bv-6);
}

.bv-b7 {
  --c: var(--bv-7);
}

.bv-face {
  display: grid;
  place-items: center;
  width: clamp(40px, 12cqw, 52px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
  font-size: clamp(22px, 7cqw, 30px);
  line-height: 1;
}

.bv-tool {
  position: absolute;
  top: -4px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  font-size: 11px;
}

.bv-name {
  margin-top: 3px;
  font: 800 9px/1.2 var(--font-round);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

/* The log: it gets shorter with every coin of this beaver, and glows when it is nearly gone. */
.bv-meter {
  position: relative;
  width: 48px;
  height: 8px;
  margin-top: 3px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.bv-meter i {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(#c08a4a, #7a4e1c);
  transform-origin: right;
  transition: transform 0.45s ease-out;
}

.bv-beaver.ready .bv-face {
  animation: bv-ready 0.9s ease-in-out infinite alternate;
}

.bv-beaver.ready .bv-meter {
  box-shadow: 0 0 8px var(--gold);
}

@keyframes bv-ready {
  to {
    box-shadow: 0 0 0 2px #fff, 0 0 16px var(--c);
    transform: scale(1.06);
  }
}

.bv-beaver.act .bv-face {
  animation: bv-jump 0.55s cubic-bezier(0.3, 0.7, 0.3, 1);
}

@keyframes bv-jump {
  35% {
    transform: translateY(-12px) scale(1.12);
  }
  65% {
    transform: translateY(2px) scale(0.96);
  }
}

/* A coin flying to its beaver. */
.bv-fly {
  position: fixed;
  z-index: 50;
  font-size: 28px;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.game-beaver .cell {
  position: relative;
}

/* A beaver coin on the reels: its beaver's colour and tool. */
.game-beaver .cell.bvt5,
.game-beaver .cell.bvt6,
.game-beaver .cell.bvt7 {
  --c: var(--bv-5);
  background: color-mix(in srgb, var(--c) 22%, transparent);
  box-shadow: inset 0 0 0 3px var(--c);
}

.game-beaver .cell.bvt6 {
  --c: var(--bv-6);
}

.game-beaver .cell.bvt7 {
  --c: var(--bv-7);
}

.game-beaver .cell.bvt5::after,
.game-beaver .cell.bvt6::after,
.game-beaver .cell.bvt7::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c);
  font-size: 10px;
}

.game-beaver .cell.bvt5::after {
  content: "🔨";
}

.game-beaver .cell.bvt6::after {
  content: "🦷";
}

.game-beaver .cell.bvt7::after {
  content: "🧺";
}

/* The bonus board lies exactly over the reels. */
.bv-board {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, var(--cell));
  grid-template-rows: repeat(3, var(--cell));
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.bv-board.on {
  opacity: 1;
}

.bv-bonus-on .slot-window {
  opacity: 0;
  transition: opacity 0.4s;
}

.bv-banner {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  white-space: nowrap;
}

.bv-cell {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 0;
  border-radius: 50%;
  text-align: center;
  line-height: 1.05;
}

.bv-cell.bv-k0 {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.bv-cell b {
  font: 800 clamp(11px, 3.4cqw, 16px) / 1.05 var(--font-round);
  font-variant-numeric: tabular-nums;
}

.bv-cell small {
  font: 800 clamp(7px, 2.1cqw, 10px) / 1.1 var(--font-round);
  letter-spacing: 0.06em;
}

.bv-icon {
  font-size: clamp(20px, 6cqw, 28px);
  line-height: 1;
}

/* Coins: gold cash, jackpot coins in their ladder colour, beaver coins in their beaver's colour. */
.bv-k1 {
  background: radial-gradient(circle at 35% 30%, #ffeaa0, #e8b52a 60%, #b98510);
  color: #3a2600;
}

.bv-k2,
.bv-k3,
.bv-k4 {
  --c: #3b8ad9;
  background: var(--c);
  box-shadow: inset 0 0 0 2px var(--gold);
  color: #fff;
}

.bv-k3 {
  --c: #9a55d9;
}

.bv-k4 {
  --c: #d9453a;
}

.bv-k5,
.bv-k6,
.bv-k7 {
  --c: var(--bv-5);
  background: var(--c);
  box-shadow: inset 0 0 0 2px #fff;
}

.bv-k6 {
  --c: var(--bv-6);
}

.bv-k7 {
  --c: var(--bv-7);
}

.bv-cell.bv-fx {
  box-shadow: 0 0 0 3px #fff, 0 0 16px rgba(255, 255, 255, 0.8);
  animation: hit-pulse 0.45s ease-in-out 2;
}

.bv-cell.bv-spin {
  animation: bv-flicker 0.16s linear infinite alternate;
}

@keyframes bv-flicker {
  to {
    background: rgba(255, 255, 255, 0.14);
  }
}

.bv-cell.bv-collect {
  animation: bv-collect 0.5s ease-in forwards;
}

@keyframes bv-collect {
  to {
    transform: translateY(24px) scale(0.6);
    opacity: 0;
  }
}

.bv-float {
  position: absolute;
  top: -6px;
  left: 50%;
  translate: -50% 0;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--bv-6);
  color: #fff;
  font: 800 12px/1.3 var(--font-round);
  animation: bv-float 0.9s ease-out forwards;
}

@keyframes bv-float {
  to {
    transform: translateY(-18px);
    opacity: 0;
  }
}

/* Under the reels: a hint, or during the bonus the respins. */
.bv-under {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.bv-respins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.bv-pips {
  display: inline-flex;
  gap: 4px;
}

.bv-pips i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.bv-pips i.on {
  background: var(--gold);
}

.beaver-egg {
  position: absolute;
  left: 50%;
  bottom: 12px;
  translate: -50% 0;
  font-size: 7px;
  line-height: 1.2;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.25);
}

/* Short phones: smaller beavers, so the reels keep their room. */
@media (max-height: 700px) {
  .bv-table {
    gap: 4px;
  }

  .bv-face {
    width: 36px;
    font-size: 20px;
  }

  .bv-tool {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .bv-jp span {
    font-size: 12px;
  }

  .bv-top {
    min-height: 20px;
  }
}

.game.turbo .bv-beaver.act .bv-face {
  animation: none;
}
