/* Gaming Bureau — the game table: stage frame and the shared control deck.
   Engine styles live in cdn/css/engines/<engine>.css and scope themselves
   under .bx-eng--<engine>. Tokens come from bureau.css (repeated here as
   fallbacks so an engine can be previewed on its own). */

.bx-table {
    --bx-bg: #120d1c;
    --bx-ink: #f3ecdf;
    --bx-muted: #b9aecb;
    --bx-jade: #3fe0b0;
    --bx-coral: #ff6b57;
    --bx-gold: #f5c451;
    --bx-line: rgba(243, 236, 223, .14);
    --bx-felt: #1b1428;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 0;
    color: var(--bx-ink);
    background: var(--bx-felt);
    border-radius: 18px;
    overflow: hidden;
}

.bx-table__art {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .55;
}

.bx-table__art + .bx-table__veil {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(120% 90% at 50% 20%, rgba(18, 13, 28, .2), rgba(18, 13, 28, .85) 70%);
}

.bx-table [data-engine-root] {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.bx-board {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 16px;
    min-height: 300px;
}

/* ---------------------------------------------------------------- deck */

.bx-deck {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 16px;
    padding: 12px 16px 16px;
    background: linear-gradient(180deg, rgba(18, 13, 28, 0), rgba(18, 13, 28, .92) 30%);
    border-top: 1px solid var(--bx-line);
}

.bx-deck .bx-status {
    flex-basis: 100%;
    order: 9;
}

.bx-stake {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--bx-line);
    border-radius: 999px;
    background: rgba(243, 236, 223, .05);
}

.bx-stake__label,
.bx-seg__label {
    padding-left: 10px;
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bx-muted);
}

.bx-stake__val {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 76px;
    line-height: 1.1;
}

.bx-stake__val b {
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.bx-stake__val small {
    font-size: .7rem;
    color: var(--bx-muted);
}

.bx-stake__btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: var(--bx-ink);
    background: rgba(243, 236, 223, .1);
    cursor: pointer;
    transition: background-color .15s ease-out, transform .12s ease-out;
}

.bx-stake__btn:hover:not(:disabled) { background: rgba(243, 236, 223, .2); }
.bx-stake__btn:active:not(:disabled) { transform: scale(.94); }
.bx-stake__btn:disabled { opacity: .35; cursor: default; }

.bx-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 168px;
    min-height: 56px;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: .02em;
    color: #0d1a14;
    background: linear-gradient(180deg, #6ff0c8, var(--bx-jade));
    box-shadow: 0 10px 24px -10px rgba(63, 224, 176, .7), inset 0 1px 0 rgba(255, 255, 255, .45);
    cursor: pointer;
    transition: transform .14s ease-out, filter .15s ease-out, box-shadow .2s ease-out;
}

.bx-play:hover:not(:disabled) { filter: brightness(1.06); }
.bx-play:active:not(:disabled) { transform: scale(.97); }
.bx-play:disabled { filter: grayscale(.8) brightness(.7); cursor: default; box-shadow: none; }

.bx-btn2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--bx-line);
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    color: var(--bx-ink);
    background: rgba(243, 236, 223, .08);
    cursor: pointer;
    transition: background-color .15s ease-out, transform .12s ease-out;
}

.bx-btn2:hover:not(:disabled) { background: rgba(243, 236, 223, .16); }
.bx-btn2:active:not(:disabled) { transform: scale(.97); }
.bx-btn2:disabled { opacity: .4; cursor: default; }
.bx-btn2[aria-pressed="true"] { border-color: var(--bx-jade); color: var(--bx-jade); }

.bx-seg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bx-seg__opts {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--bx-line);
    border-radius: 999px;
}

.bx-seg__opt {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    color: var(--bx-muted);
    background: transparent;
    cursor: pointer;
    transition: background-color .15s ease-out, color .15s ease-out;
}

.bx-seg__opt[aria-pressed="true"] {
    color: #0d1a14;
    background: var(--bx-gold);
}

.bx-seg__opt:disabled { cursor: default; opacity: .6; }

.bx-status {
    margin: 0;
    min-height: 1.5em;
    text-align: center;
    font-weight: 600;
    color: var(--bx-muted);
}

.bx-status[data-tone="win"] { color: var(--bx-gold); }
.bx-status[data-tone="back"] { color: var(--bx-ink); }
.bx-status[data-tone="info"] { color: var(--bx-jade); }

.bx-i { display: inline-grid; place-items: center; }
.bx-i svg { display: block; }

.bx-sym {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
}

.bx-sym--text {
    display: grid;
    place-items: center;
    font-size: .7rem;
    font-weight: 700;
    text-align: center;
    color: var(--bx-muted);
}

.bx-table :focus-visible {
    outline: 3px solid var(--bx-gold);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .bx-deck { gap: 10px; padding: 10px 10px 14px; }
    .bx-play { min-width: 140px; min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    .bx-table *, .bx-table *::before, .bx-table *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
