/* Shared product shell — common hierarchy, controls, and motion across Arena and Clubhouse scenes. */

:root {
    color-scheme: dark;
    --product-control-compact: 44px;
    --product-control-regular: 52px;
    --product-control-large: 56px;
    --product-radius-control: 12px;
    --product-line: rgba(235, 255, 243, 0.18);
    --product-line-strong: rgba(235, 255, 243, 0.24);
    --product-surface: rgba(11, 19, 14, 0.9);
    --product-surface-hover: rgba(19, 33, 25, 0.92);
    --product-green: var(--action-primary-bg);
    --product-green-hover: var(--action-primary-hover);
    --product-green-line: rgba(92, 221, 143, 0.42);
    --product-focus: #62e39a;
    --product-error: #ffaaa6;
    --product-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

.app-page-header {
    grid-template-columns: minmax(52px, 1fr) minmax(0, auto) minmax(52px, 1fr);
    align-items: center;
}

.app-page-header--arena,
.app-page-header--clubhouse-content {
    min-height: 56px;
    margin-bottom: 12px;
}

.app-page-header--clubhouse {
    min-height: 72px;
    margin: 0;
    padding: max(10px, env(safe-area-inset-top)) clamp(16px, 3vw, 30px) 10px;
    border-bottom: 1px solid var(--product-line);
    background: rgba(5, 8, 6, 0.96);
}

.app-page-header .lobby-main-header {
    min-width: 0;
    margin-inline: 12px;
}

.app-page-title {
    max-width: min(70vw, 640px);
    margin: 0;
    padding: 0 0.12em 0 0;
    color: #f5f8f6;
    font-family: var(--font-head);
    font-size: clamp(2rem, 3.25vw, 2.8rem);
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.035em;
    line-height: 0.98;
    text-align: center;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.34);
    text-transform: uppercase;
    text-wrap: balance;
}

.app-page-header--clubhouse .app-page-title,
.app-page-header--clubhouse-content .app-page-title {
    font-size: clamp(1.45rem, 2.3vw, 1.7rem);
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1;
}

.app-back-button,
.lobby-btn-lg.app-back-button,
.shop-v3-back.app-back-button {
    display: inline-grid;
    place-items: center;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    border: 1px solid var(--product-line) !important;
    border-radius: var(--product-radius-control) !important;
    background: var(--product-surface) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 4px 8px rgba(0, 0, 0, 0.28) !important;
    color: rgba(245, 248, 246, 0.9) !important;
    cursor: pointer;
    text-decoration: none;
    transform: translate3d(0, 0, 0);
    transition: background-color 160ms var(--product-ease-out), border-color 160ms var(--product-ease-out), color 160ms var(--product-ease-out), transform 140ms var(--product-ease-out), box-shadow 160ms var(--product-ease-out);
}

.app-back-button svg,
.lobby-btn-lg.app-back-button svg,
.shop-v3-back.app-back-button svg {
    width: 22px !important;
    height: 22px !important;
    fill: none !important;
    stroke: currentColor !important;
    filter: none;
    transition: transform 160ms var(--product-ease-out);
}

.app-back-button:focus-visible,
.app-primary-action:focus-visible {
    outline: 3px solid var(--product-focus);
    outline-offset: 3px;
}

.app-back-button:active,
.lobby-btn-lg.app-back-button:active,
.shop-v3-back.app-back-button:active {
    transform: translate3d(0, 1px, 0) scale(0.98);
}

.app-primary-action,
.btn-start.app-primary-action,
.action-btn-wide.app-primary-action,
.dock-btn.app-primary-action,
.shop-v3-primary.app-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0;
    padding-block: 0 !important;
    padding-inline: 24px !important;
    overflow: hidden;
    border: 1px solid var(--product-green-line) !important;
    border-radius: var(--product-radius-control) !important;
    background: var(--product-green) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 4px 8px rgba(0, 0, 0, 0.28) !important;
    color: var(--action-primary-text) !important;
    font-family: var(--font-action);
    font-size: 1rem !important;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1;
    text-transform: uppercase;
    transform: translate3d(0, 0, 0);
    transition: background-color 160ms var(--product-ease-out), border-color 160ms var(--product-ease-out), transform 140ms var(--product-ease-out), box-shadow 160ms var(--product-ease-out), opacity 160ms ease;
}

