.game-body { margin: 0; min-height: 100vh; color: #f4efe4; overflow-x: hidden; }
.game-body.theme-lucky-sevens { background: radial-gradient(ellipse at 50% 20%, #4a1c14 0%, #120806 55%, #070304 100%); }
.game-body.theme-diamond-rush { background: radial-gradient(ellipse at 50% 10%, #1b3d66 0%, #071018 55%, #04080f 100%); }
.game-body.theme-golden-fish { background: radial-gradient(ellipse at 50% 0%, #145a7a 0%, #062433 50%, #021018 100%); }
.game-body.theme-joker-wilds { background: radial-gradient(ellipse at 50% 10%, #5a1638 0%, #1a0614 55%, #0a0308 100%); }
.game-body.theme-royal-roulette { background: radial-gradient(ellipse at 40% 20%, #2a1020 0%, #0c0810 60%, #07060a 100%); }
.game-body.theme-blackjack {
    background-color: #080c15;
    background-image:
        repeating-linear-gradient(45deg, rgba(196, 161, 90, 0.03) 0 1px, transparent 1px 18px),
        repeating-linear-gradient(-45deg, rgba(196, 161, 90, 0.02) 0 1px, transparent 1px 18px);
    overflow: hidden;
}

.playfield { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; position: relative; }
.playfield::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle at 20% 10%, rgba(255,220,120,.08), transparent 28%),
                radial-gradient(circle at 80% 0%, rgba(255,255,255,.05), transparent 24%);
}
.theme-golden-fish .playfield::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,.06) 0 2px, transparent 3px),
        radial-gradient(circle at 70% 30%, rgba(255,255,255,.05) 0 2px, transparent 3px);
    animation: drift 18s linear infinite;
}
@keyframes drift { to { transform: translateY(-40px); } }

.game-hud {
    position: relative; z-index: 3;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px; background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.15));
    border-bottom: 1px solid rgba(245,193,74,.18);
}
.hud-brand, .hud-meta, .hud-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hud-name { font-family: Cinzel, Georgia, serif; letter-spacing: .04em; }
.hud-chip {
    min-width: 7.5rem; padding: 6px 10px; border-radius: 12px;
    background: rgba(8,10,16,.65); border: 1px solid rgba(245,193,74,.22);
}
.hud-chip span { display: block; font-size: .68rem; color: #cbb994; text-transform: uppercase; letter-spacing: .08em; }
.hud-chip strong { color: #ffe28a; }
.gbtn {
    appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 800;
    border-radius: 14px; padding: 12px 18px; color: #1a1406;
    background: linear-gradient(180deg, #ffe28a, #d4a017); box-shadow: 0 6px 0 #8a6910, 0 10px 18px rgba(0,0,0,.35);
    transition: transform .12s ease, filter .12s ease;
}
.gbtn:hover { filter: brightness(1.06); }
.gbtn:active { transform: translateY(3px); box-shadow: 0 3px 0 #8a6910, 0 6px 10px rgba(0,0,0,.3); }
.gbtn:disabled { filter: grayscale(.4) brightness(.7); cursor: not-allowed; box-shadow: none; transform: none; }
.playfield.is-busy [data-action-btn] { pointer-events: none; filter: grayscale(.25) brightness(.8); }
.gbtn.secondary { color: #f4efe4; background: linear-gradient(180deg, #2a3348, #161c2c); box-shadow: 0 6px 0 #0b0f18, 0 10px 18px rgba(0,0,0,.35); }
.gbtn.icon { width: 44px; height: 44px; padding: 0; border-radius: 12px; }
.gbtn:focus-visible { outline: 2px solid #ffe28a; outline-offset: 3px; }
.bet-stepper { display: flex; align-items: center; gap: 8px; }
.bet-stepper output { min-width: 4.5rem; text-align: center; font-weight: 800; color: #ffe28a; }
.bet-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bet-input-wrap {
    display: grid; justify-items: center; gap: 2px; min-width: 0;
}
.bet-input-wrap span { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: #cbb994; }
.bet-input-wrap input[data-bet-input] {
    width: 6.2rem; max-width: 28vw; text-align: center; font-weight: 800; color: #ffe28a;
    background: #0c1220; border: 1px solid rgba(255,215,120,.25); border-radius: 10px;
    padding: 8px 6px; font: inherit;
}
.bj-betbox .bet-input-wrap input[data-bet-input] { width: 4.6rem; font-size: 1.1rem; padding: 6px 4px; }
@media (max-width: 720px) {
    .bet-control { width: 100%; justify-content: center; }
    .bet-input-wrap input[data-bet-input] { width: min(6.2rem, 36vw); }
}

.game-stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 12px; min-height: 0; }
.scene-mount {
    width: min(1180px, 100%);
    height: min(66vh, 740px);
    min-height: 340px;
    border-radius: 20px;
    overflow: hidden;
    background: #05060a;
    box-shadow: 0 22px 55px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.05);
}
.scene-mount canvas { display: block; width: 100% !important; height: 100% !important; }
.scene-mount[hidden] { display: none !important; }
.table-labels { margin: 8px 0 0; color: #d9f0df; font-weight: 700; }
.theme-blackjack .playfield::before { display: none; }
.theme-blackjack .toast { position: absolute; top: auto; bottom: 18%; }
.fallback-2d { width: min(920px, 100%); }
.fallback-2d[hidden] { display: none !important; }
.machine {
    width: min(920px, 100%);
    background: linear-gradient(180deg, rgba(40,28,16,.9), rgba(12,8,6,.92));
    border: 8px solid #c9a227; border-radius: 28px;
    box-shadow: inset 0 0 0 3px #7a5b12, 0 24px 50px rgba(0,0,0,.45);
    padding: 18px 18px 14px; position: relative;
}
.theme-diamond-rush .machine { border-color: #9ecbff; box-shadow: inset 0 0 0 3px #35557a, 0 24px 50px rgba(0,0,0,.45); background: linear-gradient(180deg, #102033, #070d16); }
.theme-golden-fish .machine { border-color: #48c2c8; box-shadow: inset 0 0 0 3px #14555a, 0 24px 50px rgba(0,0,0,.45); background: linear-gradient(180deg, #0b3a4a, #061820); }
.theme-joker-wilds .machine { border-color: #e11d48; box-shadow: inset 0 0 0 3px #7f1d1d, 0 24px 50px rgba(0,0,0,.45); background: linear-gradient(180deg, #3a1024, #14060e); }
.reel-housing {
    display: grid; gap: 8px; padding: 14px; border-radius: 18px;
    background: linear-gradient(180deg, #0a0c12, #151820);
    box-shadow: inset 0 10px 24px rgba(0,0,0,.65), inset 0 -8px 16px rgba(255,255,255,.04);
    overflow: hidden;
}
.reel-housing[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.reel-housing[data-cols="5"] { grid-template-columns: repeat(5, 1fr); }
.reel {
    height: 276px; overflow: hidden; border-radius: 12px; position: relative;
    background: #0c1018; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.reel-strip { will-change: transform; }
.sym {
    height: 92px; margin: 0 6px 0; display: grid; place-items: center;
    background: linear-gradient(180deg, #1c2436, #101520);
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.sym img { width: 78px; height: 78px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45)); }
.sym.is-win { background: linear-gradient(180deg, #4a3a12, #2a2008); box-shadow: inset 0 0 0 2px #f5c14a; animation: glow .7s ease-in-out infinite alternate; }
.sym.is-wild { box-shadow: inset 0 0 0 2px #ffe28a, 0 0 18px rgba(245,193,74,.45); }
.sym.is-scatter { box-shadow: inset 0 0 0 2px #7dd3fc, 0 0 18px rgba(125,211,252,.35); }
@keyframes glow { to { filter: brightness(1.18); } }
.reel-glass { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 28%, transparent 72%, rgba(0,0,0,.28)); }

.game-dock {
    position: relative; z-index: 3;
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px;
    padding: 14px 18px 22px;
    background: linear-gradient(180deg, rgba(18,14,10,.15), rgba(8,6,4,.78));
    border-top: 1px solid rgba(201,162,39,.28);
    box-shadow: inset 0 12px 24px rgba(0,0,0,.18);
}
.toast {
    position: fixed; left: 50%; top: 22%; transform: translateX(-50%) scale(.96);
    min-width: min(420px, calc(100% - 24px)); text-align: center; padding: 16px 22px;
    border-radius: 18px; background: rgba(8,10,16,.88); border: 1px solid rgba(245,193,74,.35);
    color: #ffe28a; font-family: Cinzel, Georgia, serif; letter-spacing: .06em;
    opacity: 0; pointer-events: none; transition: .25s ease; z-index: 8;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) scale(1); }
.toast.win { box-shadow: 0 0 40px rgba(245,193,74,.25); }
.toast.big { font-size: 1.35rem; box-shadow: 0 0 60px rgba(245,193,74,.4); }
.toast.lose { color: #f4efe4; border-color: rgba(255,255,255,.12); }
.toast.err { color: #ffb4b4; border-color: #d44848; }
.overlay {
    position: absolute; inset: 0; display: none; place-items: center; z-index: 6;
    background: rgba(4,6,10,.62); text-align: center; padding: 24px;
}
.overlay.is-on { display: grid; }
.paytable-card, .help-card, .history-card {
    width: min(640px, 100%); max-height: 70vh; overflow: auto; text-align: left;
    background: #12182a; border: 1px solid rgba(245,193,74,.25); border-radius: 18px; padding: 18px;
}
.sr-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Roulette */
.roulette-arena { width: min(1100px, 100%); display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.wheel-stage { perspective: 900px; display: grid; place-items: center; }
.wheel-3d { width: 300px; height: 300px; transform: rotateX(28deg); transform-style: preserve-3d; position: relative; }
.wheel-rim {
    width: 100%; height: 100%; border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #1a1208 36%, #c9a227 37%, #f5c14a 42%, #7a5b12 46%, #111 47%);
    box-shadow: 0 18px 28px rgba(0,0,0,.45), inset 0 8px 16px rgba(255,255,255,.12);
    overflow: hidden; position: relative;
}
.wheel-rotor { width: 78%; height: 78%; position: absolute; inset: 11%; border-radius: 50%; overflow: hidden; }
.wheel-rotor svg { width: 100%; height: 100%; }
.wheel-hub {
    position: absolute; inset: 38%; border-radius: 50%; background: radial-gradient(circle, #ffe28a, #8a6910);
    box-shadow: 0 0 0 6px #1a1208;
}
.wheel-ball {
    position: absolute; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, #9aa);
    top: 50%; left: 50%; margin: -6px; transform-origin: 0 0;
}
.result-pip { margin-top: 14px; text-align: center; font-family: Cinzel, Georgia, serif; }
.result-pip b { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; margin-right: 8px; color: #fff; }
.result-pip.red b { background: #b81d1d; }
.result-pip.black b { background: #111; }
.result-pip.green b { background: #1f8a4c; }
.felt-table {
    background: radial-gradient(circle at 50% 0%, #1f7a46, #0c3b22);
    border: 10px solid #5b3b16; border-radius: 22px; padding: 12px;
    box-shadow: inset 0 0 40px rgba(0,0,0,.35), 0 18px 30px rgba(0,0,0,.35);
}
.euro-grid { display: grid; grid-template-columns: 42px repeat(12, 1fr) 42px; gap: 4px; }
.euro-grid button {
    min-height: 42px; border: 0; color: #fff; font-weight: 800; border-radius: 6px; cursor: pointer; position: relative;
}
.euro-grid button.red { background: #b81d1d; }
.euro-grid button.black { background: #141414; }
.euro-grid button.green { background: #1f8a4c; }
.euro-grid button.is-on { outline: 2px solid #f5c14a; }
.chip-mark {
    position: absolute; right: 4px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #f5c14a); color: #111; font-size: 9px; font-weight: 800;
    display: grid; place-items: center;
}
.outside-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 6px; }
.outside-row button, .dozen-row button {
    min-height: 40px; border: 0; border-radius: 6px; background: #0f3d24; color: #f4efe4; font-weight: 800; cursor: pointer;
}
.dozen-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.chip-picker { display: flex; gap: 8px; }
.chip {
    width: 46px; height: 46px; border-radius: 50%; border: 4px dashed rgba(255,255,255,.35);
    font-weight: 800; color: #111; cursor: pointer;
}
.chip.c1 { background: #d6d3d1; } .chip.c5 { background: #f5c14a; }
.chip.c10 { background: #60a5fa; } .chip.c25 { background: #f87171; }
.chip.is-on { box-shadow: 0 0 0 3px #fff; }

.theme-blackjack .playfield { min-height: 0; }
.theme-blackjack .playfield::before { display: none; }
.theme-blackjack .toast { position: absolute; top: auto; bottom: 12%; }

.bj-viewport {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}
.bj-page {
    width: 1536px;
    height: 1024px;
    position: relative;
    margin: 0 auto;
    transform-origin: top center;
    box-sizing: border-box;
    padding: 0;
    flex: 0 0 1536px;
}
.bj-sitebar {
    position: absolute;
    top: 0;
    left: 96px;
    width: 1346px;
    height: 75px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 8px;
    box-sizing: border-box;
    color: #f4efe4;
}
.bj-brand {
    font-family: Cinzel, Georgia, serif;
    font-weight: 700;
    letter-spacing: .04em;
    color: #f4efe4;
    text-decoration: none;
    font-size: 1.2rem;
}
.bj-brand::before { content: "♛ "; color: #d4b46a; }
.bj-sitenav { display: flex; gap: 20px; flex: 1; }
.bj-sitenav a { color: #c9c3b4; text-decoration: none; font-size: .92rem; }
.bj-sitenav a:hover { color: #ffe28a; }
.bj-credits { color: #ffe28a; font-size: .95rem; white-space: nowrap; }
.bj-gear { color: #c9c3b4; font-size: 1rem; }

.bj-window.playfield {
    position: absolute;
    top: 75px;
    left: 96px;
    width: 1346px;
    height: 894px;
    min-height: 0;
    display: grid;
    grid-template-rows: 81px 640px 108px 65px;
    border-radius: 18px;
    border: 1px solid #c4a15a;
    background: #0c1421;
    box-shadow: 0 16px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,220,150,.08);
    overflow: hidden;
}
.bj-hud {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px;
    background: #0c1421;
    border-bottom: 0;
}
.bj-hud-credits { display: none; }
.bj-hud .hud-brand { display: flex; align-items: flex-start; gap: 10px; }
.bj-suit { color: #f4efe4; font-size: 1.15rem; line-height: 1.15; }
.bj-sub { margin: 2px 0 0; color: #9a9588; font-size: .76rem; font-weight: 500; }
.hud-name { font-family: Cinzel, Georgia, serif; letter-spacing: .03em; }
.bj-icon {
    appearance: none; width: 32px; height: 32px; padding: 0;
    border-radius: 8px; border: 1px solid rgba(255,255,255,.1);
    background: #161c2c; color: #f4efe4; cursor: pointer;
    display: inline-grid; place-items: center; text-decoration: none; font: inherit;
}
.bj-icon:disabled { opacity: .4; cursor: not-allowed; }
.bj-icon[aria-pressed="false"] { color: #8b8578; }

.bj-table-stage {
    position: relative;
    min-height: 0;
    display: block;
    padding: 0;
    background: #2a1a0c;
    overflow: hidden;
}
.bj-table {
    width: 100%;
    height: 100%;
    border-radius: 0;
    background:
        repeating-linear-gradient(90deg, rgba(255,220,160,.035) 0 1px, transparent 1px 7px),
        repeating-linear-gradient(180deg, rgba(0,0,0,.05) 0 1px, transparent 1px 5px),
        linear-gradient(180deg, #3a2414 0%, #24160c 55%, #1a120a 100%);
    border: 0;
    box-shadow: none;
    padding: 8px 7px 11px;
    box-sizing: border-box;
    display: block;
}
.bj-felt {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 36px;
    background:
        radial-gradient(ellipse at 50% 38%, #168a48 0%, #12753c 46%, #0d5f30 100%);
    box-shadow:
        inset 0 0 0 1.5px rgba(196,161,90,.28),
        inset 0 0 70px rgba(0,0,0,.14);
    overflow: hidden;
}
.bj-felt::before {
    content: "";
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 0h6M0 0v6' stroke='rgba(0,0,0,0.045)' stroke-width='0.6' fill='none'/%3E%3C/svg%3E");
    pointer-events: none;
}
.bj-copy {
    position: absolute; left: 50%; top: 228px;
    transform: translateX(-50%);
    margin: 0; text-align: center;
    font-family: Cinzel, Georgia, serif;
    color: rgba(232,214,160,.7);
    pointer-events: none;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}
.bj-copy strong { display: block; font-size: 20px; letter-spacing: .16em; font-weight: 600; }
.bj-copy span { display: block; margin-top: 5px; font-size: 12px; letter-spacing: .14em; color: rgba(232,214,160,.5); }
.bj-copy::after {
    content: "";
    display: block;
    width: 380px;
    height: 1px;
    margin: 8px auto 0;
    background: rgba(232,214,160,.26);
}
.bj-rs {
    position: absolute; top: 236px;
    font-family: Cinzel, Georgia, serif;
    color: rgba(232,214,160,.32);
    font-size: 14px; letter-spacing: .18em;
}
.bj-rs::before { content: "♛ "; font-size: 11px; }
.bj-rs-l { left: 8%; }
.bj-rs-r { right: 8%; }
.bj-prop { position: absolute; }
.bj-discard {
    left: 7.5%; top: 8%;
    width: 72px;
    height: 92px;
    padding: 10px 8px 8px;
    border-radius: 4px 4px 8px 8px;
    background: linear-gradient(180deg, rgba(236,242,250,.55), rgba(210,220,232,.28));
    box-shadow: 0 8px 16px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.35);
    z-index: 2;
}
.bj-discard canvas, .bj-shoe canvas { width: 100%; height: 100%; display: block; border-radius: 5px; }
.bj-shoe {
    right: 6.5%; top: 6%;
    width: 108px;
    height: 118px;
    background: #141414;
    border-radius: 6px 22px 10px 8px;
    padding: 14px 18px 10px 12px;
    box-shadow: 0 10px 18px rgba(0,0,0,.32);
    transform: rotate(-6deg);
    z-index: 2;
}
.bj-tray {
    left: 50%; top: 508px;
    transform: translateX(-50%);
    display: none;
    gap: 7px; align-items: flex-end;
    padding: 8px 14px 7px;
    background: linear-gradient(180deg, #6a4420, #3a2410);
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,220,160,.2);
    z-index: 0;
}
.bj-tray i {
    display: block; width: 18px; height: 18px; border-radius: 50%;
    box-shadow: 0 3px 0 rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.4);
}
.bj-tray .c-w { background: #d8d4cc; }
.bj-tray .c-y { background: #d4a017; }
.bj-tray .c-b { background: #3b6ea5; }
.bj-tray .c-r { background: #a33b3b; }
.bj-tray .c-p { background: #6b4c9a; }

.bj-hand { position: absolute; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px; }
.bj-dealer { top: 6px; }
.bj-player { top: 318px; }
.bj-cards { display: flex; justify-content: center; align-items: flex-end; gap: 8px; min-height: 0; perspective: 900px; }
.bj-pill {
    min-width: 28px; height: 26px; padding: 0 8px;
    display: grid; place-items: center;
    position: relative; z-index: 2;
    background: rgba(8,10,16,.88);
    border: 1px solid rgba(212,180,106,.45);
    border-radius: 999px;
    color: #fff; font-size: .92rem; font-weight: 700;
    box-shadow: 0 3px 6px rgba(0,0,0,.22);
    -webkit-font-smoothing: antialiased;
}
.bj-pill.is-empty { opacity: 0; }
.bj-card {
    width: 87px;
    height: 122px;
    aspect-ratio: auto;
    position: relative;
    transform-style: preserve-3d;
    filter: drop-shadow(0 4px 5px rgba(0,0,0,.22));
    border-radius: 8px;
}
.bj-player .bj-card {
    width: 98px;
    height: 137px;
}
.bj-card img, .bj-card canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    border-radius: 8px;
    display: block;
}
.bj-card .back { z-index: 0; }
.bj-card .face { z-index: 1; }
.bj-card.is-down .face { visibility: hidden; }
.bj-player .bj-card.is-deal { --deal-x: 320px; --deal-y: -260px; }
.bj-dealer .bj-card.is-deal { --deal-x: 280px; --deal-y: 12px; }
.bj-card.is-deal { animation: bjdeal .42s cubic-bezier(.2,.7,.2,1); will-change: transform; }
.bj-card.is-flip { animation: bjflip .45s ease; will-change: transform; }
@keyframes bjdeal {
    from { transform: translate(var(--deal-x, 240px), var(--deal-y, -160px)) rotate(12deg); }
}
@keyframes bjflip { from { transform: rotateY(180deg); } to { transform: rotateY(0deg); } }

.bj-spot {
    position: absolute; left: 50%; top: 500px;
    transform: translateX(-50%);
    width: 78px; height: auto;
    border: 0;
    display: grid; justify-items: center; gap: 6px;
}
.bj-spot::before {
    content: "";
    width: 78px; height: 50px;
    border: 2px solid rgba(232,214,160,.38);
    border-radius: 50%;
    position: absolute; top: -6px;
    pointer-events: none;
}
.bj-spot-mark {
    font-family: Cinzel, Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: rgba(232,214,160,.42);
    letter-spacing: .08em;
}
.bj-chip-stack {
    position: relative;
    width: 38px;
    height: 38px;
    z-index: 1;
    pointer-events: none;
}
.bj-chip-stack .bj-table-chip {
    position: absolute;
    left: 0;
    top: 0;
}
.bj-table-chip {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: .72rem; font-weight: 800; color: #1a1406;
    background: radial-gradient(circle at 35% 30%, #7eb0e0, #2a5a96);
    border: 3px solid rgba(255,255,255,.55);
    box-shadow: 0 5px 0 rgba(0,0,0,.28), 0 8px 12px rgba(0,0,0,.2), inset 0 2px 4px rgba(255,255,255,.25);
    color: #f6f1e4;
}
.bj-table-chip.is-wide { font-size: .58rem; }
.bj-table-chip.c1 { background: radial-gradient(circle at 35% 30%, #e8e4dc, #9a9588); color: #1a1406; }
.bj-table-chip.c5 { background: radial-gradient(circle at 35% 30%, #f0d56a, #c89614); color: #1a1406; }
.bj-table-chip.c25 { background: radial-gradient(circle at 35% 30%, #e07070, #8a2424); }
.bj-table-chip.c50 { background: radial-gradient(circle at 35% 30%, #a888d0, #4a2e78); }
.bj-table-chip.c100 { background: radial-gradient(circle at 35% 30%, #5a5a5a, #2a2a2a); }
.bj-table-chip.c500 { background: radial-gradient(circle at 35% 30%, #c9a14a, #7a5a14); color: #1a1406; }
.bj-table-chip.c1000 { background: radial-gradient(circle at 35% 30%, #5ee0a0, #0d5a32); }

.bj-values {
    position: absolute; right: 48px; top: 356px;
    min-width: 104px; padding: 10px 12px;
    background: rgba(8,12,20,.8);
    border: 1px solid rgba(212,180,106,.28);
    border-radius: 12px;
    color: #f4efe4;
    pointer-events: none;
    -webkit-font-smoothing: antialiased;
    box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
.bj-values h3 {
    margin: 0 0 8px; font-size: .66rem; letter-spacing: .08em;
    text-transform: uppercase; color: #cbb994; font-weight: 600;
}
.bj-values p { margin: 4px 0; display: flex; justify-content: space-between; gap: 14px; font-size: .82rem; }
.bj-values strong { color: #ffe28a; min-width: 1.2em; text-align: right; }

.bj-dock {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 28px;
    padding: 0 42px;
    background: #0c1421;
    border-top: 0;
}
.bj-acts { display: flex; align-items: flex-start; gap: 18px; margin-left: auto; }
.bj-act-wrap { display: grid; justify-items: center; gap: 4px; }
.bj-act-wrap em { font-size: 11px; font-style: normal; color: #c9c3b4; letter-spacing: .02em; }
.bj-betbox { display: grid; gap: 2px; justify-items: center; min-width: 110px; }
.bj-betbox > span { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: #9a9588; }
.bj-betbox output { min-width: 3rem; color: #fff; font-size: 1.2rem; font-weight: 700; text-align: center; }
.bj-chips {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 430px;
    padding: 2px 2px 4px;
    -webkit-overflow-scrolling: touch;
}
.bj-chip {
    appearance: none; width: 42px; height: 42px; border-radius: 50%; padding: 0;
    font-weight: 800; color: #f6f1e4; cursor: pointer;
    border: 4px dashed rgba(255,255,255,.55);
    box-shadow: 0 5px 0 rgba(0,0,0,.34), 0 8px 10px rgba(0,0,0,.18), inset 0 2px 5px rgba(255,255,255,.25);
    position: relative;
}
.bj-chip span { position: relative; z-index: 1; font-size: .72rem; -webkit-font-smoothing: antialiased; }
.bj-chip.c1 { background: radial-gradient(circle at 35% 30%, #e8e4dc, #9a9588); color: #1a1406; }
.bj-chip.c5 { background: radial-gradient(circle at 35% 30%, #f0d56a, #c89614); color: #1a1406; }
.bj-chip.c10 { background: radial-gradient(circle at 35% 30%, #7eb0e0, #2a5a96); }
.bj-chip.c25 { background: radial-gradient(circle at 35% 30%, #e07070, #8a2424); }
.bj-chip.c50 { background: radial-gradient(circle at 35% 30%, #a888d0, #4a2e78); }
.bj-chip.c100 { background: radial-gradient(circle at 35% 30%, #5a5a5a, #2a2a2a); }
.bj-chip.c500 { background: radial-gradient(circle at 35% 30%, #c9a14a, #7a5a14); color: #1a1406; }
.bj-chip.c1000 { background: radial-gradient(circle at 35% 30%, #5ee0a0, #0d5a32); }
.bj-chip.c1000 span { font-size: .58rem; }
.bj-chip.is-on { box-shadow: 0 0 0 2px #fff, 0 4px 0 rgba(0,0,0,.32); transform: translateY(-2px); }
.bj-chip:disabled { opacity: .4; cursor: not-allowed; }
.bj-act {
    appearance: none; width: 54px; min-width: 54px; height: 54px; padding: 0;
    border: 0; border-radius: 50%; font: inherit; font-weight: 800; font-size: .68rem;
    color: #fff; cursor: pointer;
    background: linear-gradient(180deg, #3a4258, #232836);
    box-shadow: 0 3px 0 #12151e;
}
.bj-act.hit { background: linear-gradient(180deg, #3ed67a, #168a44); box-shadow: 0 3px 0 #0d5a2c; }
.bj-act.stand { background: linear-gradient(180deg, #e45a5a, #a01818); box-shadow: 0 3px 0 #6a1010; }
.bj-act:disabled { opacity: .38; filter: grayscale(.3); cursor: not-allowed; box-shadow: none; }
.bj-window [data-action="deal"] { min-width: 72px; height: 40px; border-radius: 12px; padding: 0 14px; }
.bj-window.is-player [data-action="deal"] { display: none; }
.bj-window-foot {
    margin: 0; padding: 0 28px;
    background: #0c1421;
    color: #8b8578; font-size: 13px;
    display: flex; justify-content: space-between; align-items: center;
}
.bj-foot-brand {
    font-family: Cinzel, Georgia, serif;
    color: #cbb994;
}
.bj-foot-brand::before { content: "♛ "; color: #d4b46a; }

.bj-ref-overlay {
    display: none;
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 80;
}
.bj-ref-overlay.is-on { display: block; }
.bj-ref-overlay img {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1536px;
    height: 1024px;
    transform: translateX(-50%) scale(var(--bj-scale, 1));
    transform-origin: top center;
    opacity: 0.5;
    pointer-events: none;
}
.bj-ref-toggle {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 90;
    appearance: none;
    border: 1px solid #c4a15a;
    background: #121826;
    color: #f4efe4;
    border-radius: 8px;
    padding: 8px 12px;
    font: 600 12px/1 Manrope, sans-serif;
    cursor: pointer;
}

/* Blackjack fallback leftovers */
.bj-arena { width: min(980px, 100%); }
.felt-bj {
    min-height: 420px; border-radius: 50% 50% 18px 18px / 18% 18% 18px 18px;
    background: radial-gradient(circle at 50% 20%, #1c7a48, #0b3d24 70%);
    border: 14px solid #5b3b16; box-shadow: inset 0 0 80px rgba(0,0,0,.28);
    padding: 28px 20px 20px; display: grid; gap: 28px;
}
.hand-row h2 { margin: 0 0 8px; font-size: 1rem; color: #d9f0df; }
.cards { display: flex; flex-wrap: wrap; min-height: 132px; gap: 0; }
.pcard {
    width: 86px; height: 124px; margin-right: -28px; position: relative;
    transform-style: preserve-3d; animation: deal .35s ease both;
}
.pcard:last-child { margin-right: 0; }
.pcard .face, .pcard .back {
    position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden;
    box-shadow: 0 10px 16px rgba(0,0,0,.28);
}
.pcard .face {
    background: linear-gradient(180deg, #fffdf8, #efe6d6);
    color: #111; padding: 8px; font-weight: 800; display: grid; align-content: space-between;
}
.pcard .face.red { color: #b81d1d; }
.pcard .back {
    background:
        radial-gradient(ellipse at 50% 50%, #151d34 0 18%, transparent 19%),
        repeating-linear-gradient(45deg, rgba(212,180,106,.18) 0 2px, transparent 2px 10px),
        repeating-linear-gradient(-45deg, rgba(212,180,106,.12) 0 2px, transparent 2px 10px),
        linear-gradient(180deg, #1a2748, #10182c);
    border: 3px solid #d4b46a; transform: rotateY(180deg);
}
.pcard.is-down { transform: rotateY(180deg); }
.pcard.is-flip { animation: flip .55s ease forwards; }
@keyframes deal { from { transform: translate(80px,-40px) rotate(12deg); opacity: 0; } }
@keyframes flip { from { transform: rotateY(180deg); } to { transform: rotateY(0); } }

.loading-bar { position: absolute; left: 10%; right: 10%; top: 48%; height: 4px; background: rgba(255,255,255,.08); overflow: hidden; border-radius: 99px; display: none; }
.loading-bar.is-on { display: block; }
.loading-bar i { display: block; height: 100%; width: 40%; background: #f5c14a; animation: load 1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-120%); } to { transform: translateX(280%); } }

@media (max-width: 860px) {
    .game-body.theme-blackjack {
        overflow: hidden;
        padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    }
    .bj-viewport {
        width: 100%;
        height: 100dvh;
        display: block;
        overflow: hidden;
    }
    .bj-page {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        flex: none;
        transform: none !important;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        box-sizing: border-box;
    }
    .bj-sitebar { display: none; }
    .bj-window.playfield {
        position: relative;
        top: auto;
        left: auto;
        width: calc(100vw - 12px);
        height: calc(100dvh - 12px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: none;
        margin: 0 auto;
        grid-template-rows: 52px minmax(0, 1fr) auto 20px;
        border-radius: 14px;
        overflow: hidden;
    }
    .bj-hud {
        padding: 0 10px;
        min-height: 52px;
    }
    .bj-hud .hud-brand { gap: 6px; align-items: center; }
    .bj-suit { font-size: 1rem; }
    .hud-name { font-size: 1rem; }
    .bj-sub { margin: 0; font-size: .62rem; }
    .bj-icon { width: 28px; height: 28px; border-radius: 7px; }
    .bj-hud .bj-icon[aria-label="Minimise"] { display: none; }
    .hud-tools { gap: 6px; flex-shrink: 0; }
    .bj-hud-credits {
        display: block;
        margin-left: auto;
        margin-right: 8px;
        color: #ffe28a;
        font-size: .72rem;
        font-weight: 700;
        white-space: nowrap;
        letter-spacing: .01em;
        -webkit-font-smoothing: antialiased;
    }

    .bj-table-stage {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px 8px;
        background: #0c1421;
    }
    .bj-table {
        width: 100%;
        height: min(100%, 460px);
        max-height: 100%;
        aspect-ratio: 1 / 1.02;
        padding: 7px;
        display: grid;
        place-items: center;
    }
    .bj-felt {
        border-radius: 48% / 42%;
        width: 100%;
        height: 100%;
    }
    .bj-discard,
    .bj-shoe,
    .bj-tray,
    .bj-rs,
    .bj-values { display: none !important; }

    .bj-copy {
        top: 38%;
        width: 86%;
    }
    .bj-copy strong { font-size: 11px; letter-spacing: .1em; }
    .bj-copy span { font-size: 9px; margin-top: 2px; letter-spacing: .08em; }
    .bj-copy span:last-of-type { font-size: 8px; opacity: .7; }
    .bj-copy::after { width: 140px; margin-top: 4px; }

    .bj-hand { left: 50%; transform: translateX(-50%); gap: 8px; }
    .bj-dealer { top: 4%; }
    .bj-player { top: calc(52% - 19px); }
    .bj-cards { gap: 6px; }
    .bj-dealer .bj-card { width: 64px; height: 90px; }
    .bj-player .bj-card { width: 81px; height: 113px; }
    .bj-pill { min-width: 24px; height: 22px; font-size: .78rem; padding: 0 7px; }
    .bj-player .bj-card.is-deal { --deal-x: 90px; --deal-y: -110px; }
    .bj-dealer .bj-card.is-deal { --deal-x: 80px; --deal-y: 6px; }

    .bj-spot {
        top: auto;
        bottom: 5%;
        width: 64px;
    }
    .bj-spot::before { width: 64px; height: 40px; }
    .bj-table-chip { width: 32px; height: 32px; font-size: .64rem; }
    .bj-spot-mark { font-size: 13px; }

    .theme-blackjack .toast {
        position: absolute;
        top: 50%;
        bottom: auto;
        min-width: 0;
        width: min(168px, 64%);
        padding: 6px 10px;
        font-size: .72rem;
        border-radius: 10px;
        letter-spacing: .04em;
        z-index: 5;
    }
    .theme-blackjack .toast.is-on { transform: translate(-50%, -110%) scale(1); }
    .theme-blackjack .toast.big { font-size: .8rem; box-shadow: 0 0 16px rgba(245,193,74,.18); }

    .bj-dock {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "bet chips" "acts acts";
        align-items: center;
        gap: 8px 10px;
        padding: 8px 10px 6px;
        margin: 0;
    }
    .bj-betbox { grid-area: bet; min-width: 0; gap: 0; }
    .bj-betbox > span { font-size: .52rem; }
    .bj-betbox output { font-size: 1rem; min-width: 2rem; }
    .bj-chips {
        grid-area: chips;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-end;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }
    .bj-chip { width: 34px; height: 34px; border-width: 3px; flex: 0 0 34px; }
    .bj-chip span { font-size: .62rem; }
    .bj-acts {
        grid-area: acts;
        margin-left: 0;
        width: 100%;
        justify-content: center;
        gap: 10px;
        align-items: center;
    }
    .bj-window [data-action="deal"] {
        min-width: 0;
        flex: 1 1 40%;
        height: 48px;
        border-radius: 12px;
        font-size: .95rem;
    }
    .bj-act.hit,
    .bj-act.stand {
        width: 64px;
        min-width: 64px;
        height: 48px;
        border-radius: 14px;
        font-size: .78rem;
    }
    .bj-act-wrap em { font-size: 10px; }
    .bj-act-wrap:nth-last-child(-n+2) .bj-act {
        width: 40px;
        min-width: 40px;
        height: 40px;
        opacity: .38;
    }
    .bj-window-foot {
        padding: 0 10px;
        font-size: 10px;
        min-height: 20px;
    }
}

@media (max-width: 400px) {
    .bj-hud-credits { font-size: .64rem; margin-right: 6px; }
    .bj-table { aspect-ratio: 1 / 1; }
    .bj-dealer .bj-card { width: 60px; height: 84px; }
    .bj-player .bj-card { width: 74px; height: 104px; }
    .bj-copy strong { font-size: 10px; }
    .bj-chip { width: 30px; height: 30px; flex-basis: 30px; }
}

@media (min-width: 401px) and (max-width: 860px) and (min-height: 800px) {
    .bj-table { aspect-ratio: 1.08 / 1; max-height: 52vh; }
    .bj-dealer .bj-card { width: 70px; height: 98px; }
    .bj-player .bj-card { width: 85px; height: 119px; }
}

@media (max-width: 900px) {
    .roulette-arena { grid-template-columns: 1fr; }
    .wheel-3d { width: 240px; height: 240px; }
    .reel { height: 216px; }
    .sym { height: 72px; }
    .sym img { width: 62px; height: 62px; }
}
@media (max-width: 680px) {
    .game-hud { flex-direction: column; align-items: stretch; }
    .hud-meta { justify-content: space-between; }
    .machine { border-width: 5px; padding: 10px; }
    .reel { height: 168px; }
    .sym { height: 56px; }
    .sym img { width: 48px; height: 48px; }
    .game-dock { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.55) 20%, rgba(0,0,0,.8)); }
    .gbtn { min-height: 48px; padding: 12px 16px; }
    .euro-grid { grid-template-columns: 28px repeat(12, 1fr) 28px; }
    .euro-grid button { min-height: 32px; font-size: .72rem; }
    .pcard { width: 68px; height: 98px; margin-right: -22px; }
    .scene-mount { height: min(52vh, 520px); min-height: 280px; border-radius: 14px; }
    .theme-blackjack .scene-mount { height: 100%; min-height: 0; }
}
@media (max-height: 500px) and (orientation: landscape) {
    .playfield { grid-template-rows: auto 1fr auto; }
    .reel { height: 150px; }
    .felt-bj { min-height: 220px; padding: 12px; }
    .scene-mount { height: min(68vh, 420px); min-height: 220px; }
    .theme-blackjack .scene-mount { height: 100%; min-height: 0; }
    .game-hud { padding: 6px 10px; }
}

@media (max-width: 860px) and (orientation: landscape) {
    .game-body.theme-blackjack { overflow: hidden; }
    .bj-viewport { height: 100dvh; overflow: hidden; display: block; }
    .bj-page {
        width: 100%;
        height: 100dvh;
        transform: none !important;
        padding: env(safe-area-inset-top) 6px env(safe-area-inset-bottom);
    }
    .bj-sitebar { display: none; }
    .bj-window.playfield {
        position: relative;
        top: auto; left: auto;
        width: calc(100vw - 12px);
        height: calc(100dvh - 10px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        grid-template-rows: 40px minmax(0, 1fr) 64px 0;
        border-radius: 12px;
    }
    .bj-hud { padding: 0 10px; min-height: 40px; }
    .bj-sub { display: none; }
    .bj-table-stage { padding: 2px 8px; }
    .bj-table {
        width: min(100%, 640px);
        aspect-ratio: 2 / 1;
        max-height: 100%;
        height: auto;
        padding: 6px;
    }
    .bj-felt { border-radius: 46% / 48%; }
    .bj-discard, .bj-shoe, .bj-tray, .bj-rs, .bj-values { display: none !important; }
    .bj-copy { top: 36%; }
    .bj-copy strong { font-size: 11px; }
    .bj-copy span { font-size: 8px; margin-top: 1px; }
    .bj-copy span:last-of-type { display: none; }
    .bj-hand { gap: 4px; }
    .bj-dealer { top: 4%; }
    .bj-player { top: 46%; }
    .bj-dealer .bj-card { width: 58px; height: 81px; }
    .bj-player .bj-card { width: 64px; height: 90px; }
    .bj-spot { top: auto; bottom: 4%; }
    .bj-dock {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        padding: 4px 10px;
    }
    .bj-acts { margin-left: auto; }
    .bj-chips { overflow-x: auto; min-width: 0; flex: 1; }
    .bj-chip { width: 30px; height: 30px; }
    .bj-window [data-action="deal"] { height: 40px; flex: 0 0 auto; min-width: 72px; }
    .bj-act.hit, .bj-act.stand { width: 48px; min-width: 48px; height: 40px; }
    .bj-window-foot { display: none; overflow: hidden; }
    .theme-blackjack .toast { top: 32%; width: min(220px, 50%); padding: 6px 10px; font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.06); }
.table-wrap { overflow-x: auto; }
.muted { color: #b7b1a4; }
