/* ============================================================
   MALFOY STORE - Dark Blue Theme
   ธีมหลักฝั่งผู้ใช้งาน (Public)
   ============================================================ */

:root {
    --bg-950: #04050a;
    --bg-900: #05070e;
    --bg-850: #070b14;
    --bg-800: #0f152a;
    --bg-750: #141c36;

    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --cyan-400: #22d3ee;

    --text-100: #eaf0ff;
    --text-300: #b4c0dd;
    --text-500: #7c8aad;

    --line: rgba(96, 165, 250, .14);
    --line-strong: rgba(96, 165, 250, .32);

    --gold: #fbbf24;
    --green: #22c55e;
    --red: #ef4444;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --shadow-soft: 0 18px 50px rgba(0, 0, 0, .45);
    --shadow-glow: 0 0 0 1px rgba(59, 130, 246, .25), 0 20px 60px rgba(29, 78, 216, .28);

    --grad-blue: linear-gradient(135deg, #2563eb 0%, #1d4ed8 45%, #22d3ee 140%);
    --grad-panel: linear-gradient(160deg, rgba(20, 28, 54, .92) 0%, rgba(11, 16, 32, .92) 100%);
}

/* ---------------- Base ---------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* เปลี่ยนหน้าแบบจาง ๆ ให้การคลิกเมนูรู้สึกต่อเนื่อง */
@view-transition { navigation: auto; }

::view-transition-old(root) {
    animation: vt-out .18s cubic-bezier(.2, .8, .3, 1) both;
}

::view-transition-new(root) {
    animation: vt-in .28s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Kanit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 300;
    background: var(--bg-950);
    color: var(--text-100);
    overflow-x: hidden;
}

a { text-decoration: none; color: var(--blue-400); transition: color .25s ease; }
a:hover { color: var(--cyan-400); }

h1, h2, h3, h4, h5, h6 { font-weight: 500; letter-spacing: .2px; }

::selection { background: var(--blue-600); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-900); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--blue-700), #0d1b3d); border-radius: 10px; border: 2px solid var(--bg-900); }
::-webkit-scrollbar-thumb:hover { background: var(--blue-600); }

/* ---------------- พื้นหลัง (สีเรียบ ไม่เรืองแสง) ---------------- */

.bg-aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: #04050a;
}

.aurora {
    display: none;
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.aurora-1 {
    width: 680px; height: 680px; top: -240px; left: -180px;
    background: radial-gradient(circle, rgba(29, 78, 216, .2), transparent 68%);
}
.aurora-2 {
    width: 560px; height: 560px; bottom: -200px; right: -120px;
    background: radial-gradient(circle, rgba(37, 99, 235, .14), transparent 68%);
}
.aurora-3 {
    width: 480px; height: 480px; top: 42%; left: 52%;
    background: radial-gradient(circle, rgba(15, 23, 42, .18), transparent 70%);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(96, 165, 250, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, .03) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, #000 35%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, #000 35%, transparent 80%);
}

/* ---------------- ปุ่ม ---------------- */

.btn {
    font-family: inherit;
    font-weight: 400;
    border-radius: var(--radius-sm);
    padding: .58rem 1.25rem;
    transition: all .28s cubic-bezier(.2, .8, .3, 1);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.btn:focus { box-shadow: none !important; }
.btn:active { transform: scale(.98); }

.btn-glow {
    background: var(--grad-blue);
    color: #fff;
    box-shadow: 0 8px 26px rgba(37, 99, 235, .38);
}
.btn-glow:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 38px rgba(37, 99, 235, .55);
}

.btn-ghost {
    background: rgba(96, 165, 250, .08);
    border-color: var(--line-strong);
    color: var(--text-100);
}
.btn-ghost:hover {
    background: rgba(96, 165, 250, .18);
    border-color: var(--blue-500);
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline-blue {
    border-color: var(--line-strong);
    color: var(--blue-400);
    background: transparent;
}
.btn-outline-blue:hover { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

.btn-danger-soft { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .4); color: #fca5a5; }
.btn-danger-soft:hover { background: var(--red); color: #fff; }

.btn-lg { padding: .8rem 1.8rem; font-size: 1.02rem; }
.btn-sm { padding: .38rem .85rem; font-size: .85rem; }

/* ---------------- Header / Navbar ---------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(6, 9, 18, .94);
    border-bottom: 1px solid var(--line);
    transition: background .3s ease, box-shadow .3s ease;
}

.site-header.scrolled {
    background: rgba(5, 7, 15, .94);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.navbar { padding: .65rem 0; }

.announce-bar {
    overflow: hidden;
    background: #0b101b;
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.announce-track {
    display: flex;
    width: max-content;
    animation: announce-scroll 36s linear infinite;
    will-change: transform;
}
.announce-set {
    display: flex;
    gap: 3rem;
    padding-right: 3rem;
    white-space: nowrap;
}
.announce-set span {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .42rem 0;
    color: rgba(232, 238, 252, .92);
    font-size: .84rem;
    font-weight: 300;
    letter-spacing: .2px;
}
.announce-set i { color: #6ea8ff; font-size: .75rem; }

@keyframes announce-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--text-100) !important;
    font-weight: 600;
    font-size: 1.22rem;
    letter-spacing: .5px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--grad-blue);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 6px 20px rgba(37, 99, 235, .5);
}

.brand-logo { height: 40px; width: auto; display: block; }

.brand-logo-fx {
    position: relative;
    display: inline-flex;
    height: 40px;
    flex: 0 0 auto;
    transform-origin: center;
    animation: logo-cycle 4.4s linear infinite;
}
.brand-logo-fx .brand-logo {
    position: relative;
    z-index: 1;
    animation: logo-glitch 4.4s linear infinite;
}
.brand-logo-fx::before,
.brand-logo-fx::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    -webkit-mask: var(--logo-url) center / contain no-repeat;
    mask: var(--logo-url) center / contain no-repeat;
}
.brand-logo-fx::before {
    background: #fff;
    animation: logo-glitch-white 4.4s linear infinite;
}
.brand-logo-fx::after {
    background: #000;
    animation: logo-glitch-black 4.4s linear infinite;
}

@keyframes logo-cycle {
    0%, 20% { transform: scale(1); }
    42% { transform: scale(.58); }
    68%, 100% { transform: scale(1); }
}
@keyframes logo-glitch {
    0% { transform: none; clip-path: inset(0); }
    2% { transform: translate(-2px, 1px); clip-path: inset(0 0 38% 0); }
    4% { transform: translate(2px, -1px); clip-path: inset(42% 0 0 0); }
    6% { transform: translate(-1px, 0) skewX(-8deg); clip-path: inset(0); }
    8% { transform: translate(3px, 1px); clip-path: inset(18% 0 46% 0); }
    11% { transform: translate(-2px, -1px); clip-path: inset(62% 0 0 0); }
    14% { transform: translate(1px, 0); clip-path: inset(0); }
    16%, 100% { transform: none; clip-path: inset(0); }
}
@keyframes logo-glitch-white {
    0%, 1% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
    2% { opacity: .95; transform: translate(-4px, 0); clip-path: inset(8% 0 60% 0); }
    4% { opacity: 0; }
    5% { opacity: .9; transform: translate(-3px, 1px); clip-path: inset(46% 0 16% 0); }
    7% { opacity: .85; transform: translate(2px, -1px); clip-path: inset(70% 0 4% 0); }
    9% { opacity: 0; }
    11% { opacity: .8; transform: translate(-3px, 0); clip-path: inset(22% 0 42% 0); }
    15%, 100% { opacity: 0; transform: none; }
}
@keyframes logo-glitch-black {
    0% { opacity: 0; }
    3% { opacity: .9; transform: translate(4px, 0); clip-path: inset(28% 0 38% 0); }
    5% { opacity: .85; transform: translate(3px, -1px); clip-path: inset(0 0 68% 0); }
    8% { opacity: 0; }
    10% { opacity: .9; transform: translate(4px, 1px); clip-path: inset(54% 0 8% 0); }
    12% { opacity: .7; transform: translate(-2px, 0); clip-path: inset(12% 0 58% 0); }
    16%, 100% { opacity: 0; transform: none; }
}

.brand-text {
    background: linear-gradient(90deg, #ffffff, #93c5fd 60%, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-toggler {
    border: 1px solid var(--line-strong);
    color: var(--text-100);
    padding: .35rem .6rem;
    border-radius: 10px;
}
.navbar-toggler:focus { box-shadow: none; }

/* เมนูหลักแบบแถบแคปซูล: เมนูที่เลือกอยู่เป็นปุ่มนูนมีขอบ */
.main-menu {
    position: relative;
    align-items: center;
    gap: .15rem;
    padding: .3rem;
    border-radius: 999px;
    background:
        radial-gradient(60% 120% at 50% 0%, rgba(37, 99, 235, .12) 0%, transparent 70%),
        linear-gradient(180deg, #0a1124 0%, #060913 100%);
    border: 1px solid rgba(59, 130, 246, .22);
    box-shadow: inset 0 1px 0 rgba(147, 197, 253, .06);
}

.main-menu .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1.05rem !important;
    border-radius: 999px;
    border: 1px solid transparent;
    overflow: hidden;
    color: #8792ad;
    font-size: .9rem;
    font-weight: 400;
    white-space: nowrap;
    transition: color .25s ease, background .25s ease, border-color .25s ease;
}

.main-menu .nav-link i {
    font-size: .8rem;
    opacity: .8;
    transition: transform .25s cubic-bezier(.3, 1.5, .6, 1), color .25s ease;
}

/* เส้นใต้ไล่สีฟ้า ยืดออกจากตรงกลางตอนชี้ */
.main-menu .nav-link::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--blue-500), var(--cyan-400));
    transform: translateX(-50%);
    transition: width .3s cubic-bezier(.2, .8, .3, 1);
}
.main-menu .nav-link:hover {
    color: #fff;
    background: rgba(59, 130, 246, .08);
}
.main-menu .nav-link:hover::before { width: 18px; }
.main-menu .nav-link:hover i {
    color: var(--blue-400);
    opacity: 1;
    transform: translateY(-2px) scale(1.12);
}

/* เมนูที่เลือกอยู่: แคปซูลน้ำเงิน ขอบฟ้า มีแสงวิ่งผ่าน */
.main-menu .nav-link.active {
    color: #fff;
    font-weight: 600;
    background: linear-gradient(180deg, rgba(37, 99, 235, .32) 0%, rgba(29, 78, 216, .14) 100%);
    border-color: rgba(96, 165, 250, .5);
    box-shadow:
        inset 0 1px 0 rgba(191, 219, 254, .18),
        0 4px 14px rgba(29, 78, 216, .28);
}
.main-menu .nav-link.active i { color: var(--cyan-400); opacity: 1; }
.main-menu .nav-link.active::before { width: 18px; }
.main-menu .nav-link.active::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .18), transparent);
    transform: skewX(-20deg);
    animation: menu-shine 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes menu-shine {
    0%, 70% { left: -60%; }
    100% { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
    .main-menu .nav-link.active::after { animation: none; display: none; }
}

/* ---------- หน้าค้นหาสินค้า ---------- */
.search-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 640px;
    margin: 0 0 2rem;
    padding: .35rem .35rem .35rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #0c1122 0%, #070a15 100%);
    border: 1px solid rgba(255, 255, 255, .1);
    transition: border-color .2s ease;
}
.search-bar:focus-within { border-color: rgba(96, 165, 250, .6); }
.search-bar-icon { color: #8b93a7; font-size: .95rem; }
.search-bar input {
    flex: 1;
    min-width: 0;
    padding: .55rem .2rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: .95rem;
}
.search-bar input::placeholder { color: #6b7280; }
.search-bar button {
    flex: 0 0 auto;
    padding: .6rem 1.4rem;
    border: 0;
    border-radius: 999px;
    background: var(--blue-600);
    color: #fff;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}
.search-bar button:hover { background: var(--blue-500); }

.nav-right { display: flex; align-items: center; gap: .6rem; }

.credit-pill {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .42rem .9rem;
    border-radius: 999px;
    background: rgba(251, 191, 36, .1);
    border: 1px solid rgba(251, 191, 36, .28);
    color: var(--gold);
    font-size: .92rem;
    font-weight: 400;
}
.credit-pill small { color: var(--text-500); font-size: .72rem; }

.lang-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, .04);
    gap: 2px;
}
.lang-switch a {
    min-width: 2.2rem;
    padding: .28rem .42rem;
    border-radius: 999px;
    text-align: center;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--text-300);
    text-decoration: none;
    line-height: 1.2;
}
.lang-switch a.active {
    background: var(--grad-blue);
    color: #fff;
}
.lang-switch a:hover { color: #fff; }
html[data-theme="light"] .lang-switch { background: #fff; }
html[data-theme="light"] .lang-switch a { color: #334155; }
html[data-theme="light"] .lang-switch a:hover { color: #0f172a; }
html[data-theme="light"] .lang-switch a.active,
html[data-theme="light"] .lang-switch a.active:hover { color: #fff; }

/* ---------------- Dropdown โปรไฟล์ ---------------- */

.profile-dropdown { position: relative; }

.profile-trigger {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--blue-500);
    padding: 2px;
    background: var(--bg-850);
    transition: transform .3s ease, box-shadow .3s ease;
}

.profile-trigger:hover .avatar-circle,
.profile-dropdown.open .avatar-circle {
    transform: scale(1.06);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .2);
}

.admin-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--gold);
    color: #1a1400;
    font-size: .58rem;
    border: 2px solid var(--bg-950);
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 276px;
    padding: .5rem;
    border-radius: var(--radius);
    background: #10182e;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px) scale(.96);
    transform-origin: top right;
    transition: opacity .25s ease, transform .3s cubic-bezier(.2, .9, .3, 1), visibility .25s;
    z-index: 1200;
}

.profile-dropdown.open .dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-panel::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: var(--bg-750);
    border-left: 1px solid var(--line-strong);
    border-top: 1px solid var(--line-strong);
    transform: rotate(45deg);
}

