:root {
    --tebex-bg: #0B0F15;
    --tebex-panel: #0F1319;
    --tebex-panel-soft: #111D28;
    --tebex-text: #F5F7FA;
    --tebex-muted: #98A3B3;
    --tebex-border: #1A2535;
    --tebex-accent: #00FFC6;
    --tebex-accent-strong: #00D8B0;
    --tebex-danger: #ff7777;
    --tebex-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.tebex-store,
.tebex-store * {
    box-sizing: border-box;
}

.tebex-store {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px;
    border-radius: 18px;
    border: 1px solid var(--tebex-border);
    color: var(--tebex-text);
    font-family: "Sora", "Poppins", sans-serif;
    background:
        radial-gradient(100% 140% at 0% 0%, #122030 0%, transparent 62%),
        radial-gradient(80% 100% at 100% 0%, #0F1C2D 0%, transparent 54%),
        var(--tebex-bg);
    box-shadow: var(--tebex-shadow);
}

.tebex-topbar {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 22px;
    background: rgba(11, 15, 21, 0.74);
    border: 1px solid var(--tebex-border);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.tebex-eyebrow {
    margin: 0;
    color: var(--tebex-accent);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.tebex-title {
    margin: 0.35rem 0;
    font-size: clamp(1.5rem, 2.4vw, 2.3rem);
}

.tebex-subtitle {
    margin: 0;
    color: var(--tebex-muted);
}

.tebex-actions {
    min-width: 360px;
    display: grid;
    gap: 10px;
}

.tebex-auth-row,
.tebex-cart-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.tebex-username {
    color: var(--tebex-accent);
    font-weight: 700;
    padding: 0 4px;
}

.tebex-toolbar {
    margin-top: 16px;
    display: grid;
    grid-template-columns: minmax(220px, 460px);
    gap: 12px;
}

#tebex-login,
#tebex-logout,
#tebex-username {
    display: none;
}

.tebex-store:not(.is-authenticated) #tebex-login {
    display: inline-flex;
}

.tebex-store.is-authenticated #tebex-logout,
.tebex-store.is-authenticated #tebex-username {
    display: inline-flex;
}

.tebex-input {
    min-height: 42px;
    border: 1px solid var(--tebex-border);
    border-radius: 10px;
    background: var(--tebex-panel);
    color: var(--tebex-text);
    padding: 0 12px;
    outline: none;
}

.tebex-input:focus {
    border-color: var(--tebex-accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 198, 0.22);
}

.tebex-currency-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--tebex-muted);
}