.app-primary-action.app-primary-action--compact {
    min-height: var(--product-control-compact) !important;
    padding-inline: 18px !important;
    font-size: 0.9rem !important;
}

/* Legacy wide-button labels must follow the shared control typography. */
.action-btn-wide.app-primary-action > span {
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.app-primary-action.app-primary-action--regular {
    min-height: var(--product-control-regular) !important;
}

.app-primary-action.app-primary-action--large {
    min-height: var(--product-control-large) !important;
    padding-inline: 30px !important;
    font-size: 1.05rem !important;
}

.app-primary-action::before,
.app-primary-action::after {
    display: none !important;
}

.app-primary-action svg {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    stroke: currentColor !important;
}

.app-primary-action:active,
.btn-start.app-primary-action:active,
.action-btn-wide.app-primary-action:active,
.dock-btn.app-primary-action:active,
.shop-v3-primary.app-primary-action:active {
    transform: translate3d(0, 1px, 0) scale(0.99);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 4px 8px rgba(0, 0, 0, 0.25) !important;
}

.app-primary-action:disabled {
    cursor: default;
    filter: saturate(0.55);
    opacity: 0.48;
}

/* Segmented navigation */
.app-segmented {
    display: flex;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    padding: 4px;
    border: 1px solid var(--product-line);
    border-radius: var(--product-radius-control);
    background: rgba(7, 13, 9, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.app-segmented .app-segmented__item,
.shop-v3-tabs .app-segmented__item,
.profile-tab-bar .app-segmented__item {
    position: relative;
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 42px;
    padding: 0 16px;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #91a098 !important;
    font-family: var(--font-tech);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.075em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 160ms var(--product-ease-out), color 160ms var(--product-ease-out), transform 120ms var(--product-ease-out);
}

.app-segmented .app-segmented__item::after {
    display: none !important;
}

.app-segmented .app-segmented__item svg {
    opacity: 0.72;
    stroke: currentColor !important;
    transition: opacity 160ms var(--product-ease-out);
}

.app-segmented .app-segmented__item.active,
.app-segmented .app-segmented__item[aria-selected="true"] {
    background: rgba(31, 76, 48, 0.72) !important;
    box-shadow: inset 0 -2px 0 var(--product-green-hover) !important;
    color: #fff !important;
}

.app-segmented .app-segmented__item.active svg,
.app-segmented .app-segmented__item[aria-selected="true"] svg {
    opacity: 1;
    stroke: currentColor !important;
}

.app-segmented .app-segmented__item:focus-visible {
    z-index: 1;
    outline: 3px solid var(--product-focus);
    outline-offset: 1px;
}

.app-segmented .app-segmented__item:active {
    transform: scale(0.98);
}

.shop-v3-tabs.app-segmented {
    width: min(360px, calc(100% - 48px));
    height: auto;
    min-height: 52px;
    border-bottom: 1px solid var(--product-line);
    background: rgba(5, 8, 6, 0.96);
}

.profile-tab-bar.app-segmented {
    margin-bottom: 1.25rem;
}

/* Shared form controls */
.app-field {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: var(--product-control-compact);
    border: 1px solid var(--product-line);
    border-radius: 10px;
    background: rgba(7, 13, 9, 0.9);
    transition: background-color 160ms var(--product-ease-out), border-color 160ms var(--product-ease-out), box-shadow 160ms var(--product-ease-out);
}

.app-field:focus-within {
    border-color: var(--product-focus);
    background: rgba(11, 22, 15, 0.96);
    outline: 2px solid var(--product-focus);
    outline-offset: 2px;
}

.app-field-control,
.app-scene .cyber-input,
.app-scene .cyber-select {
    min-height: var(--product-control-compact);
    border: 1px solid var(--product-line) !important;
    border-radius: 10px !important;
    background-color: rgba(7, 13, 9, 0.9) !important;
    box-shadow: none !important;
    color: #f3f7f4 !important;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background-color 160ms var(--product-ease-out), border-color 160ms var(--product-ease-out), box-shadow 160ms var(--product-ease-out);
}

.app-scene .cyber-select.select-sm {
    width: 100%;
    height: var(--product-control-compact) !important;
    min-height: var(--product-control-compact) !important;
    padding: 0 30px 0 11px;
    background-position: right 10px center;
    background-size: 10px auto;
    font-size: 0.875rem;
    font-weight: 700;
}

.app-field-control:focus,
.app-scene .cyber-input:focus,
.app-scene .cyber-select:focus {
    outline: 2px solid var(--product-focus);
    outline-offset: 2px;
    border-color: var(--product-focus) !important;
    background-color: rgba(11, 22, 15, 0.96) !important;
    box-shadow: none !important;
}

.app-field-control[aria-invalid="true"],
.app-scene .cyber-input[aria-invalid="true"],
.app-scene .cyber-select[aria-invalid="true"] {
    border-color: var(--product-error) !important;
}

.app-field-control::placeholder,
.app-scene .cyber-input::placeholder {
    color: #a6b2ab !important;
    font-style: normal;
    opacity: 1;
}

.app-field-label,
.app-scene .setting-group > label,
.app-scene .setting-group-inline > label {
    padding-left: 0;
    color: #a8b4ad;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.app-field.app-field--search {
    min-height: var(--product-control-compact);
    padding: 0 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.app-field.app-field--search .app-field-control {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0;
}

.search-container.app-field--search {
    padding: 0;
}

.search-container.app-field--search .app-field-control {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 12px 0 42px !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.shop-v3-search.app-field--search svg {
    flex: 0 0 auto;
    color: #a8b4ad;
}

/* Choice chips */
.app-choice-group,
.app-scene .pill-checkbox-group {
    gap: 6px;
}

.app-choice-group span,
.app-scene .pill-checkbox span,
.app-scene .pill-checkbox.decade-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px !important;
    border: 1px solid var(--product-line) !important;
    border-radius: 9px !important;
    background: rgba(7, 13, 9, 0.9) !important;
    box-shadow: none !important;
    color: #9eaca4 !important;
    font-family: var(--font-tech);
    font-size: 0.72rem !important;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    user-select: none;
    transition: background-color 160ms var(--product-ease-out), border-color 160ms var(--product-ease-out), color 160ms var(--product-ease-out), transform 120ms var(--product-ease-out);
}

.app-scene .pill-checkbox.decade-pill span {
    min-height: 30px;
    padding-inline: 10px !important;
    border-color: rgba(126, 228, 166, 0.28) !important;
    background: #07120c !important;
    color: #c7d2cc !important;
    font-size: 0.68rem !important;
}

.app-scene .pill-checkbox.decade-pill input:checked + span,
.app-scene .pill-checkbox.decade-pill input:checked ~ span {
    border-color: rgba(118, 235, 164, 0.62) !important;
    background: #1f7042 !important;
    box-shadow: inset 0 -2px 0 #2a9d5a, 0 3px 7px rgba(0, 0, 0, 0.34) !important;
    color: #fff !important;
}

.app-choice-group input:checked + span,
.app-choice-group input:checked ~ span,
.app-scene .pill-checkbox input:checked + span,
.app-scene .pill-checkbox input:checked ~ span {
    border-color: var(--product-green-line) !important;
    background: rgba(35, 139, 78, 0.32) !important;
    box-shadow: inset 0 -2px 0 var(--product-green-hover) !important;
    color: #f5fff9 !important;
}

.app-choice-group input:focus-visible + span,
.app-choice-group input:focus-visible ~ span,
.app-scene .pill-checkbox input:focus-visible + span,
.app-scene .pill-checkbox input:focus-visible ~ span {
    outline: 3px solid var(--product-focus);
    outline-offset: 2px;
}

.app-choice-group label:active span,
.app-scene .pill-checkbox:active span {
    transform: scale(0.98);
}

/* Quiet secondary actions */
.app-secondary-action,
.shop-v3-filter-toggle.app-secondary-action,
.lobby-btn-lg.app-secondary-action,
.dock-btn.app-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--product-control-compact);
    padding: 0 14px !important;
    border: 1px solid var(--product-line) !important;
    border-radius: 10px !important;
    background: rgba(7, 13, 9, 0.9) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
    color: #d4ddd8 !important;
    font-family: var(--font-tech);
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transform: translate3d(0, 0, 0);
    transition: background-color 160ms var(--product-ease-out), border-color 160ms var(--product-ease-out), color 160ms var(--product-ease-out), transform 120ms var(--product-ease-out);
}

.app-secondary-action.app-secondary-action--compact {
    min-height: var(--product-control-compact);
    padding-inline: 12px !important;
    font-size: 0.7rem;
}

.app-secondary-action.app-secondary-action--regular {
    min-height: var(--product-control-regular);
}

.app-secondary-action.app-secondary-action--icon,
.lobby-btn-lg.app-secondary-action--icon {
    width: var(--product-control-compact) !important;
    height: var(--product-control-compact) !important;
    min-width: var(--product-control-compact) !important;
    min-height: var(--product-control-compact) !important;
    padding: 0 !important;
}

.app-secondary-action:focus-visible {
    outline: 3px solid var(--product-focus);
    outline-offset: 3px;
}

.app-secondary-action svg {
    color: inherit;
}

.dock-btn.app-secondary-action svg {
    fill: none;
    stroke: currentColor !important;
}

.lobby-btn-lg.app-secondary-action svg {
    fill: currentColor !important;
    stroke: none !important;
}

.app-secondary-action:active {
    transform: scale(0.97);
}

/* Shared binary-decision modal used by reconnect and leave-match flows. */
.app-dialog-overlay.modal-overlay {
    z-index: 3000;
    padding: 16px;
    background: rgba(1, 7, 4, 0.84);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: opacity 180ms var(--product-ease-out), visibility 0s linear 180ms;
}

.app-decision-card.hero-card {
    width: min(90vw, 400px);
    max-width: 400px;
    margin: auto;
    padding: 1.5rem;
    border: 1px solid var(--product-line);
    border-radius: 14px;
    background: rgba(10, 15, 19, 0.97);
    box-shadow: 0 8px 8px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.app-dialog-card.hero-card::before,
.app-dialog-card.hero-card::after {
    display: none;
}

.app-decision-title.text-page-title {
    margin: 0;
    color: #f5f8f6;
    font-family: var(--font-head);
    font-size: 1.85rem;
    font-style: italic;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1;
    text-transform: uppercase;
    text-wrap: balance;
}

.app-decision-copy {
    max-width: 34ch;
    margin: 0.7rem auto 1.3rem;
    color: rgba(245, 248, 246, 0.76);
    font: 600 0.84rem/1.5 var(--font-body);
    letter-spacing: 0.025em;
    text-wrap: pretty;
}

.app-decision-copy strong {
    color: #fff;
    white-space: nowrap;
}

.app-decision-actions {
    display: grid;
    gap: 0.6rem;
}

.app-decision-actions .app-primary-action,
.app-decision-actions .app-secondary-action {
    width: 100%;
}

.app-decision-actions .app-secondary-action {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-style: italic;
}

.modal-capsule-btn.app-danger-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: var(--product-control-regular);
    padding: 0 20px !important;
    border: 1px solid rgba(255, 139, 135, 0.42) !important;
    border-radius: var(--product-radius-control) !important;
    background: #b83f3c !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 8px rgba(0, 0, 0, 0.28) !important;
    color: #fff !important;
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transform: translate3d(0, 0, 0);
    transition: background-color 160ms var(--product-ease-out), border-color 160ms var(--product-ease-out), transform 140ms var(--product-ease-out), opacity 160ms ease;
}

.modal-capsule-btn.app-danger-action:active {
    transform: translate3d(0, 1px, 0) scale(0.98);
}

.modal-capsule-btn.app-danger-action:focus-visible {
    outline: 3px solid var(--product-focus);
    outline-offset: 3px;
}

.app-dialog-code-input {
    width: 100%;
    min-height: 52px;
    margin: 0 0 0.85rem;
    padding: 0 14px;
    border: 1px solid var(--product-line);
    border-radius: 10px;
    background: rgba(5, 10, 8, 0.96);
    color: #fff;
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-align: center;
    text-transform: uppercase;
}

.app-dialog-code-input.is-invalid {
    border-color: rgba(255, 105, 100, 0.78);
}

.code-modal-error {
    margin: -0.35rem 0 0.85rem;
    color: #ff9b97;
    font-family: var(--font-tech);
    font-size: 0.78rem;
    line-height: 1.35;
    text-align: center;
}

/* Toggles keep their familiar affordance but share the same response timing. */
.app-scene .toggle-slider-v2 {
    border-color: var(--product-line);
    background-color: rgba(7, 13, 9, 0.9);
    transition: background-color 180ms var(--product-ease-out), border-color 180ms var(--product-ease-out);
}

.app-scene .toggle-slider-v2::before {
    transition: transform 180ms var(--product-ease-out), background-color 180ms var(--product-ease-out);
}

.app-scene .settings-round-box .toggle-wrapper {
    height: 36px !important;
}

.app-scene .cyber-toggle-v2 input:focus-visible + .toggle-slider-v2 {
    outline: 3px solid var(--product-focus);
    outline-offset: 2px;
    box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
    .app-back-button:hover,
    .lobby-btn-lg.app-back-button:hover,
    .shop-v3-back.app-back-button:hover {
        border-color: var(--product-line-strong) !important;
        background: var(--product-surface-hover) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 6px 8px rgba(0, 0, 0, 0.3) !important;
        color: #fff !important;
        transform: translate3d(-2px, 0, 0);
    }

    .app-back-button:hover svg {
        transform: translateX(-1px);
    }

    .app-primary-action:not(:disabled):hover,
    .btn-start.app-primary-action:not(:disabled):hover,
    .action-btn-wide.app-primary-action:not(:disabled):hover,
    .dock-btn.app-primary-action:not(:disabled):hover,
    .shop-v3-primary.app-primary-action:not(:disabled):hover {
        border-color: rgba(116, 236, 164, 0.58) !important;
        background: var(--product-green-hover) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.17), 0 6px 8px rgba(0, 0, 0, 0.32) !important;
        transform: translate3d(0, -2px, 0);
    }

    .app-segmented .app-segmented__item:not(.active):hover,
    .app-segmented .app-segmented__item[aria-selected="false"]:hover {
        background: rgba(255, 255, 255, 0.045) !important;
        color: #e8efeb !important;
    }

    .app-choice-group label:hover input:not(:checked) + span,
    .app-choice-group label:hover input:not(:checked) ~ span,
    .app-scene .pill-checkbox:hover input:not(:checked) + span,
    .app-scene .pill-checkbox:hover input:not(:checked) ~ span {
        border-color: var(--product-line-strong) !important;
        background: rgba(17, 29, 21, 0.96) !important;
        color: #eef5f1 !important;
    }

    .app-secondary-action:hover,
    .shop-v3-filter-toggle.app-secondary-action:hover,
    .lobby-btn-lg.app-secondary-action:hover,
    .dock-btn.app-secondary-action:hover {
        border-color: var(--product-line-strong) !important;
        background: var(--product-surface-hover) !important;
        color: #fff !important;
        transform: translate3d(0, -1px, 0);
    }

    .modal-capsule-btn.app-danger-action:hover {
        border-color: rgba(255, 174, 171, 0.58) !important;
        background: #c94844 !important;
        transform: translate3d(0, -1px, 0);
    }

    /* Utility controls stay anchored on hover. Neighbouring header actions
       now share one motion rule: light on hover, compress on press. */
    .main-nav .btn-rules-premium:hover:not(:active),
    #openBuyCoinsModalBtn.shop-v3-wallet:hover:not(:active),
    #buyCoinsModal .buy-coins-modal-btn:hover:not(:active) {
        transform: none !important;
    }
}

