/* ——— Wallet page ——— */
.game-wallet-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.game-catalog-hero--wallet {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, #10b981 16%, var(--surface)) 0%,
        var(--surface) 48%,
        color-mix(in srgb, var(--accent) 8%, var(--surface)) 100%
    );
}

.game-catalog-hero--wallet .game-catalog-hero__icon {
    background: color-mix(in srgb, #10b981 22%, var(--surface-soft));
    color: #059669;
}

html.dark .game-catalog-hero--wallet {
    background: linear-gradient(135deg, #101412 0%, var(--surface) 52%, #101010 100%);
}

html.dark .game-catalog-hero--wallet .game-catalog-hero__icon {
    background: #1a2420;
    color: #6ee7b7;
}

.game-wallet-stats {
    margin-bottom: 0;
}

.game-stat-card--positive .game-stat-value {
    color: #16a34a;
}

.game-stat-card--negative .game-stat-value {
    color: #dc2626;
}

html.dark .game-stat-card--positive .game-stat-value {
    color: #4ade80;
}

html.dark .game-stat-card--negative .game-stat-value {
    color: #f87171;
}

.game-wallet-balance-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, #10b981 28%, var(--border));
    background: linear-gradient(
        145deg,
        color-mix(in srgb, #10b981 10%, var(--surface)) 0%,
        var(--surface) 70%
    );
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

html.dark .game-wallet-balance-card {
    border-color: color-mix(in srgb, #10b981 22%, var(--border));
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.game-wallet-balance-card__label {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.game-wallet-balance-card__value {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
}

.game-wallet-balance-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.game-wallet-balance-card__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.game-wallet-page .game-card {
    margin-bottom: 0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.game-wallet-history-head {
    margin-bottom: 16px;
}

.game-wallet-history .game-card-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    font-size: 1.02rem;
}

.game-wallet-history .game-card-title i {
    color: var(--muted);
    font-size: 0.92rem;
}

.game-wallet-history-hint {
    margin: 0;
    font-size: 0.88rem;
}

.game-wallet-ledger {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.game-wallet-entry {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.game-wallet-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.game-wallet-entry:first-child {
    padding-top: 0;
}

.game-wallet-entry__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    background: var(--surface-soft);
    color: var(--muted);
    border: 1px solid var(--border);
}

.game-wallet-entry--purchase .game-wallet-entry__icon {
    background: color-mix(in srgb, #ef4444 12%, var(--surface-soft));
    color: #dc2626;
    border-color: color-mix(in srgb, #ef4444 24%, var(--border));
}

.game-wallet-entry--sale .game-wallet-entry__icon,
.game-wallet-entry--topup .game-wallet-entry__icon {
    background: color-mix(in srgb, #22c55e 12%, var(--surface-soft));
    color: #16a34a;
    border-color: color-mix(in srgb, #22c55e 24%, var(--border));
}

.game-wallet-entry--debit .game-wallet-entry__icon {
    background: color-mix(in srgb, #f59e0b 12%, var(--surface-soft));
    color: #d97706;
    border-color: color-mix(in srgb, #f59e0b 24%, var(--border));
}

.game-wallet-entry__body {
    flex: 1;
    min-width: 0;
}

.game-wallet-entry__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
}

.game-wallet-entry__title {
    font-size: 0.96rem;
    font-weight: 650;
    line-height: 1.35;
}

.game-wallet-amount {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-wallet-amount--credit {
    color: #16a34a;
}

.game-wallet-amount--debit {
    color: #dc2626;
}

html.dark .game-wallet-amount--credit {
    color: #4ade80;
}

html.dark .game-wallet-amount--debit {
    color: #f87171;
}

.game-wallet-entry__subtitle {
    margin: 4px 0 0;
    font-size: 0.86rem;
    line-height: 1.4;
}

.game-wallet-entry__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.game-wallet-entry__meta-sep {
    opacity: 0.5;
}

.game-wallet-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 16px 12px;
    gap: 8px;
}

.game-wallet-empty__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    background: var(--surface-soft);
    color: var(--muted);
    margin-bottom: 8px;
}

.game-wallet-empty__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.game-wallet-empty__text {
    margin: 0 0 12px;
    max-width: 36ch;
    font-size: 0.9rem;
}

.game-wallet-pagination {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.game-wallet-pagination nav {
    display: flex;
    justify-content: center;
}

.game-wallet-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.game-wallet-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.game-wallet-pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.game-wallet-pagination .page-item.disabled .page-link {
    opacity: 0.45;
    pointer-events: none;
}

a.game-toolbar-wallet {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

a.game-toolbar-wallet:hover {
    border-color: color-mix(in srgb, #10b981 45%, var(--border));
    background: color-mix(in srgb, #10b981 6%, var(--surface-soft));
}

a.game-toolbar-wallet:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
    outline-offset: 2px;
}

.game-topbar-balance__icon {
    margin-right: 5px;
    font-size: 0.72rem;
    opacity: 0.75;
}

/* ——— Checkout / top-up modal ——— */
.game-checkout-modal {
    z-index: 220;
}

.game-checkout-modal .game-modal-backdrop {
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(10px);
}

.game-checkout-dialog {
    width: min(720px, calc(100vw - 24px));
    max-height: min(90vh, 640px);
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, #10b981 18%, var(--border));
    box-shadow:
        0 32px 80px rgba(15, 23, 42, 0.28),
        0 0 0 1px color-mix(in srgb, var(--surface) 85%, transparent);
    display: flex;
    flex-direction: column;
}

.game-checkout-layout {
    display: grid;
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    min-height: 380px;
    max-height: min(90vh, 640px);
}

.game-checkout-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 14px;
    background: color-mix(in srgb, var(--surface-soft) 88%, #0a0a0a);
    border-right: 1px solid var(--border);
}

html:not(.dark) .game-checkout-sidebar {
    background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
}

.game-checkout-sidebar__heading {
    margin: 0;
    padding: 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.game-checkout-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-checkout-side-method {
    cursor: pointer;
    margin: 0;
}

.game-checkout-side-method__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.game-checkout-side-method__card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px 12px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: color-mix(in srgb, var(--surface) 55%, transparent);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.game-checkout-side-method:hover .game-checkout-side-method__card {
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border-color: var(--border);
}

.game-checkout-side-method__input:checked + .game-checkout-side-method__card {
    background: color-mix(in srgb, #10b981 12%, var(--surface));
    border-color: color-mix(in srgb, #10b981 45%, var(--border));
}

.game-checkout-side-method--disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.game-checkout-side-method--disabled .game-checkout-side-method__card {
    filter: grayscale(0.2);
}

.game-checkout-side-method__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.game-checkout-side-method__icon--wallet {
    background: color-mix(in srgb, #10b981 20%, var(--surface));
    color: #059669;
}

.game-checkout-side-method__icon--crypto {
    background: color-mix(in srgb, #229ed9 18%, var(--surface));
    color: #229ed9;
}

.game-checkout-side-method__body {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}

.game-checkout-side-method__name {
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.25;
}

.game-checkout-side-method__desc {
    font-size: 0.74rem;
    line-height: 1.3;
    color: var(--muted);
}

.game-checkout-side-method__chevron {
    flex-shrink: 0;
    font-size: 0.68rem;
    color: var(--muted);
    opacity: 0.7;
}

.game-checkout-side-method__input:checked + .game-checkout-side-method__card .game-checkout-side-method__chevron {
    color: #10b981;
    opacity: 1;
}

.game-checkout-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.game-checkout-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.game-checkout-kicker {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #059669;
}

html.dark .game-checkout-kicker {
    color: #6ee7b7;
}

.game-checkout-title {
    margin: 0;
    font-size: 1.28rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.game-checkout-close {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.game-checkout-close:hover {
    background: var(--surface);
    color: var(--text);
    border-color: color-mix(in srgb, #10b981 35%, var(--border));
}

.game-checkout-panel__body {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    overflow-y: auto;
}

.game-checkout-hint {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
}

.game-checkout-alert {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, #f59e0b 12%, var(--surface-soft));
    border: 1px solid color-mix(in srgb, #f59e0b 28%, var(--border));
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text);
}

.game-checkout-alert i {
    margin-top: 2px;
    color: #d97706;
}

.game-checkout-amount__editable[hidden],
.game-checkout-amount__fixed[hidden] {
    display: none !important;
}

.game-checkout-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.game-checkout-product__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    color: var(--accent);
    font-size: 1.15rem;
    flex-shrink: 0;
}

.game-checkout-product__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.game-checkout-product__name {
    display: block;
    font-size: 1rem;
    line-height: 1.35;
}

.game-checkout-product__meta {
    margin: 4px 0 0;
    font-size: 0.84rem;
}

.game-checkout-amount {
    display: grid;
    gap: 8px;
}

.game-checkout-amount__label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
}

.game-checkout-amount__wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-checkout-amount__wrap:focus-within {
    border-color: color-mix(in srgb, #10b981 50%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, #10b981 16%, transparent);
}

.game-checkout-amount__currency {
    display: grid;
    place-items: center;
    padding: 0 16px;
    font-weight: 700;
    color: var(--muted);
    background: color-mix(in srgb, var(--border) 35%, var(--surface-soft));
    border-right: 1px solid var(--border);
}

.game-checkout-amount__input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    padding: 14px 16px;
    margin: 0;
    outline: none;
    -moz-appearance: textfield;
}

.game-checkout-amount__input::-webkit-outer-spin-button,
.game-checkout-amount__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.game-checkout-amount__fixed-value {
    margin: 0;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, #10b981 28%, var(--border));
    background: color-mix(in srgb, #10b981 8%, var(--surface-soft));
}

.game-checkout-amount__fixed-value strong {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.game-checkout-amount__hint {
    margin: 8px 0 0;
    font-size: 0.82rem;
}

.game-checkout-panel__footer {
    padding: 12px 22px 20px;
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.game-checkout-submit {
    gap: 8px;
    font-weight: 700;
    padding: 13px 16px;
}

.game-checkout-submit i {
    font-size: 0.88em;
    opacity: 0.9;
}

.btn.game-checkout-topup-btn {
    gap: 8px;
    font-weight: 700;
}

@media (max-width: 720px) {
    .game-checkout-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .game-checkout-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 14px 12px;
    }

    .game-checkout-sidebar__list {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 2px;
    }

    .game-checkout-side-method {
        flex: 0 0 auto;
        min-width: 168px;
    }

    .game-checkout-side-method__chevron {
        display: none;
    }
}

@media (max-width: 640px) {
    .game-wallet-balance-card {
        padding: 18px 16px;
    }

    .game-wallet-balance-card__actions {
        width: 100%;
    }

    .game-wallet-balance-card__actions .btn {
        flex: 1;
        justify-content: center;
    }

    .game-wallet-entry__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
