.bj-board {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  min-height: 560px;
  background: #06251a;
}

.bj-felt {
  --card-w: clamp(64px, 6.4vw, 88px);
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 18px;
  padding: 26px 24px 20px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #178353 0%, #0f5a38 45%, #073521 100%);
  box-shadow: inset 0 0 90px rgb(0 0 0 / 0.45);
}
.bj-felt::before {
  /* Faint cloth texture. */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgb(255 255 255 / 0.018) 0 2px, transparent 2px 6px);
  pointer-events: none;
}
.bj-arc {
  position: absolute;
  left: 50%;
  top: 56%;
  width: min(620px, 92%);
  translate: -50% -50%;
  pointer-events: none;
}
.bj-arc svg { width: 100%; height: auto; }

.bj-shoe {
  position: absolute;
  top: 18px;
  right: 22px;
  width: calc(var(--card-w) * 0.8);
  aspect-ratio: 60 / 84;
  transform: rotate(8deg);
  filter: drop-shadow(-4px 6px 0 #0b1b3d) drop-shadow(-8px 12px 0 #0b1b3d);
}
.bj-shoe .card-svg { width: 100%; height: 100%; }

.bj-zone { position: relative; display: grid; justify-items: center; gap: 10px; z-index: 1; }
.bj-zone__label {
  color: #e8d9a6;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}

.bj-hands {
  position: relative;
  z-index: 1;
  align-self: end;
  display: flex;
  justify-content: center;
  gap: clamp(20px, 5vw, 64px);
}
.bj-hand {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  transition: box-shadow 200ms, background-color 200ms;
}
.bj-hand.is-active { background: rgb(255 255 255 / 0.06); box-shadow: inset 0 0 0 2px rgb(255 197 61 / 0.7); }
.bj-hand__meta { display: flex; align-items: center; gap: 8px; }
.bj-bet {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.35);
  color: #fff4cf;
  font-size: 12px;
  font-weight: 700;
}

.bj-cards {
  display: flex;
  min-height: calc(var(--card-w) * 1.4);
  padding-right: calc(var(--card-w) * 0.62);
}
.bj-card {
  width: var(--card-w);
  aspect-ratio: 60 / 84;
  margin-right: calc(var(--card-w) * -0.62);
  perspective: 800px;
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.35));
}
.bj-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 420ms var(--ease-out);
}
.bj-card.is-down .bj-card__inner { transform: rotateY(180deg); }
.bj-card__face { position: absolute; inset: 0; backface-visibility: hidden; }
.bj-card__back { transform: rotateY(180deg); }
.bj-card__face .card-svg { width: 100%; height: 100%; }

.bj-total {
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(11 17 29 / 0.8);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  animation: fade-in 200ms;
}
.bj-total.is-bust { background: var(--loss); }
.bj-total.is-21 { background: var(--accent); color: var(--accent-ink); }

.bj-outcome {
  position: absolute;
  top: 34%;
  left: 50%;
  translate: -50% -50%;
  padding: 7px 14px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.4);
  animation: result-in 460ms var(--ease-spring);
  z-index: 3;
}
.bj-outcome.is-gold { background: var(--accent); color: var(--accent-ink); }
.bj-outcome.is-win { background: var(--win); color: var(--win-ink); }
.bj-outcome.is-push { background: var(--bg-3); color: var(--text); }
.bj-outcome.is-loss { background: var(--loss); color: #fff; }

.bj-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  background: var(--bg-1);
  box-shadow: 0 -1px 0 var(--line);
}
.bj-action { min-width: 120px; height: 46px; gap: 10px; }
.bj-action kbd { background: var(--bg-4); }
.bj-action[data-action="double"]:not(:disabled) { box-shadow: inset 0 0 0 2px rgb(255 197 61 / 0.35); }
.bj-insurance { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 650; }
.bj-insurance .btn--s { min-width: 64px; }

@media (max-width: 700px) {
  .bj-arc { display: none; }
}
@media (max-width: 600px) {
  .bj-board { min-height: 0; }
  .bj-felt { --card-w: 54px; padding: 16px 10px 14px; }
  .bj-action { min-width: 0; flex: 1 1 40%; }
  .bj-action kbd { display: none; }
}