.dropdown-user {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .75rem .85rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: .35rem;
}
.dropdown-user img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--blue-600); }
.dropdown-user strong { display: block; font-size: .95rem; font-weight: 500; color: #fff; }

.role-badge {
    display: inline-block;
    margin-top: 2px;
    font-size: .68rem;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-weight: 300;
}
.role-admin { background: rgba(251, 191, 36, .15); color: var(--gold); border: 1px solid rgba(251, 191, 36, .3); }
.role-user  { background: rgba(59, 130, 246, .15); color: var(--blue-400); border: 1px solid rgba(59, 130, 246, .3); }

.dropdown-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .75rem;
    border-radius: 10px;
    color: var(--text-300);
    font-size: .92rem;
    transition: all .2s ease;
}
.dropdown-row i { width: 18px; text-align: center; }
a.dropdown-row:hover { background: rgba(59, 130, 246, .14); color: #fff; transform: translateX(3px); }

.credit-row { background: rgba(251, 191, 36, .07); cursor: default; }
.credit-row b { color: var(--gold); font-weight: 500; }

.admin-row { color: var(--gold); }
a.admin-row:hover { background: rgba(251, 191, 36, .14); color: #fff; }

.logout-row { color: #fca5a5; }
a.logout-row:hover { background: rgba(239, 68, 68, .14); color: #fff; }

.dropdown-divider-line { height: 1px; background: var(--line); margin: .4rem .3rem; }

.text-blue { color: var(--blue-400); }
.text-gold { color: var(--gold); }

/* ---------------- Layout ---------------- */

.site-main { min-height: 62vh; padding-bottom: 5rem; }

.section { padding: 3.2rem 0 1rem; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.6rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .7rem;
}

.section-title .bar {
    width: 5px;
    height: 28px;
    border-radius: 4px;
    background: var(--grad-blue);
    box-shadow: 0 0 16px rgba(59, 130, 246, .7);
}

.section-sub { color: var(--text-500); font-size: .92rem; margin: .3rem 0 0 1.5rem; font-weight: 200; }

/* หัวข้อแบบ "// KICKER" + ชื่อหัวข้อตัวใหญ่สีขาวล้วน */
.section-kicker {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: .7rem;
    color: #9ca3af;
    font-family: 'Orbitron', 'Kanit', sans-serif;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .32em;
}
.section-kicker::after {
    content: "";
    width: 72px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .35), transparent);
}
.section-kicker + .section-title {
    gap: .8rem;
    color: #fff;
    font-family: 'Orbitron', 'Kanit', sans-serif;
    font-size: clamp(1.7rem, 3.6vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .01em;
}
.section-kicker + .section-title i { font-size: .7em; color: #fff; }
.section-kicker ~ .section-sub { margin: .55rem 0 0; color: #9ca3af; }
html[data-theme="light"] .section-kicker + .section-title,
html[data-theme="light"] .section-kicker + .section-title i { color: #0f172a; }

.panel {
    background: var(--grad-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.6rem;
}

/* ---------------- Hero Slider ---------------- */

.welcome-wrap { margin-top: 1.7rem; }

.welcome-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .7rem;
    padding: .22rem .7rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, .35);
    background: rgba(37, 99, 235, .12);
    color: var(--blue-400);
    font-size: .78rem;
    letter-spacing: .4px;
}
.welcome-copy h1 {
    margin: 0 0 .55rem;
    font-size: 1.85rem;
    font-weight: 600;
    color: #fff;
}
.welcome-copy h1 span { color: var(--blue-400); }
.welcome-copy p {
    max-width: 640px;
    margin: 0 0 1.1rem;
    color: var(--text-500);
    font-weight: 200;
    line-height: 1.7;
}
.welcome-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.welcome-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .85rem;
    min-width: 210px;
}
.welcome-points li {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: var(--text-300);
    font-size: .92rem;
}
.welcome-point-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--blue-400);
    background: rgba(37, 99, 235, .14);
    border: 1px solid rgba(96, 165, 250, .25);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(96, 165, 250, .08);
    color: var(--text-100);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.theme-toggle:hover { background: rgba(96, 165, 250, .18); color: #fff; }

.hero-layout {
    margin-top: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .45rem;
}
/* แต่ละกรอบโทนเดียวกับแบนเนอร์: ตรงกลางดำ มุมมีแสงน้ำเงิน ขอบฟ้าเรือง ๆ */
.hero-stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    min-height: 108px;
    padding: 1rem 1.1rem;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(70% 120% at 0% 0%, rgba(37, 99, 235, .3) 0%, transparent 60%),
        radial-gradient(60% 120% at 100% 100%, rgba(37, 99, 235, .24) 0%, transparent 60%),
        linear-gradient(180deg, #050915 0%, #03050b 100%);
    border: 1px solid rgba(59, 130, 246, .35);
    box-shadow: inset 0 0 20px rgba(37, 99, 235, .14);
    transition: border-color .2s ease, transform .2s ease;
}
.hero-stat:hover {
    border-color: rgba(96, 165, 250, .6);
    transform: translateY(-2px);
}
/* ไอคอนจาง ๆ ด้านหลังกรอบ ไล่สีฟ้าโปร่ง */
.hero-stat-ghost {
    position: absolute;
    z-index: 0;
    right: .6rem;
    top: 50%;
    font-size: 4.6rem;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%) rotate(-12deg);
    transition: transform .35s ease;
}
.hero-stat-ghost i {
    display: block;
    background: linear-gradient(145deg, rgba(96, 165, 250, .3) 0%, rgba(34, 211, 238, .08) 55%, transparent 90%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-stat-status .hero-stat-ghost i {
    background-image: linear-gradient(145deg, rgba(129, 140, 248, .34) 0%, rgba(88, 101, 242, .08) 55%, transparent 90%);
}
.hero-stat:hover .hero-stat-ghost { transform: translateY(-50%) rotate(-4deg) scale(1.06); }
.hero-stat-icon,
.hero-stat > div,
.hero-stat-wave {
    position: relative;
    z-index: 1;
}
.hero-stat-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #dbeafe;
    font-size: 1rem;
    background: rgba(96, 165, 250, .1);
    border: 1px solid rgba(96, 165, 250, .2);
}
.hero-stat-kicker {
    color: rgba(203, 213, 225, .72);
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.2;
}
.hero-stat-num {
    margin-top: .12rem;
    color: #fff;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1;
}
.hero-stat-num b { font-weight: 700; }
.hero-stat-num span {
    margin-left: .15rem;
    font-size: .82rem;
    font-weight: 500;
}
.hero-stat-en {
    margin-top: .22rem;
    color: rgba(148, 163, 184, .78);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .14em;
}
.hero-stat-copy {
    min-width: 0;
    flex: 1;
}
.hero-stat-status {
    align-items: center;
    gap: .7rem;
    padding-bottom: 2.3rem;
}
.hero-stat-status .hero-stat-copy { padding-right: 0; }
.hero-stat-status .hero-stat-kicker {
    font-size: .74rem;
    letter-spacing: 0;
    white-space: nowrap;
}
.hero-stat-status .hero-stat-state {
    margin-top: .2rem;
    font-size: .95rem;
    letter-spacing: 0;
}
.hero-stat-open {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    margin-top: .22rem;
    color: rgba(191, 219, 254, .78);
    font-size: .74rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.hero-stat-open span:last-child {
    color: #f8fafc;
    font-weight: 600;
}
.hero-stat-status .hero-stat-wave {
    position: absolute;
    z-index: 1;
    left: 1.1rem;
    right: 1.1rem;
    bottom: .55rem;
    width: auto;
    height: 30px;
    margin: 0;
}
.hero-stat-state {
    margin-top: .18rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    color: #fff;
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.2;
}
.hero-stat-state i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}
.hero-stat-state.is-on { color: #4ade80; }
.hero-stat-state.is-off { color: #f87171; }
.hero-stat-discord {
    color: #8ea1ff;
    font-size: 1.15rem;
    background: rgba(88, 101, 242, .14);
    border-color: rgba(88, 101, 242, .32);
}
.hero-stat-status.is-on { color: #4ade80; }
.hero-stat-status.is-off { color: #f87171; }
.hero-stat-status.is-on .hero-stat-wave,
.hero-stat-status.is-off .hero-stat-wave { color: currentColor; }
.hero-stat-wave {
    margin-left: auto;
    width: 110px;
    height: 32px;
    overflow: hidden;
    flex: none;
}
.hero-stat-wave-track { opacity: .18; }
.hero-stat-wave-pulse {
    stroke-dasharray: 46 114;
    animation: hero-ecg 1.6s linear infinite;
}
.hero-stat-status.is-off .hero-stat-wave-pulse {
    animation-duration: 2.8s;
    opacity: .75;
}
@keyframes hero-ecg {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -160; }
}

.hero-slider {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    box-shadow: none;
    position: relative;
}

.hero-swiper { width: 100%; }

/* ---------- เอฟเฟควิ้งๆ บนแบนเนอร์ ---------- */
.hero-twinkle {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}
/* แสงเฉียงวิ่งผ่านทั้งแบนเนอร์ */
.hero-shine {
    position: absolute;
    top: -20%;
    left: -30%;
    width: 18%;
    height: 140%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .03) 30%, rgba(255, 255, 255, .16) 50%, rgba(255, 255, 255, .03) 70%, transparent 100%);
    transform: skewX(-18deg);
    animation: hero-shine 6s ease-in-out infinite;
}
@keyframes hero-shine {
    0%, 55% { left: -30%; }
    100% { left: 130%; }
}
/* ดาว 4 แฉกกระพริบ */
.hero-star {
    position: absolute;
    width: var(--s);
    height: var(--s);
    margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
    filter: drop-shadow(0 0 4px rgba(147, 197, 253, .9)) drop-shadow(0 0 10px rgba(59, 130, 246, .6));
    opacity: 0;
    transform: scale(0) rotate(0deg);
    animation: hero-star 3.6s ease-in-out infinite;
}
/* รูปดาวอยู่ใน ::before เพื่อไม่ให้ clip-path ตัดแสงเรืองทิ้ง */
.hero-star::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
}
@keyframes hero-star {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    12% { opacity: 1; transform: scale(1) rotate(45deg); }
    24% { opacity: 0; transform: scale(.2) rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-twinkle { display: none; }
}

.hero-slide {
    position: relative;
    aspect-ratio: 3.5 / 1;
    background: var(--bg-850);
    overflow: hidden;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
}

.hero-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2.4rem 2.2rem 1.7rem;
    background: linear-gradient(to top, rgba(5, 7, 15, .92), rgba(5, 7, 15, .35) 60%, transparent);
}
.hero-caption h3 { font-size: 1.6rem; margin: 0 0 .25rem; color: #fff; }
.hero-caption p { margin: 0; color: var(--text-300); font-weight: 200; font-size: .95rem; }

.hero-empty {
    aspect-ratio: 3.5 / 1;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--text-500);
    background:
        radial-gradient(600px 240px at 50% 0%, rgba(37, 99, 235, .25), transparent 70%),
        var(--bg-850);
}
.hero-empty i { font-size: 2.6rem; margin-bottom: .6rem; color: var(--blue-500); }

.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(5, 7, 15, .6);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(8px);
    color: #fff;
    transition: all .25s ease;
}
.hero-swiper .swiper-button-next:after,
.hero-swiper .swiper-button-prev:after { font-size: 1rem; font-weight: 700; }
.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover { background: var(--blue-600); border-color: var(--blue-600); }

.hero-swiper .swiper-pagination-bullet { background: #fff; opacity: .35; width: 9px; height: 9px; transition: all .3s; }
.hero-swiper .swiper-pagination-bullet-active { opacity: 1; width: 26px; border-radius: 6px; background: var(--cyan-400); }

/* ---------------- กล่องสถิติ ---------------- */

.stats-grid { margin-top: 1.6rem; }

.stat-card {
    position: relative;
    height: 100%;
    padding: 1.5rem 1.4rem;
    border-radius: var(--radius-lg);
    background: var(--grad-panel);
    border: 1px solid var(--line);
    overflow: hidden;
    transition: transform .35s cubic-bezier(.2, .8, .3, 1), border-color .35s, box-shadow .35s;
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: radial-gradient(400px 120px at var(--mx, 50%) 0%, rgba(59, 130, 246, .22), transparent 70%);
    opacity: 0;
    transition: opacity .35s;
    pointer-events: none;
}

.stat-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.stat-card:hover::after { opacity: 1; }

.stat-icon {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: #fff;
    background: var(--grad-blue);
    box-shadow: 0 10px 26px rgba(37, 99, 235, .4);
}
.stat-card:nth-child(2) .stat-icon,
.stat-card.variant-2 .stat-icon { background: linear-gradient(135deg, #0891b2, #22d3ee); box-shadow: 0 10px 26px rgba(34, 211, 238, .35); }
.stat-card.variant-3 .stat-icon { background: linear-gradient(135deg, #b45309, #fbbf24); box-shadow: 0 10px 26px rgba(251, 191, 36, .32); }

.stat-value { font-size: 2rem; font-weight: 600; line-height: 1.1; color: #fff; }
.stat-label { color: var(--text-500); font-size: .9rem; font-weight: 200; }

/* ---------------- การ์ดหมวดหมู่ ---------------- */

.category-heading {
    --heading-size: 1.7rem;
    display: flex;
    align-items: flex-start;
    gap: .8rem;
}
.category-heading-icon {
    position: relative;
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    line-height: 1;
}
.category-heading-icon-line,
.category-heading-icon-fill {
    grid-area: 1 / 1;
}
.category-heading-icon-line {
    color: transparent;
    font-size: 2.05rem;
    -webkit-text-stroke: 1.6px #60a5fa;
    filter: drop-shadow(0 0 3px rgba(37, 99, 235, .4));
}
.category-heading-icon-fill {
    color: #fff;
    font-size: 1.15rem;
    filter: drop-shadow(0 0 2px rgba(147, 197, 253, .35));
}
.category-heading-icon.is-hot .category-heading-icon-line {
    -webkit-text-stroke-color: #f97316;
    filter: drop-shadow(0 0 3px rgba(234, 88, 12, .42));
}
.category-heading-icon.is-hot .category-heading-icon-fill {
    color: #fbbf24;
    filter: drop-shadow(0 0 2px rgba(251, 191, 36, .4));
}
/* เส้น "-" มีหางจางๆ ชี้ไปที่ชื่อหัวข้อ */
.category-heading-pointer {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 3px;
    /* วางให้อยู่กึ่งกลางบรรทัดชื่อหัวข้อพอดี (ไม่ใช่กึ่งกลางทั้งกล่อง) */
    margin-top: calc(var(--heading-size) * 1.15 / 2 - 1.5px);
    border-radius: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .25) 35%, #fff 100%);
    animation: pointer-nudge 2.4s ease-in-out infinite;
}
.category-heading-pointer::after {
    content: "";
    position: absolute;
    right: -3px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, .6);
}
.category-heading-pointer.is-hot {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .25) 35%, #ffffff 100%);
}
.category-heading-pointer.is-hot::after {
    background: #ececeb;
    box-shadow: 0 0 8px rgba(241, 240, 240, 0.6);
}
@keyframes pointer-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}
html[data-theme="light"] .category-heading-pointer {
    background: linear-gradient(90deg, transparent 0%, rgba(15, 23, 42, .25) 35%, #0f172a 100%);
}
html[data-theme="light"] .category-heading-pointer::after { background: #0f172a; box-shadow: none; }
.category-heading .section-title {
    margin: 0;
    font-size: var(--heading-size);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    /* ชื่อขยับตามจังหวะเดียวกับเส้น - */
    animation: pointer-nudge 2.4s ease-in-out infinite;
}
.category-heading-sub {
    margin: .15rem 0 0;
    color: rgba(203, 213, 225, .72);
    font-size: .95rem;
    font-weight: 400;
    line-height: 1.2;
}

.section-more {
    color: rgba(226, 232, 240, .88);
    font-size: .95rem;
    font-weight: 500;
    white-space: nowrap;
}

.section-more:hover { color: #fff; }
.section-more i { margin-left: .25rem; font-size: .8rem; transition: transform .3s; }
.section-more:hover i { transform: translateX(4px); }

.category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.category-card:hover { color: inherit; }

.category-banner {
    position: relative;
    display: flex;
    align-items: center;
    aspect-ratio: 1024 / 341;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 22px;
    background:
        linear-gradient(118deg, rgba(37, 99, 235, .18) 0%, transparent 34%),
        linear-gradient(180deg, #071018 0%, #04060c 100%);
    border: 1px solid rgba(148, 163, 184, .14);
    box-shadow: none;
    transition: transform .35s cubic-bezier(.2, .8, .3, 1), border-color .3s, box-shadow .3s;
}

.category-card:hover .category-banner {
    transform: translateY(-4px);
    border-color: rgba(96, 165, 250, .45);
    box-shadow: none;
}

.category-banner:has(img) .category-copy { display: none; }

.category-copy {
    position: relative;
    z-index: 2;
    min-width: 0;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 1.15rem 1.1rem 1.15rem 1.4rem;
    background: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.category-banner:not(:has(img)) .category-copy {
    max-width: none;
    margin: 0;
    padding: 1.15rem 1rem 1.15rem 1.4rem;
    background: none;
    flex: 1;
}
.category-copy h3 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.55rem, 2.4vw, 2.55rem);
    font-weight: 700;
    line-height: .95;
    letter-spacing: .01em;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.category-copy p {
    margin: .55rem 0 0;
    color: rgba(203, 213, 225, .72);
    font-size: .8rem;
    font-weight: 400;
    letter-spacing: .04em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
}
.category-banner:not(:has(img)) .category-thumb {
    inset: 0 0 0 auto;
    width: 42%;
    background: linear-gradient(140deg, #0a1220, #04060c);
    display: grid;
    place-items: center;
}
.category-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .6s ease;
}
.category-card:hover .category-thumb img { transform: scale(1.06); }
.category-thumb .cat-icon { font-size: 1.8rem; color: var(--blue-400); text-shadow: 0 0 24px rgba(59, 130, 246, .6); }

.category-badge {
    position: absolute;
    bottom: .55rem;
    left: .65rem;
    z-index: 3;
    padding: .28rem .7rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .45);
}

.category-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem .15rem .15rem;
}
.category-foot-copy { min-width: 0; }
.category-foot h4 {
    margin: 0;
    color: #e8eefc;
    font-size: 1rem;
    font-weight: 600;
}
.category-foot p {
    margin: .15rem 0 0;
    color: var(--text-500);
    font-size: .84rem;
    font-weight: 300;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-go {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .48rem .95rem;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, .22);
    background: rgba(255, 255, 255, .03);
    color: #fff;
    font-size: .86rem;
    font-weight: 500;
    transition: background .25s, border-color .25s, transform .25s;
}
.category-card:hover .category-go {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(226, 232, 240, .4);
    transform: translateX(3px);
}
.category-card.is-soon {
    cursor: default;
}
.category-card.is-soon:hover .category-banner {
    transform: none;
    border-color: rgba(148, 163, 184, .14);
    box-shadow: none;
}
.category-card.is-soon:hover .category-thumb img,
.category-card.is-soon:hover .category-go {
    transform: none;
}
.category-card.is-soon:hover .category-go {
    background: rgba(255, 255, 255, .03);
    border-color: rgba(226, 232, 240, .22);
}

/* ---------------- การ์ดสินค้า ---------------- */

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--radius);
    background: var(--grad-panel);
    border: 1px solid var(--line);
    overflow: hidden;
    transition: transform .35s cubic-bezier(.2, .8, .3, 1), border-color .3s, box-shadow .3s;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }

.orbit-loader {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    pointer-events: none;
    background: rgba(0, 0, 0, .46);
}
.orbit-loader.is-on { display: flex; }
.orbit-corner {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 2px solid #fff;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7));
    animation: orbit-corner-bounce 1.15s cubic-bezier(.34, 1.45, .64, 1) infinite;
}
.orbit-corner-tl {
    top: 12px;
    left: 12px;
    border-right: 0;
    border-bottom: 0;
    border-top-left-radius: 8px;
    --ox: -6px;
    --oy: -6px;
}
.orbit-corner-tr {
    top: 12px;
    right: 12px;
    border-left: 0;
    border-bottom: 0;
    border-top-right-radius: 8px;
    --ox: 6px;
    --oy: -6px;
}
.orbit-corner-bl {
    bottom: 12px;
    left: 12px;
    border-right: 0;
    border-top: 0;
    border-bottom-left-radius: 8px;
    --ox: -6px;
    --oy: 6px;
}
.orbit-corner-br {
    right: 12px;
    bottom: 12px;
    border-left: 0;
    border-top: 0;
    border-bottom-right-radius: 8px;
    --ox: 6px;
    --oy: 6px;
}
@keyframes orbit-corner-bounce {
    0%, 100% { transform: translate(0, 0); }
    42% { transform: translate(var(--ox), var(--oy)); }
    68% { transform: translate(calc(var(--ox) * .28), calc(var(--oy) * .28)); }
}

.product-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0a0f1f;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, filter .35s ease; }
.product-card:hover .product-thumb > img { transform: scale(1.07); }

/* ชี้สินค้า: ภาพเบลอ + โลโก้เว็บในวงแหวนหมุน */
.product-thumb > img { transition: transform .5s cubic-bezier(.2, .8, .3, 1), filter .35s ease; }
.product-card:hover .product-thumb:not(.is-out) > img { filter: blur(3px) brightness(.72); }
.thumb-hover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, rgba(255, 255, 255, .03) 0%, rgba(0, 0, 0, .28) 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}
.product-card:hover .thumb-hover { opacity: 1; }
.thumb-hover-orb {
    position: relative;
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    transform: scale(.7);
    transition: transform .4s cubic-bezier(.2, .8, .3, 1.3);
}
.product-card:hover .thumb-hover-orb { transform: scale(1); }
.thumb-hover-orb img {
    position: relative;
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7));
}
.thumb-hover-mark { font-size: 1.8rem; color: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7)); }
.thumb-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
/* วงนอก: เส้นบางสีขาว + ขีด 4 ทิศแบบ HUD หมุนช้า */
.thumb-ring.is-dash {
    inset: 0;
    border: 2px solid rgba(255, 255, 255, .85);
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7));
    background:
        linear-gradient(#fff, #fff) 50% 0 / 2px 9px no-repeat,
        linear-gradient(#fff, #fff) 50% 100% / 2px 9px no-repeat,
        linear-gradient(#fff, #fff) 0 50% / 9px 2px no-repeat,
        linear-gradient(#fff, #fff) 100% 50% / 9px 2px no-repeat;
    animation: thumb-spin 8s linear infinite;
}
/* วงกลาง: ดาวหางสีขาวมีหางจางๆ หมุนเร็ว */
.thumb-ring.is-arc {
    inset: 8px;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 255, 255, .1) 120deg, rgba(255, 255, 255, .7) 300deg, #fff 355deg, transparent 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7));
    animation: thumb-spin 1.4s linear infinite;
}
/* วงใน: จุดไข่ปลาสีขาว หมุนสวนทาง */
.thumb-ring.is-arc-2 {
    inset: 17px;
    border: 2px dotted #fff;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7));
    animation: thumb-spin 5s linear infinite reverse;
}
@keyframes thumb-spin { to { transform: rotate(360deg); } }
/* หยุดหมุนเมื่อไม่ได้ชี้ เพื่อไม่ให้เปลืองเครื่อง */
.product-card:not(:hover) .thumb-ring { animation-play-state: paused; }
html[data-theme="light"] .thumb-hover-orb img { filter: none; }
.product-thumb.is-out img,
.product-detail-img.is-out img { filter: blur(6px); transform: scale(1.08); }
.product-card:hover .product-thumb.is-out img { transform: scale(1.08); }
.sold-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    padding: .6rem;
    background: rgba(5, 7, 15, .28);
    color: #fff;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: .04em;
    text-align: center;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .75);
    pointer-events: none;
}
.product-detail-img .sold-overlay { font-size: clamp(1.8rem, 3vw, 2.4rem); }

