:root {
    --bg-body: #F8FAFC;
    --card-bg: #FFFFFF;
    --border-color: #E5E7EB;
    --primary-color: #2563eb;
    --safe-area-bottom: env(safe-area-inset-bottom);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: #111827;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

.font-display {
    font-family: 'Manrope', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.animate-fade-in { animation: fade-in 0.3s ease-out forwards; }
@keyframes fade-in { 
    from { opacity: 0; transform: translateY(4px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.pb-safe { padding-bottom: calc(60px + var(--safe-area-bottom)); }

/* Mobile Menu Animation */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
}
.mobile-menu.open {
    transform: translateX(0);
}

/* --- Custom select (dropdown đẹp + animation) --- */
.dtc-select {
    position: relative;
    width: 100%;
}

.dtc-select-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    background-color: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    transition: border-color 0.15s ease-out, background-color 0.15s ease-out, box-shadow 0.15s ease-out, transform 0.07s ease-out;
}

.dtc-select-toggle:hover {
    background-color: #eff6ff;
}

.dtc-select-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dtc-select-toggle i {
    margin-left: auto;
}

.dtc-select.is-open .dtc-select-toggle {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.dtc-select.is-open .dtc-select-toggle i {
    transform: rotate(180deg);
}

.dtc-select-menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    padding: 4px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px) scale(0.98);
    transform-origin: top;
    transition: opacity 0.16s ease-out, transform 0.16s ease-out;
}

.dtc-select.is-open .dtc-select-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.dtc-select-option {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    padding: 7px 10px;
    border-radius: 999px;
    cursor: pointer;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background-color 0.12s ease-out, color 0.12s ease-out, transform 0.06s ease-out;
}

.dtc-select-option:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.dtc-select-option.is-active {
    background-color: #2563eb;
    color: #ffffff;
}

.dtc-select-option.is-active::after {
    content: "✓";
    font-size: 11px;
}

/* Transaction Card Styles */
.transaction-card {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.transaction-card:active {
    transform: scale(0.98);
}

/* Modal Styles */
#transaction-modal {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    background-color: rgba(17, 24, 39, 0.3) !important;
    animation: fadeIn 0.2s ease-out;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#transaction-modal.flex {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#transaction-modal > div {
    animation: slideUp 0.3s ease-out;
    position: relative;
    margin: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Ngăn body scroll khi modal mở */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

/* History Tabs Style */
#history-tabs .history-tab {
    position: relative;
    padding-bottom: 8px;
}

#history-tabs .history-tab:hover {
    color: #2563eb;
}

#history-tabs .history-tab span:last-child {
    transition: all 0.2s ease-out;
}

/* Giới hạn height cho transaction list */
@media (min-width: 768px) {
    .bg-white.rounded-2xl > div.hidden.md\:block {
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 transparent;
    }
    
    .bg-white.rounded-2xl > div.hidden.md\:block::-webkit-scrollbar {
        width: 6px;
    }
    
    .bg-white.rounded-2xl > div.hidden.md\:block::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .bg-white.rounded-2xl > div.hidden.md\:block::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }
}

@media (max-width: 767px) {
    .bg-white.rounded-2xl > div.md\:hidden {
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 transparent;
    }
    
    .bg-white.rounded-2xl > div.md\:hidden::-webkit-scrollbar {
        width: 4px;
    }
    
    .bg-white.rounded-2xl > div.md\:hidden::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .bg-white.rounded-2xl > div.md\:hidden::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }
}

