/* =============== Blackjack: TV =============== */
.bj-tv { display: flex; flex-direction: column; overflow: hidden; }
.bj-table {
  position: relative; flex: 1; margin: 0 2vw 2vh;
  background: radial-gradient(ellipse at 50% 0%, var(--felt-1), var(--felt-2) 80%);
  border-radius: 0 0 50% 50% / 0 0 40% 40%;
  border: 1.2vw solid var(--rail); border-top: none;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
}
.bj-dealer { position: absolute; top: 2vh; left: 50%; transform: translateX(-50%); text-align: center; }
.bj-dealer .label { font-size: 1.6vw; font-weight: 800; color: var(--muted); letter-spacing: 2px; }
.bj-dealer .cards .card { --w: 5.6vw; }
.bj-total {
  display: inline-block; margin-top: 0.8vh; font-size: 1.9vw; font-weight: 800;
  background: rgba(0, 0, 0, 0.45); padding: 0.3vh 1vw; border-radius: 999px;
}
.bj-total.bust { background: var(--danger); }
.bj-total.bj { background: var(--accent); color: #2a1e00; }

.cards { display: flex; justify-content: center; }
.cards .card + .card { margin-left: calc(var(--w) * -0.22); }
#bjHelperRow input:checked + .switch { background: var(--ok); }

.bj-shoe { position: absolute; top: 2vh; right: 2vw; width: 12vw; text-align: center; font-size: 1vw; color: var(--muted); font-weight: 700; }
.bj-shoe .cut-out { color: var(--accent); margin-top: 0.4vh; }
/* the shoe: longer for more decks (--dw), the cards at its back (right), the mouth at the front (left) */
.shoe-box { position: relative; width: calc(12vw * var(--dw)); height: 2.6vw; margin: 0.6vh auto; padding: 0.3vw 0.35vw 0.3vw 0.9vw;
  background: linear-gradient(180deg, #2b2b2b, #111); border-radius: 0.5vw 0.4vw 0.4vw 0.9vw; box-shadow: 0 0.4vh 1vh rgba(0, 0, 0, 0.5); }
.shoe-box::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0.75vw; border-radius: 0.5vw 0 0 0.9vw;
  background: linear-gradient(90deg, #3a3a3a, #1c1c1c); transform: skewX(-12deg); transform-origin: bottom; }
.shoe-in { position: relative; height: 100%; }
.shoe-cards { position: absolute; right: 0; top: 0; bottom: 0; border-radius: 2px;
  background: repeating-linear-gradient(90deg, #f4efe0 0 2px, #cbc3ab 2px 3px); }
.shoe-cut { position: absolute; top: -0.35vw; bottom: -0.1vw; width: 0.3vw; margin-right: -0.15vw; background: var(--danger); border-radius: 1px; }
.shoe-cut.out { top: -0.7vw; box-shadow: 0 0 0.6vw var(--danger); }

/* cutting a new shoe on the table (bjCutShow): the stack waits, then is cut and slides into the shoe */
.bj-cut-show { position: absolute; top: 38%; left: 50%; width: 40vw; transform: translate(-50%, -50%); pointer-events: none; z-index: 5; }
.bj-cut-show.waiting { animation: cs-in 0.4s ease-out; }
@keyframes cs-in { from { opacity: 0; } }
.cs-stack { position: relative; width: calc(var(--dw) * 100%); height: 5vw; margin: 0 auto; transform-origin: center; }
.bj-cut-show .cut-part { box-shadow: 0 0.6vh 1.4vh rgba(0, 0, 0, 0.5); border-top-width: 0.25vw; }
.bj-cut-show .cut-part i { width: 0.2vw; margin-left: -0.1vw; }
.cs-card { position: absolute; top: -2.4vw; bottom: -0.5vw; width: 0.55vw; border-radius: 0.15vw; background: var(--danger);
  box-shadow: 0 0 1vw rgba(0, 0, 0, 0.5); transform: translate(-50%, -40%); }
.cs-card.cs-pl { left: calc(var(--f) * 100%); }
.cs-card.cs-dl { left: calc(var(--pen, 0.75) * 100%); opacity: 0; }
.bj-cut-show.waiting .cs-card.cs-pl { animation: cs-hover 1.4s ease-in-out infinite; }
@keyframes cs-hover { 50% { transform: translate(-50%, -60%); } }
.bj-dealer.cutting .card.empty { visibility: hidden; } /* the cut card hovers where it would be */
.cs-label { text-align: center; margin-top: 1.4vh; font-size: 1.3vw; font-weight: 800; color: var(--muted); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }

.bj-center {
  position: absolute; top: 36%; left: 50%; transform: translate(-50%, -50%); text-align: center;
  font-size: 2.6vw; font-weight: 900; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); width: 60vw;
}
.bj-center .sub { font-size: 1.6vw; font-weight: 700; color: var(--muted); margin-top: 0.6vh; }
.bj-center .timer-bar { width: 24vw; margin: 1vh auto 0; }
.bj-center button { font-size: 1.1vw; padding: 0.8vh 1.4vw; margin-top: 1vh; }
.bj-arc { position: absolute; top: 49%; width: 100%; text-align: center; font-size: 1vw; letter-spacing: 3px; color: rgba(255, 255, 255, 0.35); font-weight: 800; }

.bj-seats { position: absolute; inset: 0; pointer-events: none; }
.bj-seat {
  position: absolute; transform: translate(-50%, -50%); width: 14.5vw; text-align: center;
  background: rgba(15, 26, 20, 0.85); border-radius: 14px; padding: 0.8vh 0.6vw; border: 3px solid transparent;
}
.bj-seat .name { font-size: 1.6vw; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bj-seat .chips { font-size: 1.4vw; color: var(--accent); font-weight: 700; }
.bj-seat .status { font-size: 1.25vw; color: var(--muted); font-weight: 700; min-height: 1.5vw; }
.bj-seat.turn { border-color: var(--accent); box-shadow: 0 0 24px rgba(245, 197, 66, 0.6); }
.bj-seat.idle { opacity: 0.5; }
.bj-hands { display: flex; justify-content: center; gap: 0.6vw; margin: 0.6vh 0; }
.bj-hand { padding: 0.4vh 0.3vw; border-radius: 8px; border: 2px solid transparent; }
.bj-hand.current { border-color: var(--accent); }
.bj-hand .card { --w: 3.4vw; }
.bj-hand .meta { font-size: 1.3vw; font-weight: 800; margin-top: 0.4vh; }
.bj-hand .bet-chip { color: var(--accent); }
.result-badge { display: inline-block; font-size: 1.1vw; font-weight: 900; padding: 0.1vh 0.5vw; border-radius: 6px; margin-top: 0.3vh; }
.result-badge.win { background: var(--ok); }
.result-badge.lose { background: var(--danger); }
.result-badge.push { background: #5b6b62; }
.net { font-weight: 900; font-size: 1.5vw; }
.net.up { color: #6be39a; }
.net.down { color: #ff8a80; }

/* =============== Blackjack: phone =============== */
.bj-phone.screen { padding: 12px 16px 8px; gap: 10px; }
.bj-phone .mini-toggles { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; font-weight: 700; color: var(--muted); }
.bj-phone .mini-toggles .link-btn { margin-left: auto; padding: 0; }
.mini-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.mini-toggle input { display: none; }
.mini-toggle .switch { width: 38px; height: 22px; border-radius: 11px; }
.mini-toggle .switch::after { width: 16px; height: 16px; }
.mini-toggle input:checked + .switch::after { transform: translateX(16px); }
#bjAwayRow input:checked + .switch { background: var(--danger); }
#bjHelperRow input:checked + .switch { background: var(--ok); }
/* plain text, not a box, so it doesn't look like a button */
.bj-status { text-align: center; font-size: 17px; font-weight: 700; color: var(--muted); }
.bj-status.turn { color: var(--text); }
.bj-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
/* the confirm buttons stay stuck to the bottom of the screen, so they never need scrolling to */
.bj-actions-bar { position: sticky; bottom: 0; margin-top: auto; padding: 8px 0 6px; background: var(--bg); z-index: 2; }
.bj-phone .dealer-row { display: flex; align-items: center; justify-content: space-between; background: var(--panel); border-radius: 12px; padding: 10px 12px; }
.bj-phone .dealer-row .card { --w: 40px; }
.bj-phone .my-hands { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
/* Hand 1 on the right (the dealer's left = player's right), matching the TV seat layout */
.bj-phone .my-hands:not([style*="--h:1"]) { flex-direction: row-reverse; }
#bj .gesture-felt .my-hands:not([style*="--h:1"]) { flex-direction: row-reverse; }
.bj-phone .my-hand { text-align: center; padding: 8px; border-radius: 12px; border: 2px solid transparent; }
.bj-phone .my-hand.current { border-color: var(--accent); background: rgba(245, 197, 66, 0.08); }
.bj-phone .my-hand .card { --w: 58px; }
.bj-phone .my-hand.small .card { --w: 46px; }
.bj-phone .hand-meta { font-weight: 800; margin-top: 6px; }
.bj-phone .hint-box { text-align: center; font-weight: 800; color: #2a1e00; background: var(--accent); border-radius: 10px; padding: 8px; }
/* only the moves you can make; 3 per row (4 moves = 2 per row), sharing space evenly */
.bj-phone .bj-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bj-phone .bj-actions button { flex: 1 1 calc(33.333% - 10px); }
.bj-phone .bj-actions[data-count="4"] button { flex-basis: calc(50% - 10px); }
.bj-phone .bj-actions button { min-height: 62px; padding: 14px 4px; font-size: 19px; border-radius: 14px; }
.bj-phone .bj-actions button.suggested { outline: 4px solid #fff; outline-offset: 2px; }
.bj-phone .bet-label { text-align: center; color: var(--muted); font-weight: 700; font-size: 14px; }
.bj-phone .bet-amount { text-align: center; font-size: 34px; font-weight: 900; color: var(--accent); line-height: 1.1; }
.bj-phone .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bj-phone .row2 button { padding: 16px 6px; font-size: 17px; }
.bj-phone .toggle-row { display: flex; align-items: center; justify-content: space-between; background: var(--panel); border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.bj-phone .link-btn { background: none; color: var(--accent); text-decoration: underline; padding: 6px; font-size: 15px; }
/* Cutting the shoe (phone): the stack seen from the side; its width follows the decks (--dw), --f is the cut */
.cut-stage { position: relative; height: 124px; flex-shrink: 0; margin: 2px 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.cut-stage.mine { cursor: ew-resize; }
.cut-stack { position: absolute; bottom: 22px; left: 50%; width: calc(var(--dw) * 100%); height: 58px; transform: translateX(-50%); }
.cut-part { position: absolute; top: 0; bottom: 0; overflow: hidden; border-radius: 4px; border-top: 2px solid #fffdf5;
  background: repeating-linear-gradient(90deg, #f4efe0 0 2px, #cbc3ab 2px 3px); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.45); }
.cut-part.a { left: 0; width: calc(var(--f) * 100%); border-radius: 4px 0 0 4px; }
.cut-part.b { right: 0; width: calc((1 - var(--f)) * 100%); border-radius: 0 4px 4px 0; }
.cut-part i { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(140, 40, 40, 0.5); }
.cut-part.a i { left: calc(100% * var(--p) / var(--f)); }
.cut-part.b i { left: calc(100% * (var(--p) - var(--f)) / (1 - var(--f))); }
.cut-edge { position: absolute; top: 0; bottom: 0; width: 15%; background: rgba(0, 0, 0, 0.3); border-radius: 4px; pointer-events: none; transition: opacity 0.2s; }
.cut-edge.l { left: 0; } .cut-edge.r { right: 0; }
.cut-stage.waiting .cut-edge, .cut-stage.cutting .cut-edge { opacity: 0; }
.cut-card { position: absolute; left: calc(var(--f) * 100%); top: -26px; bottom: -6px; width: 6px; border-radius: 2px;
  background: var(--danger); transform: translate(-50%, 0); box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); pointer-events: none; }
.cut-card span { position: absolute; top: -4px; left: 50%; width: 30px; height: 22px; transform: translateX(-50%);
  background: var(--danger); border: 2px solid rgba(255, 255, 255, 0.75); border-radius: 6px; }
.cut-stage.dragging .cut-card span { box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.55); }
.cut-label { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.cut-stage.waiting .cut-stack { animation: cut-wait 1.6s ease-in-out infinite; }
@keyframes cut-wait { 50% { transform: translateX(-50%) translateY(-4px); } }
.bj-cut-read { margin: 0; font-size: 13px; font-weight: 700; min-height: 1.3em; }

/* Strategy chart (phone overlay) */
.chart-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 20; overflow-y: auto; padding: 16px; }
.chart-overlay h2 { margin: 4px 0 4px; color: var(--accent); }
.chart-overlay h3 { margin: 16px 0 6px; font-size: 15px; }
.chart-overlay .rules-line { color: var(--muted); font-size: 13px; }
.chart-table { border-collapse: collapse; width: 100%; font-size: 12px; font-weight: 800; table-layout: fixed; }
.chart-table th, .chart-table td { border: 1px solid var(--bg); text-align: center; padding: 5px 0; }
.chart-table th { background: var(--panel-2); color: var(--muted); }
.chart-table th.rowlabel { width: 15%; }
.c-H { background: #f3f1e8; color: #222; }
.c-S { background: #e2574c; color: #fff; }
.c-D, .c-Ds { background: #3fb26b; color: #fff; }
.c-P { background: #4a8fe0; color: #fff; }
.c-R, .c-Rs { background: #9b6ad1; color: #fff; }
.chart-key { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 12px; }
.chart-key span { padding: 3px 8px; border-radius: 6px; font-weight: 800; }

.bj-shoe-line { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: -6px; }

/* ---------- Phone: the betting circle on a bit of felt ---------- */
.bj-felt-bet {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 10px;
  border-radius: 18px; border: 6px solid var(--rail);
  background: radial-gradient(ellipse at 50% 30%, var(--felt-1), var(--felt-2) 85%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
}
.bj-circle {
  position: relative; width: min(46vw, 170px); aspect-ratio: 1; border-radius: 50%; cursor: pointer; touch-action: none;
  border: 3px solid rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12), inset 0 0 20px rgba(0, 0, 0, 0.35);
  display: flex; align-items: flex-end; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.bj-circle.empty { border-style: dashed; animation: bj-circle-glow 1.6s ease-in-out infinite; }
@keyframes bj-circle-glow { 50% { box-shadow: 0 0 0 6px rgba(245, 197, 66, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.35); } }
.bj-circle:active { transform: scale(0.97); }
.bj-circle-amt {
  position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; font-weight: 900; font-size: 22px; color: #fff;
  text-shadow: 0 2px 6px #000; pointer-events: none;
  white-space: nowrap; /* "25🔒" stays on one line in a small circle */
}
.bj-circle.empty .bj-circle-amt { white-space: normal; } /* "Tap to bet" may still wrap */
.bj-circle.empty .bj-circle-amt { font-size: 15px; color: rgba(255, 255, 255, 0.85); bottom: 44%; }
.bj-stack { position: absolute; left: 50%; bottom: 36%; width: 58px; height: 70px; transform: translateX(-50%); pointer-events: none; }
.stack-chip {
  position: absolute; left: 0; width: 58px; height: 16px; border-radius: 50%;
  background: repeating-linear-gradient(90deg, var(--edge) 0 5px, var(--c) 5px 14px);
  border: 2px solid rgba(0, 0, 0, 0.5); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}
.bj-side-room {
  width: 66px; height: 66px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.45);
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2;
}
.bj-side-room small { font-weight: 600; font-size: 10px; }
.bj-phone .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.bj-phone .row3 button { padding: 12px 6px; font-size: 16px; }

/* Side bet circles (Perfect Pairs, 21+3) next to the main circle */
.bj-sides { display: flex; flex-direction: column; gap: 10px; }
.bj-circle.side { width: 78px; border-width: 2px; }
.bj-circle.side .bj-stack { width: 40px; bottom: 40%; }
.bj-circle.side .stack-chip { width: 40px; height: 11px; }
.bj-side-name { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font-size: 10px; font-weight: 900; color: rgba(255, 255, 255, 0.8); line-height: 1.1; pointer-events: none; }
.bj-side-name small { font-size: 8.5px; color: var(--accent); font-weight: 800; }
.bj-circle.side:not(.empty) .bj-side-name { justify-content: flex-start; padding-top: 6px; }
.bj-circle.side .bj-circle-amt { font-size: 14px; bottom: 6%; }
.bj-circle.drop { outline: 3px solid var(--accent); }
.bj-side-results { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bj-side-results span { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 4px 10px; background: var(--panel); }
.bj-side-results .win { background: var(--ok); color: #fff; }
.bj-side-results .lose { color: var(--muted); }

/* Your turn: the middle of the screen is felt you can tap (hit) or swipe (stand) */
.gesture-felt {
  flex: 1; min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 8px; border-radius: 18px;
  border: 5px solid var(--rail); background: radial-gradient(ellipse at 50% 30%, var(--felt-1), var(--felt-2) 90%);
  touch-action: none; -webkit-tap-highlight-color: transparent; transition: box-shadow 0.15s; padding: 10px;
}
.gesture-felt[data-flash="hit"] { box-shadow: inset 0 0 0 4px #6be39a; }
.gesture-felt[data-flash="stand"] { box-shadow: inset 0 0 0 4px #ff8a80; }
.gesture-hint { text-align: center; font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, 0.65); }
.gesture-felt .my-hands { pointer-events: none; }
.gesture-felt:not(.live) { touch-action: auto; }
.gesture-felt.live { border-color: var(--gold, #f5c542); }
/* Fixed move buttons: Surrender and Split above, then Stand · Hit · Double */
.bj-moves { display: flex; flex-direction: column; gap: 8px; }
.bj-moves-top { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bj-moves-top button { padding: 10px 6px; font-size: 15px; }
.bj-moves-main { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
.bj-moves-main button { height: 64px; padding: 6px; font-size: 19px; }
.bj-moves-main .hit { font-size: 24px; }
.bj-moves button:disabled { opacity: 0.25; }

/* TV: each bet as a chip stack on a betting spot, with the amount */
.bj-betspot { display: flex; align-items: center; justify-content: center; gap: 0.4vw; margin-top: 0.4vh; }
.bj-betspot .stack { position: relative; width: 2.6vw; height: 2.6vw; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); }
.bj-betspot .stack .stack-chip { width: 2vw; height: 0.65vw; left: 0.2vw; bottom: 0.5vw; }
.bj-betspot b { font-size: 1.35vw; color: var(--accent); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.bj-tv-sides { display: flex; gap: 0.3vw; justify-content: center; flex-wrap: wrap; margin-top: 0.3vh; }
.bj-tv-sides span { font-size: 1vw; font-weight: 800; border-radius: 999px; padding: 0.1vh 0.5vw; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.3); }
.bj-tv-sides span.win { background: var(--ok); border-color: var(--ok); }

/* ---------- Phone: the small table map (everyone's cards, TV order) ---------- */
.bj-map { position: relative; width: 100%; height: min(176px, 26vh); flex-shrink: 0; }
.bj-map[data-seats="some"] .bj-seat { width: min(19vw, 72px); }
.bj-map[data-seats="many"] { height: min(196px, 30vh); }
.bj-map[data-seats="many"] .bj-seat { width: min(15.5vw, 56px); padding: 1px 2px; }
.bj-map[data-seats="many"] .bj-seat .nm { font-size: 9.5px; }
.bj-map[data-seats="many"] .bj-seat .bot { display: none; }
.bj-seat .bot { font-style: normal; }
.bj-map[data-seats="many"] .mc { font-size: 8.5px; padding: 1px 1px; }
.bj-map[data-seats="many"] .tot { font-size: 11px; margin-left: 2px; }
.bj-map-felt { position: absolute; left: 4%; right: 4%; top: 0; bottom: 6%; border-radius: 0 0 50% 50% / 0 0 80% 80%;
  border: 4px solid var(--rail, #5a3a1a); border-top: 0; background: radial-gradient(ellipse at 50% 10%, var(--felt-1, #2b7a4b), var(--felt-2, #155234) 85%);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.5); }
.bj-map-dealer { position: absolute; left: 50%; top: 6%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px;
  background: rgba(0, 0, 0, 0.35); border-radius: 8px; padding: 3px 6px; z-index: 1; }
.bj-map-dealer .mc { font-size: 15px; padding: 2px 4px; }
.bj-map .mc { display: inline-block; background: #fbfaf5; color: #111; font-weight: 900; font-size: 10px; line-height: 1.15; padding: 1px 2px;
  border-radius: 3px; margin-right: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.bj-map .mc.red { color: #c8102e; }
.bj-map .mc.back { width: 12px; height: 15px; vertical-align: middle; background: repeating-linear-gradient(45deg, #b3202c 0 3px, #8e1520 3px 6px); }
.bj-map-dealer .mc.back { width: 18px; height: 22px; }
.bj-map .tot { margin-left: 3px; font-size: 12px; color: #fff; }
.bj-map-dealer .tot { font-size: 15px; }
.bj-map .st { font-size: 10px; color: var(--muted); font-weight: 700; }
.bj-seat { position: absolute; transform: translate(-50%, -50%); width: min(21vw, 82px); padding: 2px 3px; text-align: center; z-index: 2;
  background: rgba(18, 19, 23, 0.92); border: 2px solid transparent; border-radius: 8px; font-size: 10px; }
.bj-seat .nm { display: flex; justify-content: center; gap: 3px; font-weight: 800; font-size: 10.5px; white-space: nowrap; }
.bj-seat .nmt { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bj-seat .bd { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 3px; height: 16px; overflow: hidden; }
.bj-seat .mh { display: flex; align-items: center; white-space: nowrap; }
.bj-seat .mh .mcs { display: inline-flex; }
.bj-seat .mh.cur { outline: 1px solid var(--accent); border-radius: 3px; }
.bj-seat .mh.win .tot { color: #6be39a; }
.bj-seat .mh.lose .tot { color: #ff8a80; }
.bj-seat .bt { font-size: 9.5px; color: var(--accent); font-weight: 800; }
.bj-seat .nt { font-size: 9.5px; flex-shrink: 0; }
.bj-seat .nm .bt { flex-shrink: 0; }
.bj-seat .nt.up { color: #6be39a; } .bj-seat .nt.down { color: #ff8a80; }
.bj-seat.me { border-color: rgba(245, 197, 66, 0.55); }
.bj-seat.me .nm { color: var(--accent); }
.bj-seat.turn { border-color: var(--accent); background: rgba(70, 56, 10, 0.95); box-shadow: 0 0 8px rgba(245, 197, 66, 0.55); }

/* ---------- Phone: Deal next round pops up over the felt ---------- */
.gesture-felt { position: relative; }
.gesture-felt .deal-pop { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(84%, 320px); z-index: 3;
  min-height: 54px; padding: 12px; font-size: 19px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); animation: bj-deal-pop 0.25s ease-out; }
@keyframes bj-deal-pop { from { transform: translateX(-50%) scale(0.85); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.gesture-felt .deal-wait { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: var(--muted); font-weight: 700; }

/* ---------- Phone: everything fits one screen (no scrolling) ---------- */
#bj.screen { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; gap: 6px; padding-top: 10px; }
#bj .bj-body { flex: 1 1 0; min-height: 0; gap: 6px; }
#bj .gesture-felt { flex: 1 1 0; min-height: 110px; }
#bj .bj-felt-bet { flex: 1 1 0; min-height: 0; padding: 8px 10px; overflow: hidden; }
/* the felt is a size container: the circles are never bigger than the felt they sit on
   (the 6px glow ring and the 6px rail need room too) */
#bj .bj-felt-bet { container-type: size; }
#bj .bj-circle { width: min(46vw, 170px, 26vh, calc(100cqh - 32px)); flex-shrink: 0; }
#bj .bj-circle.side { width: min(78px, 11vh, calc((100cqh - 42px) / 2)); }
#bj .bj-circle.empty .bj-circle-amt { font-size: clamp(11px, 4cqh, 15px); }
#bj .bj-actions-bar { position: static; flex-shrink: 0; padding: 4px 0 2px; }
#bj .bj-moves { gap: 6px; }
#bj .row3 { margin-bottom: 6px; }
#bj .chip-tray { padding: 2px 0 6px; }
#bj .bet-hint { font-size: 12px; margin-bottom: 2px; }
@media (max-height: 700px) {
  #bj .bet-hint { display: none; }
  #bj .casino-chip { width: 52px; height: 52px; }
  #bj .casino-chip span { inset: 7px; font-size: 15px; }
  #bj .row3 button { padding: 10px 6px; }
  #bj .big-button { padding: 12px; font-size: 18px; }
  #bj .my-hand .card { --w: 50px; }
  #bj .bj-moves-main button { height: 54px; }
  #bj .bj-moves-top button { padding: 8px 6px; }
}

/* ---------- TV: the deal (cards fly from the shoe) ---------- */
#bjGame .card.incoming { visibility: hidden; }
#bjGame .card.landed { animation: bj-turn 0.22s ease-out; }
@keyframes bj-turn { from { transform: rotateY(90deg); } to { transform: none; } }
.bj-deal-fly { position: fixed; z-index: 60; transform: translate(-50%, -50%) rotate(-20deg); pointer-events: none;
  transition: left 0.3s cubic-bezier(.2,.7,.3,1), top 0.3s cubic-bezier(.2,.7,.3,1), transform 0.3s; }
.bj-deal-fly .card { box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); }

/* ---------- Phone: the table map is bigger; your felt is smaller ---------- */
.bj-map { height: min(230px, 33vh); }
.bj-map[data-seats="many"] { height: min(250px, 36vh); }
.bj-map-dealer { top: 4%; padding: 4px 6px; gap: 0; }
.bj-map-dealer .card { --w: min(12vw, 46px, 7vh); }
.bj-map-dealer .card + .card { margin-left: calc(var(--w) * -0.42); }
.bj-map-dealer .tot { margin-left: 6px; font-size: 18px; background: rgba(0, 0, 0, 0.5); border-radius: 999px; padding: 1px 8px; }
.bj-map-toggle { position: absolute; left: 0; top: 0; z-index: 3; padding: 4px 8px; font-size: 11px; font-weight: 800; border-radius: 8px;
  background: rgba(0, 0, 0, 0.45); color: rgba(255, 255, 255, 0.8); border: 1px solid rgba(255, 255, 255, 0.2); }
.bj-map.off { height: auto; }
.bj-map.off .bj-map-toggle { position: static; }
#bj .bj-map.off + .bj-body { }
/* with the map hidden, the dealer gets a row with real-size cards */
.bj-phone .dealer-row .card { --w: min(14vw, 52px, 7.5vh); }
#bj .gesture-felt { min-height: 96px; }

/* your hand: the total and the bet look different (the bet is chips + a number) */
.bj-phone .hand-meta { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; }
.hand-total { font-size: 18px; font-weight: 900; color: #fff; background: rgba(0, 0, 0, 0.45); border-radius: 999px; padding: 1px 10px; }
.hand-bet { display: inline-flex; align-items: flex-end; gap: 4px; font-weight: 900; color: var(--accent); font-size: 15px; }
.hand-bet .bet-stack { position: relative; width: 26px; height: 24px; }
.hand-bet .bet-stack .stack-chip { width: 26px; height: 8px; border-width: 1px; }
.hand-bet small { font-size: 11px; color: rgba(255, 255, 255, 0.7); margin-left: 2px; }
/* the Deal button sits at the bottom of the felt: lift your hand above it */
.gesture-felt:has(.deal-pop), .gesture-felt:has(.deal-wait) { padding-bottom: 76px; }

/* Betting: the side circles sit either side of the main one, and the map shrinks a little so the felt has room */
#bj .bj-felt-bet { gap: 10px; }
#bj.betting .bj-map { height: min(190px, 27vh); }
#bj.betting.side-bets .bj-map { height: min(170px, 24vh); }
#bj.betting .bj-map.off { height: auto; }
#bj .bj-circle.side { width: min(84px, 22vw, calc(100cqh - 26px)); }
#bj.side-bets .bj-circle:not(.side) { width: min(36vw, 150px, calc(100cqh - 32px)); }
/* the Hide table button sits in the empty bottom-left corner (the top corners have seats) */
#bj .bj-map:not(.off) .bj-map-toggle { top: auto; bottom: 0; }

/* ---------- Phase 4: your cards fill the felt (container-query sizing, like Hold'em) ----------
   The felt is a size container. A card's width is the smaller of: its share of the width (--h hands side by side,
   --n cards in the longest hand, each extra card showing 78% of a card, or 55% with 5+ cards) and the height left
   after the total, bet, result and hint lines. */
#bj .gesture-felt { container-type: size; }
#bj .gesture-felt .my-hands { --ov: 0.78; gap: 10px; flex-wrap: nowrap; }
#bj .gesture-felt .my-hands.lots { --ov: 0.55; }
#bj .gesture-felt .my-hands.lots .card + .card { margin-left: calc(var(--w) * -0.45); }
#bj .gesture-felt .my-hand { padding: 6px; min-width: 0; }
#bj .gesture-felt .my-hand .card {
  /* never smaller than 30px: at the end of a round the results and the Next button take a lot of the felt */
  --w: max(30px, calc(50px - (var(--h) - 1) * 20px), min(
    calc((100cqw - 4px - (var(--h) - 1) * 10px - var(--h) * 16px) / var(--h) / (1 + (var(--n) - 1) * var(--ov))),
    calc((100cqh - var(--reserve, 70px)) / 1.4),
    120px));
}
#bj .gesture-felt .my-hand .cards { justify-content: center; }
#bj .gesture-felt .my-hands.has-result { --reserve: 96px; }

/* ---------- Phase 4: more than one hand (Hands per player) ---------- */
#bj .bj-hand-tabs { display: flex; gap: 6px; height: 34px; flex-shrink: 0; align-items: stretch; }
#bj .bj-tab { flex: 1 1 0; min-width: 0; padding: 0 8px; border-radius: 10px; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel); color: var(--muted); border: 2px solid transparent; white-space: nowrap; position: relative; }
#bj .bj-tab b { color: var(--accent); }
#bj .bj-tab.on { border-color: var(--accent); color: var(--text); background: rgba(245, 197, 66, 0.12); }
#bj .bj-tab.add { color: var(--accent); border: 2px dashed rgba(245, 197, 66, 0.5); background: none; }
#bj .bj-tab i { font-style: normal; margin-left: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.4); color: #ff8a80; display: inline-flex; align-items: center; justify-content: center; }
#bj .bj-tab-note { flex: 1 1 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }

/* ---------- Phase 5: steady hands. The card size is fixed for the round (room for 3 cards per hand slot);
   more cards overlap more instead of shrinking. One row per hand, the badge in a fixed slot, a clear glow on
   the active hand. Sizes ease (250 ms) when they do change (a split adds a hand). */
#bj .gesture-felt .my-hands { --slot: calc((100cqw - 4px - (var(--h) - 1) * 10px - var(--h) * 16px) / var(--h)); --reserve: 70px; }
#bj .gesture-felt .my-hands.has-result { --reserve: 70px; }
#bj .gesture-felt .my-hand { flex: 0 1 var(--slot); }
#bj .gesture-felt .my-hand .card {
  --w: max(30px, min(calc(var(--slot) / 2.56), calc((100cqh - var(--reserve)) / 1.4), 120px));
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease;
}
#bj .gesture-felt .my-hand .card + .card,
#bj .gesture-felt .my-hands.lots .card + .card {
  margin-left: min(calc(var(--w) * -0.22), calc((var(--slot) - var(--k, 2) * var(--w)) / max(1, var(--k, 2) - 1)));
}
#bj .gesture-felt .my-hand .cards { flex-wrap: nowrap; }
#bj .gesture-felt .hand-meta { height: 28px; flex-wrap: nowrap; white-space: nowrap; gap: 6px; overflow: hidden; }
#bj .gesture-felt .hand-label { font-size: 12px; font-weight: 800; color: var(--muted); }
#bj .gesture-felt .hand-total { font-size: 15px; padding: 1px 8px; }
#bj .gesture-felt .my-hand { position: relative; }
#bj .gesture-felt .hand-badge-slot { position: absolute; left: 0; right: 0; bottom: 38px; height: 26px; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 3; }
#bj .gesture-felt .hand-badge-slot .result-badge { font-size: 14px; margin: 0; white-space: nowrap; }
#bj .gesture-felt .my-hand.current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.45), 0 0 18px rgba(245, 197, 66, 0.55); }
#bj .bj-hands-result { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* (the chip icon used to be hidden with 2+ hands, when the bet shared a line with the total; the bet has its own
   row under the cards now, so every hand shows it) */
#bj .gesture-felt .my-hands:not([style*="--h:1"]) .hand-meta { gap: 4px; }
#bj .gesture-felt .my-hands:not([style*="--h:1"]) .hand-total { font-size: 13px; padding: 1px 6px; }
#bj .gesture-felt .my-hands:not([style*="--h:1"]) .hand-bet { font-size: 13px; }
#bj .gesture-felt .my-hands:not([style*="--h:1"]) .hand-label { font-size: 11px; }

/* ---------- Steady layout: the felt is the same size in every phase ----------
   The table map keeps one height (it used to shrink while betting), and everything under the felt sits in a
   bottom area of one fixed height (--bj-dock: tall enough for the chip tray + Clear/Same/Sit out + Place bet).
   So betting, the deal, your turn and the results all use the exact same felt. */
#bj { --bj-dock: 168px; }
@media (min-height: 701px) { #bj { --bj-dock: 196px; } }
#bj.betting .bj-map, #bj.betting.side-bets .bj-map { height: min(190px, 27vh); }
#bj .bj-map, #bj .bj-map[data-seats="many"] { height: min(190px, 27vh); }
#bj .bj-map.off, #bj.betting .bj-map.off { height: auto; }
#bj .bj-body > .gesture-felt, #bj .bj-zone { flex: 1 1 0; min-height: 0; }
#bj .bj-dock { flex: 0 0 var(--bj-dock); height: var(--bj-dock); min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; overflow: hidden; }
#bj .bj-dock > .bj-actions-bar, #bj .bj-dock.bj-actions-bar { position: static; margin-top: 0; padding: 4px 0 2px; }
#bj .bj-dock > p { margin: 0; }
#bj .bj-dock .bj-moves-main button { height: 64px; } /* the moves get the room the chip tray had */
/* Betting: the felt holds the hand tabs, the circles and the table limits */
#bj .bj-zone {
  display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 18px; border: 5px solid var(--rail);
  background: radial-gradient(ellipse at 50% 30%, var(--felt-1), var(--felt-2) 90%); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
}
#bj .bj-zone .bj-felt-bet { border: 0; background: none; box-shadow: none; padding: 2px 4px; border-radius: 0; }
#bj .bj-zone .bj-tab { background: rgba(0, 0, 0, 0.35); }
#bj .bj-limits { text-align: center; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.7); flex-shrink: 0; }
/* Your turn: only the hand you're playing glows, not the whole felt as well */
.gesture-felt.live { border-color: var(--rail); }
/* on the betting felt the circle only needs room for its own 6px glow (the rail is on the felt around it) */
#bj .bj-zone .bj-hand-tabs { height: 28px; }
#bj .bj-zone .bj-circle { width: min(46vw, 170px, 26vh, calc(100cqh - 14px)); }
#bj.side-bets .bj-zone .bj-circle:not(.side) { width: min(36vw, 150px, calc(100cqh - 14px)); }
#bj .bj-zone .bj-circle.side { width: min(84px, 22vw, calc(100cqh - 14px)); }
/* Betting: Hand 2 on the left of Hand 1, the same sides as the deal and the TV (first hand on the dealer's left) */
#bj .bj-hand-tabs { flex-direction: row-reverse; }
/* the dealer's hole card turns over (it used to just switch faces) */
.card.turn { animation: card-turn 0.35s ease-out; }

/* ---------- Bigger cards: the felt runs under the bottom area ----------
   The felt fills the whole middle of the screen; the chip tray and the buttons float on its lower part.
   Each phase keeps only the room its own buttons need at the bottom of the felt:
   betting --bj-dock (chip tray + Clear/Same/Sit out + Place bet), the round --bj-round (the move buttons,
   or the Insurance / Surrender question). The felt's outline never changes; during the round the cards get
   the space the chip tray had (one hand grows the most; two hands are sized to fit side by side). */
#bj { --bj-round: 132px; --bj-inset: 8px; }
@media (min-height: 701px) { #bj { --bj-round: 146px; } }
#bj .bj-body { position: relative; }
#bj .bj-body > .gesture-felt, #bj .bj-zone { flex: 1 1 0; min-height: 0; }
#bj .bj-dock {
  position: absolute; left: var(--bj-inset); right: var(--bj-inset); bottom: var(--bj-inset);
  flex: none; height: auto; max-height: var(--bj-dock); z-index: 3; pointer-events: none;
}
#bj .bj-dock > * { pointer-events: auto; }
#bj .bj-dock.bj-actions-bar { pointer-events: auto; }
#bj .bj-dock, #bj .bj-dock .bj-actions-bar, #bj .bj-dock.bj-actions-bar { background: none; }
#bj .bj-zone { padding-bottom: calc(var(--bj-dock) + var(--bj-inset)); }
#bj .bj-body > .gesture-felt,
#bj .bj-body > .gesture-felt:has(.deal-pop), #bj .bj-body > .gesture-felt:has(.deal-wait) { padding-bottom: calc(var(--bj-round) + var(--bj-inset)); }
/* text that sits on the felt now */
#bj .bj-dock > p { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); font-size: 14px; line-height: 1.3; }
#bj .bj-dock .bj-moves-main button { height: 58px; }
/* the round is over: the Deal button takes the move buttons' place, any results line sits just above it */
#bj .gesture-felt .deal-pop { bottom: calc(var(--bj-inset) + 2px); }
#bj .gesture-felt .deal-wait { bottom: calc(var(--bj-inset) + 18px); color: rgba(255, 255, 255, 0.75); }
#bj .bj-body:has(.deal-pop) .bj-dock, #bj .bj-body:has(.deal-wait) .bj-dock { padding-bottom: 66px; }
/* one hand gets the most room (cards up to 120px wide); the felt's height is now what limits them */
#bj .gesture-felt .my-hands[style*="--h:1"] .my-hand .card { --w: max(40px, min(calc(var(--slot) / 2.2), calc((100cqh - var(--reserve)) / 1.4), 120px)); }
/* (the betting bar is also .bj-actions-bar, which other rules keep in the page flow: float it here too) */
#bj .bj-body > .bj-dock, #bj .bj-body > .bj-dock.bj-actions-bar { position: absolute; margin: 0; }
/* the move buttons (or the Insurance / Surrender question) are ~102px tall: reserve just that */
#bj { --bj-round: 108px; }
@media (min-height: 701px) { #bj { --bj-round: 118px; } }
/* taller phones: bigger chips and the hint line make the betting bar ~240px */
@media (min-height: 701px) { #bj { --bj-dock: 246px; } }

/* ---------- TV: Craps-style layout. The table on the left, a side panel on the right with the game's message
   (and timer), then every player with their chips and what they're doing. The seats only show cards and bets. ---------- */
.bj-tv .bj-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 24vw; grid-template-rows: minmax(0, 1fr); gap: 1.5vw; padding: 0 1.5vw 1.5vh; min-height: 0; }
.bj-tv .bj-main .bj-table { margin: 0; min-width: 0; }
.bj-tv .bj-main .bj-center { display: none; } /* its message is in the side panel now */
.bj-side { display: flex; flex-direction: column; gap: 1vh; min-height: 0; }
.bj-side .panel-box { background: var(--panel); border-radius: 14px; padding: 1.2vw 1vw; min-height: 9vw; display: flex; flex-direction: column; justify-content: center; }
.bj-side-msg { margin-top: 0; font-size: 1.7vw; }
.bj-side-msg .sub { white-space: normal; }
.bj-side-msg .timer-bar { width: 100%; }
.bj-side .cr-players { overflow: hidden; }
.bj-side .cr-player.turn { box-shadow: 0 0 0 2px var(--accent) inset; }
/* the cards' total above them */
.bj-dealer .bj-total-slot { min-height: 3.6vw; display: flex; align-items: center; justify-content: center; }
.bj-dealer .bj-total { margin: 0 0 0.6vh; }
.bj-hand .meta { margin: 0 0 0.4vh; min-height: 1.6vw; }
/* a player's total is a dark pill like the dealer's (the bet under the name is plain gold text) */
.bj-hand .bj-total.bj-hand-total { margin: 0; font-size: 1.3vw; padding: 0.1vh 0.7vw; text-shadow: none; white-space: nowrap; }
.bj-hand .card { --w: 3.2vw; }
.bj-seat .name { font-size: 1.4vw; }
/* the hand's total (and its name and bet) sit above the cards now, like the TV */
.bj-phone .hand-meta { margin-top: 0; margin-bottom: 6px; }

/* ---------- Your turn: only the cards glow (no big box around the hand), phone and TV ---------- */
.bj-phone .my-hand.current, #bj .gesture-felt .my-hand.current { border-color: transparent; background: none; box-shadow: none; }
.bj-phone .my-hand.current .card { box-shadow: 0 0 0 3px var(--accent), 0 0 14px rgba(245, 197, 66, 0.7); }
.bj-tv .bj-hand.current { border-color: transparent; }
.bj-tv .bj-hand.current .card { box-shadow: 0 0 0 0.25vw var(--accent), 0 0 1.2vw rgba(245, 197, 66, 0.7); }
/* TV seats: no dark box behind the cards (and no second highlight box on the seat whose turn it is) */
.bj-tv .bj-seat, .bj-tv .bj-seat.turn { background: none; border-color: transparent; box-shadow: none; }
.bj-tv .bj-seat .name, .bj-tv .bj-seat .status, .bj-tv .bj-hand .meta { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.bj-tv .bj-seat.turn .name { color: var(--accent); }
/* Betting: Clear and Same only (sitting out is the Away switch in the ⋯ menu) */
#bj .row3.two { grid-template-columns: 1fr 1fr; }
/* the hand: its total above the cards, the bet (chips + amount) below them */
.bj-phone .hand-top { margin: 0 0 6px; }
.bj-phone .hand-under { margin: 6px 0 0; }
/* short phones: the bet row under the cards takes the line the "Tap the felt to hit" hint had (the move
   buttons are right there), so the cards keep their size */
@media (max-height: 700px) { #bj .gesture-felt .gesture-hint { display: none; } }
/* the bottom area doesn't clip: the chips (the picked one lifts up a little) draw past its top edge, on top of the felt */
#bj .bj-body > .bj-dock { overflow: visible; }
#bj .bj-dock .chip-tray { position: relative; z-index: 4; }

/* ---------- Side bets on each hand's bet row: "PP 5" riding, "PP +40" won (green), "PP ✗" lost (faded) ---------- */
.bj-phone .hand-under { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 6px; }
.side-chip { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; line-height: 1; white-space: nowrap;
  padding: 3px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.35); color: #fff; }
.side-chip.win { background: var(--ok); border-color: var(--ok); }
.side-chip.lose { opacity: 0.45; }
.side-chip .lock-mark { font-size: 9px; }
/* TV: the same chips under each hand */
.bj-tv .bj-tv-sides { margin-top: 0.4vh; gap: 0.3vw; }
.bj-tv .bj-tv-sides .side-chip { font-size: 0.95vw; padding: 0.15vw 0.45vw; }
.bj-tv .bj-tv-sides .side-chip.lose { opacity: 0.45; background: rgba(0, 0, 0, 0.45); border-color: rgba(255, 255, 255, 0.3); }
/* two or three hands: the side-bet chips drop under the bet when the row is wider than the hand */
#bj .gesture-felt .my-hand .hand-under { flex-wrap: wrap; white-space: normal; row-gap: 3px; }
#bj .gesture-felt .my-hand .hand-under { height: auto; min-height: 28px; overflow: visible; }

/* ---------- One hand at a time (Nov 19) ----------
   While the round plays, your felt shows one hand, big (the one being played). The strip above it has a pill per
   hand: Hand 1 on the right, like the TV; the hand being played glows gold; the one on show is outlined; tap one to
   look at it. The strip takes the place of the hand's own total row, so the felt keeps its height. */
#bj .bj-strip { display: flex; flex-direction: row-reverse; align-items: center; gap: 6px; height: 28px; margin-top: 6px; flex-shrink: 0; min-width: 0; }
#bj .bj-pills { flex: 1 1 0; min-width: 0; display: flex; flex-direction: row-reverse; justify-content: center; gap: 4px; }
#bj .bj-pill { flex: 0 1 auto; min-width: 0; min-height: 0; height: 28px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden;
  background: rgba(0, 0, 0, 0.42); color: rgba(255, 255, 255, 0.72); border: 2px solid transparent; }
#bj .bj-pill span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#bj .bj-pill b { color: #fff; flex-shrink: 0; }
#bj .bj-pill.on { border-color: rgba(255, 255, 255, 0.75); color: #fff; }
#bj .bj-pill.active { border-color: var(--accent); background: rgba(245, 197, 66, 0.2); color: #fff; box-shadow: 0 0 10px rgba(245, 197, 66, 0.6); }
#bj .bj-pill.bust b { color: #ff8a80; }
#bj .bj-pill.bj b { color: var(--accent); }
#bj .bj-strip.compact .bj-pill { padding: 0 6px; font-size: 11px; gap: 3px; }
#bj .bj-strip.tiny .bj-pills { gap: 3px; }
#bj .bj-strip.tiny .bj-pill { flex: 1 1 0; padding: 0 2px; justify-content: center; font-size: 11px; }
#bj .bj-count { flex-shrink: 0; font-size: 11px; font-weight: 800; color: rgba(255, 255, 255, 0.6); white-space: nowrap; }
/* the line under your hand has one fixed height in every phase (it can hold the Back button) */
#bj .gesture-felt .gesture-hint { height: 24px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
#bj .bj-back { min-height: 0; height: 24px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; background: rgba(0, 0, 0, 0.45); color: var(--accent); border: 1px solid var(--accent); }
/* moving to your next hand: it slides in from the left (the next hand sits to the left, like the table) */
#bj .my-hand.bj-slide { animation: bj-slide-in 0.28s ease-out; }
#bj .my-hand.bj-fade { animation: bj-fade-in 0.18s ease-out; }
@keyframes bj-slide-in { from { transform: translateX(-48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bj-fade-in { from { opacity: 0.2; } to { opacity: 1; } }
.reduce-motion #bj .my-hand.bj-slide { animation: bj-fade-in 0.18s ease-out; }
@media (prefers-reduced-motion: reduce) { #bj .my-hand.bj-slide { animation: bj-fade-in 0.18s ease-out; } }
/* how a finished hand ended ("Stand 19", "Bust 24"): pops in while it holds before the next hand */
#bj .gesture-felt .result-badge.bj-how { font-size: 15px; }
#bj .gesture-felt .result-badge.bj-how.pop { animation: bj-how-pop 0.25s ease-out; }
@keyframes bj-how-pop { from { transform: scale(0.7); opacity: 0; } to { transform: none; opacity: 1; } }

/* The round is over: all hands side by side, small. Each hand is a column: name + total, cards, result badge,
   bet. The badge has its own row (no covering the cards); 5+ hands go in two rows. */
#bj .gesture-felt .my-hands.all { --reserve: 92px; row-gap: 4px; align-content: center; }
#bj .gesture-felt .my-hands.all .my-hand { padding: 4px; }
#bj .gesture-felt .my-hands.all .hand-meta { margin-top: 0; }
#bj .gesture-felt .my-hands.all .hand-top { height: 24px; }
#bj .gesture-felt .my-hands.all .hand-badge-row { height: 24px; display: flex; align-items: center; justify-content: center; }
#bj .gesture-felt .my-hands.all .hand-badge-row .result-badge { margin: 0; font-size: 13px; padding: 2px 8px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#bj .gesture-felt .my-hands.all .hand-under { min-height: 24px; }
#bj .gesture-felt .my-hands.all.tight .hand-total { font-size: 12px; padding: 1px 5px; }
#bj .gesture-felt .my-hands.all.tight .hand-label { font-size: 11px; }
#bj .gesture-felt .my-hands.all.tight .hand-bet { font-size: 12px; }
#bj .gesture-felt .my-hands.all.tight .hand-badge-row .result-badge { font-size: 11px; padding: 1px 5px; }
#bj .gesture-felt .my-hands.all.rows2 { flex-wrap: wrap; justify-content: center; }
#bj .gesture-felt .my-hands.all .my-hand .card { --w: max(22px, min(calc(var(--slot) / 2.56), calc((100cqh - var(--reserve)) / 1.4), 90px)); }
#bj .gesture-felt .my-hands.all.rows2 .my-hand .card { --w: max(18px, min(calc(var(--slot) / 2.56), calc((50cqh - var(--reserve) - 4px) / 1.4), 60px)); }
#bj .gesture-felt .my-hands.all.rows2 .hand-top, #bj .gesture-felt .my-hands.all.rows2 .hand-badge-row { height: 20px; }
#bj .gesture-felt .my-hands.all.rows2 .hand-under { min-height: 20px; }
#bj .gesture-felt .my-hands.all.rows2 { --reserve: 74px; }
/* the height the one big hand leaves for everything that isn't a card: the strip (or the total row), the hand's
   padding, the bet row, the gaps and the hint line. On short phones the hint line goes, so the cards keep their size. */
#bj .gesture-felt .my-hands.one { --reserve: 124px; }
@media (max-height: 700px) {
  #bj .gesture-felt:has(.my-hands.one) .gesture-hint { display: none; }
  #bj .gesture-felt .my-hands.one { --reserve: 92px; }
}
#bj .bj-strip .bj-back { flex-shrink: 0; height: 28px; padding: 0 10px; font-size: 12px; }
/* the end of the round: no hint line; side-bet chips stay on the bet's line (and give way when hands are narrow) */
#bj .gesture-felt:has(.my-hands.all) .gesture-hint { display: none; }
#bj .gesture-felt .my-hands.all { --reserve: 100px; }
#bj .gesture-felt .my-hands.all .my-hand .hand-under { flex-wrap: nowrap; white-space: nowrap; height: 24px; min-height: 0; overflow: hidden; gap: 4px; }
#bj .gesture-felt .my-hands.all .hand-under .side-chip { font-size: 10px; padding: 1px 5px; }
#bj .gesture-felt .my-hands.all.tight .hand-under .side-chip { display: none; }
#bj .gesture-felt .my-hands.all .hand-total.bust { color: #ff8a80; }
#bj .gesture-felt .my-hands.all.tight { gap: 6px; }
#bj .gesture-felt .my-hands.all.tight .my-hand { padding: 3px; }
#bj .gesture-felt .my-hands.all.tight .hand-meta { gap: 3px; }
/* two rows (5+ hands): name + total, cards, result; the bets are on the TV and the strip at the top */
#bj .gesture-felt .my-hands.all.rows2 { --reserve: 52px; }
#bj .gesture-felt .my-hands.all.rows2 .hand-under { display: none; }
#bj .gesture-felt .my-hands.all.rows2 .my-hand .card { --w: max(18px, min(calc(var(--slot) / 2.56), calc((50cqh - var(--reserve) - 4px) / 1.4), 60px)); }
/* end of round, sizing: each hand gets an equal share of the row (gaps included), and the cards overlap to fit it */
#bj .gesture-felt .my-hands.all { --gap: 10px; column-gap: var(--gap); --slot: calc((100cqw - 2px - (var(--h) - 1) * var(--gap)) / var(--h) - 12px); }
#bj .gesture-felt .my-hands.all.tight { --gap: 6px; }
#bj .gesture-felt .my-hands.all .my-hand { box-sizing: border-box; flex: 0 0 calc(var(--slot) + 12px); min-width: 0; }
#bj .gesture-felt .my-hands.all .my-hand .card { --w: max(18px, min(calc(var(--slot) * 0.55), calc((100cqh - var(--reserve)) / 1.4), 90px)); }
#bj .gesture-felt .my-hands.all.rows2 .my-hand .card { --w: max(18px, min(calc(var(--slot) * 0.55), calc((50cqh - var(--reserve) - 4px) / 1.4), 60px)); }
/* side bets that won stay on the bet's line, wrapping under it with room kept; the lost ones (✗) are left out */
#bj .gesture-felt .my-hands.all .hand-under .side-chip.lose { display: none; }
#bj .gesture-felt .my-hands.all:not(.tight):not(.rows2) .my-hand .hand-under { flex-wrap: wrap; height: auto; max-height: 48px; row-gap: 2px; justify-content: center; }
#bj .gesture-felt .my-hands.all:not(.tight):not(.rows2):has(.side-chip:not(.lose)) { --reserve: 124px; }
/* two rows: plain small text for the name and total, and the badge */
#bj .gesture-felt .my-hands.all.rows2 .hand-total { background: none; padding: 0; font-size: 11px; }
#bj .gesture-felt .my-hands.all.rows2 .hand-label { font-size: 10px; }
#bj .gesture-felt .my-hands.all.rows2 .hand-badge-row .result-badge { font-size: 10px; padding: 1px 4px; }
/* A player's hands sit right to left, like the deal: the dealer deals from their left (the screen's right), so
   Hand 1 is on the right, then Hand 2 (and 3) to its left, and split hands next to the hand they came from.
   The TV seat (also the phone's Table view) and the phone's small table map, matching the phone's own felt. */
.bj-tv .bj-hands { flex-direction: row-reverse; }
.bj-seat .bd { flex-direction: row-reverse; }

/* Free doubles / free splits: the house's free bet on a hand (phone and TV) */
.free-bet { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #2b7a4b; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: 0.3px; line-height: 16px; vertical-align: middle; }
.bj-betspot .free-bet { font-size: 14px; line-height: 20px; padding: 0 8px; }

/* ---------- House frame (tv-frame.css): the printed name sits in the open felt between the dealer and the
   payout arc, above the seats; the rail and player rows come from tv-frame. ---------- */
.bj-tv .hf-felt-name { top: 31%; --hf-name: 3.4vw; }
/* each hand is one fixed-width column (the 3-card zone): its cards, then its bet and result under them, lined up */
.bj-tv .bj-hand, .bj-tv .bj-hand-under { width: calc(3.2vw * 2.56 + 0.8vw); /* the shared 3-card zone (tv-frame) + room */ flex: 0 0 auto; box-sizing: border-box; }
.bj-tv .bj-hand-under { display: flex; flex-direction: column; align-items: center; }
.bj-tv .bj-hands.bj-unders { margin-top: 0.2vh; }
/* split hands: each hand is a narrower column (a 2-card zone); a 3rd card and more squeeze into it */
.bj-tv .bj-seat.split .bj-hand, .bj-tv .bj-seat.split .bj-hand-under { width: calc(3.2vw * 1.78 + 0.4vw); }
.bj-tv .bj-seat.split .bj-tv-sides { flex-wrap: wrap; }

/* Hold Place bet to lock Ready: the same 🔒 badge as the other games' Ready button; the button never changes size */
#placeBet { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
#placeBet.ready-locked { position: relative; box-shadow: inset 0 0 0 2px var(--accent); }
#placeBet.ready-locked::after {
  content: '🔒'; position: absolute; top: -7px; right: -5px; font-size: 13px; line-height: 1; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

/* Table map: other players' cards keep a fixed zone (each hand an equal share of the seat). A long hand squeezes in,
   each card stacked behind the next with its rank still showing, and the total never shrinks, so it's always there. */
.bj-seat .mh { flex: 1 1 0; min-width: 0; justify-content: center; }
.bj-seat .mh .mcs { display: flex; flex: 0 1 auto; min-width: 0; overflow: hidden; justify-content: flex-end; } /* too tight: the oldest cards clip on the left, the newest card and the total stay */
.bj-map .bj-seat .mc { --cw: 19px; display: block; position: relative; flex: 0 1 calc(var(--cw) - 3px); min-width: 5px;
  margin: 0; padding: 0; background: none; box-shadow: none; overflow: visible; }
.bj-map .bj-seat .mc:last-child { flex: 0 0 var(--cw); }
.bj-map .bj-seat .mc > i { display: block; width: var(--cw); box-sizing: border-box; padding: 1px 2px; font-style: normal; text-align: left;
  background: #fbfaf5; border-radius: 3px; box-shadow: -1px 0 2px rgba(0, 0, 0, 0.45); }
.bj-map .bj-seat .mc.back > i { height: 15px; background: repeating-linear-gradient(45deg, #b3202c 0 3px, #8e1520 3px 6px); }
.bj-map[data-seats="many"] .bj-seat .mc { --cw: 15px; padding: 0; }
.bj-map[data-seats="many"] .bj-seat .mc > i { padding: 1px 1px; }
.bj-map[data-seats="many"] .bj-seat .mc.back > i { height: 12px; }
.bj-seat .mh .tot { flex-shrink: 0; }

/* Tap a seat on the table map: their hand, big, over a faded screen (tap anywhere to close) */
.bj-map .bj-seat[data-pid] { cursor: pointer; }
.bj-peek { position: fixed; inset: 0; z-index: 9600; background: rgba(0, 0, 0, 0.74); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: bj-peek-in 0.18s ease-out; }
.bj-peek.hidden { display: none; }
@keyframes bj-peek-in { from { opacity: 0; } to { opacity: 1; } }
.bj-peek-box { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; }
.bj-peek-name { font-size: 18px; font-weight: 900; padding: 3px 14px; border-radius: 999px; background: var(--panel); border: 2px solid var(--accent); color: var(--accent); }
.bj-peek-hand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; border: 2px solid transparent; }
.bj-peek-hand.cur { border-color: var(--accent); }
.bj-peek-top { display: flex; align-items: center; gap: 8px; font-weight: 900; }
.bj-peek-tot { font-size: 16px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; }
.bj-peek-tot.bust { background: var(--danger); }
.bj-peek-tot.bj { background: var(--accent); color: #2a1e00; }
.bj-peek-bet { font-size: 14px; color: var(--accent); }
.bj-peek-top .result-badge { font-size: 12px; }
.bj-peek-cards { display: flex; }
/* as big as fits: across (each card keeps at least 40% showing) and down (all the hands) */
.bj-peek-cards .card { --w: min(19vw, 76px, calc(84vw / (1 + 0.4 * (var(--n) - 1))), calc((68vh / var(--hands) - 50px) / 1.4)); }
.bj-peek-cards .card + .card { margin-left: min(6px, calc((84vw - var(--w)) / max(1, var(--n) - 1) - var(--w))); }
/* rank and suit in the top left corner, so they show when the cards overlap */
.bj-peek-cards .card:not(.back) { align-items: flex-start; justify-content: flex-start; padding: calc(var(--w) * 0.05) 0 0 calc(var(--w) * 0.07); gap: 0; }
.bj-peek-cards .card .rank { font-size: calc(var(--w) * 0.32); font-weight: 900; letter-spacing: -0.04em; }
.bj-peek-cards .card .suit { font-size: calc(var(--w) * 0.28); }
.bj-peek-none, .bj-peek-hint { font-size: 12px; color: var(--muted); margin: 0; }

/* Watching someone else cut (Blackjack and Baccarat): the cut card glides after theirs (bjCutWatch), on phones and the TV */
.cut-stage.waiting .cut-card { transition: left 0.12s linear; }
.bj-cut-show.waiting .cs-card.cs-pl { transition: left 0.12s linear; }
