/**
 * Character selection, controls, settings and fullscreen UX.
 */

.bgf-character-select {
    position: absolute;
    z-index: 8;
    inset: 0;
    display: grid;
    align-content: center;
    gap: clamp(10px, 2vh, 18px);
    overflow: auto;
    padding: clamp(18px, 4vw, 42px);
    background: color-mix(in srgb, var(--boost-ui-bg) 96%, transparent);
    color: var(--boost-ui-text);
    overscroll-behavior: contain;
}


.bgf-player-intro {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(100%, 720px);
    margin: auto;
    text-align: center;
}

.bgf-player-intro h2,
.bgf-player-intro p {
    margin: 0;
}

.bgf-player-intro h2 {
    max-width: 18ch;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
}

.bgf-player-intro .bgf-game-funnel__lead {
    max-width: 60ch;
    color: var(--boost-ui-text-muted);
    font-size: clamp(0.98rem, 2vw, 1.2rem);
    line-height: 1.6;
}

.bgf-player-intro__actions {
    justify-content: center;
    margin-top: 6px;
}

.bgf-player-setup__details {
    display: grid;
    gap: clamp(10px, 1.6vh, 14px);
    width: min(100%, 780px);
    margin: 0 auto;
}

.bgf-player-setup__details[hidden] {
    display: none;
}

.bgf-player-setup__details .bgf-character-select__copy {
    padding-right: 0;
    text-align: center;
}

.bgf-player-setup__details .bgf-character-select__copy h3 {
    margin: 0;
    font-size: clamp(1.2rem, 2.7vw, 1.8rem);
    line-height: 1.15;
}

.bgf-setup-dimension {
    display: grid;
    gap: 8px;
}

.bgf-setup-dimension__title {
    margin: 0;
    color: var(--boost-ui-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bgf-character-select__copy {
    padding-right: min(156px, 16vw);
}

.bgf-character-select__copy h2 {
    max-width: 20ch;
    margin: 0 0 8px;
    font-size: clamp(1.55rem, 4vw, 3rem);
}

.bgf-character-select__copy h3 {
    margin: 0;
    font-size: clamp(0.95rem, 2vw, 1.25rem);
}

.bgf-character-carousel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.bgf-character-carousel[data-bgf-navigation="hidden"] {
    grid-template-columns: minmax(0, 1fr);
}

.bgf-character-carousel__arrow,
.bgf-icon-button {
    border: 1px solid color-mix(in srgb, var(--boost-ui-secondary) 22%, var(--boost-ui-border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--boost-ui-surface) 92%, transparent);
    color: var(--boost-ui-text);
    cursor: pointer;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--boost-ui-secondary) 12%, transparent);
    touch-action: manipulation;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.bgf-character-carousel__arrow {
    min-width: 46px;
    min-height: 68px;
    padding: 8px;
    font-weight: 800;
}

.bgf-character-carousel__arrow:hover,
.bgf-game-funnel[data-bgf-settings-open="true"] [data-bgf-action="settings"],
.bgf-icon-button:hover {
    background: var(--boost-ui-bg-alt);
    border-color: color-mix(in srgb, var(--boost-ui-primary) 34%, var(--boost-ui-border));
    transform: translateY(-1px);
    box-shadow: 0 14px 26px color-mix(in srgb, var(--boost-ui-secondary) 16%, transparent);
}

.bgf-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
    touch-action: pan-y;
}

.bgf-profile-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 7px 10px;
    min-width: 0;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--boost-ui-secondary) 18%, var(--boost-ui-border));
    border-radius: 16px;
    background: var(--boost-ui-surface);
    color: var(--boost-ui-text);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--boost-ui-secondary) 10%, transparent);
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.bgf-character-card {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 76px;
}

.bgf-profile-card:hover,
.bgf-profile-card[aria-selected="true"] {
    border-color: color-mix(in srgb, var(--boost-ui-primary) 58%, var(--boost-ui-border));
    box-shadow: 0 16px 34px color-mix(in srgb, var(--boost-ui-primary) 16%, transparent);
    transform: translateY(-1px);
}