/* Discount Table Styles */
.discount-table-wrapper {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.discount-table-wrapper > div {
    overflow-x: auto;
}

.discount-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.discount-table-header-row {
    background-color: rgba(249, 250, 251, 0.8);
}

.discount-table-header-label {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    min-width: 180px;
}

.discount-table-header-denom {
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    min-width: 100px;
}

.discount-table-row {
    transition: background-color 0.15s ease-out;
}

.discount-table-row:hover {
    background-color: rgba(239, 246, 255, 0.3);
}

.discount-table-row:not(:first-child) {
    border-top: 1px solid #f3f4f6;
}

.discount-table-row-label {
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    color: #111827;
    border-right: 1px solid #f3f4f6;
    background-color: rgba(249, 250, 251, 0.3);
}

.discount-table-cell {
    padding: 1.25rem 1rem;
    text-align: center;
    border-right: 1px solid #f3f4f6;
}

.discount-table-cell:last-child {
    border-right: 0;
}

.discount-rate {
    font-weight: 500;
    color: #374151;
}

.discount-rate-active {
    color: #16a34a;
    font-weight: 700;
}

.discount-rate-empty {
    color: #d1d5db;
}

/* ===== Lootbar-like layout for game-topup ===== */
.lb-page {
    color: #0f172a;
}
.lb-hero {
    background: #ffffff;
    padding: 20px 0 14px;
}
.lb-hero__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 14px;
    display: flex;
    flex-direction: column;
}
.lb-hero__banner-row {
    display: flex;
    justify-content: center;
    overflow: hidden;
}
.lb-banner-slider {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
}
.lb-banner-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68%;
    max-width: 900px;
    height: 280px;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, z-index 0s;
    cursor: pointer;
}
@media (max-width: 768px) {
    .lb-hero {
        padding: 12px 0 10px;
    }
    .lb-hero__inner {
        padding: 0 12px;
    }
    .lb-hero__banner-row {
        padding: 0;
        margin: 0 -12px;
    }
    .lb-banner-slider {
        height: 180px;
        width: 100%;
        max-width: 100%;
    }
    .lb-banner-slide {
        width: 90%;
        max-width: none;
        height: 150px;
        border-radius: 16px;
    }
    .lb-banner-slide.is-left {
        transform: translate(-105%, -50%) scale(0.65);
        opacity: 0.4;
    }
    .lb-banner-slide.is-right {
        transform: translate(5%, -50%) scale(0.65);
        opacity: 0.4;
    }
    .lb-banner-slide.is-center {
        width: 90%;
    }
}
.lb-banner-slide.is-center {
    z-index: 3;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.lb-banner-slide.is-left {
    z-index: 1;
    transform: translate(-120%, -50%) scale(0.75);
    opacity: 0.65;
    filter: blur(2px);
}
.lb-banner-slide.is-right {
    z-index: 1;
    transform: translate(20%, -50%) scale(0.75);
    opacity: 0.65;
    filter: blur(2px);
}
.lb-banner-slide img {
    width: 100%;
    height: 100%;
    display: block;
}
.lb-banner-dots {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.65);
    backdrop-filter: blur(12px);
}
.lb-banner-dots span {
    width: 22px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
}
.lb-banner-dots span.is-active {
    background: #f97316;
}
.lb-category-row {
    padding-bottom: 8px;
    background: #ffffff;
}
.lb-category-item {
    position: relative;
    border-radius: 999px;
    transition: all 0.18s ease-out;
}
.lb-category-item:hover {
    background: #e5f0ff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transform: translateY(-3px);
}
@media (max-width: 768px) {
    .lb-category-row {
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .lb-category-item {
        min-width: auto;
    }
}

/* Cate siêu nhỏ (màn < 480px): thu hẹp icon + text để tránh tràn */
@media (max-width: 480px) {
    .lb-category-row {
        gap: 4px;
        padding-left: 8px;
        padding-right: 8px;
    }
    .lb-category-icon {
        width: 32px !important;
        height: 32px !important;
        border-radius: 14px;
    }
    .lb-category-label {
        font-size: 10px !important;
    }
}

.lb-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 14px 10px;
}
.lb-section--muted {
    padding-bottom: 40px;
}
.lb-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.lb-section__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: #475569;
    margin: 0;
    font-size: 12px;
}
.lb-section__title {
    margin: 2px 0 0;
    font-size: 20px;
    font-weight: 800;
}
.lb-section__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}
.lb-section__filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.lb-chip {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lb-chip.is-active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.lb-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.lb-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.lb-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    color: #0f172a;
}
.lb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
    border-color: #dbeafe;
}
.lb-card__thumb {
    position: relative;
    padding-top: 90%;
    overflow: hidden;
}
.lb-card__thumb img {
    position: absolute;
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.35s ease;
}
.lb-card:hover .lb-card__thumb img {
    transform: scale(1.05);
}
.lb-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 10px;
}
.lb-card__body {
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.lb-card__game {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.lb-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}
.lb-card__button {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 5px;
    border: 1px solid #fb923c;
    color: #f97316;
    font-weight: 700;
    font-size: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(248, 153, 72, 0.18);
    transition: all 0.18s ease-out;
}
.lb-card:hover .lb-card__button {
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 24px rgba(248, 153, 72, 0.32);
    transform: translateY(-1px);
}
.lb-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-weight: 700;
    font-size: 13px;
}
.lb-card--compact .lb-card__thumb {
    padding-top: 100%;
}
.lb-card--compact .lb-card__body {
    padding: 10px 10px 12px;
}
.lb-card__meta {
    margin: 0;
    color: #94a3b8;
    font-size: 12px;
}

.lb-btn {
    border: none;
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lb-btn--primary {
    background: #2563eb;
    color: #fff;
}
.lb-btn--primary:hover {
    background: #1d4ed8;
}
.lb-btn--light {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.lb-empty {
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    color: #475569;
    display: grid;
    place-items: center;
    gap: 8px;
}

.lb-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.lb-feature {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    display: grid;
    gap: 6px;
}
.lb-feature h4 {
    margin: 0;
    font-weight: 800;
    font-size: 15px;
}
.lb-feature p {
    margin: 0;
    color: #475569;
    font-size: 14px;
}

@media (max-width: 991px) {
}
@media (max-width: 768px) {
    .lb-section {
        padding: 22px 12px 6px;
    }
    .lb-hero__inner {
        padding: 0 12px;
    }
    .lb-card {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }
    .lb-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .lb-grid--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .lb-card__body {
        padding: 8px 8px 10px;
        gap: 4px;
    }
    .lb-card__game {
        font-size: 11px;
    }
    .lb-card__thumb {
        padding-top: 90%;
    }
    .lb-card__button {
        font-size: 10px;
        padding: 4px 10px;
    }
    .lb-card__title {
        font-size: 9px;
    }
}

@media (min-width: 769px) {
    /* Desktop: tăng min-width để 1 hàng ~6 game */
    .lb-grid,
    .lb-grid--compact {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .lb-grid > a,
    .lb-grid > div,
    .lb-grid--compact > a,
    .lb-grid--compact > div {
        max-width: 200px;
        width: 100%;
        justify-self: start;
    }
    .lb-card {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }
}

/* Search input */
.lb-search-input {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    outline: none;
    transition: all 0.15s ease-out;
}
.lb-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.16);
}