/* Storefront theme tokens, shared layout, and page styles.
   Colors come from :root in index.php (--app-primary, --app-secondary, theme vars). */

:root {
    --app-gradient: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
    --app-primary-soft: color-mix(in srgb, var(--app-primary) 18%, transparent);
    --app-secondary-soft: color-mix(in srgb, var(--app-secondary) 18%, transparent);
    --app-primary-ring: color-mix(in srgb, var(--app-primary) 22%, transparent);
    --app-secondary-ring: color-mix(in srgb, var(--app-secondary) 24%, transparent);
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 50px;
}

body.theme-dark {
    --surface: #0f172a;
    --surface-alt: #1e293b;
    --surface-muted: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --home-card-bg: #0f172a;
    --home-card-border: rgba(255, 255, 255, 0.08);
    --home-card-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    --home-text-title: #ffffff;
    --home-text-desc: #94a3b8;
    --home-marquee-bg: rgba(15, 23, 42, 0.85);
    --home-overlay-fade: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.6) 50%, #0f172a 100%);
    --home-control-bg: rgba(15, 23, 42, 0.75);
    --home-control-color: #ffffff;
}

body.theme-light {
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-muted: #f1f5f9;
    --surface-border: rgba(0, 0, 0, 0.08);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --home-card-bg: #ffffff;
    --home-card-border: rgba(0, 0, 0, 0.08);
    --home-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --home-text-title: #0f172a;
    --home-text-desc: #64748b;
    --home-marquee-bg: rgba(255, 255, 255, 0.95);
    --home-overlay-fade: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.65) 50%, #ffffff 100%);
    --home-control-bg: rgba(255, 255, 255, 0.85);
    --home-control-color: #0f172a;
}

html, body {
    font-family: var(--app-font-family) !important;
    font-size: var(--font-size, 16px);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, p, a, label, li,
input, select, textarea, button, .modal, .dropdown-menu {
    font-family: var(--app-font-family) !important;
}

span:not([class*="fa-"]) {
    font-family: var(--app-font-family) !important;
}

i[class*="fa-"], span[class*="fa-"],
.fa, .fa-solid, .fa-regular, .fa-brands {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    font-style: normal !important;
    font-weight: 900 !important;
}
.fa-regular { font-weight: 400 !important; }
.fa-brands { font-family: "Font Awesome 6 Brands" !important; font-weight: 400 !important; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background-color 0.25s ease;
    color: var(--text-main);
}

.main-container-wrapper {
    max-width: 1350px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.text-theme-main { color: var(--text-main) !important; }
.text-theme-sub,
body.theme-dark .text-secondary,
body.theme-light .text-secondary { color: var(--text-muted) !important; }

.icon-grad {
    background: var(--app-gradient) !important;
    color: #fff !important;
}

.card, .auth-card, .border-glowing, .dashboard-card {
    border-radius: var(--radius-lg) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .card,
body.theme-dark .auth-card,
body.theme-dark .border-glowing,
body.theme-dark .dashboard-card {
    background-color: var(--surface) !important;
    border: 1px solid var(--surface-border) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

body.theme-light .card,
body.theme-light .auth-card,
body.theme-light .border-glowing,
body.theme-light .dashboard-card {
    background-color: var(--surface) !important;
    border: 1px solid var(--surface-border) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04) !important;
}

body.theme-light label,
body.theme-light .form-label,
body.theme-light .card h1, body.theme-light .card h2, body.theme-light .card h3,
body.theme-light .card h4, body.theme-light .card h5, body.theme-light .card h6,
body.theme-light .card p,
body.theme-light .card span:not([class*="fa-"]):not(.badge):not(:where(.step-badge, .ls-ico)),
body.theme-light a:not(.custom-navbar *):not(.btn):not(.btn-gaming-buy):not(.btn-share-icon):not(.nav-link-item):not(:where(.page-item.active .page-link)) {
    color: var(--text-main) !important;
}

body.theme-dark label,
body.theme-dark .form-label,
body.theme-dark .card h1, body.theme-dark .card h2, body.theme-dark .card h3,
body.theme-dark .card h4, body.theme-dark .card h5, body.theme-dark .card h6,
body.theme-dark .card p,
body.theme-dark .card span:not([class*="fa-"]):not(.badge):not(:where(.step-badge, .ls-ico)),
body.theme-dark a:not(.custom-navbar *):not(.btn):not(.btn-gaming-buy):not(.btn-share-icon):not(.nav-link-item):not(:where(.page-item.active .page-link)) {
    color: var(--text-main) !important;
}

.form-control,
.form-control-custom,
.form-control-topup {
    background-color: var(--surface-alt) !important;
    color: var(--text-main) !important;
    border: 1.5px solid var(--surface-border) !important;
    border-radius: 12px;
}

.form-control::placeholder,
.form-control-custom::placeholder,
.form-control-topup::placeholder {
    color: var(--text-muted) !important;
}

.form-control:focus,
.form-control-custom:focus,
.form-control-topup:focus {
    border-color: var(--app-secondary) !important;
    box-shadow: 0 0 0 3px var(--app-primary-ring) !important;
    color: var(--text-main) !important;
    background-color: var(--surface-alt) !important;
}

.btn-primary,
button[type="submit"]:not(.btn-outline-danger):not(.btn-outline-secondary),
#submitLoginBtn,
#submitRegisterBtn,
.btn-auth-submit,
.btn-action-adaptive,
.btn-buy-action,
.btn-topup-action,
.btn-gaming-action,
.btn-pro-primary:hover {
    background: var(--app-primary) !important;
    border: 1.5px solid var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
}

.btn-primary,
.btn-auth-submit,
#submitLoginBtn,
#submitRegisterBtn {
    border-radius: var(--radius-pill);
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover,
button[type="submit"]:not(.btn-outline-danger):not(.btn-outline-secondary):hover,
#submitLoginBtn:hover,
#submitRegisterBtn:hover,
.btn-auth-submit:hover,
.btn-action-adaptive:hover,
.btn-buy-action:hover,
.btn-topup-action:hover,
.btn-gaming-action:hover {
    background: var(--app-secondary) !important;
    border-color: var(--app-secondary) !important;
    color: var(--app-secondary-contrast, #ffffff) !important;
    transform: translateY(-2px);
}

.btn-buy-action,
.btn-topup-action,
.btn-gaming-action {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
    border: none !important;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 14px var(--app-primary-ring);
}

.btn-buy-action:hover,
.btn-topup-action:hover,
.btn-gaming-action:hover {
    filter: brightness(1.08);
}

/* Preloader */
#sitePreloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #0b0f19;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease, visibility 0.35s;
}
#sitePreloader.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-wrapper {
    position: relative;
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.08);
    border-top: 2.5px solid var(--app-primary);
    border-right: 2.5px solid var(--app-secondary);
    animation: spinLoader 0.9s linear infinite;
}
@keyframes spinLoader { to { transform: rotate(360deg); } }
.loader-center-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--app-primary);
}

