:root {
    --rngh-green: #72b51f;
    --rngh-green-deep: #4f9210;
    --rngh-green-soft: #f2fae9;
    --rngh-ink: #172218;
    --rngh-muted: #6c766e;
    --rngh-line: #e7ebe6;
    --rngh-surface: #ffffff;
    --rngh-bg: #f7f9f6;
    --rngh-credit: #2f8f4e;
    --rngh-credit-soft: #eaf7ee;
    --rngh-debit: #a1543d;
    --rngh-debit-soft: #fff1ec;
    --rngh-radius: 20px;
    --rngh-shadow: 0 16px 45px rgba(24, 45, 28, .08);
}

.rngh-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--rngh-green-deep);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .12em;
}

/* Account dashboard cards */
.rngh-wallet-dashboard-card,
.rngh-referral-card {
    position: relative;
    overflow: hidden;
    margin: 18px 0;
    border: 1px solid var(--rngh-line);
    border-radius: var(--rngh-radius);
    background: var(--rngh-surface);
    box-shadow: var(--rngh-shadow);
}

.rngh-wallet-dashboard-card {
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f5fbea 100%);
}

.rngh-wallet-dashboard-card::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    right: -70px;
    bottom: -85px;
    border-radius: 999px;
    background: rgba(114, 181, 31, .10);
}

.rngh-wallet-card-top,
.rngh-referral-card__top,
.rngh-wallet-checkout-head,
.rngh-wallet-main-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.rngh-wallet-card-top {
    justify-content: flex-start;
}

.rngh-wallet-card-top h3,
.rngh-referral-card h3,
.rngh-wallet-checkout-box h4,
.rngh-wallet-page h2,
.rngh-wallet-page h3 {
    margin: 0;
    color: var(--rngh-ink);
}

.rngh-wallet-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 14px;
    background: var(--rngh-green);
    box-shadow: 0 8px 20px rgba(114, 181, 31, .22);
}

.rngh-wallet-icon svg {
    width: 23px;
    height: 23px;
    fill: #fff;
}

.rngh-wallet-hero-balance {
    position: relative;
    z-index: 1;
    margin: 22px 0 5px;
    color: var(--rngh-ink);
    font-size: clamp(34px, 6vw, 48px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.04em;
}

.rngh-wallet-card-copy,
.rngh-wallet-reserved-note,
.rngh-referral-card p,
.rngh-wallet-checkout-copy,
.rngh-wallet-page-head p,
.rngh-wallet-main-card p {
    color: var(--rngh-muted);
}

.rngh-wallet-primary-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--rngh-green-deep) !important;
    font-weight: 700;
    text-decoration: none !important;
}

.rngh-wallet-primary-link span {
    transition: transform .18s ease;
}

.rngh-wallet-primary-link:hover span {
    transform: translateX(4px);
}

.rngh-referral-card {
    padding: 24px;
}

.rngh-referral-rate {
    display: inline-grid;
    min-width: 52px;
    height: 38px;
    place-items: center;
    border-radius: 999px;
    background: var(--rngh-green-soft);
    color: var(--rngh-green-deep);
    font-weight: 800;
}

.rngh-referral-code-row {
    display: flex;
    gap: 10px;
    margin: 18px 0 12px;
}