.badge-ribbon {
    position: absolute;
    top: .65rem;
    left: .65rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .28rem .72rem .28rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .01em;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
}
.badge-ribbon.hot {
    color: #fff;
    background: linear-gradient(135deg, #fb7185, #dc2626);
    border: 1px solid rgba(255, 255, 255, .28);
}
.badge-ribbon.recommend {
    color: #422006;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    border: 1px solid rgba(255, 255, 255, .45);
}

.badge-stock {
    position: absolute;
    top: .7rem;
    left: .7rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 400;
    backdrop-filter: blur(6px);
}
.badge-stock.is-lower { top: auto; bottom: .7rem; }
.stock-in  { background: rgba(34, 197, 94, .18); color: #86efac; border: 1px solid rgba(34, 197, 94, .35); }
.stock-out { background: rgba(239, 68, 68, .18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .35); }

.badge-cat {
    position: absolute;
    top: .7rem;
    right: .7rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .72rem;
    background: rgba(5, 7, 15, .65);
    border: 1px solid var(--line-strong);
    color: var(--text-300);
    backdrop-filter: blur(6px);
}

.product-body { padding: 1rem 1.1rem; flex: 1 1 auto; display: flex; flex-direction: column; }
.product-body h5 { font-size: 1rem; margin: 0 0 .35rem; color: #fff; line-height: 1.45; }
.product-body p { color: var(--text-500); font-size: .84rem; font-weight: 200; margin: 0 0 .9rem; }

.product-price { margin-top: auto; display: flex; align-items: baseline; gap: .55rem; }
.price-now { font-size: 1.32rem; font-weight: 600; color: var(--blue-400); }
.price-old { font-size: .88rem; color: var(--text-500); text-decoration: line-through; }

.product-foot { padding: 0 1.1rem 1.1rem; display: flex; gap: .5rem; }
.product-foot .btn { flex: 1; }

/* ---------------- หน้าสินค้า ---------------- */

/* ---- หน้าสินค้า: รูปซ้าย 480px (ไฟล์สูง 600px จึงยังคมชัด) | ข้อมูลขวา | รายละเอียดเต็มความกว้าง ---- */
.pd-crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.6rem 0 1.4rem;
    color: var(--text-500);
    font-size: .85rem;
    font-weight: 300;
}
.pd-crumb a { color: var(--text-300); text-decoration: none; }
.pd-crumb a:hover { color: var(--blue-400); }
.pd-crumb > span { color: var(--text-500); }
.pd-back {
    width: 34px;
    height: 34px;
    margin-right: .35rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(59, 130, 246, .08);
    color: #fff !important;
    font-size: .82rem;
    transition: background .2s ease, border-color .2s ease;
}
.pd-back:hover { background: var(--blue-600); border-color: var(--blue-600); }
.pd-crumb-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-500);
}

