.bj-table { position: relative; margin: 8px 12px 0; aspect-ratio: 360 / 400; }
.bj-svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 14px 24px rgba(0,0,0,.45)); }
.bj-shoe { position: absolute; top: 0; right: 15%; width: 13%; aspect-ratio: 56 / 80; z-index: 2; }
.bj-shoe i { position: absolute; inset: 0; border-radius: 6px; background: #1d2958; border: 1px solid #0c1229; box-shadow: 0 3px 0 #0c1229; } .bj-shoe i:nth-child(1) { transform: translateY(0); } .bj-shoe i:nth-child(2) { transform: translateY(4px); } .bj-shoe i:nth-child(3) { transform: translateY(8px); background: #4e5467; }
.bj-dealer { position: absolute; left: 0; right: 0; top: 9%; display: flex; justify-content: center; z-index: 3; }
.bj-cards { display: flex; position: relative; min-height: 80px; }
.bj-cards { perspective: 800px; }
.bjc { width: 56px; height: 80px; margin-left: -28px; flex: none; position: relative; filter: drop-shadow(0 6px 6px rgba(0,0,0,.38)); will-change: transform; }
.bjin { position: absolute; inset: 0; transform-style: preserve-3d; } .bjin.down { transform: rotateY(180deg); }
.bjf, .bjk { position: absolute; inset: 0; border-radius: 6px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.bjf { background: #fff; background-image: linear-gradient(135deg, #fff 55%, #eef0f8); } .bjk { transform: rotateY(180deg); background: #1b2856; border: 1px solid #0a1024; } .bjk svg { width: 100%; height: 100%; display: block; }
.bjc:first-child { margin-left: 0; }
.bjr { position: absolute; top: 5px; left: 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1; } .bjr b { font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.bjs { position: absolute; right: 4px; bottom: 4px; line-height: 0; }
.bj-badge { position: absolute; min-width: 34px; height: 26px; padding: 0 10px; border-radius: 13px; background: #172043; color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; z-index: 4; }
.bj-badge.win { background: #1fae6a; } .bj-badge.bust { background: #e0393e; }
.bj-dealer .bj-badge { bottom: -8px; left: calc(50% + 30px); }
.bj-hands { position: absolute; left: 0; right: 0; top: 54%; display: flex; justify-content: center; gap: 10px; z-index: 3; }
.bj-hand { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 8px 4px; border-radius: 12px; transition: background .2s; }
.bj-hand.on { background: rgba(255,255,255,.1); box-shadow: 0 0 0 2px rgba(255,255,255,.45); }
.bj-hand .bj-badge { top: -6px; right: -4px; }
.bj-bet { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 4px 10px 4px 6px; border-radius: 14px; background: #172043; } .bj-bet i { width: 16px; height: 16px; border-radius: 50%; background: #3d5afe; border: 2px dashed rgba(255,255,255,.7); } .bj-bet b { font-size: 12.5px; color: #fff; }
.bj-hands:has(.bj-hand:nth-child(3)) .bjc { width: 40px; height: 58px; margin-left: -20px; } .bj-hands:has(.bj-hand:nth-child(2)) .bjc { width: 46px; height: 66px; margin-left: -23px; } .bj-hands:has(.bj-hand:nth-child(2)) .bjr b { font-size: 13px; } .bj-hands:has(.bj-hand:nth-child(2)) .bjs svg { width: 22px; height: 22px; }
.bj-msg { position: absolute; left: 0; right: 0; top: 43%; text-align: center; z-index: 5; opacity: 0; transform: translateY(6px); transition: .25s; pointer-events: none; }
.bj-msg.show { opacity: 1; transform: none; } .bj-msg.show { display: block; }
.bj-msg.show::before { content: attr(data-x); }
.bj-msg { font-weight: 800; font-size: 18px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.7); } .bj-msg.win { color: #5ff0a8; } .bj-msg.lose { color: #ff8189; }
.bj-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 10px 16px 0; }
.bj-tools button, .bj-pill { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 9px; background: #131c3d; border: 1px solid #1b254b; color: #8f98cf; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.bj-actions { margin: 10px 16px 0; padding: 12px; border-radius: 12px; background: #131c3d; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bj-actions button { height: 54px; border-radius: 8px; background: #505565; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; transition: transform .1s, background .2s; } .bj-actions button:active:not(:disabled) { transform: scale(.96); background: #3a4590; }
.bj-actions button:disabled { background: #1a2344; color: #566099; } .bj-actions button:disabled svg { opacity: .45; }
.bj-actions.ins { grid-template-columns: 1fr 1fr; } .bj-q { grid-column: 1 / -1; text-align: center; font-size: 13px; font-weight: 700; color: #cfd6ff; padding-bottom: 2px; }
.bj-actions.ins button { flex-direction: column; gap: 0; } .bj-actions.ins button.y { background: #3d5afe; } .bj-actions.ins small { font-size: 11px; opacity: .8; }
.bj-rules { text-align: center; font-size: 11px; color: var(--mute); margin-top: 12px; }
@media (max-width: 380px) { .bjc { width: 50px; height: 72px; margin-left: -25px; } }
.bj-badge[hidden] { display: none; }

.bj-hands .bj-bet { transition: background .4s; }

.bj-msg { display: none !important; }

/* Duel-style blackjack details */
.bjc { width: 62px; height: 90px; margin-left: -36px; } .bjr b { font-size: 18px; } .bjs svg { width: 38px; height: 38px; }
.bj-badge { background: #182245 !important; color: #fff; }
.bj-hand.res-win .bj-badge { background: #5ee6c0 !important; color: #08271f; } .bj-hand.res-lose .bj-badge { background: #f0426a !important; color: #fff; } .bj-hand.res-push .bj-badge { background: #ffa200 !important; color: #2a1800; }
.bj-hand.res-win .bjf { box-shadow: inset 0 0 0 2.5px #5ee6c0; } .bj-hand.res-lose .bjf { box-shadow: inset 0 0 0 2.5px #f0426a; } .bj-hand.res-push .bjf { box-shadow: inset 0 0 0 2.5px #ffa200; }
.bj-bet { background: #182245; border-radius: 18px; padding: 5px 8px 5px 6px; gap: 7px; } .bj-bet b { font-size: 13px; }
.bj-hand.res-win .bj-bet { box-shadow: inset 0 0 0 2px #5ee6c0; } .bj-hand.res-lose .bj-bet { box-shadow: inset 0 0 0 2px #f0426a; } .bj-hand.res-push .bj-bet { box-shadow: inset 0 0 0 2px #ffa200; }
.chipdot { width: 20px; height: 20px; border-radius: 50%; background: #3d5afe; border: 2px dashed rgba(255,255,255,.85); display: block; flex: none; }
.bj-insb { margin-top: 8px; text-align: center; } .bj-insb small { display: block; font-size: 9.5px; letter-spacing: .14em; color: #cfd6ff; font-weight: 800; margin-bottom: 4px; } .bj-insb .bj-bet { margin: 0 auto; }
.bj-actions.ins .bj-q { font-size: 17px; color: #fff; padding: 4px 0 10px; } .bj-actions.ins button { height: 48px; flex-direction: row; } .bj-actions.ins button:not(.y) { background: #545969; } .bj-actions.ins button.y { background: #4a5cff; }
.bj-hands:has(.bj-hand:nth-child(2)) .bjc { width: 48px; height: 70px; margin-left: -28px; }
.bj-hands:has(.bj-hand:nth-child(3)) .bjc { width: 40px; height: 58px; margin-left: -24px; }

.bj-shoe i { background: none !important; border: 0 !important; overflow: hidden; } .bj-shoe i svg { width: 100%; height: 100%; display: block; border-radius: 6px; } .bj-shoe i:nth-child(1) { filter: brightness(.7); } .bj-shoe i { box-shadow: 0 3px 0 #0a1030, 0 6px 10px rgba(0,0,0,.35) !important; }

/* many hands (high roller): smaller cards so 5+ hands fit */
.bj-hands:has(.bj-hand:nth-child(4)) { gap: 3px; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-hand { padding: 4px 2px 2px; }
.bj-hands:has(.bj-hand:nth-child(4)) .bjc { width: 33px; height: 48px; margin-left: -19px; } .bj-hands:has(.bj-hand:nth-child(4)) .bjr b { font-size: 11px; } .bj-hands:has(.bj-hand:nth-child(4)) .bjs svg { width: 16px; height: 16px; }
.bj-hands:has(.bj-hand:nth-child(4)) .bj-bet { transform: scale(.78); transform-origin: center top; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-cards { min-height: 52px; } .bj-hands:has(.bj-hand:nth-child(6)) .bjc { width: 28px; height: 41px; margin-left: -17px; }
.bj-hands:has(.bj-hand:nth-child(4)) { padding: 0 3px; gap: 2px; box-sizing: border-box; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-hand { min-width: 0; flex: 1 1 0; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-bet { transform: none; gap: 2px; padding: 2px 5px; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-bet > :first-child, .bj-hands:has(.bj-hand:nth-child(4)) .bj-bet .chipdot { display: none; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-bet b { font-size: 9.5px; letter-spacing: -.02em; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-badge { transform: scale(.8); top: -10px; right: -2px; }
/* clear active hand: bright ring + arrow, the others fade */
.bj-hand.on { background: rgba(255,255,255,.14); box-shadow: 0 0 0 3px #ffd23f, 0 0 22px rgba(255,210,63,.5); animation: bjOn 1.3s ease-in-out infinite; }
.bj-hand.on::before { content: "\25BC"; position: absolute; top: -20px; left: 50%; margin-left: -8px; color: #ffd23f; font-size: 15px; line-height: 1; text-shadow: 0 2px 4px rgba(0,0,0,.7); animation: bjArrow .7s ease-in-out infinite alternate; }
.bj-hands:has(.bj-hand.on) .bj-hand:not(.on) { opacity: .5; }
@keyframes bjOn { 50% { box-shadow: 0 0 0 3px #ffd23f, 0 0 30px rgba(255,210,63,.75); } } @keyframes bjArrow { to { transform: translateY(4px); } }
/* many hands: wrap into rows with bigger cards so nothing overlaps */
.bj-hands:has(.bj-hand:nth-child(4)) { flex-wrap: wrap; top: 40%; row-gap: 12px; column-gap: 6px; padding: 0 10px; align-content: flex-start; justify-content: center; }
.bj-hands:has(.bj-hand:nth-child(4)) .bj-hand { flex: 0 0 calc(50% - 6px); max-width: calc(50% - 6px); padding: 6px 4px 4px; }
.bj-hands:has(.bj-hand:nth-child(5)) .bj-hand { flex-basis: calc(33.33% - 6px); max-width: calc(33.33% - 6px); }
.bj-hands:has(.bj-hand:nth-child(7)) .bj-hand { flex-basis: calc(25% - 6px); max-width: calc(25% - 6px); }
.bj-hands:has(.bj-hand:nth-child(4)) .bjc { width: 52px; height: 75px; margin-left: -28px; } .bj-hands:has(.bj-hand:nth-child(4)) .bjc:first-child { margin-left: 0; }
.bj-hands:has(.bj-hand:nth-child(4)) .bjr b { font-size: 15px; } .bj-hands:has(.bj-hand:nth-child(4)) .bjs svg { width: 26px; height: 26px; }
.bj-hands:has(.bj-hand:nth-child(7)) .bjc { width: 40px; height: 58px; margin-left: -22px; } .bj-hands:has(.bj-hand:nth-child(7)) .bjr b { font-size: 12px; } .bj-hands:has(.bj-hand:nth-child(7)) .bjs svg { width: 20px; height: 20px; }
.bj-hands:has(.bj-hand:nth-child(4)) .bj-cards { min-height: 76px; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-bet b { font-size: 11.5px; } .bj-hands:has(.bj-hand:nth-child(4)) .bj-bet { padding: 3px 8px; }
.bj-hands:has(.bj-hand.on) .bj-hand:not(.on) { opacity: .75; }

/* side bets v2: same field style as Bet Amount */
.bj-side { margin-top: 12px; display: grid; gap: 12px; }
.bj-sb .bet2-h > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.bj-sb-up { font-size: 12px; font-weight: 700; color: #5fd896; }
.bj-sb-i { width: 17px; height: 17px; padding: 0; border-radius: 50%; border: 1.5px solid currentColor; background: none; color: var(--mut, #8b98a5); font: italic 800 10px/1 Georgia, serif; display: inline-grid; place-items: center; cursor: pointer; opacity: .8; }
.bj-sb-i:hover, .bj-sb-i.on { opacity: 1; color: #fff; }
.bj-sb .bet2-q button { font-size: 12px; padding: 0 10px; }
.bj-sb input::placeholder { color: rgba(255,255,255,.3); }
.bj-sb-pt { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: rgba(0,0,0,.2); font-size: 13px; }
.bj-sb-pt small { display: block; margin-bottom: 6px; color: var(--mut, #8b98a5); font-size: 12px; line-height: 1.4; }
.bj-sb-pt p { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0 0; color: #c9d2e3; }
.bj-sb-pt b { color: #fff; }
html[data-theme="light"] .bj-sb-pt { background: #f1f3f9; }
html[data-theme="light"] .bj-sb-pt p { color: #3a4560; } html[data-theme="light"] .bj-sb-pt b, html[data-theme="light"] .bj-sb-i.on { color: #12163a; }
html[data-theme="light"] .bj-sb-up { color: #1a9a55; } html[data-theme="light"] .bj-sb input::placeholder { color: rgba(18,22,58,.35); }
.bj-sres { display: flex; gap: 8px; margin-top: 10px; }
.bj-sres > div { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; padding: 7px 10px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.07); }
.bj-sres small { grid-column: 1 / -1; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #8b98a5; }
.bj-sres b { font-size: 13px; color: #c9d2e3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bj-sres span { font-size: 13px; font-weight: 800; color: #8b98a5; }
.bj-sres .w { border-color: rgba(64,200,120,.45); background: rgba(64,200,120,.1); }
.bj-sres .w b { color: #fff; } .bj-sres .w span { color: #5fe39a; }
html[data-theme="light"] .bj-sres > div { background: #fff; border-color: #dfe4ef; }
html[data-theme="light"] .bj-sres b { color: #3a4560; } html[data-theme="light"] .bj-sres .w b { color: #12163a; } html[data-theme="light"] .bj-sres .w span { color: #1a9a55; }

/* side bets v3: on/off switch, fields side by side when there is room */
.bj-swr { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--mut, #8b98a5); }
.bj-swr .sw { border: 0; padding: 0; cursor: pointer; flex: none; }
.bj-swr .sw:disabled { opacity: .5; cursor: default; }
.bj-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.bj-side[hidden] { display: none; }
.bj-sb-up { background: none; border: 0; padding: 0; font-size: 12px; font-weight: 700; color: #5fd896; cursor: pointer; }
.bj-sb-up:hover, .bj-sb-up.on { text-decoration: underline; text-underline-offset: 3px; }