#buyCoinsModal .buy-coins-modal-btn:active {
    transform: scale(0.97) !important;
}

@media (max-width: 768px) {
    .app-field-control,
    .app-scene .cyber-input,
    .app-scene .cyber-select,
    .app-scene .cyber-select.select-sm {
        font-size: 1rem;
    }

    .app-page-header {
        grid-template-columns: 48px minmax(0, 1fr) 48px !important;
    }

    .app-page-header--arena,
    .app-page-header--clubhouse-content {
        min-height: 48px;
        margin-bottom: 8px;
    }

    .app-page-header--clubhouse {
        grid-template-columns: 48px minmax(0, 1fr) auto !important;
        min-height: 60px;
        padding: max(7px, env(safe-area-inset-top)) 10px 7px;
    }

    .app-page-header .lobby-main-header {
        margin-inline: 8px;
    }

    .app-page-title {
        max-width: 100%;
        font-size: clamp(1.55rem, 7vw, 2rem) !important;
        line-height: 1;
    }

    .app-page-header--clubhouse .app-page-title,
    .app-page-header--clubhouse-content .app-page-title {
        font-size: clamp(1.15rem, 5.4vw, 1.4rem) !important;
    }

    .app-back-button,
    .lobby-btn-lg.app-back-button,
    .shop-v3-back.app-back-button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 11px !important;
    }

    .app-primary-action.app-primary-action--large,
    .app-primary-action.app-primary-action--regular {
        min-height: 52px !important;
    }

    .shop-v3-tabs.app-segmented {
        width: calc(100% - 92px);
        min-height: 48px;
        margin-inline: 14px;
    }

    .app-segmented .app-segmented__item,
    .shop-v3-tabs .app-segmented__item,
    .profile-tab-bar .app-segmented__item {
        min-height: 40px;
        padding-inline: 10px;
        font-size: 0.7rem;
        letter-spacing: 0.05em;
    }

    .profile-tab-bar.app-segmented {
        margin-bottom: 1rem;
    }
}