.pd-layout {
    display: grid;
    grid-template-columns: 480px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
}
.pd-media { min-width: 0; }
.product-detail-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, .3);
    background: #0a0f1f;
}
.product-detail-img img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.pd-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .9rem;
    padding: .38rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(59, 130, 246, .05);
    color: var(--text-500);
    font-size: .76rem;
}

.pd-info { min-width: 0; padding-top: .2rem; }
.pd-kicker {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--line);
    color: var(--blue-400);
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-decoration: none;
}
.pd-kicker:hover { color: var(--cyan-400); }
.pd-title {
    margin: 1rem 0 .4rem;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.45;
}
.pd-lead {
    margin: 0 0 .2rem;
    color: var(--text-300);
    font-size: .92rem;
    font-weight: 300;
    line-height: 1.6;
}
.pd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .85rem;
}
.pd-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .24rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(59, 130, 246, .06);
    color: var(--text-300);
    font-size: .78rem;
    font-weight: 500;
}
.pd-tag > i:empty {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.pd-tag.is-green { color: #4ade80; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .1); }
.pd-tag.is-red { color: #f87171; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .1); }
.pd-tag.is-blue { color: #93c5fd; }
.pd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.1rem;
    margin-top: .9rem;
    color: var(--text-500);
    font-size: .8rem;
}
.pd-meta i { margin-right: .3rem; font-size: .75rem; }
.pd-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem .8rem;
    margin-top: 1.1rem;
    padding-bottom: 1.3rem;
    border-bottom: 1px solid var(--line);
}
.pd-price strong {
    background: linear-gradient(90deg, var(--blue-400), var(--cyan-400));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.01em;
}
.pd-price-old {
    color: var(--text-500);
    font-size: 1rem;
    text-decoration: line-through;
}

.pd-buy {
    margin-top: 1.3rem;
    padding: 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background:
        radial-gradient(60% 80% at 0% 0%, rgba(37, 99, 235, .14) 0%, transparent 70%),
        #070b16;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.pd-buy-note {
    margin: 0 0 .25rem;
    color: var(--text-300);
    font-size: .86rem;
    text-align: center;
}
.pd-buy-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
}
.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 44px;
    padding: .6rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: rgba(59, 130, 246, .06);
    color: var(--text-100);
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.pd-btn:hover { background: rgba(59, 130, 246, .16); border-color: var(--blue-500); color: #fff; }
.pd-btn.is-primary {
    border-color: transparent;
    background: var(--blue-600);
    color: #fff;
}
.pd-btn.is-primary:hover { background: var(--blue-500); }
.pd-btn:disabled { opacity: .5; cursor: not-allowed; }

.pd-desc {
    max-width: 1000px;
    margin: 2.2rem auto 0;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
}
.pd-desc-title {
    margin: 0 0 1rem;
    color: var(--text-500);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .1em;
}
.pd-desc-body {
    color: var(--text-100);
    font-size: .95rem;
    font-weight: 300;
    line-height: 1.85;
    white-space: pre-line;
}

@media (max-width: 991.98px) {
    .pd-layout { grid-template-columns: 1fr; gap: 1.6rem; max-width: 560px; }
    .pd-crumb, .pd-desc { max-width: 560px; }
}
@media (max-width: 479.98px) {
    .pd-price strong { font-size: 2.1rem; }
}

.detail-price {
    font-size: 2.4rem;
    font-weight: 600;
    background: linear-gradient(90deg, #60a5fa, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    background: rgba(96, 165, 250, .08);
    border: 1px solid var(--line);
    font-size: .85rem;
    color: var(--text-300);
}

.desc-box {
    background: rgba(5, 7, 15, .5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    color: var(--text-300);
    font-weight: 200;
    line-height: 1.85;
    white-space: pre-line;
}

.product-review { padding-top: 1rem; }
.review-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}
.review-copy { padding: 0 .5rem; }
.review-kicker {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--blue-400);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .16em;
}
.review-kicker::before {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}
.review-title {
    margin: .55rem 0 .7rem;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
}
.review-title span {
    display: block;
    background: linear-gradient(90deg, var(--blue-400), var(--cyan-400));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.review-sub {
    margin: 0;
    max-width: 22rem;
    color: var(--text-300);
    font-size: .95rem;
    font-weight: 300;
    line-height: 1.7;
}

/* กรอบวิดีโอโทนเดียวกับเว็บ: ดำน้ำเงิน มุมมีแสงฟ้า ขอบฟ้า */
.review-window {
    position: relative;
    padding: .8rem;
    border-radius: 18px;
    background:
        radial-gradient(55% 60% at 0% 0%, rgba(37, 99, 235, .3) 0%, transparent 70%),
        radial-gradient(50% 60% at 100% 100%, rgba(37, 99, 235, .24) 0%, transparent 70%),
        linear-gradient(180deg, #050915 0%, #03050b 100%);
    border: 1px solid rgba(59, 130, 246, .35);
    box-shadow: inset 0 0 22px rgba(37, 99, 235, .14);
}
.review-window-bar {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .15rem .3rem .75rem;
}
.review-dots { display: inline-flex; gap: .35rem; }
.review-dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(96, 165, 250, .22);
}
.review-dots i:first-child { background: var(--blue-500); }
.review-dots i:nth-child(2) { background: var(--cyan-400); opacity: .6; }
.review-window-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-300);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .18em;
}
.review-hd {
    padding: .14rem .5rem;
    border-radius: 6px;
    background: var(--grad-blue);
    color: #fff;
    font-size: .66rem;
    font-weight: 700;
}
.product-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #02040a;
    border: 1px solid rgba(59, 130, 246, .3);
}
.product-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-corner {
    position: absolute;
    z-index: 1;
    width: 20px;
    height: 20px;
    border-color: var(--blue-400);
    border-style: solid;
    pointer-events: none;
}
.video-corner.tl { top: 7px; left: 7px; border-width: 2px 0 0 2px; border-top-left-radius: 6px; }
.video-corner.tr { top: 7px; right: 7px; border-width: 2px 2px 0 0; border-top-right-radius: 6px; }
.video-corner.bl { bottom: 7px; left: 7px; border-width: 0 0 2px 2px; border-bottom-left-radius: 6px; }
.video-corner.br { right: 7px; bottom: 7px; border-width: 0 2px 2px 0; border-bottom-right-radius: 6px; }
.review-window-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem .3rem .1rem;
}
.review-window-foot strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
}
.review-window-foot a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(59, 130, 246, .1);
    color: var(--blue-400);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}
