diff --git a/apps/web/src/games/blackjack/board.tsx b/apps/web/src/games/blackjack/board.tsx index 5fe6a89..245848e 100644 --- a/apps/web/src/games/blackjack/board.tsx +++ b/apps/web/src/games/blackjack/board.tsx @@ -51,19 +51,23 @@ const CSS = ` .bj-total.bj { background: linear-gradient(160deg, #fde047, #f59e0b); color: #5a2a00; border-color: #fff7c2; } .bj-total.d21 { background: #15803d; } .bj-cards { display: flex; align-items: flex-end; justify-content: center; min-height: 20px; } -.bj-cards > * + * { margin-left: calc(var(--cw) * -0.42); } +.bj-cards > * + * { margin-left: calc(var(--cw) * -1 * var(--ov, .42)); } .bj-card-in { animation: bj-in .42s cubic-bezier(.2,.8,.3,1.1) both; } @keyframes bj-in { from { transform: translate(var(--fx, 260px), var(--fy, -260px)) rotate(-24deg) scale(.6); opacity: 0; } 30% { opacity: 1; } to { transform: none; opacity: 1; } } .bj-card-flip { animation: bj-flip .46s ease both; } @keyframes bj-flip { from { transform: perspective(500px) rotateY(90deg); } to { transform: perspective(500px) rotateY(0); } } -.bj-seat { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -100%); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 5px; } -.bj-seat .hands { display: flex; gap: 14px; align-items: flex-end; } +.bj-seat { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -100%); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 5px; + width: max-content; max-width: var(--mw, 40%); } +.bj-name .nm { min-width: 0; } +/* Split hands wrap inside the seat's share of the table instead of running into the neighbours. */ +.bj-seat .hands { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; } +.bj-seat .hrow { display: flex; gap: 10px; align-items: flex-end; justify-content: center; } .bj-hand { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 6px 4px; border-radius: 14px; border: 2px solid transparent; transition: border-color .2s, background .2s; } .bj-hand.on { border-color: var(--focus); background: rgba(245,158,11,.14); box-shadow: 0 0 18px rgba(245,158,11,.35); } -.bj-hand .meta { display: flex; gap: 5px; align-items: center; } +.bj-hand .meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 5px; align-items: center; } .bj-tag { font-weight: 900; font-size: .8rem; border-radius: 6px; padding: 0 7px; color: #fff; white-space: nowrap; } .bj-bet { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 800; background: rgba(255,255,255,.92); color: #1c1e21; border-radius: 999px; padding: 0 8px 0 3px; font-variant-numeric: tabular-nums; white-space: nowrap; } -.bj-name { display: flex; align-items: center; gap: 6px; background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 10px 3px 3px; box-shadow: var(--shadow), 0 3px 10px rgba(0,0,0,.2); +.bj-name { display: flex; align-items: center; gap: 6px; max-width: 100% !important; background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 10px 3px 3px; box-shadow: var(--shadow), 0 3px 10px rgba(0,0,0,.2); font-size: .82rem; font-weight: 800; white-space: nowrap; max-width: 220px; border: 2px solid transparent; } .bj-name .nm { overflow: hidden; text-overflow: ellipsis; } .bj-name .ch { color: var(--warning); font-variant-numeric: tabular-nums; } @@ -118,7 +122,7 @@ const CSS = ` .bj-print, .bj-shoe { display: none; } .bj-dealer { position: relative; left: auto; top: auto; transform: none; } .bj-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 10px; } - .bj-seat { position: relative; left: auto; top: auto; transform: none; } + .bj-seat { position: relative; left: auto; top: auto; transform: none; width: auto; max-width: 100%; } .bj-seat.me { order: 99; flex-basis: 100%; } .bj-dock { flex-direction: column; gap: 10px; padding: 10px; } .bj-me { flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 6px 10px; } @@ -231,7 +235,7 @@ function HandBox({ h, active, width, q, final }: { h: HandView; active: boolean; h.outcome === 'win' || h.outcome === 'blackjack' || h.outcome === 'bonus' ? '#16a34a' : h.outcome === 'lose' || h.status === 'bust' ? '#dc2626' : h.outcome === 'push' ? '#6b7280' : '#b45309'; return (