@media (max-width: 700px) {
    /* The selected shop item has a fixed 46px action track on mobile. */
    .shop-v3-feature-action .shop-v3-primary {
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-back-button,
    .app-back-button svg,
    .app-primary-action,
    .app-segmented__item,
    .app-field,
    .app-field-control,
    .app-choice-group span,
    .app-scene .pill-checkbox span,
    .app-secondary-action,
    .modal-capsule-btn.app-danger-action,
    .app-scene .toggle-slider-v2,
    .app-scene .toggle-slider-v2::before {
        transition-duration: 1ms !important;
    }
}

/* Solo energy access strip — one status and one action, never competing pills. */
.solo-energy-wrapper {
    width: min(100%, 600px);
    margin: 8px auto 10px;
}

.solo-energy-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 7px;
    border: 1px solid var(--product-line);
    border-radius: var(--product-radius-control);
    background: rgba(5, 10, 7, 0.9);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.solo-energy-strip--ready {
    justify-content: center;
    min-height: 52px;
}

.solo-energy-status {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    color: #d4ddd8;
}

.solo-energy-status__icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid var(--product-green-line);
    border-radius: 9px;
    background: rgba(35, 139, 78, 0.13);
    color: #78d9a0;
}

.solo-energy-status__icon svg {
    width: 17px;
    height: 17px;
}