body.theme-dark .swal2-popup {
    background-color: var(--surface) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--surface-border) !important;
}
body.theme-dark .swal2-title, body.theme-dark .swal2-html-container { color: var(--text-main) !important; }
body.theme-light .swal2-popup {
    background-color: var(--surface) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--surface-border) !important;
}
body.theme-light .swal2-title, body.theme-light .swal2-html-container { color: var(--text-main) !important; }
.swal2-popup .btn-gaming-action {
    background: var(--app-gradient) !important;
    border: none !important;
    color: #ffffff !important;
}

/* Navbar */
.floating-navbar-container {
    position: sticky;
    top: 18px;
    z-index: 1030;
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
    animation: navSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

body .custom-navbar,
body.theme-dark .custom-navbar,
body.theme-light .custom-navbar {
    background-color: var(--navbar-bg) !important;
    border: 1.5px solid var(--app-primary) !important;
    border-radius: var(--radius-pill) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    padding: 0.45rem 1.25rem !important;
}

.custom-navbar .navbar-brand {
    color: var(--navbar-text) !important;
}
.custom-navbar .navbar-toggler i {
    color: var(--navbar-text) !important;
}

.nav-search-input {
    background: transparent !important;
    border-color: var(--app-primary) !important;
    color: var(--navbar-text) !important;
}
.nav-search-btn {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
    border: 1.5px solid var(--app-primary) !important;
}

.btn-user-pill {
    background: transparent !important;
    border: 1.5px solid var(--app-primary) !important;
    border-radius: var(--radius-pill);
    padding: 0.4rem 1.1rem 0.4rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--navbar-text) !important;
    text-decoration: none;
    transition: all 0.25s ease;
}
.btn-user-pill i { color: var(--app-primary-text) !important; }
.btn-user-pill:hover,
.btn-user-pill[aria-expanded="true"] {
    border-color: var(--app-secondary) !important;
    background: color-mix(in srgb, var(--navbar-text) 12%, transparent) !important;
}
.btn-user-pill:hover i,
.btn-user-pill[aria-expanded="true"] i { color: var(--app-secondary-text) !important; }

body .dropdown-menu.custom-dropdown-menu {
    background-color: var(--navbar-bg) !important;
    border: 1.5px solid var(--app-primary) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7) !important;
    padding: 10px !important;
    min-width: 240px;
    margin-top: 10px !important;
}

body .custom-dropdown-item {
    color: var(--navbar-text) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: transparent !important;
    border: 1.5px solid transparent !important;
    transition: all 0.2s ease;
}
body .custom-dropdown-item i {
    color: var(--app-primary-text) !important;
}
body .custom-dropdown-item:hover,
body .custom-dropdown-item.active-item {
    background: color-mix(in srgb, var(--navbar-text) 10%, transparent) !important;
    border-color: var(--app-secondary) !important;
    color: var(--navbar-text) !important;
}
body .custom-dropdown-item:hover i,
body .custom-dropdown-item.active-item i {
    color: var(--app-secondary-text) !important;
}

