:root {
    --accent: #2dd4bf;
    --accent2: #f87171;
    --accent3: #ffc53d;
    --black: #07040f;
    --medium: #150c2e;
    --dark: #0e0820;
    --light: #a79fc4;
    --white: #f5f2ff;
    --telegram: #229ed9;
    --violet: #8b5cf6;
    --violet-deep: #6d28d9;
    --border: #2a1b4d;
    --border-strong: #3b2a6b;
    --surface: #0e0820;
    --surface-raised: #150c2e;
    --shadow: 0 18px 55px rgba(4, 2, 11, 0.45);
    --app-safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px), var(--telegram-runtime-safe-top, 0px));
    --app-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px), var(--telegram-runtime-safe-bottom, 0px));
    --app-safe-left: max(env(safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px));
    --app-safe-right: max(env(safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px));
}

* {
    box-sizing: border-box;
}

html,
body {
    background:
        radial-gradient(circle at 50% -10%, rgba(124, 58, 237, 0.18), transparent 34%),
        #07040f;
    color: var(--white);
}

body {
    min-height: var(--tg-viewport-stable-height, 100dvh);
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app_container {
    width: 100%;
    max-width: 500px;
    min-height: var(--tg-viewport-stable-height, 100dvh);
    position: relative;
    background: rgba(7, 4, 15, 0.96);
}

.app_body {
    height: var(--tg-viewport-stable-height, 100dvh);
}

.app_tab {
    height: var(--tg-viewport-stable-height, 100dvh);
    gap: 10px;
    padding: calc(var(--app-safe-top) + 58px) calc(var(--app-safe-right) + 14px) calc(112px + var(--app-safe-bottom)) calc(var(--app-safe-left) + 14px);
    scrollbar-width: none;
}

.global_balance_bar {
    position: fixed;
    z-index: 997;
    top: calc(var(--app-safe-top) + 7px);
    left: 50%;
    display: flex;
    width: min(calc(100% - 28px), 472px);
    min-height: 42px;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(14, 8, 32, .94);
    box-shadow: 0 9px 28px rgba(2, 1, 8, .32);
    backdrop-filter: blur(14px);
}

/* Telegram's iOS chat launcher can report no content-safe top inset while its
   floating Close/menu controls still occupy the top of the Mini App. */
body.telegram-overlay-fallback .global_balance_bar {
    top: calc(var(--app-safe-top) + 61px);
}

body.telegram-overlay-fallback .app_tab {
    padding-top: calc(var(--app-safe-top) + 112px);
}

body.telegram-overlay-fallback .bet_offer_tab_chart_container,
body.telegram-overlay-fallback .bet_details_tab_chart_container {
    height: clamp(176px, calc(38dvh - 54px), 286px);
    min-height: 176px;
}

.global_balance_item {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    margin: 3px;
    padding: 0 7px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.global_balance_item.active.real {
    border-color: rgba(45, 212, 191, .42);
    background: rgba(45, 212, 191, .09);
    box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .04);
}

.global_balance_item.active.virtual {
    border-color: rgba(255, 197, 61, .42);
    background: rgba(255, 197, 61, .08);
}

.global_balance_item span {
    color: #756d92;
    font-size: 6px;
    font-weight: 800;
    letter-spacing: .09em;
}

.global_balance_item strong { font-size: 11px; }
.global_balance_item.real strong { color: var(--accent); }
.global_balance_item.virtual strong { color: #ffc53d; }
.global_real_chevron { display: none; color: #6ee7d7; font-size: 8px; }
.global_balance_item.real.has-mixed-funding .global_real_chevron { display: inline-block; }
.global_balance_divider { width: 1px; height: 19px; background: var(--border); }

#bet_offer_tab {
    overflow: hidden;
}

.app_container_lg {
    gap: 12px;
    border-radius: 18px;
}

.app_container_lg:last-child {
    margin-bottom: 0;
}

.app_container_lg_inner,
.app_bet_details_container,
.ton_connect,
.credit-card,
.support_textarea {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.app_container_lg_inner {
    min-height: 72px;
    padding: 12px 13px;
    border-radius: 14px;
}

.app_container_lg_inner_chart {
    border-radius: 18px;
}

.app_section_title_wrapper_center {
    justify-content: flex-start;
    height: auto;
    padding: 2px 1px 0;
    background: transparent;
}

.app_section_title_wrapper_center div {
    font-size: clamp(16px, 4.25vw, 19px);
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-align: left;
}

.trade_heading {
    display: flex;
    min-height: 45px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 1px;
}

.trade_heading span,
.trade_heading strong {
    display: block;
}

.trade_heading span {
    color: #a78bfa;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .12em;
}

.trade_heading strong {
    margin-top: 3px;
    font-size: 18px;
    line-height: 1.18;
    letter-spacing: -.03em;
}

.game_help_button {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(21, 12, 46, .72);
    color: #8279aa;
}

.game_help_button ion-icon {
    font-size: 15px;
}

#bet_offer_tab .asset_logo {
    display: none;
}

#bet_offer_tab .app_container_lg_inner {
    position: relative;
    min-height: 54px;
    padding-block: 8px;
}

.trade_activity_inline {
    position: absolute;
    top: 50%;
    right: 11px;
    display: flex;
    width: min(48%, 205px);
    min-width: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    transform: translateY(-50%);
    text-align: right;
    pointer-events: none;
}

.trade_activity_inline span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #8279aa;
    font-size: 6px;
    font-weight: 850;
    letter-spacing: .1em;
}

.trade_activity_inline span i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 7px rgba(45,212,191,.8);
}

.trade_activity_inline strong {
    display: block;
    width: 100%;
    overflow: hidden;
    color: #aaa1c4;
    font-size: 7px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity .2s ease, transform .2s ease;
}

.trade_activity_inline strong.is-changing { opacity: 0; transform: translateY(2px); }
.trade_activity_inline .activity_amount { font-weight: 850; }
.trade_activity_inline .activity_amount.positive { color: var(--accent); }
.trade_activity_inline .activity_amount.negative { color: var(--accent2); }

#bet_offer_tab .asset_name { font-size: 11px; }
#bet_offer_current_price { font-size: 11px; }
#bet_offer_tab .asset_price_wrapper { font-size: 9px; }

.app_section_title_wrapper {
    gap: 10px;
    padding: 2px 0 6px;
}

.app_section_title_wrapper ion-icon {
    width: 36px;
    height: 36px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-raised);
    color: var(--accent);
}