.review-window-foot a:hover { background: var(--blue-600); color: #fff; }
.review-window-foot a i { font-size: .7rem; }
@media (max-width: 991.98px) {
    .review-layout { grid-template-columns: 1fr; gap: 1.2rem; max-width: 560px; }
    .review-copy { padding: 0; }
}

/* ---------------- ฟอร์ม ---------------- */

.auth-wrap { display: grid; place-items: center; padding: 3.5rem 0; }

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 2.4rem 2.2rem;
    border-radius: var(--radius-lg);
    background: var(--grad-panel);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-glow);
    animation: card-in .6s cubic-bezier(.2, .9, .3, 1);
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.auth-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: #fff;
    background: var(--grad-blue);
    box-shadow: 0 12px 30px rgba(37, 99, 235, .45);
}

.form-label { font-size: .88rem; color: var(--text-300); font-weight: 300; margin-bottom: .35rem; }

.form-control, .form-select, textarea.form-control {
    background: rgba(5, 7, 15, .6);
    border: 1px solid var(--line);
    color: var(--text-100);
    border-radius: var(--radius-sm);
    padding: .68rem .95rem;
    font-family: inherit;
    font-weight: 300;
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.form-control:focus, .form-select:focus {
    background: rgba(5, 7, 15, .85);
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .16);
    color: #fff;
}

.form-control::placeholder { color: #5a6784; font-weight: 200; }

.form-select option { background: var(--bg-850); color: var(--text-100); }

.input-icon { position: relative; }
.input-icon i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--text-500); font-size: .9rem; pointer-events: none; }
.input-icon .form-control { padding-left: 2.5rem; }

.form-check-input { background-color: rgba(5, 7, 15, .6); border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--blue-600); border-color: var(--blue-600); }
.form-check-label { font-size: .88rem; color: var(--text-300); font-weight: 300; }