.solo-energy-status__copy {
    min-width: 0;
    color: #9ba9a1;
    font: 700 0.72rem/1.25 var(--font-tech);
    letter-spacing: 0.035em;
    text-wrap: pretty;
}

.solo-energy-status__time {
    color: #f5f8f6;
    font-size: 0.8rem;
    white-space: nowrap;
}

.solo-energy-ready {
    color: #cfe7d8;
    font: 700 0.78rem/1 var(--font-tech);
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.solo-energy-ad.app-primary-action {
    min-width: 190px;
    min-height: 48px !important;
    flex: 0 0 auto;
    padding-inline: 18px !important;
    font-family: var(--font-tech);
    font-size: 0.78rem !important;
    font-style: normal;
    letter-spacing: 0.045em;
}

.solo-energy-ad .energy-play-icon,
.energy-modal-actions .energy-play-icon {
    display: block;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px;
    fill: currentColor;
    stroke: none !important;
    transform: translateX(0.75px);
}

.solo-energy-ad > span,
.energy-modal-actions .energy-btn > span {
    display: block;
    line-height: 1;
}

/* Shared energy decision — used from Solo and match settings. */
.energy-modal-overlay.app-dialog-overlay {
    z-index: 3000;
    display: flex;
    box-sizing: border-box;
    padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
    background: rgba(1, 7, 4, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.energy-modal-content.app-decision-card {
    box-sizing: border-box;
    width: min(400px, 100%);
    max-width: 400px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--product-line);
    border-radius: 14px;
    background: rgba(8, 14, 10, 0.98);
    box-shadow: 0 8px 8px rgba(0, 0, 0, 0.48);
    text-align: center;
}

.energy-modal-content .energy-modal-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    border: 1px solid var(--product-green-line);
    border-radius: 10px;
    background: rgba(35, 139, 78, 0.13);
    color: #78d9a0;
}

.energy-modal-content .energy-modal-title {
    margin: 0;
    color: #f5f8f6;
    font-family: var(--font-head);
    font-size: 1.75rem;
    font-style: italic;
    font-weight: 800;
    letter-spacing: 0.035em;
    line-height: 1.05;
    text-transform: uppercase;
    text-wrap: balance;
}

.energy-modal-content .energy-modal-desc {
    max-width: 32ch;
    margin: 11px auto 20px;
    color: #b8c4bd;
    font: 600 0.9rem/1.48 var(--font-body);
    letter-spacing: 0;
    text-wrap: pretty;
}

.energy-modal-actions {
    display: grid;
    gap: 8px;
}

.energy-modal-actions .energy-btn {
    box-sizing: border-box;
    width: 100%;
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 52px !important;
    margin: 0;
    padding: 7px 18px !important;
    border-radius: var(--product-radius-control) !important;
    font-family: var(--font-tech);
    font-size: 0.8rem !important;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.15;
    white-space: normal;
    text-wrap: balance;
    transition: background-color 160ms var(--product-ease-out), border-color 160ms var(--product-ease-out), color 160ms var(--product-ease-out), transform 140ms var(--product-ease-out);
}

/* The ad icon is a fixed leading affordance; the label stays optically
   centered in the button instead of being shifted by the icon's width. */
.energy-modal-actions .energy-btn-ad .energy-play-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    margin: 0;
    transform: translate(0.75px, -50%);
}

