.bj-shell {
    --bj-cw: 68px;
    --bj-ch: 97px;
    --bj-felt: #1b5f4b;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 0 26px;
    color: var(--cg-ink);
    font-family: Inter, Arial, sans-serif;
}

.bj-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.bj-stats {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.bj-stat {
    flex: 0 1 auto;
    min-width: 74px;
    padding: 7px 10px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    box-shadow: 0 8px 18px rgba(33, 43, 40, 0.07);
}

.bj-stat span {
    display: block;
    color: var(--cg-muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bj-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.bj-icons {
    display: flex;
    gap: 8px;
}

.bj-btn,
.bj-chipbtn,
.bj-chiptoggle,
.bj-close {
    min-height: 44px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    color: var(--cg-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(33, 43, 40, 0.07);
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.bj-btn {
    padding: 0 15px;
}

.bj-btn kbd {
    margin-left: 5px;
    padding: 1px 4px;
    border: 1px solid currentColor;
    border-radius: 4px;
    opacity: 0.5;
    font: inherit;
    font-size: 0.68rem;
}

.bj-btn:hover:not(:disabled),
.bj-chipbtn:hover:not(:disabled),
.bj-chiptoggle:hover,
.bj-close:hover {
    transform: translateY(-1px);
    border-color: var(--cg-teal);
}

.bj-btn:disabled,
.bj-chipbtn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.bj-btn:focus-visible,
.bj-chipbtn:focus-visible,
.bj-chiptoggle:focus-visible,
.bj-close:focus-visible,
.bj-table:focus-visible {
    outline: 3px solid rgba(18, 122, 137, 0.45);
    outline-offset: 2px;
}

.bj-icon {
    width: 44px;
    min-width: 44px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    font-size: 1.05rem;
}

.bj-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bj-primary {
    border-color: transparent;
    background: var(--cg-green);
    color: #fff;
}

.bj-primary:hover:not(:disabled) {
    border-color: transparent;
    filter: brightness(1.08);
}

.bj-small {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.bj-tablewrap {
    padding: 12px;
    overflow: hidden;
    border: 1px solid #0d3b2e;
    border-radius: 16px;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 3px, rgba(0, 0, 0, 0.02) 3px 6px),
        radial-gradient(120% 108% at 50% -14%, #2f8a68 0%, var(--bj-felt) 54%, #10382c 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 70px rgba(0, 0, 0, 0.3), var(--cg-shadow);
}

.bj-table {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 442px;
    padding-bottom: 14px;
    -webkit-user-select: none;
    user-select: none;
}

.bj-table::before {
    content: '';
    position: absolute;
    left: -10%;
    right: -10%;
    top: 34%;
    height: 58%;
    border-top: 2px solid rgba(255, 255, 255, 0.09);
    border-radius: 50% / 100% 100% 0 0;
    pointer-events: none;
}

.bj-print {
    position: relative;
    text-align: center;
    line-height: 1.25;
    color: rgba(255, 240, 200, 0.9);
}

.bj-print b {
    display: block;
    font-size: clamp(0.9rem, 2.6vw, 1.15rem);
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.bj-print span,
.bj-print em {
    display: block;
    font-style: normal;
    font-size: clamp(0.6rem, 1.8vw, 0.72rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bj-print span {
    color: rgba(214, 240, 226, 0.72);
    margin-top: 2px;
}

.bj-print em {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 214, 107, 0.86);
}

.bj-dealer,
.bj-hand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bj-dealer {
    flex: 0 0 auto;
}

.bj-tag {
    padding: 3px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    color: #eaf5ef;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.bj-seats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex: 1 1 auto;
}

.bj-hand {
    position: relative;
    padding: 6px 4px;
    border-radius: 12px;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.bj-hand.is-active {
    background: rgba(255, 214, 107, 0.12);
    box-shadow: inset 0 0 0 2px rgba(255, 214, 107, 0.6);
}

.bj-row {
    display: flex;
    justify-content: center;
    min-height: var(--bj-ch);
}

.bj-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bj-tot,
.bj-wager {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.bj-tot {
    background: rgba(0, 0, 0, 0.3);
    color: #eaf5ef;
}

.bj-wager {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    min-height: 26px;
    padding: 0 8px;
    border: 2px dashed rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    background: rgba(199, 61, 55, 0.32);
    color: #ffe9c9;
    font-variant-numeric: tabular-nums;
}

.bj-res {
    min-height: 18px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.bj-res.is-win,
.bj-res.is-blackjack {
    color: #b6f2d0;
}

.bj-res.is-lose {
    color: #ffb3ad;
}

.bj-res.is-push {
    color: #ffe3a3;
}

.bj-row.is-empty::before,
.bj-row.is-empty::after {
    content: '';
    width: var(--bj-cw);
    height: var(--bj-ch);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: calc(var(--bj-cw) * 0.09);
}

.bj-row.is-empty::after {
    margin-left: calc(var(--bj-cw) * -0.38);
}

.bj-shoebox {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.bj-shoebox b {
    width: 13px;
    height: 21px;
    border: 1px solid rgba(0, 0, 0, 0.45);
    border-radius: 3px;
    background: linear-gradient(160deg, #8d2f33, #6d2026 60%, #4d161c);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.bj-shoebox span {
    margin-left: 4px;
    color: rgba(214, 240, 226, 0.55);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bj-pen {
    position: relative;
    height: 6px;
    margin-top: auto;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.bj-pen i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.38), rgba(255, 214, 107, 0.68));
    transition: width 0.3s ease;
}

.bj-pen b {
    position: absolute;
    top: -2px;
    width: 3px;
    height: 10px;
    border-radius: 2px;
    background: #e05a4f;
    box-shadow: 0 0 6px rgba(224, 90, 79, 0.8);
}

.bj-card {
    position: relative;
    flex: 0 0 auto;
    width: var(--bj-cw);
    height: var(--bj-ch);
    perspective: 760px;
}

.bj-card + .bj-card {
    margin-left: calc(var(--bj-cw) * -0.38);
}

.bj-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.46s cubic-bezier(0.3, 0.9, 0.4, 1);
}

.bj-down .bj-inner {
    transform: rotateY(180deg);
}

.bj-face,
.bj-back {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: calc(var(--bj-cw) * 0.09);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.bj-face {
    background: linear-gradient(168deg, #ffffff 0%, #fbfaf4 62%, #f1efe4 100%);
    border: 1px solid #c9cdc2;
    box-shadow: 0 3px 7px rgba(6, 26, 19, 0.42);
    color: #23282b;
}

.bj-red .bj-face {
    color: #c0322b;
}

.bj-back {
    transform: rotateY(180deg);
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 4px, transparent 4px 8px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.09) 0 4px, transparent 4px 8px),
        linear-gradient(160deg, #8d2f33, #6d2026 60%, #4d161c);
    border: 1px solid #40121a;
    box-shadow: 0 3px 7px rgba(6, 26, 19, 0.42);
}

.bj-back::after {
    content: '';
    position: absolute;
    inset: 8%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: calc(var(--bj-cw) * 0.05);
}

.bj-in {
    animation: bj-deal 0.34s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes bj-deal {
    from { opacity: 0; transform: translate3d(38%, -180%, 0) rotate(14deg) scale(0.94); }
    to { opacity: 1; transform: none; }
}

.bj-ix {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.95;
}

.bj-tl {
    left: 6%;
    top: 3.5%;
}

.bj-br {
    right: 6%;
    bottom: 3.5%;
    transform: rotate(180deg);
}

.bj-ix b {
    font-size: calc(var(--bj-cw) * 0.3);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.bj-ix i {
    margin-top: 1px;
    font-size: calc(var(--bj-cw) * 0.23);
    font-style: normal;
}

.bj-pips {
    position: absolute;
    left: 3%;
    right: 3%;
    top: 8%;
    bottom: 8%;
}

.bj-pip {
    position: absolute;
    font-size: calc(var(--bj-cw) * 0.22);
    font-style: normal;
    line-height: 1;
    transform: translate(-50%, -50%);
}

.bj-pip.bj-flip {
    transform: translate(-50%, -50%) rotate(180deg);
}

.bj-big {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: calc(var(--bj-cw) * 0.5);
    font-style: normal;
    line-height: 1;
    opacity: 0.92;
    transform: translate(-50%, -50%);
}

.bj-alt {
    display: none;
}

.bj-compact .bj-pips {
    display: none;
}

.bj-compact .bj-alt {
    display: block;
}

.bj-court {
    position: absolute;
    left: 20%;
    right: 20%;
    top: 19%;
    bottom: 19%;
    display: grid;
    place-items: center;
    border-radius: calc(var(--bj-cw) * 0.05);
    overflow: hidden;
}

.bj-court::before,
.bj-court::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.bj-court::before {
    background: currentColor;
    opacity: 0.07;
}

.bj-court::after {
    border: 1px solid currentColor;
    opacity: 0.32;
}

.bj-court b {
    position: relative;
    z-index: 1;
    font-size: calc(var(--bj-cw) * 0.44);
    line-height: 1.05;
}

.bj-court i {
    position: absolute;
    z-index: 1;
    right: 6%;
    bottom: 2%;
    font-size: calc(var(--bj-cw) * 0.19);
    font-style: normal;
}

.bj-coach {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    min-height: 56px;
    padding: 11px 14px;
    border: 1px solid var(--cg-line);
    border-left: 4px solid var(--cg-teal);
    border-radius: 10px;
    background: var(--cg-panel);
    box-shadow: 0 6px 16px rgba(33, 43, 40, 0.07);
}

.bj-coach b {
    flex: 0 0 auto;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
}

.bj-coach span {
    flex: 1 1 240px;
    color: var(--cg-muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.bj-coach[data-ok='good'] {
    border-left-color: var(--cg-green);
    background: linear-gradient(120deg, #edf8f2, #ffffff 65%);
}

.bj-coach[data-ok='good'] b {
    color: var(--cg-green);
}

.bj-coach[data-ok='bad'] {
    border-left-color: var(--cg-red);
    background: linear-gradient(120deg, #fdf0ee, #ffffff 65%);
}

.bj-coach[data-ok='bad'] b {
    color: var(--cg-red);
}

.bj-coach[data-ok='off'] {
    border-left-color: var(--cg-line);
    opacity: 0.75;
}

.bj-controls {
    margin-top: 12px;
}

.bj-betrow,
.bj-actrow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bj-actrow {
    min-height: 48px;
    margin-top: 8px;
}

.bj-betrow.is-locked {
    opacity: 0.62;
}

.bj-betlab {
    color: var(--cg-muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bj-chipbtn {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 50%;
    border: 3px dashed rgba(255, 255, 255, 0.72);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    box-shadow: 0 5px 12px rgba(33, 43, 40, 0.24);
}

.bj-c5 { background: #b9483f; }
.bj-c25 { background: #1d7f62; }
.bj-c100 { background: #2c4c86; }
.bj-c500 { background: #3d3a44; }

.bj-betnow {
    margin-left: auto;
    color: var(--cg-muted);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bj-betnow strong {
    margin-left: 4px;
    color: var(--cg-ink);
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
}

.bj-opts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.bj-chiptoggle {
    padding: 0 15px;
}

.bj-chiptoggle[aria-pressed='true'] {
    background: var(--cg-ink);
    border-color: var(--cg-ink);
    color: #fff;
}

.bj-status {
    margin: 10px 2px 0;
    min-height: 20px;
    color: var(--cg-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.bj-result {
    margin-top: 10px;
    padding: 14px 16px;
    border: 1px solid #b9d6c9;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef8f3, #ffffff 62%);
    box-shadow: var(--cg-shadow);
    text-align: center;
    animation: bj-rise 0.22s ease;
}

@keyframes bj-rise {
    from { opacity: 0; transform: translateY(7px); }
}

.bj-kicker {
    display: block;
    color: var(--cg-teal);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bj-result strong {
    display: block;
    margin: 3px 0 2px;
    font-size: 1.32rem;
    font-variant-numeric: tabular-nums;
}

.bj-result p {
    margin: 0 0 10px;
    color: var(--cg-muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.bj-res-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.bj-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(14, 32, 25, 0.58);
}

.bj-modal-card {
    position: relative;
    width: min(100%, 480px);
    max-height: 86vh;
    overflow-y: auto;
    padding: 22px;
    border: 1px solid var(--cg-line);
    border-radius: 12px;
    background: var(--cg-panel);
    box-shadow: 0 24px 70px rgba(16, 30, 25, 0.32);
}

.bj-modal-card h2 {
    margin: 0 44px 10px 0;
    font-size: 1.18rem;
}

.bj-modal-card p {
    margin: 0 0 10px;
    color: var(--cg-muted);
    font-size: 0.9rem;
    line-height: 1.48;
}

.bj-modal-card kbd {
    padding: 1px 5px;
    border: 1px solid var(--cg-line);
    border-radius: 4px;
    background: var(--cg-bg);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
}

.bj-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
    .bj-in { animation: none; }
    .bj-inner { transition: none; }
}

@media (max-width: 640px) {
    .bj-shell {
        padding-bottom: 18px;
    }

    .bj-stat {
        min-width: 0;
        flex: 1 1 0;
        padding: 6px 7px;
    }

    .bj-stat strong {
        font-size: 15px;
    }

    .bj-wide {
        display: none;
    }

    .bj-icons {
        gap: 6px;
    }

    .bj-btn,
    .bj-chiptoggle,
    .bj-close {
        min-height: 42px;
        font-size: 0.84rem;
    }

    .bj-btn {
        padding: 0 12px;
    }

    .bj-icon {
        width: 42px;
        min-width: 42px;
    }

    .bj-small {
        min-height: 38px;
        font-size: 0.78rem;
    }

    .bj-tablewrap {
        padding: 8px;
        border-radius: 12px;
    }

    .bj-table {
        min-height: 384px;
        gap: 8px;
    }

    .bj-seats {
        gap: 8px;
    }

    .bj-shoebox span {
        display: none;
    }

    .bj-shoebox {
        padding: 5px 6px;
    }

    .bj-chipbtn {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        border-width: 2px;
        font-size: 0.74rem;
    }

    .bj-betnow {
        font-size: 0.72rem;
    }

    .bj-coach {
        min-height: 62px;
        padding: 9px 11px;
    }

    .bj-coach b,
    .bj-coach span {
        font-size: 0.8rem;
    }

    .bj-btn kbd {
        display: none;
    }
}