.rngh-referral-code {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    padding: 13px 15px;
    border: 1px dashed #bed49f;
    border-radius: 12px;
    background: #fbfef8;
    color: var(--rngh-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .08em;
    word-break: break-all;
}

.rngh-copy-referral,
.rngh-wallet-use-full {
    border: 0;
    border-radius: 12px;
    background: var(--rngh-green);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.rngh-copy-referral {
    padding: 0 18px;
}

.rngh-copy-referral:hover,
.rngh-wallet-use-full:hover {
    background: var(--rngh-green-deep);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(79, 146, 16, .18);
}

.rngh-copy-referral.is-copied {
    background: var(--rngh-ink);
}

/* Dedicated wallet page */
.rngh-wallet-page {
    max-width: 900px;
}

.rngh-wallet-page-head {
    margin-bottom: 20px;
}

.rngh-wallet-page-head h2 {
    font-size: 30px;
    letter-spacing: -.03em;
}

.rngh-wallet-page-head p {
    margin: 7px 0 0;
}

.rngh-wallet-main-card {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, #18261a 0%, #294a25 58%, #5a9c20 100%);
    box-shadow: 0 20px 50px rgba(27, 57, 30, .18);
    color: #fff;
}

.rngh-wallet-main-card::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    right: -90px;
    bottom: -145px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    box-shadow: 0 0 0 35px rgba(255,255,255,.035), 0 0 0 70px rgba(255,255,255,.025);
}

.rngh-wallet-icon--large {
    background: rgba(255,255,255,.14);
    box-shadow: none;
}

.rngh-wallet-status-pill {
    position: relative;
    z-index: 1;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.rngh-wallet-main-label {
    display: block;
    position: relative;
    z-index: 1;
    margin-top: 30px;
    color: rgba(255,255,255,.72);
    font-size: 13px;
}

.rngh-wallet-main-balance {
    position: relative;
    z-index: 1;
    margin: 5px 0 8px;
    color: #fff;
    font-size: clamp(38px, 8vw, 58px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.045em;
}

.rngh-wallet-main-card > p {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 0;
    color: rgba(255,255,255,.75);
}

.rngh-wallet-reserved-banner {
    position: relative;
    z-index: 1;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 11px;
    background: rgba(255,255,255,.11);
    color: rgba(255,255,255,.88);
    font-size: 13px;
}

.rngh-wallet-mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0 30px;
}

.rngh-wallet-stat {
    padding: 18px 20px;
    border: 1px solid var(--rngh-line);
    border-radius: 16px;
    background: var(--rngh-surface);
}

.rngh-wallet-stat span {
    display: block;
    margin-bottom: 4px;
    color: var(--rngh-muted);
    font-size: 12px;
    font-weight: 600;
}

.rngh-wallet-stat strong {
    color: var(--rngh-ink);
    font-size: 21px;
}

.rngh-wallet-section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rngh-wallet-activity-list {
    overflow: hidden;
    border: 1px solid var(--rngh-line);
    border-radius: 18px;
    background: var(--rngh-surface);
}

.rngh-wallet-activity-item {
    display: flex;
    gap: 14px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--rngh-line);
}

.rngh-wallet-activity-item:last-child {
    border-bottom: 0;
}

.rngh-wallet-activity-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    font-size: 18px;
    font-weight: 800;
}

.rngh-wallet-activity-icon.is-credit {
    background: var(--rngh-credit-soft);
    color: var(--rngh-credit);
}

.rngh-wallet-activity-icon.is-debit {
    background: var(--rngh-debit-soft);
    color: var(--rngh-debit);
}

.rngh-wallet-activity-body {
    min-width: 0;
    flex: 1;
}

.rngh-wallet-activity-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.rngh-wallet-activity-title strong {
    color: var(--rngh-ink);
}

.rngh-wallet-activity-amount {
    white-space: nowrap;
    font-weight: 800;
}

.rngh-wallet-activity-amount.is-credit {
    color: var(--rngh-credit);
}

.rngh-wallet-activity-amount.is-debit {
    color: var(--rngh-debit);
}

.rngh-wallet-activity-body p {
    overflow: hidden;
    margin: 4px 0 6px;
    color: var(--rngh-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rngh-wallet-activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: #8a928b;
    font-size: 11px;
}

.rngh-wallet-empty {
    padding: 38px 24px;
    border: 1px solid var(--rngh-line);
    border-radius: 18px;
    background: var(--rngh-surface);
    text-align: center;
}

.rngh-wallet-empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    place-items: center;
    border-radius: 50%;
    background: var(--rngh-green-soft);
    color: var(--rngh-green-deep);
    font-size: 22px;
    font-weight: 800;
}