.nav-link-item {
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.45rem 1.25rem !important;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: 1.5px solid var(--app-primary) !important;
    background: transparent !important;
    color: var(--navbar-text) !important;
    transition: all 0.25s ease;
}
.nav-link-item i { color: var(--app-primary-text) !important; }
.nav-link-item:hover {
    border-color: var(--app-secondary) !important;
    background: color-mix(in srgb, var(--navbar-text) 10%, transparent) !important;
    color: var(--navbar-text) !important;
    transform: translateY(-2px);
}
.nav-link-item:hover i { color: var(--app-secondary-text) !important; }
.nav-link-item.active-link {
    border-color: var(--app-primary) !important;
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
    font-weight: 700;
}
.nav-link-item.active-link i { color: #ffffff !important; }


/* Gaming product cards */
.gaming-product-card {
    border-radius: var(--radius-xl) !important;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    background-color: var(--surface) !important;
    border: 1px solid var(--app-primary) !important;
}
.gaming-product-card:hover {
    transform: translateY(-4px);
    border-color: var(--app-secondary) !important;
    box-shadow: 0 0 24px var(--app-secondary-ring);
}
.gaming-product-card.is-clickable { cursor: pointer; }

/* Per-user scrollbar and pointer decorations */
html[data-scrollbar-style="default"],
body[data-scrollbar-style="default"],
body[data-scrollbar-style="default"] * {
    scrollbar-width: thin;
    scrollbar-color: var(--app-primary, #38bdf8) color-mix(in srgb, var(--app-secondary, #2563eb) 24%, var(--surface, #0f172a));
}
html[data-scrollbar-style="default"]::-webkit-scrollbar,
body[data-scrollbar-style="default"]::-webkit-scrollbar,
body[data-scrollbar-style="default"] *::-webkit-scrollbar { width: 12px; height: 12px; }
html[data-scrollbar-style="default"]::-webkit-scrollbar-track,
body[data-scrollbar-style="default"]::-webkit-scrollbar-track,
body[data-scrollbar-style="default"] *::-webkit-scrollbar-track { background: color-mix(in srgb, var(--app-secondary, #2563eb) 24%, var(--surface, #0f172a)); border: 1px solid color-mix(in srgb, var(--app-primary, #38bdf8) 18%, transparent); border-radius: 999px; }
html[data-scrollbar-style="default"]::-webkit-scrollbar-thumb,
body[data-scrollbar-style="default"]::-webkit-scrollbar-thumb,
body[data-scrollbar-style="default"] *::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--app-primary, #38bdf8) 0%, color-mix(in srgb, var(--app-primary, #38bdf8) 50%, var(--app-secondary, #2563eb)) 48%, var(--app-secondary, #2563eb) 100%); border: 2px solid color-mix(in srgb, var(--app-secondary, #2563eb) 24%, var(--surface, #0f172a)); border-radius: 999px; transition: filter .2s ease; }
html[data-scrollbar-style="default"]::-webkit-scrollbar-thumb:hover,
body[data-scrollbar-style="default"]::-webkit-scrollbar-thumb:hover,
body[data-scrollbar-style="default"] *::-webkit-scrollbar-thumb:hover { filter: brightness(1.12); }
html[data-scrollbar-style="default"]::-webkit-scrollbar-button:single-button:vertical:decrement,
body[data-scrollbar-style="default"]::-webkit-scrollbar-button:single-button:vertical:decrement,
body[data-scrollbar-style="default"] *::-webkit-scrollbar-button:single-button:vertical:decrement,
html[data-scrollbar-style="accent"]::-webkit-scrollbar-button:single-button:vertical:decrement,
body[data-scrollbar-style="accent"]::-webkit-scrollbar-button:single-button:vertical:decrement,
body[data-scrollbar-style="accent"] *::-webkit-scrollbar-button:single-button:vertical:decrement {
    display: block;
    height: 14px;
    background-color: var(--app-secondary, #2563eb);
    border-radius: 7px 7px 0 0;
    background-image: linear-gradient(135deg, transparent 46%, var(--app-primary, #38bdf8) 47% 60%, transparent 61%), linear-gradient(225deg, transparent 46%, var(--app-primary, #38bdf8) 47% 60%, transparent 61%);
    background-repeat: no-repeat;
    background-size: 6px 6px;
    background-position: center 6px;
}
html[data-scrollbar-style="default"]::-webkit-scrollbar-button:single-button:vertical:increment,
body[data-scrollbar-style="default"]::-webkit-scrollbar-button:single-button:vertical:increment,
body[data-scrollbar-style="default"] *::-webkit-scrollbar-button:single-button:vertical:increment,
html[data-scrollbar-style="accent"]::-webkit-scrollbar-button:single-button:vertical:increment,
body[data-scrollbar-style="accent"]::-webkit-scrollbar-button:single-button:vertical:increment,
body[data-scrollbar-style="accent"] *::-webkit-scrollbar-button:single-button:vertical:increment {
    display: block;
    height: 14px;
    background-color: var(--app-secondary, #2563eb);
    border-radius: 0 0 7px 7px;
    background-image: linear-gradient(45deg, transparent 46%, var(--app-primary, #38bdf8) 47% 60%, transparent 61%), linear-gradient(315deg, transparent 46%, var(--app-primary, #38bdf8) 47% 60%, transparent 61%);
    background-repeat: no-repeat;
    background-size: 6px 6px;
    background-position: center 2px;
}

html[data-scrollbar-style="accent"],
body[data-scrollbar-style="accent"],
body[data-scrollbar-style="accent"] * {
    scrollbar-width: thin;
    scrollbar-color: var(--app-primary, #a855f7) color-mix(in srgb, var(--app-secondary, #7c3aed) 24%, var(--surface, #0f172a));
}
html[data-scrollbar-style="accent"]::-webkit-scrollbar,
body[data-scrollbar-style="accent"]::-webkit-scrollbar,
body[data-scrollbar-style="accent"] *::-webkit-scrollbar { width: 12px; height: 12px; }
html[data-scrollbar-style="accent"]::-webkit-scrollbar-track,
body[data-scrollbar-style="accent"]::-webkit-scrollbar-track,
body[data-scrollbar-style="accent"] *::-webkit-scrollbar-track { background: color-mix(in srgb, var(--app-secondary, #7c3aed) 24%, var(--surface, #0f172a)); border: 1px solid color-mix(in srgb, var(--app-primary, #a855f7) 22%, transparent); border-radius: 999px; }
html[data-scrollbar-style="accent"]::-webkit-scrollbar-thumb,
body[data-scrollbar-style="accent"]::-webkit-scrollbar-thumb,
body[data-scrollbar-style="accent"] *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--app-primary, #a855f7) 0%, color-mix(in srgb, var(--app-primary, #a855f7) 50%, #ec4899) 48%, var(--app-secondary, #7c3aed) 100%);
    border: 2px solid color-mix(in srgb, var(--app-secondary, #7c3aed) 24%, var(--surface, #0f172a));
    border-radius: 999px;
}
html[data-scrollbar-style="accent"]::-webkit-scrollbar-thumb:hover,
body[data-scrollbar-style="accent"]::-webkit-scrollbar-thumb:hover,
body[data-scrollbar-style="accent"] *::-webkit-scrollbar-thumb:hover { filter: brightness(1.18); }
html[data-scrollbar-style="slim"],
body[data-scrollbar-style="slim"],
body[data-scrollbar-style="slim"] * { scrollbar-width: thin; scrollbar-color: var(--text-muted, #64748b) transparent; }
html[data-scrollbar-style="slim"]::-webkit-scrollbar,
body[data-scrollbar-style="slim"]::-webkit-scrollbar,
body[data-scrollbar-style="slim"] *::-webkit-scrollbar { width: 7px; height: 7px; }
html[data-scrollbar-style="slim"]::-webkit-scrollbar-track,
body[data-scrollbar-style="slim"]::-webkit-scrollbar-track,
body[data-scrollbar-style="slim"] *::-webkit-scrollbar-track { background: transparent; }
html[data-scrollbar-style="slim"]::-webkit-scrollbar-thumb,
body[data-scrollbar-style="slim"]::-webkit-scrollbar-thumb,
body[data-scrollbar-style="slim"] *::-webkit-scrollbar-thumb { background: var(--text-muted, #64748b); border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }

body[data-cursor-style="purple"] { cursor: url("../images/cursors/purple-arrow.svg") 5 3, auto !important; }
body[data-cursor-style="purple"] :is(a, button, input[type="button"], input[type="submit"], [role="button"], [onclick], [data-bs-toggle], [data-spa-link], select, label[for], .clean-stat-card, .gaming-product-card.is-clickable, .channel-vertical-item, .toggle-password, .side-banner-close-btn) {
    cursor: url("../images/cursors/purple-pointer.svg") 12 4, pointer !important;
}
body[data-cursor-style="default"] { cursor: var(--store-cursor-arrow, auto) !important; }
body[data-cursor-style="default"] :is(a, button, input[type="button"], input[type="submit"], [role="button"], [onclick], [data-bs-toggle], [data-spa-link], select, label[for], .clean-stat-card, .gaming-product-card.is-clickable, .channel-vertical-item, .toggle-password, .side-banner-close-btn) {
    cursor: var(--store-cursor-pointer, pointer) !important;
}
body[data-cursor-style="mint"] { cursor: url("../images/cursors/mint-arrow.svg") 5 3, auto !important; }
body[data-cursor-style="mint"] :is(a, button, input[type="button"], input[type="submit"], [role="button"], [onclick], [data-bs-toggle], [data-spa-link], select, label[for], .clean-stat-card, .gaming-product-card.is-clickable, .channel-vertical-item, .toggle-password, .side-banner-close-btn) {
    cursor: url("../images/cursors/mint-pointer.svg") 12 4, pointer !important;
}
.gaming-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: var(--surface-alt);
    margin-bottom: 12px;
    position: relative;
}
.gaming-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.gaming-product-card:hover .gaming-img-wrapper img { transform: scale(1.04); }
.gaming-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--text-main) !important;
}
.gaming-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    min-height: 20px;
    color: var(--text-muted) !important;
}
.gaming-desc-scroll {
    max-height: 5.6em;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: var(--app-primary, #d946ef) transparent;
    padding-right: 4px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.gaming-desc-scroll::-webkit-scrollbar { width: 4px; }
.gaming-desc-scroll::-webkit-scrollbar-thumb { background: var(--app-primary, #d946ef); border-radius: 999px; }
.gaming-desc-scroll::-webkit-scrollbar-track { background: transparent; }
/* การ์ดในหน้าแรก/หมวดหมู่: โชว์ 2 บรรทัด ยาวกว่านั้นเลื่อนอ่านในกล่องได้ (การ์ดสูงเท่ากันทุกใบ) */
.gaming-desc-scroll.gaming-desc-short { height: 2.8em; max-height: 2.8em; white-space: normal; }
.gaming-divider {
    border-top: 1px solid var(--surface-border);
    margin: 14px 0 10px 0;
}
.gaming-price-label, .gaming-stock-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
}
.gaming-price-val {
    color: var(--app-primary-text) !important;
    font-weight: 800;
    font-size: 1.45rem;
    line-height: 1.1;
}
.gaming-stock-val {
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}
.stock-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-in-stock { background-color: #10b981; box-shadow: 0 0 8px #10b981; }
.dot-out-stock { background-color: #ef4444; box-shadow: 0 0 8px #ef4444; }
.btn-gaming-buy {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
    border: none !important;
    border-radius: var(--radius-pill) !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    margin-top: 12px;
    box-shadow: 0 4px 14px var(--app-primary-ring);
    transition: all 0.2s ease;
}
.btn-gaming-buy:hover {
    background: var(--app-secondary) !important;
    color: var(--app-secondary-contrast, #ffffff) !important;
    transform: translateY(-1px);
}
.btn-gaming-buy.disabled-card {
    background: var(--surface-alt) !important;
    color: var(--text-muted) !important;
    box-shadow: none;
    pointer-events: none;
}
.gaming-badge-floating {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.badge-rec {
    background: var(--app-gradient);
    color: #fff;
}

/* Products filter */
.products-container-card,
.surface-panel {
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    background: var(--surface);
    border: 1.5px solid var(--surface-border);
    box-shadow: var(--home-card-shadow);
}
.cat-filter-pill {
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 16px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.cat-filter-pill:hover,
.cat-filter-pill.active {
    background: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
    box-shadow: 0 4px 12px var(--app-primary-ring);
}
.count-pill {
    background: var(--app-primary-soft);
    color: var(--app-primary-text);
    border: 1px solid color-mix(in srgb, var(--app-primary) 30%, transparent);
    font-size: 0.75rem;
}

/* Home */
/* ========================================================
   Hero Carousel: fixed aspect ratio prevents jumps between differently sized images
   ======================================================== */
.hero-carousel-card {
    border-radius: var(--radius-xl) !important;
    border: 1px solid var(--home-card-border) !important;
    background: #0b1020 !important;
    box-shadow: var(--home-card-shadow);
    overflow: hidden;
    position: relative;
    width: 100%;
}

.hero-carousel-item {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 1 !important;
    position: relative !important;
    overflow: hidden !important;
    background: #0b1020 !important;
}

#shopBannerCarousel .carousel-inner { background: #0b1020 !important; }

@media (max-width: 768px) {
    .hero-carousel-item {
        aspect-ratio: 4 / 1 !important;
    }
}

.hero-bg-media {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;        /* ขยายเต็มกรอบ 100% ไร้ขอบขาวแน่นอน */
    display: block;
}
.hero-overlay-scrim {
    position: absolute;
    inset: 0;
    background: var(--home-overlay-fade);
    z-index: 2;
}
.hero-content-anchor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 28px 36px;
}
@media (max-width: 576px) {
    .hero-content-anchor { padding: 20px; }
}
.hero-banner-title { color: var(--home-text-title) !important; font-weight: 800; }
.hero-banner-desc { color: var(--home-text-desc) !important; }
.hero-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--home-control-bg);
    border: 1px solid var(--home-card-border);
    color: var(--home-control-color) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.85;
    z-index: 10;
}
.hero-control-btn:hover {
    opacity: 1;
    background: var(--app-primary);
    color: var(--app-primary-contrast, #ffffff) !important;
    border-color: var(--app-primary);
}
.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background-color: var(--home-text-desc);
    margin: 0 5px;
    opacity: 0.4;
}
.carousel-indicators .active {
    width: 28px;
    border-radius: 10px;
    background: var(--app-primary);
    opacity: 1;
}
.btn-action-adaptive {
    border: none;
    border-radius: 12px;
    padding: 9px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.announcement-box-adaptive {
    background: var(--home-marquee-bg);
    border: 1px solid var(--home-card-border);
    border-radius: var(--radius-pill);
    box-shadow: var(--home-card-shadow);
    padding: 8px 14px 8px 10px;
    overflow: hidden;
}
.announcement-badge {
    background: var(--app-primary);
    color: var(--app-primary-contrast, #ffffff) !important;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.marquee-wrapper-modern {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}
.marquee-content-modern {
    display: inline-block;
    padding-left: 100%;
    animation: marqueeFlow 28s linear infinite;
    color: var(--home-text-title);
}
.marquee-wrapper-modern:hover .marquee-content-modern { animation-play-state: paused; }
@keyframes marqueeFlow {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Home page rhythm and theme-safe surfaces. Accent colors stay in small details;
   content surfaces and spacing remain calm with both dark and light palettes. */
.page-home > .container.py-2 {
    max-width: 1320px;
    padding-top: 0.5rem !important;
    padding-bottom: 2rem;
}
.page-home .hero-carousel-card {
    border: 1px solid var(--surface-border) !important;
    box-shadow: var(--home-card-shadow);
}
.page-home .hero-banner-placeholder {
    background:
        radial-gradient(ellipse at 82% 18%, var(--app-secondary-soft), transparent 42%),
        linear-gradient(135deg, color-mix(in srgb, var(--app-primary) 38%, #111827), #111827) !important;
}
.page-home .announcement-box-adaptive {
    min-height: 50px;
    gap: 0.75rem;
    border-radius: 14px;
    padding: 8px 12px;
}
.page-home .announcement-box-adaptive .announcement-badge,
.page-home .announcement-box-adaptive > .badge {
    margin-right: 0 !important;
}
.page-home .clean-stat-card {
    position: relative !important;
    background: var(--surface) !important;
    border: 1px solid var(--surface-border) !important;
    border-radius: 18px !important;
    padding: 1.15rem 1.2rem !important;
    box-shadow: var(--home-card-shadow) !important;
}
.page-home .clean-stat-card::before {
    content: "";
    position: absolute;
    inset: 0 16px auto;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, var(--app-primary), var(--app-secondary));
}
.page-home .clean-stat-title { color: var(--text-muted) !important; font-size: .82rem; }
.page-home .clean-stat-unit { color: var(--text-muted) !important; }
.page-home .clean-stat-num { color: var(--text-main) !important; font-size: 1.8rem; }
.page-home .clean-stat-icon-outline {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-left: .65rem;
    border-radius: 15px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--app-primary) 18%, var(--surface)), color-mix(in srgb, var(--app-secondary) 18%, var(--surface)));
    color: var(--app-primary-text) !important;
    font-size: 1.35rem !important;
}
.page-home .clean-stat-card:hover {
    transform: translateY(-3px) !important;
    border-color: color-mix(in srgb, var(--app-primary) 55%, var(--surface-border)) !important;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--app-primary) 12%, transparent) !important;
}
.page-home .home-title-icon-box {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
    box-shadow: 0 5px 16px var(--app-primary-ring);
}
.page-home .home-section-header {
    gap: 1rem;
}
.page-home .home-section-header h4 {
    letter-spacing: -0.02em;
}
.page-home .wide-category-card {
    aspect-ratio: 2.8 / 1 !important;
    border: 1px solid var(--surface-border) !important;
}
body.theme-dark .page-home .wide-category-overlay {
    background: linear-gradient(90deg, rgba(9, 13, 22, 0.94) 0%, rgba(9, 13, 22, 0.72) 55%, rgba(9, 13, 22, 0.2) 100%) !important;
}
body.theme-light .page-home .wide-category-overlay {
    background: linear-gradient(115deg, rgba(248, 250, 252, 0.95) 0%, rgba(239, 246, 255, 0.82) 55%, rgba(216, 180, 254, 0.5) 100%) !important;
}
body.theme-light .page-home .wide-category-body,
body.theme-light .page-home .wide-category-body p { color: #111827 !important; }
body.theme-light .page-home .wide-category-body .border-top { border-color: rgba(71, 85, 105, 0.2) !important; }
.page-home .wide-category-body .badge {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
}
.page-home .gaming-product-card {
    padding: 12px;
    box-shadow: var(--home-card-shadow);
}
.page-home .gaming-img-wrapper { border-radius: 14px; }
.page-home .gaming-badge-floating {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
}
/* Keep labels and icons legible on the colored controls used on Home. */
/* พื้นเป็นสีหลักของร้าน: ใช้สีตัวอักษรที่คำนวณจากสีหลัก (ดำหรือขาว) */
.page-home .announcement-badge,
.page-home .announcement-badge *,
.page-home .btn-gaming-buy:not(.disabled-card),
.page-home .btn-gaming-buy:not(.disabled-card) *,
.page-home .wide-category-body .badge,
.page-home .wide-category-body .badge * {
    color: var(--app-primary-contrast, #fff) !important;
}
/* พื้นสีแดง/ส้มคงที่ (ป้ายขายดี, ไอคอนหัวข้อ): ตัวอักษรขาวอ่านออกอยู่แล้ว */
.page-home .home-title-icon-box,
.page-home .home-title-icon-box *,
.page-home .gaming-badge-floating,
.page-home .gaming-badge-floating * {
    color: #fff !important;
}
.page-home .home-title-icon-box[style*="var(--app-primary"],
.page-home .home-title-icon-box[style*="var(--app-primary"] * {
    color: var(--app-gradient-contrast, #fff) !important;
}
.random-product-odds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 0.5rem;
}
.random-product-odds-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--home-card-border);
    border-radius: 10px;
    background: var(--home-card-bg);
    color: var(--home-text-title);
    font-size: 0.78rem;
}
.random-product-odds-item img,
.random-product-odds-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
}
.random-product-odds-placeholder,
.random-reel-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    color: var(--text-muted);
}
.random-product-odds-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.random-product-odds-item strong { color: var(--app-primary-text); }
.random-reel-shell {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: 12px 0;
    overflow: hidden;
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 14px;
    background: var(--surface, #111827);
}
.random-reel-window { overflow: hidden; }
.random-reel-window.is-finished {
    display: flex;
    align-items: center;
    justify-content: center;
}
.random-reel-window.is-finished .random-reel-track { display: none; }
.random-reel-final { display: none; }
.random-reel-window.is-finished .random-reel-final { display: block; }
.random-reel-window.is-finished .random-reel-final > .random-reel-item { width: 110px; margin: 0 auto; }
.random-reel-track {
    display: flex;
    gap: 8px;
    width: max-content;
    transform: translateX(0);
    transition: transform 5.4s cubic-bezier(0.12, 0.72, 0.08, 1);
    will-change: transform;
}
.random-reel-item {
    display: flex;
    flex: 0 0 110px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 126px;
    padding: 8px;
    overflow: hidden;
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-radius: 10px;
    background: var(--surface-alt, #1f2937);
    color: var(--text-main, #fff);
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}
.random-reel-item img,
.random-reel-placeholder {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    border-radius: 8px;
    object-fit: cover;
}
.random-reel-item > span:last-child {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.random-reel-item.is-winner {
    border: 2px solid #f59e0b;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}
  .random-reel-item.is-nothing {
      border: 2px solid #ef4444;
      background: rgba(127, 29, 29, 0.22);
      color: #fecaca;
  }
  .random-reel-item.is-nothing .random-reel-placeholder {
      background: rgba(239, 68, 68, 0.16);
      color: #fca5a5;
  }
  .random-reel-item.is-mystery .random-reel-placeholder {
      background: linear-gradient(145deg, rgba(124, 58, 237, 0.3), rgba(30, 41, 59, 0.9));
      color: #e9d5ff;
      border: 1px solid rgba(192, 132, 252, 0.4);
  }
.random-reel-marker {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 3px solid #f59e0b;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.9));
    pointer-events: none;
}
.random-result-card { text-align: center; }
.random-result-image {
    display: block;
    width: 110px;
    height: 110px;
    margin: 0 auto 0.75rem;
    border-radius: 14px;
    object-fit: cover;
}
.random-result-key {
    max-height: 220px;
    overflow: auto;
    padding: 0.85rem;
    border: 1px dashed rgba(128, 128, 128, 0.5);
    border-radius: 10px;
    background: rgba(128, 128, 128, 0.08);
    font-family: monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-align: left;
}
@media (max-width: 767.98px) {
    .page-home > .container.py-2 { padding-inline: 0.25rem; }
    .page-home .home-section-header { align-items: flex-start; margin-bottom: 0.9rem; }
    .page-home .home-title-icon-box { width: 36px; height: 36px; border-radius: 11px; }
    .page-home .wide-category-card { aspect-ratio: 3 / 1 !important; }
    .page-home .announcement-box-adaptive { border-radius: 12px; }
    .page-home .clean-stat-card { padding: .8rem .85rem !important; border-radius: 15px !important; }
    .page-home .clean-stat-icon-outline { width: 38px; height: 38px; border-radius: 12px; font-size: 1.1rem !important; }
    .page-home .clean-stat-num { font-size: 1.35rem; }
}
.stat-card-adaptive {
    background: var(--home-card-bg);
    border: 1px solid var(--home-card-border);
    border-radius: var(--radius-lg);
    padding: 24px 18px;
    overflow: hidden;
    box-shadow: var(--home-card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.stat-card-adaptive:hover {
    transform: translateY(-6px);
    border-color: var(--app-primary);
}
.stat-icon-adaptive {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 14px;
    background: var(--icon-bg, var(--app-primary-soft));
    color: var(--icon-color, var(--app-primary));
    border: 1px solid var(--icon-border, color-mix(in srgb, var(--app-primary) 25%, transparent));
}
.stat-card-adaptive:hover .stat-icon-adaptive { transform: scale(1.12) rotate(4deg); }
.stat-label-adaptive {
    color: var(--home-text-desc);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-counter-val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--home-text-title);
}
.stat-counter-unit {
    font-size: 0.85rem;
    color: var(--home-text-desc);
    margin-left: 4px;
}
.contact-pill-primary {
    background: var(--app-primary-soft);
    color: var(--app-primary-text) !important;
}
.contact-pill-secondary {
    background: var(--app-secondary-soft);
    color: var(--app-secondary-text) !important;
}

/* Category */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-card { animation: slideInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.wide-category-card {
    border-radius: 22px;
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none !important;
    height: 185px;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.25);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    background-color: var(--surface);
}
.wide-category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    padding: 2px;
    background: var(--app-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.85;
}
.wide-category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.45);
}
.wide-category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: transform 0.45s ease;
}
.category-image-fallback {
    display: grid !important;
    place-items: center;
    color: var(--app-primary-text, #38bdf8);
    background: linear-gradient(135deg, color-mix(in srgb, var(--app-primary, #38bdf8) 18%, #0f172a), #0f172a) !important;
}
body.theme-light .category-image-fallback {
    color: var(--app-primary, #2563eb);
    background: linear-gradient(135deg, color-mix(in srgb, var(--app-primary, #2563eb) 12%, #fff), #f1f5f9) !important;
}
.category-image-fallback i { font-size: clamp(1.1rem, 4vw, 2.6rem); opacity: .65; }
.wide-category-card:hover .wide-category-img { transform: scale(1.08); }
.wide-category-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(9, 13, 22, 0.94) 0%, rgba(9, 13, 22, 0.72) 52%, rgba(9, 13, 22, 0.2) 100%);
    z-index: 1;
}
body.theme-light .wide-category-overlay {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.78) 55%, rgba(255, 255, 255, 0.3) 100%);
}
.wide-category-body {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.35rem 1.6rem;
    color: var(--text-main);
}
.cat-detail-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 1.6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    border: 1.5px solid var(--surface-border);
    background: var(--surface);
    color: var(--text-main);
    box-shadow: var(--home-card-shadow);
}
.cat-detail-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1.5px;
    background: var(--app-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}
.cat-detail-bg-ambient {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.12;
    filter: blur(8px);
    transform: scale(1.05);
    pointer-events: none;
}
.cat-detail-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.btn-back-theme {
    background: var(--app-secondary);
    color: var(--app-secondary-contrast, #ffffff) !important;
    border: none;
}

/* Product detail */
.breadcrumb-custom a,
.breadcrumb-custom span,
.breadcrumb-custom i {
    color: var(--text-muted) !important;
    text-decoration: none;
}
.breadcrumb-custom a:hover,
.breadcrumb-custom .active-product-name {
    color: var(--app-primary-text) !important;
}
.detail-card-dark {
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    color: var(--text-main);
    border: 1.5px solid var(--surface-border);
    box-shadow: var(--home-card-shadow);
}
.product-img-box {
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    min-height: 340px;
    max-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 1px solid var(--surface-border);
    background: var(--surface-alt);
}
.product-img-box img {
    width: 100%;
    height: 100%;
    max-height: 410px;
    object-fit: contain;
    transition: transform 0.35s ease;
}
.product-img-box:hover img { transform: scale(1.03); }
.html-content-box,
.order-box-theme {
    border-radius: 14px;
    padding: 1.15rem;
    background: var(--surface-muted);
    color: var(--text-main);
    border: 1px solid var(--surface-border);
}
.summary-bar-theme {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
}

/* Auth */
.auth-card {
    border: 1.5px solid var(--app-primary) !important;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.auth-card:hover {
    border-color: var(--app-secondary) !important;
    transform: translateY(-3px);
}
.auth-logo-badge {
    background: var(--surface-muted);
    border: 1.5px solid var(--app-primary) !important;
    border-radius: var(--radius-lg);
    display: inline-block;
    padding: 10px;
}
.auth-card:hover .auth-logo-badge { border-color: var(--app-secondary) !important; }
.input-wrapper { position: relative; }
.form-control-custom {
    border-radius: 14px !important;
    height: 48px;
    font-size: 0.92rem;
}
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    z-index: 10;
}
.toggle-password:hover { color: var(--app-secondary-text); }
#passwordStrengthBar { transition: width 0.35s ease, background-color 0.35s ease; }

/* Topup */
.topup-hub-banner,
.topup-screen-panel,
.topup-history-card {
    border-radius: var(--radius-lg) !important;
    background-color: var(--surface) !important;
    border: 1px solid var(--surface-border) !important;
    color: var(--text-main);
}
.user-balance-badge {
    border-radius: var(--radius-pill);
    padding: 6px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-muted);
    border: 1px solid var(--surface-border);
}
.channel-vertical-item {
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: var(--surface-alt);
    border: 1.5px solid var(--surface-border);
    color: var(--text-main);
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.channel-vertical-item:hover { transform: translateX(4px); }
.channel-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--surface-muted);
    color: var(--text-muted);
}
.channel-info { flex-grow: 1; overflow: hidden; }
.channel-title { font-size: 0.95rem; font-weight: 700; }
.channel-desc { font-size: 0.78rem; margin-top: 3px; opacity: 0.75; }
.channel-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--surface-border);
}
.channel-vertical-item.active {
    border-color: var(--app-primary) !important;
    transform: translateX(4px);
}
.channel-vertical-item.active .channel-icon-box,
.channel-vertical-item.active .channel-badge {
    background: var(--app-gradient) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
.btn-topup-action {
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
}
.form-control-topup { height: 48px; }
.topup-nav-tabs { border-bottom: none !important; gap: 8px; }
.topup-nav-tabs .nav-link {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 10px 20px;
    border: 1px solid var(--surface-border) !important;
    background: var(--surface-alt) !important;
    color: var(--text-muted) !important;
}
.topup-nav-tabs .nav-link.active {
    background: var(--app-gradient) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}


.topup-history-card table.dataTable thead th {
    background-color: var(--surface-alt) !important;
    color: var(--app-primary-text) !important;
    border: none !important;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
}
.topup-history-card table.dataTable tbody td {
    color: var(--text-main) !important;
    border-top: 1px solid var(--surface-border) !important;
    border-bottom: 1px solid var(--surface-border) !important;
}
body.theme-dark .bank-info-card { filter: brightness(1.15); }

/* History */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade { animation: fadeIn 0.28s ease-out forwards; }
.table-pro { margin-bottom: 0; vertical-align: middle; font-size: 0.9rem; }
.table-pro th {
    background-color: var(--surface-alt) !important;
    color: var(--text-muted) !important;
    border-bottom: 1px solid var(--surface-border) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table-pro th:hover { color: var(--app-primary-text); }
.table-pro td {
    padding: 0.95rem 1rem;
    background-color: var(--surface);
    color: var(--text-main);
    border-bottom: 1px solid var(--surface-border) !important;
}
.table-pro tbody tr:hover td { background-color: var(--surface-muted) !important; }
.order-code-text, .price-text { color: var(--text-main) !important; font-weight: 700; }
.qty-badge {
    background: transparent !important;
    border: 1px solid var(--surface-border);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.78rem;
}
.show-key-modal-btn,
.btn-pro-primary {
    background: transparent !important;
    border: 1px solid var(--app-primary) !important;
    color: var(--app-primary-text) !important;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.show-key-modal-btn:hover,
.btn-pro-primary:hover {
    background: var(--app-primary) !important;
    color: var(--app-primary-contrast, #ffffff) !important;
}
.btn-claim-link {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    color: #b45309;
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(180, 83, 9, 0.35);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
body.theme-dark .btn-claim-link {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(251, 191, 36, 0.4);
}
.btn-claim-link:hover,
.btn-claim-link:focus-visible {
    background: #f59e0b !important;
    border-color: #f59e0b;
    color: #111827;
}
/* ปุ่มรีวิวในประวัติการสั่งซื้อ (ใช้สีหลักของร้าน แยกจากปุ่มเคลมสีส้ม) */
.btn-claim-link.btn-review-link,
body.theme-dark .btn-claim-link.btn-review-link {
    color: var(--app-primary-text, #38bdf8);
    background: color-mix(in srgb, var(--app-primary, #38bdf8) 10%, transparent) !important;
    border-color: color-mix(in srgb, var(--app-primary, #38bdf8) 40%, transparent);
}
.btn-claim-link.btn-review-link:hover,
.btn-claim-link.btn-review-link:focus-visible {
    color: #ffffff;
    background: var(--app-primary, #38bdf8) !important;
    border-color: var(--app-primary, #38bdf8);
}
.btn-claim-link.btn-review-link.is-reviewed i { color: #fbbf24; }
.btn-claim-link.btn-review-link.is-reviewed:hover i { color: #ffffff; }
/* ดาวรีวิวบนการ์ดสินค้า (assets/js/review-badges.js) */
.card-review-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0 1px;
    font-size: 0.74rem;
    line-height: 1.3;
    color: var(--text-muted, #94a3b8);
}
.card-review-badge i { color: #fbbf24; font-size: 0.7rem; }
.card-review-badge b { color: var(--text-main, #f8fafc); font-weight: 700; }
.coupon-badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2.5px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--app-primary-soft);
    color: var(--app-primary-text);
    border: 1px solid color-mix(in srgb, var(--app-primary) 25%, transparent);
}
.status-badge-success,
.status-badge-warning,
.status-badge-danger {
    padding: 3.5px 11px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
}
.status-badge-success { background: rgba(16, 185, 129, 0.08); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }
.status-badge-warning { background: rgba(245, 158, 11, 0.08); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.25); }
.status-badge-danger { background: rgba(239, 68, 68, 0.08); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.product-thumb-box {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.badge-fee { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); padding: 4px 10px; border-radius: 50px; font-weight: 600; font-size: 11px; }
.badge-status-success { background: rgba(16, 185, 129, 0.12); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); padding: 4px 12px; border-radius: 50px; font-weight: 600; font-size: 11.5px; }

/* Roulette modal inherits the active storefront theme and accent colors. */
.swal2-popup.random-spin-popup {
    color: var(--text-main, #f8fafc);
    background: var(--surface, #0f172a);
    border: 1px solid var(--surface-border, rgba(128, 128, 128, 0.25));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.random-spin-popup .swal2-title,
.random-spin-popup .swal2-html-container { color: var(--text-main, #f8fafc); }
.random-reel-shell {
    border-color: var(--surface-border, rgba(128, 128, 128, 0.3));
    background: color-mix(in srgb, var(--surface-alt, #1e293b) 72%, var(--surface, #0f172a));
}
.random-reel-item {
    border-color: var(--surface-border, rgba(128, 128, 128, 0.25));
    background: var(--surface-alt, #1e293b);
    color: var(--text-main, #f8fafc);
}
.random-reel-item.is-mystery .random-reel-placeholder {
    border: 1px solid color-mix(in srgb, var(--app-primary, #38bdf8) 45%, var(--surface-border, transparent));
    background: linear-gradient(145deg, color-mix(in srgb, var(--app-primary, #38bdf8) 24%, var(--surface-alt, #1e293b)), var(--surface, #0f172a));
    color: var(--app-primary-text, #38bdf8);
}
.random-reel-item.is-winner {
    border-color: var(--app-primary, #38bdf8);
    box-shadow: 0 0 0 1px var(--app-primary, #38bdf8), 0 0 22px color-mix(in srgb, var(--app-primary, #38bdf8) 45%, transparent);
}
.random-reel-item.is-nothing {
    border-color: color-mix(in srgb, #ef4444 72%, var(--surface-border, transparent));
    background: color-mix(in srgb, #ef4444 12%, var(--surface-alt, #1e293b));
    color: var(--text-main, #f8fafc);
}
.random-reel-item.is-nothing .random-reel-placeholder {
    background: color-mix(in srgb, #ef4444 16%, var(--surface-alt, #1e293b));
    color: #ef4444;
}
.random-reel-marker {
    border-color: var(--app-primary, #38bdf8);
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--app-primary, #38bdf8) 80%, transparent));
}
body.theme-light .random-spin-popup { box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18); }
@media (max-width: 575.98px) {
    .random-reel-shell { max-width: 100%; }
    .random-reel-item { flex-basis: 96px; height: 116px; padding: 7px; }
    .random-reel-item img,
    .random-reel-placeholder { width: 66px; height: 66px; flex-basis: 66px; }
}

.history-table-frame {
    border: 1px solid var(--surface-border, rgba(128, 128, 128, 0.2));
    border-radius: 14px;
    background: var(--surface, #fff);
    overflow: auto;
    scrollbar-width: thin;
}
.history-table-frame > .dataTables_wrapper { min-width: 100%; }
.history-table-frame table.table-pro {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}
.history-table-frame table.table-pro thead th:first-child { border-top-left-radius: 12px; }
.history-table-frame table.table-pro thead th:last-child { border-top-right-radius: 12px; }
.history-table-frame table.table-pro thead th { background-clip: padding-box; }



/* ==========================================================================
   THEME COMPATIBILITY
   ให้คอมโพเนนต์ของ Bootstrap (ตาราง, สีข้อความ, badge) อ่านออกได้ทั้งธีมมืด/สว่าง
   และกับทุกสีที่ร้านเลือก (ตัวแปร --app-*-contrast / --app-*-text มาจาก systems/ThemeColors.php)
   ========================================================================== */

/* ตาราง: ใช้พื้นของการ์ดที่ครอบอยู่ แทนพื้นขาวค่าเริ่มต้นของ Bootstrap */
body.theme-dark .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.035);
    --bs-table-striped-color: var(--text-main);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
    --bs-table-hover-color: var(--text-main);
    --bs-table-active-bg: rgba(255, 255, 255, 0.08);
    --bs-table-active-color: var(--text-main);
    --bs-table-border-color: rgba(255, 255, 255, 0.09);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.09);
}
body.theme-light .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    --bs-table-striped-bg: rgba(15, 23, 42, 0.03);
    --bs-table-striped-color: var(--text-main);
    --bs-table-hover-bg: rgba(15, 23, 42, 0.05);
    --bs-table-hover-color: var(--text-main);
    --bs-table-active-bg: rgba(15, 23, 42, 0.07);
    --bs-table-active-color: var(--text-main);
    --bs-table-border-color: rgba(15, 23, 42, 0.1);
    color: var(--text-main);
    border-color: rgba(15, 23, 42, 0.1);
}
body.theme-dark .table > :not(caption) > * > *,
body.theme-light .table > :not(caption) > * > * {
    color: var(--bs-table-color);
    background-color: var(--bs-table-bg);
    box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg, transparent)));
}

/* สีความหมาย (info/warning/success/danger) บนพื้นสว่างต้องเข้มขึ้นให้อ่านออก */
body.theme-light .text-info { color: #0e7490 !important; }
body.theme-light .text-warning { color: #b45309 !important; }
body.theme-light .text-success { color: #047857 !important; }
body.theme-light .text-danger { color: #b91c1c !important; }
body.theme-light .text-primary { color: var(--app-primary-text) !important; }
body.theme-light .btn-outline-info { --bs-btn-color: #0e7490; --bs-btn-border-color: #0e7490; --bs-btn-hover-bg: #0e7490; --bs-btn-hover-border-color: #0e7490; --bs-btn-hover-color: #fff; }
body.theme-light .btn-outline-warning { --bs-btn-color: #b45309; --bs-btn-border-color: #d97706; --bs-btn-hover-bg: #d97706; --bs-btn-hover-border-color: #d97706; --bs-btn-hover-color: #111827; }
body.theme-light .btn-outline-success { --bs-btn-color: #047857; --bs-btn-border-color: #059669; }
body.theme-dark .text-primary { color: var(--app-primary-text) !important; }

/* badge พื้นสีเหลือง/ฟ้า: ตัวอักษรขาวอ่านไม่ออก ใช้ตัวอักษรเข้มแทน */
.badge.bg-warning:not([class*="bg-opacity-"]), .badge.text-bg-warning, .bg-warning.text-white:not([class*="bg-opacity-"]),
.badge.bg-info:not([class*="bg-opacity-"]), .badge.text-bg-info, .bg-info.text-white:not([class*="bg-opacity-"]),
.badge.bg-light:not([class*="bg-opacity-"]) {
    color: #111827 !important;
}

/* badge พื้นจาง (bg-opacity-*) ในธีมสว่าง: ตัวอักษรต้องเข้มตามธีม */
body.theme-light .badge[class*="bg-opacity-"],
body.theme-light .badge.bg-secondary.bg-opacity-25 {
    color: var(--text-main) !important;
}
body.theme-light .badge.bg-warning[class*="bg-opacity-"] { color: #92400e !important; }
body.theme-light .badge.bg-success[class*="bg-opacity-"] { color: #065f46 !important; }
body.theme-light .badge.bg-danger[class*="bg-opacity-"] { color: #991b1b !important; }
body.theme-light .badge.bg-info[class*="bg-opacity-"] { color: #155e75 !important; }

/* สีที่เขียนตายตัวในหน้าเว็บ (inline style) ซึ่งจางเกินไปบนพื้นสว่าง */
body.theme-light [style*="color: #10b981"], body.theme-light [style*="color:#10b981"] { color: #047857 !important; }
body.theme-light [style*="color: #f97316"], body.theme-light [style*="color:#f97316"] { color: #c2410c !important; }
body.theme-light [style*="color: #fb7185"], body.theme-light [style*="color:#fb7185"] { color: #be123c !important; }
body.theme-light [style*="color: #38bdf8"], body.theme-light [style*="color:#38bdf8"] { color: #0369a1 !important; }
body.theme-light [style*="color: #fbbf24"], body.theme-light [style*="color:#fbbf24"],
body.theme-light [style*="color: #f59e0b"], body.theme-light [style*="color:#f59e0b"] { color: #b45309 !important; }

/* โค้ด/คีย์สินค้าในตาราง */
body.theme-light code.text-info { color: #0e7490 !important; }

/* คลาส text-white ของ Bootstrap บนพื้นสีของร้าน (inline style) -> ใช้สีตัวอักษรที่อ่านออก */
.text-white[style*="background-color: var(--app-primary"], .text-white[style*="background-color:var(--app-primary"],
.text-white[style*="background: var(--app-primary"], .text-white[style*="background:var(--app-primary"] {
    color: var(--app-primary-contrast, #fff) !important;
}
.text-white[style*="background-color: var(--app-secondary"], .text-white[style*="background: var(--app-secondary"] {
    color: var(--app-secondary-contrast, #fff) !important;
}
.text-white[style*="linear-gradient"][style*="var(--app-primary"] {
    color: var(--app-gradient-contrast, #fff) !important;
}
.text-white[style*="var(--app-primary"] i, .text-white[style*="var(--app-secondary"] i { color: inherit !important; }

/* แถบเลขหน้า (ตาราง/รายการ) ตามสีร้านและธีม */
.pagination {
    --bs-pagination-active-bg: var(--app-primary);
    --bs-pagination-active-border-color: var(--app-primary);
    --bs-pagination-active-color: var(--app-primary-contrast, #fff);
}
.page-item.active .page-link { color: var(--app-primary-contrast, #fff) !important; }
body.theme-dark .pagination {
    --bs-pagination-color: var(--text-main);
    --bs-pagination-bg: rgba(255, 255, 255, 0.04);
    --bs-pagination-border-color: rgba(255, 255, 255, 0.12);
    --bs-pagination-hover-color: var(--text-main);
    --bs-pagination-hover-bg: rgba(255, 255, 255, 0.09);
    --bs-pagination-disabled-color: rgba(248, 250, 252, 0.4);
    --bs-pagination-disabled-bg: rgba(255, 255, 255, 0.02);
    --bs-pagination-disabled-border-color: rgba(255, 255, 255, 0.08);
}
body.theme-dark .page-item.disabled .page-link { background: rgba(255, 255, 255, 0.02) !important; color: rgba(248, 250, 252, 0.4) !important; }

/* ป้ายสถานะ/ตัวเลขสต็อกสีเขียว-เหลืองบนพื้นสว่าง */
body.theme-light .status-badge-success, body.theme-light .home-premium-stock { color: #047857 !important; }
body.theme-light .status-badge-warning { color: #b45309 !important; }
body.theme-light .product-follow-state { color: #be123c; }

/* ตัวเลขสต็อกสีเขียวในหน้าแอพพรีเมี่ยม (ธีมสว่าง) */
body.theme-light .partner-app-option-meta { color: #047857 !important; }
/* ป้ายจาง (bg-opacity) ที่ใช้ตัวอักษรเข้มของ Bootstrap ในธีมมืด */
body.theme-dark .badge.text-dark[class*="bg-opacity-"],
body.theme-dark .badge.bg-secondary.bg-opacity-10 { color: var(--text-main) !important; }