.app_section_title_wrapper div {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.asset_logo {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(145deg, #ffc53d, #fb923c);
    box-shadow: 0 8px 24px rgba(251, 146, 60, 0.16);
}

.asset_logo ion-icon {
    color: #150c2e;
    font-size: 27px;
}

.asset_name {
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.asset_start_price,
.asset_price_wrapper {
    color: var(--light);
    font-size: 12px;
}

#bet_offer_current_price {
    color: var(--white);
    font-size: 13px;
    font-weight: 650;
}

.asset_end_price_change_good,
.bet_reward_won,
.deposit_amount {
    color: var(--accent);
}

.asset_end_price_change_bad,
.bet_reward_lost {
    color: var(--accent2);
}

.bet_offer_tab_chart_container,
.bet_details_tab_chart_container {
    height: clamp(230px, 38dvh, 340px);
    min-height: 230px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.expand_chart_button {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(21, 12, 46, 0.9);
    color: var(--light);
    backdrop-filter: blur(8px);
}

.app_bet_details_container {
    min-height: 82px;
    padding: 12px 14px;
    border-radius: 15px;
}

.app_reward_title,
.app_reward_subtitle {
    color: var(--light);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app_reward_wrapper_amount {
    color: var(--accent);
    font-size: 22px;
    font-weight: 750;
}

.number-input {
    gap: 7px;
}

.number-input button,
.number-input input {
    height: 38px;
    border: 1px solid var(--border-strong);
    background: var(--black);
    color: var(--white);
}

.number-input button {
    width: 38px;
    border-radius: 10px;
}

.number-input input {
    width: 54px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 750;
    text-align: center;
}

.stake_selector_card {
    display: flex;
    min-height: 78px;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 9px 11px;
}

.training_buffer_notice {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    padding: 4px 7px;
    border: 1px solid rgba(255,197,61,.3);
    border-radius: 8px;
    background: rgba(255,197,61,.08);
    color: #ffc53d;
    font-size: 7px;
    font-weight: 750;
    letter-spacing: .01em;
    max-width: 100%;
    line-height: 1.25;
    white-space: normal;
}

.training_buffer_notice[hidden] { display: none; }


.stake_selector_top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stake_selector_title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.stake_selector_title span {
    color: #c1b7dc;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .12em;
}

.stake_selector_title small {
    color: #716888;
    font-size: 7px;
}

.stake_reward_preview {
    display: flex;
    min-width: 112px;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.stake_reward_preview span {
    color: #9d92bc;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.stake_reward_preview strong {
    color: var(--accent);
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.real_funding_source {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: 23px minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 28px;
    align-items: center;
    gap: 6px;
    padding: 2px 7px;
    border: 1px solid rgba(105, 66, 176, .48);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(31, 14, 61, .96), rgba(12, 6, 29, .96));
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.real_funding_source[hidden],
body[data-balance-mode="virtual"] .real_funding_source { display: none; }
.stake_selector_card.has-mixed-funding .stake_selector_title { display: none; }
body[data-balance-mode="virtual"] .stake_selector_card.has-mixed-funding .stake_selector_title { display: flex; }

.real_funding_coin {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #18e7ad, #7650f4 56%, #da47cb);
    color: #fff;
    font-size: 8px;
    font-weight: 850;
}

.real_funding_coin[data-asset="TON"] { background: linear-gradient(145deg, #28a9eb, #0878bf); }
.real_funding_coin[data-asset="USDC"] { background: #2775ca; }
.real_funding_coin[data-asset="USDT"] { background: #26a17b; }
.real_funding_coin svg { width: 14px; height: 14px; fill: #fff; }
.real_funding_coin[data-asset="SOL"] svg { fill: #62f7cc; }

.real_funding_label { min-width: 0; }
.real_funding_label small {
    display: block;
    margin-bottom: 1px;
    color: #82769e;
    font-size: 6px;
    font-weight: 800;
    letter-spacing: .1em;
}

.real_funding_label strong {
    display: block;
    width: 100%;
    overflow: hidden;
    border: 0;
    outline: 0;
    background: transparent;
    color: #f8f5ff;
    font: inherit;
    font-size: 9px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.real_funding_chevron { color: #a78bfa; font-size: 9px; transition: transform .18s ease; }
.real_funding_source[aria-expanded="true"] .real_funding_chevron { transform: rotate(180deg); }

.real_funding_menu[hidden] { display: none; }
.real_funding_menu { position: fixed; z-index: 5300; inset: 0; }
.real_funding_menu_backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(3,0,12,.42); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.real_funding_menu_panel {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 7px;
    border: 1px solid rgba(139,92,246,.55);
    border-radius: 15px;
    background: linear-gradient(155deg, #1a0d37, #0b0619 75%);
    box-shadow: 0 18px 50px rgba(0,0,0,.58), 0 0 24px rgba(124,58,237,.15);
}
.real_funding_option {
    display: grid;
    grid-template-columns: 31px minmax(0,1fr) auto 14px;
    min-height: 50px;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: rgba(255,255,255,.025);
    color: #fff;
    font: inherit;
    text-align: left;
}
.real_funding_option.is-active { border-color: rgba(45,212,191,.42); background: rgba(45,212,191,.07); }
.real_funding_option .real_funding_coin { width: 29px; height: 29px; font-size: 10px; }
.real_funding_option .real_funding_coin svg { width: 19px; height: 19px; }
.real_funding_option_copy { min-width: 0; }
.real_funding_option_copy strong, .real_funding_option_copy small { display: block; }
.real_funding_option_copy strong { color: #f8f5ff; font-size: 11px; }
.real_funding_option_copy small { margin-top: 2px; color: #81779a; font-size: 7px; }
.real_funding_option > b { color: #ffc53d; font-size: 11px; white-space: nowrap; }
.real_funding_option > i { color: transparent; font-size: 9px; }
.real_funding_option.is-active > i { color: #2dd4bf; }

.stake_quick_amounts {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.stake_quick_amounts button {
    min-width: 0;
    height: 29px;
    border: 1px solid rgba(105, 66, 176, .36);
    border-radius: 8px;
    background: rgba(11, 5, 27, .82);
    color: #aea3ca;
    font-size: 9px;
    font-weight: 800;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.stake_quick_amounts button::before {
    content: '$';
    margin-right: 1px;
    color: #6f658b;
    font-size: 8px;
}

body[data-balance-mode="virtual"] .stake_quick_amounts button::before {
    content: '';
    margin: 0;
}

.stake_quick_amounts button.is-active {
    border-color: rgba(65, 216, 199, .72);
    background: linear-gradient(135deg, rgba(103, 38, 218, .72), rgba(31, 179, 177, .28));
    box-shadow: 0 5px 16px rgba(83, 39, 170, .2);
    color: #fff;
    transform: translateY(-1px);
}

.stake_quick_amounts button.is-active::before { color: #c9fff8; }

.stake_custom_row {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    padding: 3px 4px 3px 11px;
    border: 1px solid rgba(105, 66, 176, .46);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(26, 12, 56, .9), rgba(11, 5, 27, .9));
}

.stake_custom_label {
    color: #a99fc3;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.stake_custom_stepper {
    display: grid;
    grid-template-columns: 28px 58px 28px 28px;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(122, 76, 205, .54);
    border-radius: 8px;
    background: rgba(8, 4, 20, .8);
}

.stake_step_button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    background: rgba(106, 49, 196, .22);
    color: #c5b8e9;
    font-size: 14px;
}

.stake_step_button:active {
    background: rgba(65, 216, 199, .2);
    color: #55ddce;
}

.stake_confirm_button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-right: 1px solid rgba(105, 66, 176, .36);
    background: rgba(45, 212, 191, .15);
    color: #41d8c7;
    font-size: 14px;
}

.stake_confirm_button:active,
.stake_confirm_button.is-confirmed {
    background: rgba(45, 212, 191, .35);
    color: #d7fff9;
}

.stake_custom_amount {
    display: grid;
    height: 28px;
    min-width: 0;
    place-items: center;
    border-right: 1px solid rgba(105, 66, 176, .36);
    border-left: 1px solid rgba(105, 66, 176, .36);
}

.stake_custom_amount input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.stake_custom_row.is-custom {
    border-color: rgba(65, 216, 199, .72);
    background: linear-gradient(135deg, rgba(103, 38, 218, .48), rgba(31, 179, 177, .2));
}

.stake_custom_row.is-custom .stake_custom_label {
    color: #55ddce;
}

.bet_button_wrapper {
    gap: 10px;
}

.bet_button_lower,
.bet_button_higher {
    display: flex;
    width: 100%;
    min-height: 52px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 750;
    box-shadow: none;
}

.bet_button_lower {
    background: linear-gradient(145deg, #be123c, #ef476f);
}

.bet_button_higher {
    background: linear-gradient(145deg, #047857, #10b981);
}

.button_undertext_lower,
.button_undertext_higher {
    margin-top: 2px;
    color: rgba(255,255,255,.82);
    font-size: 8px;
    font-weight: 700;
}

.button_undertext_lower {
    color: rgba(255,255,255,.82);
}

.button_undertext_higher {
    color: rgba(255,255,255,.82);
}

.app_nav {
    bottom: max(8px, var(--app-safe-bottom));
    width: min(calc(100% - 28px), 430px);
    min-height: 54px;
    justify-content: space-around;
    gap: 0;
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(14, 8, 32, 0.94);
    box-shadow: 0 18px 48px rgba(2, 1, 8, 0.58);
    backdrop-filter: blur(18px);
}

.app_nav .nav_button {
    display: grid;
    width: 36px;
    height: 36px;
    padding: 8px;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8279aa;
    opacity: 1;
    cursor: pointer;
}

.app_nav .nav_button.active {
    background: #1f1145;
    color: #a78bfa !important;
}

.app_nav .nav_button svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.leaderboard_shell {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    gap: 10px;
}

.leaderboard_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 2px 2px;
}

.leaderboard_eyebrow {
    color: #a78bfa;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .16em;
}

.leaderboard_header h2 {
    margin: 3px 0 1px;
    font-size: 23px;
    letter-spacing: -.04em;
}

.leaderboard_header p {
    margin: 0;
    color: var(--light);
    font-size: 11px;
}

.leaderboard_trophy {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255, 197, 61, .32);
    border-radius: 14px;
    background: radial-gradient(circle at 35% 25%, #ffe79a, #ffc53d 45%, #b96809);
    color: #241105;
    box-shadow: 0 10px 26px rgba(255, 197, 61, .16);
    font-size: 19px;
}

.leaderboard_modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}

.leaderboard_mode {
    min-height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8279aa;
    font-size: 9px;
    font-weight: 750;
}

.leaderboard_mode i {
    margin-right: 5px;
}

.leaderboard_mode.active {
    background: #1f1145;
    color: #c4b5fd;
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .16);
}

.leaderboard_periods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.leaderboard_period {
    min-height: 27px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(14, 8, 32, .72);
    color: #756d92;
    font-size: 8px;
    font-weight: 700;
}

.leaderboard_period.active {
    border-color: rgba(45, 212, 191, .34);
    background: rgba(45, 212, 191, .08);
    color: var(--accent);
}

.leaderboard_list {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    padding-right: 2px;
    overscroll-behavior: contain;
}

.leaderboard_row {
    display: grid;
    min-height: 52px;
    grid-template-columns: 24px 38px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.leaderboard_rank {
    color: #8279aa;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.leaderboard_avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #2a1857, #15102e);
    color: #bca8ff;
    font-size: 11px;
    font-weight: 800;
}

.leaderboard_wallet,
.leaderboard_profit {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.leaderboard_wallet strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard_wallet span,
.leaderboard_profit span {
    margin-top: 3px;
    color: var(--light);
    font-size: 8px;
}

.leaderboard_profit {
    align-items: flex-end;
}

.leaderboard_profit strong {
    color: var(--accent);
    font-size: 12px;
}

.leaderboard_row.is-first { border-color: rgba(255, 197, 61, .48); background: linear-gradient(90deg, rgba(255, 197, 61, .08), var(--surface) 44%); }
.leaderboard_row.is-first .leaderboard_rank { color: #ffc53d; }
.leaderboard_row.is-second .leaderboard_rank { color: #c8ceda; }
.leaderboard_row.is-third .leaderboard_rank { color: #d98c58; }
.leaderboard_row.is-you { border-color: rgba(45, 212, 191, .42); background: linear-gradient(90deg, rgba(45, 212, 191, .08), var(--surface)); }

.leaderboard_demo_note {
    flex: 0 0 auto;
    color: #756d92;
    font-size: 8px;
    text-align: center;
}

.activity_ticker {
    position: fixed;
    z-index: 998;
    left: 50%;
    bottom: calc(max(8px, var(--app-safe-bottom)) + 61px);
    display: flex;
    width: min(calc(100% - 44px), 400px);
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    transform: translateX(-50%);
    border: 1px solid rgba(42, 27, 77, .84);
    border-radius: 13px;
    background: linear-gradient(105deg, rgba(31, 17, 69, .94), rgba(14, 8, 32, .94));
    box-shadow: 0 10px 30px rgba(2, 1, 8, .38), inset 0 1px 0 rgba(255,255,255,.025);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.activity_ticker.is-hidden { display: none; }
.activity_ticker.is-obstructing { display: none; }
body[data-current-tab="bet_offer_tab"] .activity_ticker { display: none; }

#wallet_transaction_button_wrapper {
    gap: 8px;
    margin: 0;
}

#wallet_transaction_button_wrapper .bet_button_lower,
#wallet_transaction_button_wrapper .bet_button_higher {
    min-height: 40px;
    padding: 6px 12px;
    border-radius: 11px;
    font-size: 11px;
}

.wallet_support_button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 2px;
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(31, 17, 69, .65);
    color: #b7afd0;
    font-size: 10px;
    font-weight: 700;
}

.wallet_support_button ion-icon { color: #a78bfa; font-size: 15px; }

.wallet_support_top {
    width: auto;
    min-width: 0;
    min-height: 42px;
    flex: 1;
    margin: 0;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: #8279aa;
    font-size: 10px;
}

.wallet_support_top span { white-space: nowrap; }

.activity_amount {
    font-weight: 850;
}

.activity_amount.positive { color: var(--accent); }
.activity_amount.negative { color: var(--accent2); }

.history_modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}

.history_mode {
    min-height: 36px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8279aa;
    font-size: 9px;
    font-weight: 750;
}

.history_mode i { margin-right: 5px; }
.history_mode.active { background: #1f1145; color: #fff; }
.history_mode[data-history-mode="real"].active i { color: var(--accent); }
.history_mode[data-history-mode="virtual"].active i { color: #ffc53d; }

.history_currency_badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 3px 5px;
    border: 1px solid rgba(45, 212, 191, .24);
    border-radius: 6px;
    color: var(--accent);
    font-size: 6px;
    font-weight: 850;
    letter-spacing: .08em;
}

.history_currency_badge.virtual { border-color: rgba(255,197,61,.25); color: #ffc53d; }

.history_empty_state {
    padding: 24px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: #8279aa;
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
}

#bet_details_thumbs {
    min-height: 250px;
    height: auto;
    z-index: 2;
}

.bet_details_header {
    display: grid;
    min-height: 72px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(120deg, rgba(31,17,69,.92), rgba(14,8,32,.96));
}

.bet_details_header.won { border-color: rgba(45,212,191,.35); background: linear-gradient(120deg, rgba(45,212,191,.1), rgba(14,8,32,.96) 56%); }
.bet_details_header.lost { border-color: rgba(248,113,113,.35); background: linear-gradient(120deg, rgba(248,113,113,.1), rgba(14,8,32,.96) 56%); }
.bet_details_header > button { display: grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: #150c2e; color: #a78bfa; }
.bet_details_header > button ion-icon { font-size: 18px; }
.bet_details_header > div { min-width: 0; }
.bet_details_header > div span, .bet_details_header > div strong, .bet_details_header > div small { display: block; }
.bet_details_header > div span { color: #8279aa; font-size: 6px; font-weight: 850; letter-spacing: .13em; }
.bet_details_header > div strong { overflow: hidden; margin-top: 3px; color: #fff; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.bet_details_header.won > div strong { color: var(--accent); }
.bet_details_header.lost > div strong { color: var(--accent2); }
.bet_details_header > div small { margin-top: 2px; color: var(--light); font-size: 8px; }
.bet_details_header.pending > div strong { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -.025em; }
.bet_details_header.pending > div small { margin-top: 5px; color: var(--accent); font-size: 23px; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.bet_details_header.pending > div small::before { content: "⏱ "; color: var(--accent); font-size: 12px; }
.bet_details_mode_badge { padding: 5px 7px; border: 1px solid rgba(45,212,191,.25); border-radius: 8px; color: var(--accent); font-size: 6px; font-weight: 850; letter-spacing: .06em; }
.bet_details_mode_badge.virtual { border-color: rgba(255,197,61,.28); color: #ffc53d; }
.bet_details_mode_badge i { margin-right: 3px; }

#bet_details_tab > .app_container_lg > .app_container_lg_inner .asset_logo {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
    opacity: .82;
}

#bet_details_tab > .app_container_lg > .app_container_lg_inner .asset_logo ion-icon { font-size: 18px; }
#bet_details_tab > .app_container_lg > .app_container_lg_inner .asset_name { color: #b7afd0; font-size: 9px; font-weight: 650; }
#bet_details_tab > .app_container_lg > .app_container_lg_inner .asset_price_wrapper { margin-top: 1px; color: #756d92; font-size: 8px; }

.bet_result_panel {
    display: flex;
    min-height: 250px;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 18px;
    border: 1px solid rgba(45, 212, 191, .34);
    border-radius: 18px;
    background: radial-gradient(circle at 50% 15%, rgba(45,212,191,.16), transparent 42%), var(--surface);
    text-align: center;
}

.bet_result_panel.lost {
    border-color: rgba(251, 97, 130, .34);
    background: radial-gradient(circle at 50% 15%, rgba(251,97,130,.15), transparent 42%), var(--surface);
}

.bet_result_icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
    place-items: center;
    border-radius: 16px;
    background: rgba(45,212,191,.13);
    color: var(--accent);
    font-size: 22px;
}

.bet_result_panel.lost .bet_result_icon { background: rgba(251,97,130,.13); color: var(--accent2); }
.bet_result_panel > span { color: #8279aa; font-size: 7px; font-weight: 850; letter-spacing: .13em; }
.bet_result_panel h2 { margin: 5px 0 2px; color: var(--accent); font-size: 24px; }
.bet_result_panel.lost h2 { color: var(--accent2); }
.bet_result_panel > strong { color: #fff; font-size: 25px; }
.bet_result_panel p { max-width: 270px; margin: 7px 0 14px; color: var(--light); font-size: 9px; line-height: 1.4; }
.bet_result_panel button { min-height: 42px; padding: 0 20px; border: 0; border-radius: 11px; background: linear-gradient(96deg,#6d28d9,#7c3aed 65%,#2dd4bf); color: #fff; font-size: 10px; font-weight: 800; }
.virtual_win_real_prompt {
    width: min(100%, 290px);
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255,197,61,.35);
    border-radius: 12px;
    background: rgba(255,197,61,.07);
}
.virtual_win_real_prompt strong,
.virtual_win_real_prompt span { display: block; }
.virtual_win_real_prompt strong { color: #ffc53d; font-size: 10px; line-height: 1.3; }
.virtual_win_real_prompt span { margin-top: 3px; color: var(--light); font-size: 8px; line-height: 1.35; }
.bet_result_panel .virtual_win_deposit_button { width: min(100%, 290px); }
.bet_result_panel .bet_result_secondary_button {
    min-height: 30px;
    margin-top: 5px;
    padding: 0 10px;
    background: transparent;
    color: #a79fc4;
    font-size: 8px;
    text-decoration: underline;
}
.bet_result_pending { display: flex; min-height: 180px; align-items: center; justify-content: center; gap: 9px; color: #a78bfa; }
.bet_result_pending i { animation: spin 1s linear infinite; }

.activity_icon {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    border-radius: 9px;
    background: rgba(45, 212, 191, .1);
    color: var(--accent);
    font-size: 11px;
}

.activity_copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.activity_status {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    color: #8279aa;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .08em;
}

.activity_status i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 7px var(--accent);
}

.activity_message {
    overflow: hidden;
    color: #c9c2dd;
    font-size: 10px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity .22s ease, transform .22s ease;
}

.support_header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.support_back_button {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-raised);
    color: #a78bfa;
}

.support_back_button ion-icon { font-size: 18px; }
.support_header strong, .support_header span { display: block; }
.support_header strong { font-size: 15px; }
.support_header span { margin-top: 2px; color: var(--light); font-size: 9px; }

.invite_shell {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    gap: 10px;
}

.invite_hero {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 86% 10%, rgba(45,212,191,.13), transparent 32%),
        linear-gradient(145deg, rgba(31,17,69,.92), rgba(14,8,32,.98));
}

.invite_icon {
    display: grid;
    width: 38px;
    height: 38px;
    margin-bottom: 12px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #7c3aed, #2dd4bf);
    color: white;
    font-size: 15px;
}

.invite_hero > span {
    color: #a78bfa;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .14em;
}

.invite_hero h2 {
    margin: 5px 0 6px;
    font-size: 23px;
    line-height: 1.05;
    letter-spacing: -.045em;
}

.invite_hero p {
    margin: 0;
    color: var(--light);
    font-size: 10px;
    line-height: 1.45;
}

.invite_rewards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.invite_rewards > div {
    display: grid;
    min-height: 72px;
    grid-template-columns: 25px 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.invite_rewards i { grid-row: 1 / 3; align-self: center; color: #a78bfa; }
.invite_rewards span { color: var(--light); font-size: 8px; }
.invite_rewards strong { margin-top: 3px; color: var(--accent); font-size: 14px; }
.invite_rewards > div:last-child strong { color: #ffc53d; }

.invite_link_card {
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}

.invite_link_card > span { color: #756d92; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.invite_link_card > div { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.invite_link_card code { flex: 1; overflow: hidden; color: #c9c2dd; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.invite_link_card button { width: 30px; height: 30px; border: 0; border-radius: 9px; background: #1f1145; color: #a78bfa; }

.invite_share_button {
    min-height: 48px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(96deg, #6d28d9, #7c3aed 68%, #2dd4bf);
    color: white;
    font-size: 12px;
    font-weight: 800;
}

.invite_share_button i { margin-right: 7px; }
.invite_steps { display: flex; align-items: center; justify-content: space-between; color: #756d92; }
.invite_steps > div { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.invite_steps b { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: #a78bfa; font-size: 8px; }
.invite_steps span { font-size: 7px; line-height: 1.2; }
.invite_steps > i { font-size: 7px; }
.invite_steps .is-reward b { border-color: rgba(45,212,191,.5); background: rgba(45,212,191,.12); color: var(--accent); }
.invite_preview_note { margin-top: auto; color: #756d92; font-size: 8px; text-align: center; }

.activity_message.is-changing {
    opacity: 0;
    transform: translateY(3px);
}

.nav_icon_wrapper {
    display: flex;
}

.nav_subtab_container {
    width: 100%;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}

.nav_subtab_button {
    flex: 1;
    justify-content: center;
    min-height: 42px;
    border-radius: 10px;
    background: transparent;
    color: #8279aa;
    font-size: 12px;
    font-weight: 700;
}

.nav_subtab_button.active {
    background: #1f1145;
    color: #a78bfa;
}

.credit-card {
    min-height: 220px;
    padding: 20px;
    overflow: hidden;
    border-color: var(--border-strong);
    border-radius: 20px;
    background:
        radial-gradient(circle at 82% 16%, rgba(139, 92, 246, 0.17), transparent 32%),
        linear-gradient(135deg, #1f1145, #0e0820 62%, #07040f);
}

.credit-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -58px;
    bottom: -95px;
    border: 1px solid rgba(167, 139, 250, 0.16);
    border-radius: 42px;
    transform: rotate(-18deg);
}

.company-name {
    font-size: 16px;
    font-weight: 750;
}

.issued-date,
.card-footer > div:last-child {
    color: var(--light);
}

.chip {
    width: 40px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(145deg, #ffc53d, #f59e0b);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.18);
}

.balance {
    color: var(--accent);
}

.ton_connect {
    padding: 22px 18px;
    border-radius: 18px;
    gap: 15px;
}

.ton_connect_title2 {
    font-size: 18px;
    letter-spacing: -0.02em;
}

.ton_connect_image2 {
    width: min(190px, 56vw);
    height: 170px;
    object-fit: contain;
}

.ton_connect_text2 {
    max-width: 340px;
    color: var(--light);
    font-size: 12px;
    line-height: 1.55;
}

#ton-connect-button div tc-root button {
    min-height: 48px;
    border-radius: 13px;
    background: linear-gradient(96deg, #6d28d9, #7c3aed 76%, #2dd4bf) !important;
}

/* The Privy SDK mounts its own UI styles at runtime. Keep the game's trigger
   visually consistent and isolated from those injected defaults. */
#privy-deposit-root .privy-deposit-button {
    width: 100% !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 12px 16px !important;
    border: 1px solid rgba(154, 112, 255, .62) !important;
    border-radius: 13px !important;
    background: linear-gradient(100deg, #5b21b6 0%, #7c3aed 68%, #238f91 140%) !important;
    box-shadow: 0 9px 24px rgba(87, 37, 181, .24) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    appearance: none !important;
}

#privy-deposit-root .privy-deposit-button ion-icon {
    flex: 0 0 auto !important;
    color: #fff !important;
    font-size: 18px !important;
}

.crypto-picker-overlay {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: grid;
    align-items: end;
    padding: 16px;
    background: rgba(3, 1, 10, .78);
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
}

.crypto-picker-modal {
    position: relative;
    width: min(100%, 480px);
    max-height: min(760px, calc(100dvh - 32px));
    margin: 0 auto;
    overflow: auto;
    padding: 25px 18px 18px;
    border: 1px solid rgba(157, 115, 255, .54);
    border-radius: 24px;
    background: radial-gradient(circle at 88% 0%, rgba(45, 212, 191, .12), transparent 31%), linear-gradient(150deg, #1b0d38, #0b0619 70%);
    box-shadow: 0 -18px 60px rgba(0,0,0,.56);
    animation: cryptoPickerIn .22s ease-out;
}
@keyframes cryptoPickerIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.crypto-picker-close {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 11px;
    background: rgba(0,0,0,.2);
    color: #c8bddf;
    font-size: 20px;
}
.crypto-picker-eyebrow { color: #bda2ff; font-size: 9px; font-weight: 850; letter-spacing: .15em; }
.crypto-picker-eyebrow ion-icon { margin-right: 5px; font-size: 12px; vertical-align: -2px; }
.crypto-picker-modal h2 { margin: 9px 0 6px; color: #fff; font-size: 23px; letter-spacing: -.035em; }
.crypto-picker-modal > p { margin: 0 0 17px; color: #aaa0c3; font-size: 12px; line-height: 1.45; }
.crypto-picker-list { display: flex; flex-direction: column; gap: 8px; }
.crypto-picker-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border: 1px solid rgba(151, 109, 255, .25);
    border-radius: 15px;
    background: rgba(255,255,255,.035);
    color: #fff;
    text-align: left;
    font: inherit;
}
.crypto-picker-option:active { transform: scale(.985); background: rgba(139, 92, 246, .17); }
.crypto-picker-copy { flex: 1; min-width: 0; }
.crypto-picker-copy strong { display: block; font-size: 14px; font-weight: 750; }
.crypto-picker-copy small { display: block; margin-top: 2px; color: #a89dbc; font-size: 10px; }
.crypto-picker-option > ion-icon { color: #aa8fff; font-size: 18px; }
.crypto-picker-option em { color: #f4b544; font-size: 9px; font-style: normal; font-weight: 800; }
.crypto-logo {
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 23px;
    font-weight: 850;
    line-height: 1;
}
.crypto-logo svg { width: 22px; height: 22px; fill: currentColor; }
.crypto-logo.bitcoin { background: #f7931a; }
.crypto-logo.ethereum { background: #627eea; }
.crypto-logo.solana { background: linear-gradient(145deg, #17e6b4, #8b5cf6 54%, #ff4fb2); }
.crypto-logo.usdc { background: #2775ca; font-size: 10px; }
.crypto-logo.usdt { background: #26a17b; font-size: 11px; }
.crypto-picker-footnote { display: flex; align-items: center; gap: 6px; margin: 15px 2px 1px; color: #827695; font-size: 9px; line-height: 1.4; }
.crypto-picker-footnote ion-icon { color: #2dd4bf; font-size: 15px; }
.privy-wallet-address { display: flex; align-items: center; gap: 9px; }
.privy-wallet-address .crypto-logo { width: 26px; height: 26px; flex-basis: 26px; font-size: 16px; }
.privy-wallet-address .crypto-logo svg { width: 16px; height: 16px; }

.privy-connected-card {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(45, 212, 191, .28);
    border-radius: 12px;
    background: rgba(45, 212, 191, .07);
    text-align: left;
}

.privy-connected-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(45, 212, 191, .14);
    color: #2dd4bf;
    font-size: 17px;
}

.privy-connected-copy { min-width: 0; }
.privy-connected-copy span {
    display: block;
    margin-bottom: 2px;
    color: #8f83ad;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.privy-connected-copy strong {
    display: block;
    color: #fff;
    font-size: 12px;
    font-weight: 750;
}
.privy-connected-copy code {
    display: block;
    overflow: hidden;
    color: #2dd4bf;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.privy-deposit-note {
    margin: 9px 3px 0;
    color: #9f94ba;
    font-size: 9px;
    line-height: 1.45;
    text-align: center;
}

.my_bets_list,
#transactions_list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.my_bets_list .app_container_lg_inner,
#transactions_list .app_container_lg_inner {
    border-radius: 15px;
}

.bet_status_icon_pending,
.bet_status_icon_bad,
.bet_status_icon_good,
.deposit_status_icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-raised);
}

.bet_status_icon_good,
.deposit_status_icon {
    color: var(--accent);
}

.bet_status_icon_bad {
    color: var(--accent2);
}

.my_bets_list .bet_history_card {
    min-height: 66px;
    padding: 9px 10px;
}

.my_bets_list .bet_status_icon_pending,
.my_bets_list .bet_status_icon_bad,
.my_bets_list .bet_status_icon_good {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
    font-size: 14px;
    opacity: .82;
}

.my_bets_list .asset_name {
    color: #8279aa;
    font-size: 8px;
    font-weight: 650;
}

.my_bets_list .history_currency_badge { font-size: 5px; }
.my_bets_list .asset_price_wrapper { margin-top: 4px; opacity: .78; }
.my_bets_list .pill_stake_wrapper,
.my_bets_list .bet_resolved_at_pill { font-size: 7px; }

.my_bets_list .bet_reward_wrapper {
    min-width: 92px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(21,12,46,.72);
}

.my_bets_list .bet_reward_title {
    color: #fff;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: -.025em;
}

.my_bets_list .bet_reward_value_good,
.my_bets_list .bet_reward_value_bad {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 850;
}

.support_textarea {
    min-height: 300px;
    height: calc(100dvh - 270px);
    padding: 15px;
    border-radius: 15px;
    color: var(--white);
    line-height: 1.5;
    outline: none;
}

.support_textarea:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.13);
}

.modal_overlay {
    align-items: center;
    padding: 12px;
    background: rgba(7, 4, 15, 0.82);
    backdrop-filter: blur(7px);
}

.modal_container {
    width: 100%;
    max-width: 460px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 18px;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.23), transparent 34%),
        linear-gradient(180deg, #1f1145, #0e0820 22%, #07040f);
    box-shadow: 0 24px 70px rgba(3, 1, 10, 0.78);
}

.modal_overlay.is-open .modal_container {
    animation: corporateModalIn 260ms cubic-bezier(.2, .95, .25, 1) forwards;
}

@keyframes corporateModalIn {
    from { transform: translateY(18px) scale(.985); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal_header_title {
    margin: 0;
    color: #a78bfa;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.modal_close_button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-raised);
    color: var(--light);
}

.modal_body {
    gap: 13px;
}

.offer_visual_shell {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    filter: drop-shadow(0 16px 24px rgba(3, 1, 10, 0.6)) drop-shadow(0 0 20px rgba(139, 92, 246, 0.25));
}

.offer_visual_shell .modal_body_image {
    width: 172px;
    height: 172px;
    max-width: none;
    object-fit: contain;
    object-position: center;
}

.modal_body > .modal_body_image {
    width: 178px;
    height: 178px;
    object-fit: contain;
}

.modal_body_image {
    animation: premiumFloat 5s ease-in-out infinite;
}

@keyframes premiumFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-5px) rotate(1deg); }
}

.modal_body_text {
    color: var(--white);
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.preconnect_title {
    font-size: 20px;
    letter-spacing: -0.025em;
}

.preconnect_subtitle {
    max-width: 340px;
    margin-top: 7px;
    color: var(--light);
    font-size: 12px;
    line-height: 1.5;
}

.tablo_main_wrapper {
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface-raised);
}

.tablo_title {
    color: var(--light);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tablo_card {
    width: 34px;
    height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--accent3);
    font-size: 24px;
}

.tablo_seperator {
    color: var(--accent3);
    font-size: 25px;
}

.deposit_button_boosted,
.modal_button {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: linear-gradient(96deg, #6d28d9, #7c3aed 76%, #2dd4bf);
    color: white;
    font-size: 14px;
    font-weight: 750;
    box-shadow: 0 12px 30px rgba(109, 40, 217, 0.25);
}

.default_deposit_button {
    color: var(--light);
    font-size: 11px;
}

#loading_screen {
    background: #07040f;
}

#bouncing-dots .dot {
    background: var(--violet);
}

@media (max-width: 380px) {
    .app_tab {
        padding-inline: 12px;
    }

    .bet_offer_tab_chart_container,
    .bet_details_tab_chart_container {
        height: clamp(220px, 35dvh, 280px);
        min-height: 220px;
    }

    .modal_container {
        padding: 15px;
    }

    .offer_visual_shell {
        width: 150px;
        height: 150px;
    }

    .offer_visual_shell .modal_body_image {
        width: 146px;
        height: 146px;
    }
}

@media (max-height: 700px) {
    .app_tab { gap: 8px; padding-top: calc(var(--app-safe-top) + 55px); }
    .app_container_lg { gap: 8px; }
    #bet_offer_tab {
        gap: 6px;
    }
    #bet_offer_tab > .app_container_lg:first-child {
        flex: 1 1 auto;
        min-height: 0;
        gap: 6px;
    }
    #bet_offer_tab > .app_container_lg:nth-child(2) {
        flex: 0 0 auto;
        gap: 6px;
    }
    #bet_offer_tab .app_container_lg_inner_chart {
        flex: 1 1 auto;
        min-height: 0;
    }
    .app_container_lg_inner { min-height: 64px; padding-block: 9px; }
    #bet_offer_tab .app_container_lg_inner { min-height: 48px; padding-block: 6px; }
    #bet_offer_tab .trade_heading span { font-size: 6px; }
    #bet_offer_tab .trade_heading strong { font-size: clamp(14px, 4vw, 17px); line-height: 1.15; }
    .bet_offer_tab_chart_container,
    body.telegram-overlay-fallback .bet_offer_tab_chart_container {
        width: 100%;
        height: 100%;
        min-height: 118px;
    }
    .app_bet_details_container { min-height: 70px; padding-block: 8px; }
    .stake_selector_card { min-height: 76px; gap: 4px; padding: 5px 8px; }
    .stake_selector_title small { display: none; }
    .stake_reward_preview { gap: 1px; }
    .stake_reward_preview strong { font-size: 15px; }
    .stake_quick_amounts button { height: 23px; }
    .stake_custom_row { min-height: 27px; margin-top: 0; padding-block: 1px; }
    .stake_custom_stepper { grid-template-columns: 26px 54px 26px 26px; }
    .stake_step_button, .stake_confirm_button, .stake_custom_amount { width: auto; height: 23px; }
    .bet_button_lower, .bet_button_higher { min-height: 42px; }
    .leaderboard_row { min-height: 53px; padding-block: 6px; }
    .leaderboard_mode { min-height: 34px; }
}

@media (max-height: 620px) {
    #bet_offer_tab {
        padding-bottom: calc(82px + var(--app-safe-bottom));
    }
    #bet_offer_tab .app_container_lg_inner { min-height: 42px; padding: 4px 9px; }
    #bet_offer_tab .asset_logo { width: 30px; height: 30px; font-size: 17px; }
    #bet_offer_tab .trade_heading span { display: none; }
    #bet_offer_tab .training_buffer_notice { display: none; }
    #bet_offer_tab .trade_heading strong { font-size: 13px; }
    .bet_offer_tab_chart_container,
    body.telegram-overlay-fallback .bet_offer_tab_chart_container { min-height: 100px; }
    .stake_selector_title { display: none; }
    .stake_selector_card { min-height: 66px; }
    .stake_quick_amounts button { height: 21px; }
    .stake_custom_row { min-height: 24px; }
    .stake_step_button, .stake_confirm_button, .stake_custom_amount { height: 21px; }
    .bet_button_lower, .bet_button_higher { min-height: 38px; font-size: 13px; }
    .button_undertext_lower, .button_undertext_higher { margin-top: 0; font-size: 7px; }
}

@media (max-height: 900px) {
    #bet_offer_tab {
        gap: 7px;
        padding-bottom: calc(76px + var(--app-safe-bottom));
    }
    #bet_offer_tab > .app_container_lg:first-child { gap: 7px; }
    #bet_offer_tab > .app_container_lg:nth-child(2) { gap: 7px; }
    #bet_offer_tab .trade_heading { min-height: 39px; }
    #bet_offer_tab .trade_heading strong { font-size: clamp(15px, 4.3vw, 17px); }
    #bet_offer_tab .bet_offer_tab_chart_container,
    body.telegram-overlay-fallback #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(188px, 29dvh, 250px);
        min-height: 188px;
    }
    #bet_offer_tab .stake_selector_card { gap: 5px; padding-block: 7px; }
    #bet_offer_tab .stake_quick_amounts button { height: 25px; }
    #bet_offer_tab .stake_custom_row { min-height: 29px; margin-top: 1px; }
    #bet_offer_tab .stake_step_button,
    #bet_offer_tab .stake_confirm_button,
    #bet_offer_tab .stake_custom_amount { height: 25px; }
    #bet_offer_tab .bet_button_lower,
    #bet_offer_tab .bet_button_higher { min-height: 46px; }
}

@media (max-height: 760px) {
    body.telegram-overlay-fallback .app_tab {
        padding-top: calc(var(--app-safe-top) + 112px);
    }
    #bet_offer_tab .trade_heading { min-height: 34px; }
    #bet_offer_tab .trade_heading span { font-size: 5px; }
    #bet_offer_tab .trade_heading strong { margin-top: 1px; font-size: 14px; }
    #bet_offer_tab .bet_offer_tab_chart_container,
    body.telegram-overlay-fallback #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(130px, 20dvh, 160px);
        min-height: 130px;
    }
    #bet_offer_tab .stake_selector_card { min-height: 68px; padding-block: 5px; }
    #bet_offer_tab .stake_selector_title small { display: none; }
    #bet_offer_tab .stake_quick_amounts button { height: 22px; }
    #bet_offer_tab .stake_custom_row { min-height: 25px; }
    #bet_offer_tab .stake_step_button,
    #bet_offer_tab .stake_confirm_button,
    #bet_offer_tab .stake_custom_amount { height: 22px; }
    #bet_offer_tab .bet_button_lower,
    #bet_offer_tab .bet_button_higher { min-height: 42px; }

    body.telegram-overlay-fallback #bet_offer_tab > .app_container_lg:first-child {
        flex: 1 1 auto;
        min-height: 0;
    }
    body.telegram-overlay-fallback #bet_offer_tab .app_container_lg_inner_chart {
        flex: 1 1 auto;
        min-height: 0;
    }
    body.telegram-overlay-fallback #bet_offer_tab .bet_offer_tab_chart_container {
        height: 100%;
        min-height: 84px;
    }
}

/* Fill the real space between Telegram's top chrome and our bottom nav.
   The constants include the asset, heading, stake selector, actions and a
   permanent 12–16px safety gap above the navigation. */
@media (min-height: 701px) and (max-height: 760px) {
    #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(204px, calc(90dvh - 378px - var(--app-safe-top)), 306px);
        min-height: 204px;
    }
    body.telegram-overlay-fallback #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(155px, calc(90dvh - 427px - var(--app-safe-top)), 257px);
        min-height: 155px;
    }
}

@media (min-height: 761px) and (max-height: 900px) {
    #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(243px, calc(90dvh - 393px - var(--app-safe-top)), 413px);
        min-height: 243px;
    }
    body.telegram-overlay-fallback #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(194px, calc(90dvh - 442px - var(--app-safe-top)), 365px);
        min-height: 194px;
    }
}

/* Above 900px the regular layout restores roomier headers and cards. Keep
   growing the chart, but account for that extra vertical chrome so actions
   retain the same safe distance from the fixed navigation. */
@media (min-height: 901px) and (max-height: 1100px) {
    #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(310px, calc(90dvh - 452px - var(--app-safe-top)), 538px);
        min-height: 310px;
    }
    body.telegram-overlay-fallback #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(262px, calc(90dvh - 500px - var(--app-safe-top)), 490px);
        min-height: 262px;
    }
}

@media (max-height: 700px) {
    #bet_offer_tab .bet_offer_tab_chart_container,
    body.telegram-overlay-fallback #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(36px, calc(90dvh - 504px - var(--app-safe-top)), 126px);
        min-height: 36px;
    }
}

@media (max-height: 620px) {
    #bet_offer_tab { gap: 4px; }
    #bet_offer_tab > .app_container_lg { gap: 4px; }
    #bet_offer_tab .app_container_lg_inner { min-height: 36px; }
    #bet_offer_tab .trade_heading { min-height: 26px; }
    #bet_offer_tab .bet_offer_tab_chart_container,
    body.telegram-overlay-fallback #bet_offer_tab .bet_offer_tab_chart_container {
        height: clamp(28px, calc(54px - var(--app-safe-top)), 54px);
        min-height: 28px;
    }
    #bet_offer_tab .stake_selector_card { min-height: 54px; padding-block: 3px; }
    #bet_offer_tab .bet_button_lower,
    #bet_offer_tab .bet_button_higher { min-height: 34px; }
}

@media (max-height: 580px) {
    #bet_offer_tab {
        overflow-y: auto;
        padding-bottom: calc(78px + var(--app-safe-bottom));
    }
}

.bonus_payment_modal {
    max-width: 390px;
}

.bonus_payment_body {
    gap: 10px;
}

.bonus_payment_intro {
    margin-bottom: 4px;
    color: #b7accf;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.bonus_payment_option {
    display: grid;
    width: 100%;
    min-height: 66px;
    grid-template-columns: 42px 1fr 18px;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid rgba(125, 85, 243, .38);
    border-radius: 15px;
    background: linear-gradient(110deg, rgba(29, 14, 62, .96), rgba(13, 7, 30, .96));
    color: #fff;
    text-align: left;
}

.bonus_payment_option:active {
    border-color: rgba(55, 218, 198, .75);
    transform: scale(.99);
}

.bonus_payment_icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: rgba(124, 58, 237, .2);
    color: #bba5ff;
    font-size: 24px;
    font-weight: 900;
}

.bonus_payment_option.ton .bonus_payment_icon {
    background: rgba(0, 152, 234, .16);
    color: #45c6ff;
}

.bonus_payment_option span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.bonus_payment_option strong { font-size: 13px; }
.bonus_payment_option small { color: #9186ad; font-size: 9px; }
.bonus_payment_option > ion-icon { color: #786c98; font-size: 16px; }

.bonus_payment_note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 9px 10px;
    color: #8f84aa;
    font-size: 9px;
    line-height: 1.4;
}

.bonus_payment_note ion-icon {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 14px;
}

.referral_prompt[hidden] { display: none; }
.referral_prompt {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: grid;
    align-items: end;
    opacity: 0;
    transition: opacity .2s ease;
}
.referral_prompt.is-visible { opacity: 1; }
.referral_prompt_backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 0, 12, .76);
    backdrop-filter: blur(7px);
}
.referral_prompt_card {
    position: relative;
    width: min(calc(100% - 24px), 430px);
    margin: 0 auto max(14px, env(safe-area-inset-bottom));
    padding: 24px 18px 16px;
    border: 1px solid rgba(139, 92, 246, .55);
    border-radius: 25px;
    background: radial-gradient(circle at 50% 0, rgba(124,58,237,.24), transparent 38%), #0e0820;
    box-shadow: 0 22px 65px rgba(0,0,0,.55), 0 0 30px rgba(124,58,237,.16);
    color: #fff;
    text-align: center;
    transform: translateY(24px);
    transition: transform .24s ease;
}
.referral_prompt.is-visible .referral_prompt_card { transform: translateY(0); }
.referral_prompt_close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(167,139,250,.2);
    border-radius: 11px;
    background: rgba(19,9,43,.85);
    color: #9b91b5;
}
.referral_prompt_gift {
    display: grid;
    width: 62px;
    height: 62px;
    margin: 0 auto 13px;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(145deg, #7c3aed, #2dd4bf);
    box-shadow: 0 12px 30px rgba(45,212,191,.18);
    font-size: 25px;
}
.referral_prompt_eyebrow { color: #a78bfa; font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.referral_prompt_card h2 { margin: 7px auto 8px; max-width: 330px; font-size: 22px; line-height: 1.08; letter-spacing: -.035em; }
.referral_prompt_card > p { margin: 0 auto 14px; max-width: 340px; color: #a89fbd; font-size: 10px; line-height: 1.5; }
.referral_prompt_rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.referral_prompt_rewards div { padding: 11px 8px; border: 1px solid #34215f; border-radius: 13px; background: rgba(18,9,40,.78); }
.referral_prompt_rewards small { display: block; color: #81779b; font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.referral_prompt_rewards strong { display: block; margin-top: 4px; color: #2dd4bf; font-size: 17px; }
.referral_prompt_rewards div:last-child strong { color: #ffc53d; }
.referral_prompt_cta { width: 100%; min-height: 48px; border: 0; border-radius: 14px; background: linear-gradient(96deg,#6d28d9,#7c3aed 65%,#2dd4bf); color: white; font-size: 12px; font-weight: 850; }
.referral_prompt_cta i { margin-right: 7px; }
.referral_prompt_later { margin-top: 5px; padding: 9px 18px; border: 0; background: transparent; color: #9b91b5; font-size: 10px; text-decoration: underline; }

@media (min-height: 700px) {
    .referral_prompt { align-items: center; }
    .referral_prompt_card { margin-bottom: 0; }
}

.virtual_refill_prompt[hidden] { display: none; }
.virtual_refill_prompt {
    position: fixed;
    z-index: 5200;
    inset: 0;
    display: grid;
    align-items: center;
    padding: 18px;
    opacity: 0;
    transition: opacity .2s ease;
}
.virtual_refill_prompt.is-visible { opacity: 1; }
.virtual_refill_backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 0, 12, .82);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}
.virtual_refill_card {
    position: relative;
    width: min(100%, 390px);
    margin: 0 auto;
    padding: 25px 20px 19px;
    border: 1px solid rgba(255, 197, 61, .38);
    border-radius: 24px;
    background: radial-gradient(circle at 50% 0, rgba(255,197,61,.13), transparent 38%), linear-gradient(155deg, #1c0d3b, #0b0619 72%);
    box-shadow: 0 24px 70px rgba(0,0,0,.58), 0 0 30px rgba(124,58,237,.14);
    color: #fff;
    text-align: center;
    transform: translateY(12px) scale(.985);
    transition: transform .22s ease;
}
.virtual_refill_prompt.is-visible .virtual_refill_card { transform: translateY(0) scale(1); }
.virtual_refill_icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 13px;
    place-items: center;
    border: 1px solid rgba(255,197,61,.28);
    border-radius: 20px;
    background: linear-gradient(145deg, #6d28d9, #ffc53d 130%);
    box-shadow: 0 13px 34px rgba(124,58,237,.25);
    color: #ffd765;
    font-size: 26px;
}
.virtual_refill_eyebrow { color: #c4a7ff; font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.virtual_refill_card h2 { margin: 7px 0 7px; color: #ffc53d; font-size: 25px; line-height: 1.05; letter-spacing: -.035em; }
.virtual_refill_card p { margin: 0 auto 16px; max-width: 320px; color: #aaa0c3; font-size: 10px; line-height: 1.5; }
.virtual_refill_card button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(96deg, #6d28d9, #7c3aed 64%, #2dd4bf);
    box-shadow: 0 9px 24px rgba(90,43,190,.28);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
}
.virtual_refill_card button:disabled { opacity: .68; }
.virtual_refill_card button i { margin-right: 7px; }
#virtual_refill_error { display: block; min-height: 14px; margin-top: 8px; color: #fb7185; font-size: 9px; line-height: 1.35; }