.rngh-wallet-empty p {
    margin: 5px 0 0;
    color: var(--rngh-muted);
}

/* Checkout wallet */
.rngh-wallet-checkout-box {
    margin: 0 0 18px;
    padding: 20px;
    border: 1px solid #dfe8d8;
    border-radius: 18px;
    background: linear-gradient(145deg, #ffffff 0%, #f7fcef 100%);
    box-shadow: 0 10px 30px rgba(38, 70, 31, .06);
}

.rngh-wallet-available-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 8px 11px;
    border-radius: 12px;
    background: var(--rngh-green-soft);
}

.rngh-wallet-available-pill span {
    color: var(--rngh-muted);
    font-size: 10px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.rngh-wallet-available-pill strong {
    margin-top: 2px;
    color: var(--rngh-green-deep);
    font-size: 16px;
}

.rngh-wallet-checkout-copy {
    margin: 10px 0 15px;
    font-size: 13px;
}

.rngh-wallet-amount-control > label {
    display: block;
    margin-bottom: 7px;
    color: var(--rngh-ink);
    font-size: 12px;
    font-weight: 700;
}

.rngh-wallet-input-wrap {
    display: grid;
    grid-template-columns: auto minmax(90px, 1fr) auto;
    align-items: center;
    overflow: hidden;
    border: 1px solid #d8e2d2;
    border-radius: 13px;
    background: #fff;
}

.rngh-wallet-currency {
    padding-left: 14px;
    color: var(--rngh-ink);
    font-weight: 800;
}

.rngh-wallet-input-wrap #rngh_wallet_amount {
    width: 100%;
    min-height: 46px;
    margin: 0 !important;
    padding: 10px 8px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--rngh-ink);
    font-size: 17px;
    font-weight: 700;
    outline: none;
}

.rngh-wallet-use-full {
    align-self: stretch;
    margin: 5px;
    padding: 0 13px;
    border-radius: 9px;
    font-size: 12px;
}

.rngh-wallet-quick-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
}

.rngh-wallet-clear {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--rngh-green-deep);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.rngh-wallet-quick-actions span {
    color: #8a928b;
    font-size: 10px;
    line-height: 1.35;
    text-align: right;
}

/* Backward-compatible table styling */
.rngh-account-card {
    padding: 18px;
    border: 1px solid var(--rngh-line);
    border-radius: 16px;
    background: var(--rngh-surface);
}

.rngh-wallet-table {
    width: 100%;
    border-collapse: collapse;
}

.rngh-wallet-table th,
.rngh-wallet-table td {
    padding: 10px;
    border-bottom: 1px solid var(--rngh-line);
    text-align: left;
}

@media (max-width: 680px) {
    .rngh-wallet-dashboard-card,
    .rngh-referral-card,
    .rngh-wallet-main-card,
    .rngh-wallet-checkout-box {
        border-radius: 16px;
    }

    .rngh-wallet-dashboard-card,
    .rngh-referral-card,
    .rngh-wallet-main-card {
        padding: 20px;
    }

    .rngh-referral-code-row {
        align-items: stretch;
    }

    .rngh-referral-code {
        font-size: 15px;
    }

    .rngh-copy-referral {
        padding: 0 13px;
    }

    .rngh-wallet-mini-stats {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .rngh-wallet-stat {
        padding: 14px;
    }

    .rngh-wallet-stat strong {
        font-size: 17px;
    }

    .rngh-wallet-activity-item {
        gap: 10px;
        padding: 14px;
    }

    .rngh-wallet-activity-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .rngh-wallet-activity-title {
        align-items: flex-start;
    }

    .rngh-wallet-activity-body p {
        white-space: normal;
    }

    .rngh-wallet-input-wrap {
        grid-template-columns: auto minmax(70px, 1fr);
    }

    .rngh-wallet-use-full {
        grid-column: 1 / -1;
        min-height: 40px;
        margin: 0 5px 5px;
    }

    .rngh-wallet-quick-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .rngh-wallet-quick-actions span {
        text-align: left;
    }
}
