/*
 * sheets.css — Bottom sheets for History and Rules.
 *
 * Shared dim layer + slide-up sheet. Both sheets dim the game behind them,
 * leaving the top HUD readable so the user can still see balance/seats.
 */

#bj-sheet-scrim {
    position: absolute;
    inset: 0;
    z-index: var(--z-sheet);
    background: rgba(0, 0, 0, 0.55);
    pointer-events: auto;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--t-med) var(--ease-out-quint);
}

#bj-sheet-scrim.is-open {
    opacity: 1;
}

#bj-sheet-scrim.is-hidden {
    pointer-events: none;
}

.bj-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--z-sheet) + 1);
    background: var(--surface-2);
    border-top-left-radius: var(--r-xl);
    border-top-right-radius: var(--r-xl);
    border-top: 1px solid var(--hairline);
    box-shadow: var(--shadow-panel);
    max-height: 70dvh;
    transform: translateY(100%);
    transition: transform var(--t-slow) var(--ease-out-quint);
    pointer-events: auto;
    padding-bottom: var(--safe-bottom);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bj-sheet.is-open {
    transform: translateY(0);
}

.bj-sheet__grabber {
    width: 36px;
    height: 4px;
    background: var(--hairline-strong);
    border-radius: var(--r-pill);
    margin: 8px auto 4px;
}

.bj-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 16px 8px;
}

.bj-sheet__title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.bj-sheet__close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast);
}

.bj-sheet__close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
}

.bj-sheet__body {
    overflow-y: auto;
    padding: 0 16px 20px;
    -webkit-overflow-scrolling: touch;
}

/* ── History sheet ───────────────────────────────────────────────────────── */
.bj-history-list {
    display: flex;
    flex-direction: column;
}

.bj-history-head {
    display: grid;
    grid-template-columns: 40px 1fr 70px 70px;
    gap: 8px;
    padding: 6px 4px;
    font-size: 9px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700;
    border-bottom: 1px solid var(--hairline);
}

.bj-history-row {
    display: grid;
    grid-template-columns: 40px 1fr 70px 70px;
    gap: 8px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--hairline);
    align-items: center;
}

.bj-history-row__id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

.bj-history-row__result {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.bj-history-row__totals {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.bj-history-row__bet,
.bj-history-row__pl {
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: right;
}

.bj-history-row__pl--win  { color: var(--win); }
.bj-history-row__pl--lose { color: var(--lose); }
.bj-history-row__pl--push { color: var(--text-tertiary); }

.bj-history-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ── Rules sheet ─────────────────────────────────────────────────────────── */
.bj-rules-section {
    margin-top: 14px;
}

.bj-rules-section__title {
    font-size: 9px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700;
    margin-bottom: 6px;
}

.bj-rules-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--hairline);
    align-items: center;
    font-size: 14px;
    color: var(--text-primary);
}

.bj-rules-row__value {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 13px;
}