/* สวิตช์เปิด/ปิด */
.switch { position: relative; display: inline-block; width: 50px; height: 27px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider-ui {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #1d2438;
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: .3s;
}
.switch .slider-ui::before {
    content: '';
    position: absolute;
    width: 19px;
    height: 19px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #64748b;
    transition: .3s cubic-bezier(.2, .9, .3, 1);
}
.switch input:checked + .slider-ui { background: rgba(37, 99, 235, .3); border-color: var(--blue-500); }
.switch input:checked + .slider-ui::before { transform: translateX(23px); background: var(--cyan-400); box-shadow: 0 0 12px rgba(34, 211, 238, .8); }

/* ---------------- ตาราง ---------------- */

.table-wrap {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
    background: rgba(5, 7, 15, .4);
}

.table-dark-blue { margin: 0; width: 100%; border-collapse: collapse; }

.table-dark-blue thead th {
    background: rgba(37, 99, 235, .14);
    color: var(--text-300);
    font-weight: 400;
    font-size: .85rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
}

.table-dark-blue tbody td {
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(96, 165, 250, .08);
    color: var(--text-300);
    font-size: .9rem;
    font-weight: 300;
    vertical-align: middle;
}

.table-dark-blue tbody tr { transition: background .2s; }
.table-dark-blue tbody tr:hover { background: rgba(59, 130, 246, .07); }
.table-dark-blue tbody tr:last-child td { border-bottom: none; }

.pill { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .76rem; border: 1px solid transparent; }
.pill-green { background: rgba(34, 197, 94, .14); color: #86efac; border-color: rgba(34, 197, 94, .3); }
.pill-blue  { background: rgba(59, 130, 246, .14); color: #93c5fd; border-color: rgba(59, 130, 246, .3); }
.pill-gold  { background: rgba(251, 191, 36, .14); color: #fcd34d; border-color: rgba(251, 191, 36, .3); }
.pill-red   { background: rgba(239, 68, 68, .14); color: #fca5a5; border-color: rgba(239, 68, 68, .3); }
.pill-grey  { background: rgba(148, 163, 184, .12); color: #cbd5e1; border-color: rgba(148, 163, 184, .25); }

/* ---------------- หน้าเติมเงิน ---------------- */

.topup-tabs { display: flex; gap: .6rem; margin-bottom: 1.6rem; flex-wrap: wrap; }

.topup-tab {
    flex: 1 1 200px;
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    background: rgba(5, 7, 15, .5);
    border: 1px solid var(--line);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .85rem;
    transition: all .3s cubic-bezier(.2, .8, .3, 1);
}
.topup-tab:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.topup-tab.active { border-color: var(--blue-500); background: rgba(37, 99, 235, .16); box-shadow: 0 10px 30px rgba(37, 99, 235, .25); }

.topup-tab .ic {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
    font-size: 1.2rem; color: #fff; background: var(--grad-blue);
}
.topup-tab.truemoney .ic { background: linear-gradient(135deg, #dc2626, #f97316); }
.topup-tab strong { display: block; font-size: .98rem; font-weight: 500; color: #fff; }
.topup-tab small { color: var(--text-500); font-size: .78rem; }

.topup-pane { display: none; animation: fade-up .45s ease; }
.topup-pane.active { display: block; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.qr-box {
    max-width: 340px;
    margin: 0 auto;
    padding: 1rem;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 16px 44px rgba(0, 0, 0, .5);
}
.qr-box img { width: 100%; display: block; border-radius: 10px; }

.qr-name {
    text-align: center;
    margin-top: .9rem;
    font-size: 1.02rem;
    color: #fff;
    font-weight: 400;
}
.qr-name small { display: block; color: var(--text-500); font-size: .8rem; font-weight: 200; }

.step-list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step-list li {
    position: relative;
    padding: .55rem 0 .55rem 2.4rem;
    color: var(--text-300);
    font-weight: 200;
    font-size: .92rem;
    counter-increment: step;
}
.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: .5rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .78rem;
    color: #fff;
    background: var(--grad-blue);
}

/* ---------------- สถานะว่างเปล่า ---------------- */

.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-500);
}
.empty-state .ic {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.1rem;
    border-radius: 28px;
    display: grid;
    place-items: center;
    font-size: 2.2rem;
    color: var(--blue-400);
    background: rgba(59, 130, 246, .1);
    border: 1px solid var(--line);
}
.empty-state h5 { color: var(--text-100); margin-bottom: .4rem; }

/* ---------------- Footer ---------------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: linear-gradient(to bottom, rgba(8, 11, 22, .6), rgba(5, 7, 15, .95));
    padding: 3.4rem 0 1.6rem;
    margin-top: 2.5rem;
}

/* แบรนด์ (ซ้าย) | ลิงก์สรุป (กลาง) | Discord (ขวา) */
.footer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.75fr) 320px;
    gap: 3rem;
    align-items: center;
}

/* ----- Brand ----- */
.footer-brand { min-width: 0; }
.footer-brand-head {
    display: flex;
    align-items: center;
    gap: .9rem;
}
.footer-logo-fx { height: 60px; }
.footer-logo-fx .footer-logo { height: 60px; }
.footer-mark {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    color: var(--blue-400);
    background: rgba(59, 130, 246, .12);
    border: 1px solid var(--line);
}
.footer-brand-meta { min-width: 0; }
.footer-brand-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.footer-name {
    margin: 0;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.2;
}
.footer-edit {
    display: inline-block;
    padding: .05rem .45rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .3em;
    text-indent: .3em;
}
.footer-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .25rem;
    color: var(--green);
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .08em;
}
.footer-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: status-pulse 1.8s ease-out infinite;
}
@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
    100% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ตัวอักษรแบบ Glitch ขาวดำให้เข้ากับโลโก้ */
.glitch-text { position: relative; }
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    padding: inherit;
    text-indent: inherit;
    pointer-events: none;
    opacity: 0;
}
.glitch-text::before {
    color: #fff;
    animation: text-glitch-a 4.4s steps(1, end) infinite;
}
.glitch-text::after {
    color: #000;
    text-shadow: 1px 0 0 rgba(255, 255, 255, .35);
    animation: text-glitch-b 4.4s steps(1, end) infinite;
}
@keyframes text-glitch-a {
    0%, 1% { opacity: 0; }
    2% { opacity: .9; transform: translate(-3px, 0); clip-path: inset(10% 0 55% 0); }
    5% { opacity: .85; transform: translate(2px, -1px); clip-path: inset(60% 0 8% 0); }
    8% { opacity: .9; transform: translate(-2px, 1px); clip-path: inset(30% 0 35% 0); }
    11%, 100% { opacity: 0; transform: none; }
}
@keyframes text-glitch-b {
    0%, 2% { opacity: 0; }
    3% { opacity: .85; transform: translate(3px, 0); clip-path: inset(45% 0 20% 0); }
    6% { opacity: .8; transform: translate(-2px, 1px); clip-path: inset(0 0 70% 0); }
    9% { opacity: .85; transform: translate(2px, 0); clip-path: inset(72% 0 4% 0); }
    12%, 100% { opacity: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .glitch-text::before,
    .glitch-text::after,
    .footer-status i { animation: none; }
}

.footer-tagline {
    max-width: 26rem;
    margin: 1.1rem 0 0;
    color: var(--text-300);
    font-size: .9rem;
    font-weight: 300;
    line-height: 1.75;
}
.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.1rem;
}
.footer-social {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(59, 130, 246, .06);
    color: var(--text-300);
    font-size: .95rem;
    text-decoration: none;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.footer-social:hover {
    color: #fff;
    border-color: var(--line-strong);
    background: var(--blue-600);
}

/* ----- Link columns ----- */
.footer-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}
.footer-heading {
    position: relative;
    margin: 0 0 1.15rem;
    padding-bottom: .6rem;
    color: #fff;
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.footer-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 34px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--blue-500), var(--cyan-400));
}
.footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .7rem;
}
.footer-list li {
    min-width: 0;
    color: #c7d0e4;
    font-size: .9rem;
    font-weight: 300;
    line-height: 1.4;
}
.footer-list a,
.footer-list span {
    display: inline-flex;
    align-items: flex-start;
    gap: .6rem;
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
}
.footer-list i {
    width: 1rem;
    flex: 0 0 auto;
    margin-top: .2rem;
    color: var(--text-500);
    font-size: .85rem;
    text-align: center;
    transition: color .2s ease;
}
.footer-list a:hover { color: #fff; }
.footer-list a:hover i { color: var(--blue-400); }

/* ----- Discord card ----- */
.discord-card {
    width: 100%;
    padding: 1.1rem 1.1rem 1rem;
    border-radius: 14px;
    background: linear-gradient(160deg, #0b1122 0%, #070a15 100%);
    border: 1px solid var(--line);
    color: var(--text-100);
}
.discord-card-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.discord-card-brand i { color: #5865f2; font-size: 1.25rem; }
.discord-card-brand span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.discord-card-count {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .3rem .5rem;
    margin: .55rem 0 0;
}
.discord-card-count strong {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}
.discord-card-count span { color: var(--text-300); font-size: .85rem; }
.discord-live {
    width: 7px;
    height: 7px;
    align-self: center;
    border-radius: 50%;
    background: #23a559;
    animation: status-pulse 1.8s ease-out infinite;
}
.discord-card-label {
    margin: .9rem 0 .5rem;
    color: var(--text-500);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .08em;
}
.discord-members {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.discord-members li {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--text-100);
    font-size: .86rem;
    font-weight: 400;
}
.discord-member-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.discord-avatar {
    position: relative;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}
.discord-avatar img,
.discord-avatar-fallback {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: #5865f2;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}
.discord-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #090e1c;
    background: #23a559;
}
.discord-dot.is-idle { background: #f0b232; }
.discord-dot.is-dnd { background: #f23f43; }
.discord-join {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: .95rem;
    padding: .6rem 1rem;
    border-radius: 8px;
    background: var(--blue-600);
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s ease;
}
.discord-join:hover { background: var(--blue-500); color: #fff; }

@media (max-width: 1199.98px) {
    .footer-layout { grid-template-columns: minmax(0, 1fr) 320px; }
    .footer-summary { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 767.98px) {
    .footer-layout { grid-template-columns: 1fr; gap: 2rem; }
    .footer-summary { grid-row: auto; }
    .discord-card { max-width: 380px; }
}
@media (max-width: 479.98px) {
    .footer-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.footer-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-width: 8.5rem;
    padding: .62rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .04);
    color: #eef2f8;
    font-size: .92rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.footer-pill:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .32);
    color: #fff;
}

.footer-bottom {
    margin-top: 2.4rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--text-500);
    font-size: .82rem;
    font-weight: 200;
}

@media (max-width: 575.98px) {
    .footer-name { font-size: 1.2rem; letter-spacing: .06em; }
    .footer-pill { min-width: 7.4rem; }
}

/* ---------------- Back to top ---------------- */

/* ---------------- เอฟเฟคเมาส์แบบ Cyber (ไม่เรืองแสง) ---------------- */
.cy-burst {
    position: fixed;
    z-index: 2000;
    width: 0;
    height: 0;
    pointer-events: none;
}
.cy-burst-ring {
    position: absolute;
    left: -14px;
    top: -14px;
    width: 28px;
    height: 28px;
    border: 1px solid #3b82f6;
    transform: rotate(45deg) scale(.3);
    animation: cy-ring .45s cubic-bezier(.2, .8, .3, 1) forwards;
}
.cy-shard {
    position: absolute;
    left: -5px;
    top: -1px;
    width: 10px;
    height: 2px;
    transform: rotate(var(--rot));
    animation: cy-shard .6s cubic-bezier(.15, .75, .3, 1) forwards;
}
@keyframes cy-ring {
    to { transform: rotate(45deg) scale(1.6); opacity: 0; }
}
@keyframes cy-shard {
    0% { transform: translate(0, 0) rotate(var(--rot)) scaleX(1.4); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scaleX(.2); opacity: 0; }
}

/* ปุ่มลอย Discord มุมขวาล่าง */
.discord-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1041;
    display: block;
    text-decoration: none;
}
.discord-float-btn {
    position: relative;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #6b77f5, #4752c4);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
    transition: transform .2s ease;
}
.discord-float:hover .discord-float-btn { transform: scale(1.08); }
/* ปุ่มกลับขึ้นบนอยู่เหนือปุ่ม Discord เว้นระยะ 16px */
@media (max-width: 575.98px) {
    .discord-float { right: 14px; bottom: 14px; }
    .discord-float-btn { width: 44px; height: 44px; font-size: 1.15rem; }
    .back-to-top { right: 13px; bottom: 74px; }
}

.back-to-top {
    position: fixed;
    right: 23px;
    bottom: 86px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: 1px solid var(--line-strong);
    background: rgba(11, 16, 32, .85);
    color: var(--blue-400);
    backdrop-filter: blur(10px);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: all .3s ease;
    z-index: 1040;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--blue-600); color: #fff; }

/* ---------------- SweetAlert2 ธีมมืด ---------------- */

.swal2-popup.swal-dark {
    background: var(--grad-panel) !important;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg) !important;
    color: var(--text-100) !important;
    font-family: 'Kanit', sans-serif !important;
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(20px);
}
.swal2-popup.swal-dark .swal2-title { color: #fff !important; font-weight: 500; }
.swal2-popup.swal-dark .swal2-html-container { color: var(--text-300) !important; font-weight: 200; }
.swal2-popup.swal-dark .swal2-input,
.swal2-popup.swal-dark .swal2-textarea,
.swal2-popup.swal-dark .swal2-select {
    background: rgba(5, 7, 15, .7);
    border: 1px solid var(--line);
    color: var(--text-100);
    border-radius: 10px;
    font-family: 'Kanit', sans-serif;
    box-shadow: none;
}
.swal2-popup.swal-dark .swal2-input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(59, 130, 246, .16); }
.swal2-popup.swal-dark .swal2-confirm {
    background: var(--grad-blue) !important;
    border-radius: 10px !important;
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .4) !important;
}
.swal2-popup.swal-dark .swal2-cancel {
    background: rgba(148, 163, 184, .16) !important;
    color: var(--text-100) !important;
    border-radius: 10px !important;
    font-family: 'Kanit', sans-serif;
    font-weight: 300;
}
.swal2-popup.swal-dark .swal2-timer-progress-bar { background: var(--grad-blue); }

/* ป๊อปอัปยืนยันยังมีม่านมืด แต่แถบแจ้งเตือนสั้น ๆ ไม่เบลอหน้าเว็บ */
.swal2-container.swal2-backdrop-show { background: rgba(3, 5, 12, .78) !important; }
body.swal2-toast-shown .swal2-container {
    background: transparent !important;
    backdrop-filter: none !important;
}
.swal2-popup.swal2-toast.swal-dark {
    background: #121a30 !important;
    backdrop-filter: none !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, .45);
}

