/* EMC effects top-up clean final */

/* Header balance - no avatar, no nested button */
body.effects-body .effects-header #miniBalanceButton.emc-topup-balance-button {
    all: unset;
    box-sizing: border-box;
    width: min(100%, 360px);
    height: 58px;
    display: block;
    cursor: pointer;
    border: 4px solid var(--ink);
    background: rgba(255, 255, 255, .18);
    color: var(--ink);
    box-shadow: 6px 6px 0 rgba(255, 0, 127, .18);
}

body.effects-body .effects-header #miniBalanceButton.emc-topup-balance-button *,
body.effects-body .effects-header #miniBalanceButton.emc-topup-balance-button *::before,
body.effects-body .effects-header #miniBalanceButton.emc-topup-balance-button *::after {
    box-sizing: border-box;
}

body.effects-body .effects-header #miniBalanceButton .emc-topup-balance-card {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 0 14px;
}

body.effects-body .effects-header #miniBalanceButton .emc-topup-balance-main {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

body.effects-body .effects-header #miniBalanceButton #miniBalance {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    color: var(--pink);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(22px, 2.4vw, 34px);
    line-height: 1;
    letter-spacing: -0.04em;
}

body.effects-body .effects-header #miniBalanceButton .emc-topup-balance-action {
    display: block;
    color: rgba(42, 12, 11, .78);
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    line-height: 1.25;
    white-space: nowrap;
    text-transform: uppercase;
}

body.effects-body .effects-header #miniBalanceButton:hover {
    transform: translate(-1px, -1px);
    box-shadow: 8px 8px 0 rgba(255, 0, 127, .20);
}

body.effects-body .effects-header #miniBalanceButton:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 rgba(255, 0, 127, .16);
}

@media (max-width: 520px) {
    body.effects-body .effects-header #miniBalanceButton.emc-topup-balance-button {
        width: 100%;
        height: 56px;
        border-width: 3px;
    }

    body.effects-body .effects-header #miniBalanceButton .emc-topup-balance-card {
        padding: 0 12px;
        gap: 10px;
    }

    body.effects-body .effects-header #miniBalanceButton #miniBalance {
        font-size: clamp(21px, 7.2vw, 31px);
    }

    body.effects-body .effects-header #miniBalanceButton .emc-topup-balance-action {
        font-size: 7px;
    }
}

/* Top-up modal. Scoped only to .emc-topup-* */
.emc-topup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 14px;
    background: rgba(10, 10, 14, .58);
    overflow: hidden;
}

.emc-topup-overlay[hidden] {
    display: none !important;
}

.emc-topup-overlay,
.emc-topup-overlay * {
    box-sizing: border-box;
    text-transform: none;
}

.emc-topup-window {
    width: min(430px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    padding: 22px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 24px;
    background: #fff;
    color: #201820;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
    font-family: Arial, Helvetica, sans-serif;
}

.emc-topup-window::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.emc-topup-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: start;
    gap: 12px;
    margin-bottom: 18px;
}

.emc-topup-title {
    margin: 0;
    min-width: 0;
    overflow: visible;
    color: #201820;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: 0;
    text-align: left;
    white-space: normal;
}

.emc-topup-close {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 14px;
    background: rgba(0, 0, 0, .06);
    color: #201820;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.emc-topup-field {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}

.emc-topup-label {
    color: rgba(32, 24, 32, .65);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.emc-topup-input {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 18px;
    outline: 0;
    background: rgba(0, 0, 0, .035);
    color: #201820;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    font-weight: 900;
}

.emc-topup-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 10px 0 18px;
}

.emc-topup-amount {
    margin: 10px 0 20px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--pink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(42px, 12vw, 64px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    text-align: center;
    white-space: nowrap;
}

.emc-topup-actions {
    display: grid;
    gap: 10px;
}

.emc-topup-preset,
.emc-topup-primary,
.emc-topup-secondary,
.emc-topup-danger {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.emc-topup-preset,
.emc-topup-secondary {
    background: rgba(0, 0, 0, .07);
    color: #201820;
}

.emc-topup-primary {
    background: #2b2b2f;
    color: #fff;
}

.emc-topup-danger {
    background: transparent;
    color: rgba(32, 24, 32, .58);
}

@media (max-width: 520px) {
    .emc-topup-window {
        padding: 18px;
        border-radius: 22px;
    }

    .emc-topup-presets {
        grid-template-columns: repeat(2, 1fr);
    }

    .emc-topup-title {
        font-size: 21px;
    }
}