.energy-modal-actions .energy-btn-ad > span {
    display: block;
    margin-inline: auto;
    line-height: 1;
    text-align: center;
}

.energy-modal-actions .energy-btn-vip {
    border-color: rgba(228, 202, 82, 0.44) !important;
    color: #f3df78 !important;
}

@media (max-width: 520px) {
    .solo-energy-strip {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
    }

    .solo-energy-status {
        min-height: 38px;
        justify-content: center;
    }

    .solo-energy-ad.app-primary-action {
        width: 100%;
        min-width: 0;
    }

    .energy-modal-content.app-decision-card {
        padding: 20px;
    }

    .energy-modal-actions .energy-btn-ad .energy-play-icon {
        left: 18px;
    }
}

/* One continuous account rail: actions are separated by rhythm, not nested pills. */
.main-nav {
    min-height: 58px;
    gap: 0;
    padding: 7px 24px !important;
    border-bottom: 1px solid rgba(235, 255, 243, 0.1);
    background: rgba(5, 8, 6, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.main-nav .nav-container {
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.main-nav .btn-rules-premium,
.main-nav .balance-widget,
.main-nav .btn-profile-trigger {
    min-height: 44px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.main-nav .btn-rules-premium,
.main-nav .balance-widget {
    border-right: 1px solid rgba(235, 255, 243, 0.12) !important;
}

.main-nav .btn-rules-premium:hover,
.main-nav .balance-widget:hover,
.main-nav .btn-profile-trigger:hover,
.main-nav .btn-profile-trigger[aria-expanded='true'] {
    border-color: rgba(235, 255, 243, 0.12) !important;
    background: rgba(235, 255, 243, 0.055) !important;
    box-shadow: none !important;
}

.main-nav .header-right {
    position: relative;
    right: auto;
}

/* Shared compact account header for phone browser viewports. */
@media (max-width: 700px) {
    .main-nav {
        box-sizing: border-box;
        left: 0;
        right: 0;
        justify-content: center !important;
        gap: 0;
        width: auto !important;
        min-height: calc(49px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) max(5px, env(safe-area-inset-right)) 0 max(5px, env(safe-area-inset-left)) !important;
        overflow: visible;
        border-bottom: 1px solid var(--product-line);
        background: rgba(5, 8, 6, 0.96);
    }

    .main-nav > * {
        min-width: 0;
    }

    .main-nav .nav-container {
        flex: 0 1 auto;
        justify-content: flex-end;
        gap: 0;
        width: auto;
        max-width: calc(100% - 54px);
        padding: 0;
        border: 0;
        border-radius: 0 !important;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }

    .main-nav #nav-user {
        flex-shrink: 1;
    }

    .main-nav .nav-container:hover {
        background: transparent;
        box-shadow: none;
        transform: none;
    }

    .main-nav .btn-rules-premium {
        min-width: 0;
        min-height: 44px;
        padding: 0 10px !important;
        border-radius: 0;
        white-space: nowrap;
    }

    .main-nav .btn-rules-premium span {
        font-size: 0.68rem;
    }

    .main-nav .balance-widget {
        min-width: 0;
        min-height: 44px;
        padding: 0 9px;
        border-radius: 0 !important;
        background: transparent !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }

    .main-nav .balance-widget .coin-value {
        font-size: 0.8rem;
    }

    .main-nav .balance-widget .nav-shop-icon {
        width: 15px;
        height: 15px;
        margin-right: 2px;
    }

    .main-nav .buy-coins-plus {
        width: 20px;
        height: 20px;
        margin-left: 3px;
    }

    .main-nav .header-right {
        flex: 0 0 auto;
        position: relative;
        right: auto;
    }

    .main-nav .btn-profile-trigger {
        gap: 6px;
        min-width: 68px;
        min-height: 44px;
        padding: 2px 8px;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .main-nav .avatar-circle {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
    }

    .main-nav .dropdown-chevron {
        width: 12px;
        height: 12px;
    }
}

@media (min-width: 390px) and (max-width: 700px) {
    .main-nav .user-name {
        display: block;
        max-width: 58px;
        overflow: hidden;
        font-size: 0.72rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 359px) {
    .main-nav {
        gap: 4px;
        padding-inline: max(6px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-right)) !important;
    }

    .main-nav .nav-container {
        max-width: calc(100% - 50px);
        padding: 0;
    }

    .main-nav .btn-rules-premium,
    .main-nav .balance-widget {
        padding-inline: 7px !important;
    }

    .main-nav .btn-profile-trigger {
        gap: 0;
        width: 46px;
        min-width: 46px;
        padding: 2px 4px;
    }

    .main-nav .avatar-circle {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .main-nav .user-name,
    .main-nav .dropdown-chevron {
        display: none !important;
    }

    .app-primary-action.app-primary-action--large,
    .app-primary-action.app-primary-action--regular {
        padding-inline: 14px !important;
        font-size: 0.9rem !important;
        letter-spacing: 0.035em;
    }

    .lobby-dock .dock-btn {
        min-width: 0;
        padding-inline: 8px !important;
        gap: 5px;
        font-size: 0.76rem !important;
        letter-spacing: 0.025em;
    }

    .lobby-dock .dock-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Unified pressable contract
   Buttons stay anchored on hover and compress identically on press.
   Semantic colors remain distinct; the physical response does not. */
:where(
    button,
    input[type="button"],
    input[type="submit"],
    a.app-primary-action,
    a.app-secondary-action,
    a.app-back-button,
    a.lobby-btn-lg,
    a[class*="btn-"],
    [role="button"]
) {
    transform-origin: center;
    transition:
        transform 140ms var(--product-ease-out),
        background-color 160ms var(--product-ease-out),
        border-color 160ms var(--product-ease-out),
        color 160ms var(--product-ease-out),
        box-shadow 160ms var(--product-ease-out),
        opacity 160ms var(--product-ease-out) !important;
}

@media (hover: hover) and (pointer: fine) {
    :where(
        button,
        input[type="button"],
        input[type="submit"],
        a.app-primary-action,
        a.app-secondary-action,
        a.app-back-button,
        a.lobby-btn-lg,
        a[class*="btn-"],
        [role="button"]
    ):not(:disabled):not([aria-disabled="true"]):hover {
        transform: none !important;
    }

    .app-back-button:hover svg {
        transform: none !important;
    }
}

:where(
    button,
    input[type="button"],
    input[type="submit"],
    a.app-primary-action,
    a.app-secondary-action,
    a.app-back-button,
    a.lobby-btn-lg,
    a[class*="btn-"],
    [role="button"]
):not(:disabled):not([aria-disabled="true"]):active {
    transform: scale(0.97) !important;
    transition-duration: 120ms !important;
}

:where(
    button,
    input[type="button"],
    input[type="submit"],
    a.app-primary-action,
    a.app-secondary-action,
    a.app-back-button,
    a.lobby-btn-lg,
    a[class*="btn-"],
    [role="button"]
):focus-visible {
    outline: 3px solid var(--product-focus) !important;
    outline-offset: 3px !important;
}

:where(button, input[type="button"], input[type="submit"]):disabled {
    cursor: not-allowed;
    transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
    :where(
        button,
        input[type="button"],
        input[type="submit"],
        a.app-primary-action,
        a.app-secondary-action,
        a.app-back-button,
        a.lobby-btn-lg,
        a[class*="btn-"],
        [role="button"]
    ) {
        transition:
            background-color 120ms ease,
            border-color 120ms ease,
            color 120ms ease,
            box-shadow 120ms ease,
            opacity 120ms ease !important;
    }

    :where(
        button,
        input[type="button"],
        input[type="submit"],
        a.app-primary-action,
        a.app-secondary-action,
        a.app-back-button,
        a.lobby-btn-lg,
        a[class*="btn-"],
        [role="button"]
    ):active {
        transform: none !important;
    }
}