.swal-code-box {
    background: rgba(5, 7, 15, .8);
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    padding: .9rem 1rem;
    margin-top: .8rem;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #7dd3fc;
    font-size: .95rem;
    word-break: break-all;
    text-align: left;
    line-height: 1.8;
}

/* ---------------- Utility ---------------- */

.text-muted-blue { color: var(--text-500) !important; }
.divider { height: 1px; background: var(--line); margin: 1.5rem 0; }
.shine-text {
    background: linear-gradient(90deg, #ffffff, #60a5fa, #22d3ee, #ffffff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 300% 0; } }

.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .86rem;
    color: var(--text-500);
    padding: 1.6rem 0 .3rem;
    font-weight: 200;
    flex-wrap: wrap;
}
.breadcrumb-bar a { color: var(--text-300); }
.breadcrumb-bar a:hover { color: var(--blue-400); }

/* ---------------- สินค้าที่ซื้อล่าสุด ---------------- */

.recent-section { padding-top: 2.4rem; }

.recent-heading {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 .9rem;
    font-size: 1.02rem;
    font-weight: 400;
    color: var(--text-300);
}
.recent-heading i { color: var(--text-500); font-size: .95rem; }

.recent-marquee {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.recent-track {
    display: flex;
    width: max-content;
    animation: recent-scroll linear infinite;
    will-change: transform;
}

.recent-set {
    display: flex;
    gap: .7rem;
    padding-right: .7rem;
}

.recent-card {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 250px;
    min-height: 74px;
    padding: .55rem .7rem .55rem .55rem;
    border-radius: 14px;
    background: rgba(12, 16, 28, .92);
    border: 1px solid rgba(255, 255, 255, .06);
    color: inherit;
    flex: 0 0 auto;
}
.recent-card:hover { color: inherit; border-color: var(--line-strong); }
.recent-card.is-gift {
    border: 1px solid #ff2d2d;
    background: rgba(48, 8, 12, .94);
    box-shadow:
        0 0 0 1px rgba(255, 45, 45, .28),
        0 0 8px rgba(255, 40, 40, .32);
}
.recent-card.is-gift:hover {
    border-color: #ff4d4d;
    color: inherit;
    box-shadow:
        0 0 0 1px rgba(255, 70, 70, .35),
        0 0 10px rgba(255, 40, 40, .4);
}
.recent-card.is-gift .recent-card-text strong { color: #fecaca; }
.gift-lucky {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: .16rem .55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff4d4d, #dc2626);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.2;
    box-shadow: 0 0 6px rgba(255, 45, 45, .4);
}

.recent-card img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 auto;
    background: #0a0f1f;
}

.recent-card-text { min-width: 0; display: flex; flex-direction: column; gap: .28rem; }
.recent-card-text strong {
    color: #fff;
    font-size: .86rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-card-text small {
    display: flex;
    gap: .65rem;
    color: var(--text-500);
    font-size: .72rem;
    font-weight: 200;
    white-space: nowrap;
}
.recent-card-text small i { margin-right: .2rem; }

@keyframes recent-scroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
}

/* ---------------- ทำไมต้องเลือก ---------------- */

.why-section { padding-top: 2.6rem; padding-bottom: 1.4rem; }

.why-title {
    margin: 0 0 1.1rem;
    font-size: 1.35rem;
    font-weight: 500;
    color: #fff;
}
.why-title span { color: var(--blue-400); }

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.why-card {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: 1.15rem 1.2rem;
    border-radius: 16px;
    background: rgba(12, 16, 28, .72);
    border: 1px solid rgba(255, 255, 255, .06);
}

.why-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--blue-400);
    font-size: 1.15rem;
}

.why-card h3 {
    margin: 0 0 .25rem;
    font-size: .98rem;
    font-weight: 500;
    color: #fff;
}
.why-card p {
    margin: 0;
    color: var(--text-500);
    font-size: .86rem;
    font-weight: 200;
    line-height: 1.55;
}

@media (max-width: 767.98px) {
    .why-grid { grid-template-columns: 1fr; }
}

/* ---------------- จัดกรอบรูป ---------------- */

body.crop-open { overflow: hidden; }

.crop-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(3, 5, 12, .82);
}
.crop-modal[hidden] { display: none; }

.crop-dialog {
    width: min(720px, 100%);
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: #10182e;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-glow);
}
.crop-dialog h5 { margin: 0 0 .25rem; color: #fff; }
.crop-dialog p { margin: 0 0 .8rem; color: var(--text-500); font-size: .86rem; font-weight: 200; }

.crop-stage {
    height: min(52vh, 420px);
    background: #070b14;
    border-radius: 12px;
    overflow: hidden;
}
.crop-stage img { display: block; max-width: 100%; }

.crop-tools, .crop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    margin-top: .8rem;
}
.crop-actions { justify-content: flex-end; }
.crop-zoom { display: flex; align-items: center; gap: .45rem; color: var(--text-300); font-size: .84rem; margin-left: auto; }
.crop-zoom input { width: 140px; }

button.dropdown-row {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}
.avatar-change {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: .9rem;
        padding: 1rem;
        border-radius: var(--radius);
        background: var(--grad-panel);
        border: 1px solid var(--line-strong);
    }
    .main-menu { gap: .2rem; margin-bottom: .9rem; align-items: stretch; border-radius: 16px; }
    .main-menu .nav-link { border-radius: 12px; }
    .nav-right { justify-content: space-between; width: 100%; }
    .dropdown-panel { right: auto; left: 0; transform-origin: top left; }
    .hero-layout { grid-template-columns: 1fr; }
    .welcome-box { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
    .welcome-copy h1 { font-size: 1.4rem; }
    .hero-caption { padding: 1.4rem 1.2rem 1rem; }
    .hero-caption h3 { font-size: 1.15rem; }
}

@media (max-width: 575.98px) {
    .section-title { font-size: 1.3rem; }
    .category-heading { --heading-size: 1.35rem; }
    .category-heading-icon { width: 1.7rem; height: 1.7rem; }
    .category-heading-icon-line { font-size: 1.55rem; }
    .category-heading-icon-fill { font-size: 1.05rem; }
    .category-copy { max-width: none; margin: auto 1rem 1rem; }
    .category-foot { align-items: flex-start; }
    .category-go { align-self: flex-end; }
    .hero-stats { grid-template-columns: 1fr 1fr; gap: .4rem; }
    .hero-stat-ghost { font-size: 3.4rem; right: .3rem; }
    .hero-stat { padding: .7rem .65rem; }
    .hero-stat-wave { display: none; }
    .hero-stat-status .hero-stat-wave { display: block; left: .65rem; right: .65rem; height: 24px; }
    .hero-stat-status { padding-bottom: 2rem; }
    .hero-stat-num { font-size: 1.2rem; }
    .stat-value { font-size: 1.6rem; }
    .stat-icon { flex: 0 0 52px; width: 52px; height: 52px; font-size: 1.25rem; }
    .auth-card { padding: 1.8rem 1.3rem; }
    .hero-caption { display: none; }
}

/* ---------------- โหมดสว่าง ---------------- */