.bgf-profile-card__avatar {
    position: relative;
    grid-row: auto;
    width: 32px;
    height: 32px;
    margin-top: 2px;
    border-radius: 10px;
    background: var(--boost-ui-primary);
    box-shadow: 0 10px 18px color-mix(in srgb, var(--boost-ui-secondary) 16%, transparent);
}

.bgf-profile-card__avatar::after {
    position: absolute;
    top: 8px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: var(--boost-ui-primary-contrast);
    content: "";
}

.bgf-profile-card__avatar[data-bgf-profile-avatar="micro-business-owner"] {
    background: var(--boost-ui-secondary);
}

.bgf-profile-card__avatar[data-bgf-profile-avatar="small-agency"] {
    background: var(--boost-ui-accent);
}

.bgf-profile-card__title {
    align-self: center;
    min-width: 0;
    font-size: clamp(0.78rem, 1.5vw, 0.94rem);
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.bgf-character-select__position {
    margin: 0;
    color: var(--boost-ui-primary);
    font-size: clamp(0.66rem, 1.25vw, 0.8rem);
    font-weight: 800;
}




@media (prefers-reduced-motion: reduce) {
    .bgf-profile-card,
    .bgf-character-carousel__arrow,
    .bgf-icon-button,
    .bgf-pixel-button {
        transition: none;
    }
}

.bgf-touch-hint {
    position: absolute;
    z-index: 13;
    right: calc(max(12px, var(--boost-game-safe-area-right)) + var(--_shell-controls-width, 0px) + 12px);
    bottom: max(16px, var(--boost-game-safe-area-bottom));
    left: max(12px, var(--boost-game-safe-area-left));
    max-width: 360px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--boost-ui-secondary) 14%, var(--boost-ui-border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--boost-ui-surface) 90%, transparent);
    color: var(--boost-ui-text-muted);
    font-size: clamp(0.62rem, 1.5vw, 0.76rem);
    overflow-wrap: anywhere;
    pointer-events: none;
}


.bgf-pre-game {
    position: absolute;
    z-index: 24;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(14px, 4vw, 34px);
    background: var(--boost-ui-bg-alt);
}

.bgf-game-funnel[data-bgf-mode="pre-game"] [data-bgf-canvas],
.bgf-game-funnel[data-bgf-mode="pre-game"] [data-bgf-hud],
.bgf-game-funnel[data-bgf-mode="pre-game"] [data-bgf-stage-indicator] {
    visibility: hidden;
}

.bgf-pre-game__card {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(100%, 480px);
    padding: clamp(18px, 3vw, 30px);
    border: 1px solid color-mix(in srgb, var(--boost-ui-secondary) 22%, var(--boost-ui-border));
    border-radius: 24px;
    background: var(--boost-ui-surface);
    color: var(--boost-ui-text);
    box-shadow: 0 28px 60px color-mix(in srgb, var(--boost-ui-secondary) 20%, transparent);
    text-align: center;
}

.bgf-pre-game__card h2,
.bgf-pre-game__card p {
    margin: 0;
}

.bgf-pre-game__stage {
    color: var(--boost-ui-text-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.bgf-pre-game__countdown {
    display: grid;
    place-items: center;
    min-height: 74px;
    color: var(--boost-ui-primary);
    font-size: clamp(2rem, 6vw, 3.4rem);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.bgf-pre-game__countdown[data-bgf-state="ready"] {
    color: var(--boost-ui-success);
}

.bgf-pre-game .bgf-game-funnel__actions {
    justify-content: center;
}


.bgf-game-funnel[data-bgf-mode="pre-game"] .bgf-shell-controls,
.bgf-game-funnel[data-bgf-mode="pre-game"] .bgf-touch-hint {
    display: none;
}
