:root {
    --bm-game-accent: #8b5cf6;
    --bm-game-accent-2: #3b82f6;
    --bm-game-text: #f8fafc;
    --bm-game-muted: #94a3b8;
    --bm-game-surface: rgba(255, 255, 255, 0.06);
    --bm-game-border: rgba(255, 255, 255, 0.14);
    --bm-game-shadow: rgba(0, 0, 0, 0.35);
}

.bm-game-shell {
    width: 100%;
}

.bm-game-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

.bm-game-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.bm-game-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    background: linear-gradient(135deg, var(--bm-game-accent), var(--bm-game-accent-2));
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.25);
}

.bm-game-title-wrap {
    min-width: 0;
}

.bm-game-title {
    margin: 0;
    line-height: 1.05;
}

.bm-game-subtitle {
    margin-top: 0.15rem;
    color: var(--bm-game-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
}

.bm-stat-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bm-stat-pill {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--bm-game-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--bm-game-text);
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1;
}

.bm-stat-pill[data-tone="live"] {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(74, 222, 128, 0.35);
}

.bm-stat-pill[data-tone="score"] {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
}

.bm-stat-pill[data-tone="timer"] {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(168, 85, 247, 0.35);
    font-variant-numeric: tabular-nums;
}

.bm-help-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: var(--bm-game-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
}

.bm-help-btn:hover,
.bm-help-btn:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--bm-game-accent);
    outline: none;
}

.bm-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.bm-control-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid var(--bm-game-border);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.45rem;
}

.bm-modal {
    background: rgba(13, 12, 34, 0.74);
    backdrop-filter: blur(6px);
}

.bm-modal-card {
    border-radius: 20px;
    border: 1px solid var(--bm-game-border);
    background: rgba(30, 27, 75, 0.96);
    box-shadow: 0 24px 70px var(--bm-game-shadow);
}

.bm-rules-modal {
    max-height: min(86vh, 680px);
    overflow: auto;
}

.bm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

@media (max-width: 640px) {
    .bm-game-header {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .bm-stat-row {
        justify-content: flex-start;
        gap: 0.4rem;
    }

    .bm-stat-pill {
        min-height: 32px;
        padding: 0.3rem 0.6rem;
        font-size: 0.78rem;
    }

    .bm-game-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 10px;
    }

    .bm-help-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .bm-control-bar {
        align-items: stretch;
    }

    .bm-control-group {
        flex: 1 1 auto;
    }

    .bm-modal-actions {
        flex-direction: column;
    }
}