html[data-theme="light"] {
    --bg-950: #f3f6fb;
    --bg-900: #e7eef8;
    --bg-850: #ffffff;
    --bg-800: #f8fafc;
    --bg-750: #e8eef7;
    --text-100: #0f172a;
    --text-300: #334155;
    --text-500: #64748b;
    --line: rgba(15, 23, 42, .1);
    --line-strong: rgba(37, 99, 235, .28);
    --grad-panel: linear-gradient(160deg, #ffffff 0%, #f4f7fb 100%);
    --shadow-soft: 0 14px 34px rgba(15, 23, 42, .08);
    --shadow-glow: 0 0 0 1px rgba(37, 99, 235, .12), 0 16px 40px rgba(15, 23, 42, .08);
}
html[data-theme="light"] .site-header,
html[data-theme="light"] .site-header.scrolled {
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
html[data-theme="light"] .announce-bar { background: #e7eef8; }
html[data-theme="light"] .announce-set span { color: #1e293b; }
html[data-theme="light"] .brand-logo,
html[data-theme="light"] .footer-logo { filter: brightness(0); }
html[data-theme="light"] .brand-logo-fx::before { background: #000; }
html[data-theme="light"] .brand-logo-fx::after { background: #fff; }
html[data-theme="light"] .brand-text {
    background: none;
    -webkit-text-fill-color: #0f172a;
    color: #0f172a;
}
html[data-theme="light"] .main-menu,
html[data-theme="light"] .search-bar { background: #f1f5f9; border-color: rgba(15, 23, 42, .1); }
html[data-theme="light"] .main-menu .nav-link { color: #64748b; }
html[data-theme="light"] .main-menu .nav-link:hover { color: #0f172a; background: rgba(15, 23, 42, .04); }
html[data-theme="light"] .main-menu .nav-link.active {
    color: #0f172a;
    background: #fff;
    border-color: rgba(15, 23, 42, .15);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}
html[data-theme="light"] .search-bar input { color: #0f172a; }
html[data-theme="light"] .welcome-copy h1,
html[data-theme="light"] .stat-value,
html[data-theme="light"] .category-foot h4,
html[data-theme="light"] .category-heading-icon,
html[data-theme="light"] .category-heading-sub,
html[data-theme="light"] .section-more,
html[data-theme="light"] .product-body h5,
html[data-theme="light"] .footer-name,
html[data-theme="light"] .dropdown-user strong,
html[data-theme="light"] .recent-card-text strong,
html[data-theme="light"] .section-title { color: #0f172a; }
html[data-theme="light"] .category-heading-icon-fill { color: #0f172a; }
html[data-theme="light"] .category-heading-sub { color: #64748b; }
html[data-theme="light"] .section-more:hover { color: var(--blue-700); }
html[data-theme="light"] .category-go {
    color: #0f172a;
    border-color: rgba(15, 23, 42, .16);
    background: #fff;
}
html[data-theme="light"] .category-card:hover .category-go {
    color: #0f172a;
    background: #f3f4f6;
    border-color: rgba(15, 23, 42, .28);
}
html[data-theme="light"] .category-card.is-soon:hover .category-go {
    background: #fff;
    border-color: rgba(15, 23, 42, .16);
}
html[data-theme="light"] .site-footer {
    background: #fff;
}
html[data-theme="light"] .footer-pill {
    color: #111827;
    border-color: rgba(15, 23, 42, .16);
    background: #fff;
}
html[data-theme="light"] .footer-pill:hover {
    color: #111827;
    background: #f3f4f6;
    border-color: rgba(15, 23, 42, .28);
}
html[data-theme="light"] .footer-list li,
html[data-theme="light"] .footer-sub,
html[data-theme="light"] .footer-tagline { color: #475569; }
html[data-theme="light"] .pd-title,
html[data-theme="light"] .pd-desc-body,
html[data-theme="light"] .review-title { color: #0f172a; }
html[data-theme="light"] .pd-buy { background: #fff; border-color: rgba(15, 23, 42, .1); }
html[data-theme="light"] .pd-btn:not(.is-primary) { color: #0f172a; background: #fff; }
html[data-theme="light"] .pd-back { color: #0f172a !important; background: #fff; }
html[data-theme="light"] .footer-list a:hover,
html[data-theme="light"] .footer-heading { color: #0f172a; }
html[data-theme="light"] .footer-edit { color: #0f172a; border-color: rgba(15, 23, 42, .3); background: #fff; }
html[data-theme="light"] .footer-social { background: #fff; color: #334155; }
html[data-theme="light"] .footer-social:hover { color: #fff; }
html[data-theme="light"] .discord-card { background: #fff; border-color: rgba(15, 23, 42, .1); }
html[data-theme="light"] .discord-card-brand,
html[data-theme="light"] .discord-card-count strong,
html[data-theme="light"] .discord-members li { color: #0f172a; }
html[data-theme="light"] .discord-card-count span { color: #475569; }
html[data-theme="light"] .discord-dot { border-color: #fff; }
html[data-theme="light"] .dropdown-panel { background: #fff; color: #0f172a; }
html[data-theme="light"] .bg-aurora { opacity: .25; }
html[data-theme="light"] .theme-toggle:hover { color: var(--blue-700); }
html[data-theme="light"] .recent-card { background: #fff; }
html[data-theme="light"] .why-title { color: #0f172a; }
html[data-theme="light"] .why-card {
    background: #fff;
    border-color: rgba(15, 23, 42, .1);
}
html[data-theme="light"] .why-card h3 { color: #0f172a; }
html[data-theme="light"] .why-card p { color: #64748b; }
html[data-theme="light"] .recent-card.is-gift {
    border-color: #dc2626;
    background: #fff5f5;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, .22), 0 0 8px rgba(220, 38, 38, .18);
}
html[data-theme="light"] .recent-card.is-gift .recent-card-text strong { color: #b91c1c; }

/* ---------------- หิมะโปรย ---------------- */

.snow {
    position: fixed;
    inset: 0;
    z-index: 1040;
    overflow: hidden;
    pointer-events: none;
}
.snow span {
    position: absolute;
    top: -12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: none;
    animation-name: snow-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
@keyframes snow-fall {
    from { transform: translate3d(0, -12px, 0); }
    to { transform: translate3d(var(--drift, 16px), 105vh, 0); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .recent-track {
        animation-name: recent-scroll !important;
        animation-timing-function: linear !important;
        animation-iteration-count: infinite !important;
        animation-duration: 32s !important;
    }
    .announce-track {
        animation-name: announce-scroll !important;
        animation-timing-function: linear !important;
        animation-iteration-count: infinite !important;
        animation-duration: 36s !important;
    }
    .snow span {
        animation-name: snow-fall !important;
        animation-timing-function: linear !important;
        animation-iteration-count: infinite !important;
        animation-duration: var(--len) !important;
    }
}

/* ---------------- หน้าวิธีใช้งาน ---------------- */

.guide-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .7rem;
    margin-bottom: 1.6rem;
}
.guide-nav a {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 72px;
    padding: .75rem .85rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--grad-panel);
    color: var(--text-300);
    font-size: .86rem;
    font-weight: 300;
    line-height: 1.35;
}
.guide-nav a:hover {
    color: #fff;
    border-color: var(--line-strong);
    box-shadow: var(--shadow-glow);
}
.guide-nav b {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--grad-blue);
    font-size: .82rem;
    font-weight: 500;
}
.guide-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr);
    gap: 1.4rem;
    align-items: center;
    margin-bottom: 1.1rem;
    scroll-margin-top: 8rem;
}
.guide-step > * { min-width: 0; }
#step-topup { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.guide-step.reverse { direction: rtl; }
.guide-step.reverse > * { direction: ltr; }
.guide-copy h3 {
    margin: .35rem 0 .55rem;
    font-size: 1.35rem;
}
.guide-copy p,
.guide-copy li {
    color: var(--text-300);
    font-weight: 200;
    line-height: 1.75;
}
.guide-copy ol { margin: 0; padding-left: 1.15rem; }
.guide-kicker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--blue-400);
    font-size: .78rem;
    letter-spacing: .4px;
}
.guide-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .8rem;
}
.guide-figure {
    margin: 0;
    padding: .85rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    background:
        radial-gradient(420px 160px at 20% 0%, rgba(37, 99, 235, .18), transparent 60%),
        var(--grad-panel);
    box-shadow: var(--shadow-soft);
}
.guide-figure figcaption {
    margin-top: .7rem;
    color: var(--text-500);
    font-size: .78rem;
    font-weight: 200;
    text-align: center;
}
.shot {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-900);
}
.shot-bar {
    display: flex;
    align-items: center;
    gap: .35rem;
    height: 28px;
    padding: 0 .7rem;
    background: var(--bg-800);
    border-bottom: 1px solid var(--line);
}
.shot-bar i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
}
.shot-bar i:nth-child(1) { background: #ef4444; }
.shot-bar i:nth-child(2) { background: #fbbf24; }
.shot-bar i:nth-child(3) { background: #22c55e; }
.shot-bar span {
    margin-left: .45rem;
    color: var(--text-500);
    font-size: .72rem;
}
.shot-body { padding: .9rem; }
.shot-label {
    margin: 0 0 .65rem;
    color: var(--text-100);
    font-size: .92rem;
    font-weight: 400;
}
.mini-qr {
    width: 92px;
    height: 92px;
    margin: 0 auto .6rem;
    border-radius: 10px;
    background:
        linear-gradient(90deg, #0b1020 8px, transparent 8px) 0 0 / 16px 16px,
        linear-gradient(#0b1020 8px, transparent 8px) 0 0 / 16px 16px,
        #dbe7ff;
    box-shadow: inset 0 0 0 8px #fff;
}
.mini-field {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .55rem;
    padding: .55rem .7rem;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--bg-850);
    color: var(--text-500);
    font-size: .78rem;
}
.mini-btn {
    display: block;
    width: 100%;
    padding: .55rem .7rem;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--grad-blue);
    font-size: .82rem;
    text-align: center;
}
.mini-credit {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-left: auto;
    padding: .35rem .7rem;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, .35);
    background: rgba(251, 191, 36, .1);
    color: var(--gold);
    font-size: .82rem;
}
.mini-menu {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .7rem;
    color: var(--text-500);
    font-size: .78rem;
}
.mini-card {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-850);
}
.mini-thumb {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--grad-blue);
}
.mini-card strong { display: block; color: var(--text-100); font-size: .84rem; font-weight: 400; }
.mini-card small { color: var(--text-500); font-size: .74rem; }
.mini-key {
    margin-top: .55rem;
    padding: .7rem .8rem;
    border-radius: 10px;
    border: 1px dashed rgba(34, 211, 238, .45);
    background: rgba(34, 211, 238, .08);
    color: var(--cyan-400);
    letter-spacing: 1.5px;
    text-align: center;
    font-size: .95rem;
}
.guide-note {
    margin-top: .4rem;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(251, 191, 36, .4);
    background: rgba(251, 191, 36, .08);
    scroll-margin-top: 8rem;
}
.guide-note strong {
    display: block;
    margin-bottom: .25rem;
    color: var(--gold);
}
.guide-note p {
    margin: 0;
    color: var(--text-100);
    font-weight: 300;
    line-height: 1.7;
}
@media (max-width: 991.98px) {
    .guide-nav { grid-template-columns: 1fr 1fr; }
    .guide-step,
    .guide-step.reverse,
    #step-topup { direction: ltr; grid-template-columns: 1fr; }
    .guide-split { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .guide-nav { grid-template-columns: 1fr; }
}