.tebex-btn {
    border: 1px solid transparent;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tebex-btn:hover {
    transform: translateY(-1px);
}

.tebex-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.tebex-btn-primary {
    background: linear-gradient(135deg, var(--tebex-accent) 0%, #5CF5D8 100%);
    border-color: var(--tebex-accent);
    color: #030A16;
    font-weight: 700;
}

.tebex-btn-ghost {
    border-color: var(--tebex-border);
    background: rgba(11, 15, 21, 0.72);
    color: var(--tebex-text);
}

.tebex-btn-danger {
    border-color: rgba(255, 119, 119, 0.5);
    background: rgba(255, 119, 119, 0.12);
    color: #ffd9d9;
}

.tebex-pill {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 198, 0.2);
    color: var(--tebex-accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.tebex-status {
    min-height: 28px;
    margin: 14px 2px 0;
    font-size: 0.9rem;
}

.tebex-status.is-error {
    color: #ffb2b2;
}

.tebex-status.is-success {
    color: #90FFE6;
}

.tebex-status.is-info {
    color: #b5d4e8;
}

.tebex-products {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 220px));
    justify-content: flex-start;
    gap: 12px;
}

.tebex-card {
    border: 1px solid var(--tebex-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--tebex-panel);
    display: flex;
    flex-direction: column;
}

.tebex-card-media {
    aspect-ratio: 4 / 3;
    background: #0B0F15;
}

.tebex-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tebex-card-body {
    padding: 10px;
    display: grid;
    gap: 6px;
}

.tebex-card-body h3 {
    margin: 0;
    font-size: 0.9rem;
}

.tebex-card-price {
    margin: 0;
    color: var(--tebex-accent);
    font-size: 0.9rem;
    font-weight: 700;
}

.tebex-converted-note {
    margin: -2px 0 0;
    color: var(--tebex-muted);
    font-size: 0.75rem;
}

.tebex-chip {
    width: fit-content;
    margin: 0;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 198, 0.45);
    color: var(--tebex-accent);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.tebex-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tebex-loading,
.tebex-empty {
    border: 1px dashed var(--tebex-border);
    border-radius: 12px;
    padding: 22px;
    color: var(--tebex-muted);
    text-align: center;
}

.tebex-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(3, 10, 22, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.tebex-modal.is-open {
    display: flex;
}

.tebex-modal-panel {
    width: min(980px, 100%);
    max-height: min(88vh, 980px);
    overflow: auto;
    border: 1px solid var(--tebex-border);
    border-radius: 16px;
    background: linear-gradient(160deg, #0F1319 0%, #0B0F15 100%);
    box-shadow: var(--tebex-shadow);
    padding: 22px;
    position: relative;
}

.tebex-close {
    position: absolute;
    right: 12px;
    top: 10px;
    border: 0;
    background: transparent;
    color: var(--tebex-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.tebex-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tebex-modal-media {
    border: 1px solid var(--tebex-border);
    border-radius: 12px;
    background: #0B0F15;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.tebex-modal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tebex-modal-content h2 {
    margin: 0.4rem 0 0;
}

.tebex-price {
    margin: 0.45rem 0 0;
    color: var(--tebex-accent);
    font-size: 1.22rem;
    font-weight: 700;
}

.tebex-product-description {
    color: var(--tebex-muted);
}

.tebex-tab-list {
    margin-top: 14px;
    display: inline-flex;
    border: 1px solid var(--tebex-border);
    border-radius: 10px;
    overflow: hidden;
}

.tebex-tab {
    border: 0;
    background: #0F1319;
    color: var(--tebex-muted);
    padding: 9px 16px;
    cursor: pointer;
}

.tebex-tab.is-active {
    background: #162232;
    color: var(--tebex-text);
}

.tebex-pane {
    display: none;
    margin-top: 14px;
    gap: 10px;
}

.tebex-pane.is-active {
    display: grid;
}

.tebex-validation {
    margin: 0;
    font-size: 0.86rem;
    color: var(--tebex-muted);
}

.tebex-validation.ok {
    color: #90FFE6;
}

.tebex-validation.error {
    color: #ffbbbb;
}

.tebex-cart-panel {
    width: min(760px, 100%);
}

.tebex-cart-panel h2 {
    margin: 0 0 12px;
}

.tebex-cart-items {
    display: grid;
    gap: 10px;
}

.tebex-coupon-row {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
}

.tebex-cart-item {
    border: 1px solid var(--tebex-border);
    background: var(--tebex-panel-soft);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.tebex-cart-item.is-gift {
    border-color: rgba(0, 255, 198, 0.6);
    box-shadow: inset 0 0 0 1px rgba(0, 255, 198, 0.15);
}

.tebex-cart-item h4,
.tebex-cart-item p {
    margin: 0;
}

.tebex-cart-item p {
    color: var(--tebex-muted);
    font-size: 0.9rem;
}

.tebex-gift-meta {
    margin-top: 6px !important;
    padding: 7px 10px;
    border-left: 3px solid #00FFC6;
    border-radius: 8px;
    background: rgba(0, 255, 198, 0.12);
    color: #C0FFF0 !important;
    display: grid;
    gap: 2px;
}

.tebex-gift-meta strong {
    color: #7BFFE0;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tebex-gift-meta span {
    color: #D0FFF5;
    font-size: 0.9rem;
}

.tebex-cart-footer {
    margin-top: 14px;
    border-top: 1px solid var(--tebex-border);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.tebex-cart-footer p {
    margin: 0;
}

body.tebex-no-scroll {
    overflow: hidden;
}

.tebex-store.is-busy .tebex-products,
.tebex-store.is-busy .tebex-cart-items {
    opacity: 0.85;
}

@media (max-width: 920px) {
    .tebex-modal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .tebex-store {
        padding: 18px;
    }

    .tebex-actions {
        min-width: 0;
        width: 100%;
    }

    .tebex-auth-row,
    .tebex-cart-row {
        justify-content: flex-start;
    }

    .tebex-toolbar {
        grid-template-columns: 1fr;
    }

    .tebex-btn {
        width: 100%;
    }

    .tebex-card-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tebex-coupon-row {
        grid-template-columns: 1fr;
    }

    .tebex-cart-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .tebex-cart-footer {
        flex-direction: column;
        align-items: stretch;
    }
}