
    .top-bar {
        display: flex; justify-content: space-between; align-items: center;
        padding: 4px 10px; 
        background: #05080f; position: sticky; top: 0; z-index: 999;
        box-shadow: 0 4px 15px rgba(0,0,0,0.8); border-bottom: none;
        height: 45px; 
    }
    .top-bar::after {
        content: ''; position: absolute; bottom: -6px; left: 0; width: 100%; height: 6px;
        background-image: radial-gradient(circle at 5px 0, #d4af37 5px, transparent 6px);
        background-repeat: repeat-x; background-size: 10px 6px;
        filter: drop-shadow(0 2px 3px rgba(212, 175, 55, 0.5)); z-index: 1000;
    }
    .logo img { height: 22px; width: auto; z-index: 2; } 

    .user-actions { display: flex; align-items: center; gap: 6px; z-index: 2; }

    .credit-wrapper {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.6));
        border: 1px solid rgba(255, 215, 0, 0.4); 
        border-radius: 4px; padding: 0px 6px; 
        display: flex; align-items: center; gap: 3px; height: 24px; 
    }
    .credit-amount {
        font-size: 12px; color: #fff; font-weight: 700; 
        font-family: 'JetBrains Mono', 'Arial', sans-serif; line-height: 1; position: relative; top: 1px;
    }
    .currency { color: #ffd700; font-size: 10px; font-weight: 700; margin-right: 1px; }

    .login-btn-mini {
        background: linear-gradient(to right, #ffd700, #d4af37); border: none; color: #000;
        font-size: 10px; font-weight: 700; padding: 0 10px; height: 24px;    
        border-radius: 4px; cursor: pointer; box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
        transition: 0.2s; display: flex; align-items: center; gap: 4px; white-space: nowrap;
    }
    .login-btn-mini:hover { transform: scale(1.05); }
    .login-btn-mini i { font-size: 9px; } 

    .logout-btn-mini {
        background: rgba(255, 0, 0, 0.15); border: 1px solid #ff4444; color: #ff4444;
        width: 24px; height: 24px; border-radius: 4px;
        display: flex; align-items: center; justify-content: center;
        cursor: pointer; font-size: 10px; transition: 0.2s; padding: 0;
    }
    .logout-btn-mini:hover { background: #ff4444; color: #fff; }

    /* =========================================
       📱 2. BOTTOM NAV
       ========================================= */
    .bottom-nav {
        position: fixed; bottom: 0; left: 0; right: 0;
        width: 100%; height: 75px; background: #050b14;
        display: flex !important; flex-direction: row !important; 
        justify-content: space-around; align-items: center;
        z-index: 1000; border-top: 1px solid rgba(212, 175, 55, 0.4); 
        box-shadow: 0 -5px 20px rgba(0,0,0,0.8);
    }
    .bottom-nav::before { content: none !important; }
    .nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none !important; color: #64748b; width: 20%; position: relative; }
    .nav-custom-icon { width: 40px; height: 40px; object-fit: contain; margin-bottom: 4px; filter: none !important; transition: 0.3s ease; }
    .nav-item.active .nav-custom-icon, .nav-item:hover .nav-custom-icon { transform: scale(1.1); filter: drop-shadow(0 0 8px #d4af37) !important; }
    .nav-item span { font-size: 10px; font-weight: 500; transition: 0.3s; }
    .nav-item.active span { color: #d4af37; font-weight: 800; }
    .center-play-btn {
        background: transparent !important; border: none !important;
        box-shadow: none !important; animation: none !important;
        position: absolute; top: -55px; left: 50%; transform: translateX(-50%);
        z-index: 1001; display: flex; align-items: center; justify-content: center;
        width: auto; height: auto;
    }
    .nav-custom-icon-center { width: 100px; height: 100px; object-fit: contain; filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.8)); transition: transform 0.3s ease; }
    .center-label { margin-top: 55px; color: #d4af37 !important; font-weight: 800; font-size: 11px; text-shadow: 0 0 8px rgba(212, 175, 55, 0.4); display: block; text-align: center; }
    .nav-item:active .nav-custom-icon-center { transform: scale(0.95); }
    .nav-item .nav-icon-lock, .nav-item .nav-icon-home { width: 70px; height: 70px; object-fit: contain; display: block; margin: 0 auto; position: relative; top: 6px; }
    .nav-item .nav-icon-account { font-size: 32px; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; margin: 0 auto; line-height: 1; }
    
   /* SweetAlert Styling */
   div:where(.swal2-container) { z-index: 200000 !important; }
   div:where(.swal2-container) div:where(.swal2-popup) { background: #0f1218 !important; border: 1px solid #d4af37 !important; color: #fff !important; }
   div:where(.swal2-icon).swal2-error { border-color: #d33 !important; color: #d33 !important; }
   div:where(.swal2-icon).swal2-success { border-color: #d4af37 !important; color: #d4af37 !important; }
   div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm { background: linear-gradient(90deg, #ffd700, #d4af37) !important; color: #000 !important; font-weight: bold !important; }

   /* General Modal Styles */
   .luxury-modal { background: #0f1218; border: 1px solid #d4af37; border-radius: 20px; box-shadow: 0 0 30px rgba(0,0,0,0.8); }
   .dark-input { background: #000 !important; border: 1px solid #333 !important; color: #fff !important; border-radius: 10px; height: 45px; }
   .dark-input:focus { border-color: #d4af37 !important; box-shadow: 0 0 10px rgba(212, 175, 55, 0.2); }
   .text-gold { color: #ffd700; }
   .text-xs { font-size: 12px; }
   .btn-gold-gradient { background: linear-gradient(90deg, #ffd700, #d4af37); color: #000; border: none; transition: 0.3s; }
   .btn-gold-gradient:hover { transform: scale(1.02); box-shadow: 0 0 20px rgba(212, 175, 55, 0.4); }

    /* =========================================
       ✨ 3. Compact Login Modal (ขนาดเล็ก)
       ========================================= */
    @media (max-width: 576px) {
        #loginModal .modal-dialog { max-width: 320px; margin: 1.75rem auto; }
    }
    #loginModal .modal-content { border-radius: 15px; }
    #loginModal .modal-header { padding: 10px 15px; }
    #loginModal .modal-title { font-size: 16px; font-weight: 600; }
    #loginModal .modal-body { padding: 15px 20px; }
    #loginModal .form-group { margin-bottom: 12px !important; }
    #loginModal .dark-input { height: 38px; font-size: 13px; }
    #loginModal .text-xs { font-size: 11px; margin-bottom: 4px; display: inline-block; }
    #loginModal .btn-gold-gradient { padding-top: 8px; padding-bottom: 8px; font-size: 14px; margin-top: 5px; }
    #loginModal .text-center.mt-4 { margin-top: 15px !important; font-size: 12px; }

    /* =========================================
    📞 4. Floating Contact Staff
    ========================================= */

    /* ปุ่มหลัก */
    .floating-contact-btn{
        position: fixed;
        bottom: 120px;
        right: 0;                 /* ✅ ชิดขอบ */
        width: 90px;
        height: 90px;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0;
        margin: 0;
        overflow: visible;
        z-index: 2000;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateX(28%); /* ✅ ล้นออกขอบเล็กน้อยเหมือนรูป */
        transition: transform .18s ease;
        -webkit-tap-highlight-color: transparent;
    }

    /* แสงรอบๆ (เลย์ด้ากระจาย) */
    .floating-contact-btn img{
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        filter:
        drop-shadow(0 0 7px rgba(255,255,255,0.70))
        drop-shadow(0 0 16px rgba(255,255,255,0.38))
        drop-shadow(0 0 34px rgba(255,255,255,0.20))
        drop-shadow(0 0 12px rgba(212,175,55,0.22));
        transition: filter .25s ease, transform .25s ease;
    }

    /* hover / active (เหมือนกด) */
    .floating-contact-btn:hover{ transform: translateX(28%) scale(1.05); }
    .floating-contact-btn:active{ transform: translateX(28%) scale(0.94); }

    /* ✅ เด้งเบาๆ + แสงขาวกระจาย ตอนเปิดเมนู */
    .floating-contact-btn.is-open{ animation: staffPop .55s ease-out 1; }
    .floating-contact-btn.is-open img{
        filter:
        drop-shadow(0 0 10px rgba(255,255,255,0.95))
        drop-shadow(0 0 24px rgba(255,255,255,0.60))
        drop-shadow(0 0 52px rgba(255,255,255,0.34))
        drop-shadow(0 0 16px rgba(212,175,55,0.20));
    }

    @keyframes staffPop{
        0%   { transform: translateX(28%) scale(1); }
        35%  { transform: translateX(28%) scale(1.08); }
        65%  { transform: translateX(28%) scale(0.98); }
        100% { transform: translateX(28%) scale(1); }
    }

    /* ✅ “แสงระเบิด” เบาๆ รอบปุ่ม (เป็นวงขาว) */
    .floating-contact-btn::after{
        content: ""; position: absolute; inset: -18px; border-radius: 999px;
        pointer-events: none; opacity: 0; transform: scale(0.85);
        background: radial-gradient(circle, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.18) 35%, rgba(255,255,255,0.00) 70%);
    }

    .floating-contact-btn.is-open::after{ animation: whiteBurst .55s ease-out 1; }

    @keyframes whiteBurst{
        0%   { opacity: 0; transform: scale(0.75); }
        25%  { opacity: 1; transform: scale(1.05); }
        100% { opacity: 0; transform: scale(1.35); }
    }

    /* =========================================
    เมนูเลือกช่องทาง (LINE / TELE)
    ========================================= */

    .contact-menu-hidden{
        position: fixed;
        bottom: 128px;               /* ✅ เดิม 160px -> ลงมาเกือบถึงปุ่ม */
        right: 18px;                 /* ✅ ถอยเข้ามาจากขอบ */
        display: block;
        width: 80px; height: 170px;
        z-index: 1999;
        opacity: 0; visibility: hidden;
        transform: translateY(20px) scale(0.92);
        transition: .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .contact-menu-show{ opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

    /* ปุ่มกลม Line / Telegram */
    .contact-item-circle{
        position: absolute; left: 50%; transform: translateX(-50%);
        width: 70px; height: 70px;
        display: block; border-radius: 50%;
        transition: transform .2s ease, filter .2s ease;
        filter: drop-shadow(0 6px 10px rgba(0,0,0,0.45));
        animation: none !important;
    }

    .contact-item-circle img{ width: 100%; height: 100%; object-fit: contain; display: block; }

    /* Telegram (ตัวบน) */
    #contact-menu a:nth-child(1){ top: 0px; }

    /* LINE (ตัวล่าง) — ชิดขึ้น */
    #contact-menu a:nth-child(2){ top: 38px; }

    /* =========================================
    📱 PWA Install Banner
    ========================================= */

    @keyframes bannerBlink {
        0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; }
    }
    @keyframes slideDown {
        from { transform: translateY(-100%); } to  { transform: translateY(0); }
    }

    .pwa-banner {
        position: fixed; top: 0; left: 0; width: 100%; height: auto;
        min-height: 46px; padding: 6px 10px;
        padding-top: max(env(safe-area-inset-top), 6px);
        background: rgba(25, 25, 25, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 100000;
        display: flex; align-items: center; justify-content: space-between;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        animation: slideDown 0.35s ease-out, bannerBlink 3s infinite ease-in-out;
        line-height: 1.1;
    }

    .pwa-content-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
    .pwa-close { color: #888; font-size: 16px; cursor: pointer; padding: 3px; flex-shrink: 0; }
    .pwa-logo-img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
    .pwa-text-group { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
    .pwa-title { color: #ffffff; font-size: 12px; font-weight: 600; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pwa-desc { color: #aaaaaa; font-size: 10px; margin-top: 0; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    
    .pwa-btn-install {
        background-color: #ff0000; color: #fff; border: none;
        border-radius: 10px; padding: 6px 10px; font-size: 11px; font-weight: 700;
        white-space: nowrap; box-shadow: 0 2px 5px rgba(255, 0, 0, 0.3);
        margin-left: 8px; flex-shrink: 0; animation: none;
    }
    .pwa-btn-install:active { transform: scale(0.95); }

    .contact-item-circle:hover{
        transform: translateX(-50%) scale(1.12);
        filter: drop-shadow(0 0 12px rgba(255,255,255,0.65)) drop-shadow(0 6px 12px rgba(0,0,0,0.40));
    }

    @supports (padding: max(0px)) {
        .floating-contact-btn{ right: max(0px, env(safe-area-inset-right)); }
    }

/* =========================================
   📢 POPUP THEME: BLACK / GREEN (COMPACT HEADER)
   ========================================= */

/* --- 1. ฉากหลัง (Overlay) --- */
.popup-overlay {
    position: fixed; inset: 0; z-index: 120000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    opacity: 0; visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.popup-overlay.active { opacity: 1; visibility: visible; }

/* --- 2. ตัวการ์ด (Card) --- */
.popup-card {
    position: relative; width: 100%; max-width: 420px;
    
    /* พื้นหลังดำไล่ไปเขียวมืด */
    background: linear-gradient(180deg, #050505 0%, #001a00 100%); 
    
    /* ขอบขาวจางๆ (คลีนๆ) */
    border: 1px solid rgba(255, 255, 255, 0.1); 
    
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    
    transform: scale(0.9) translateY(10px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: visible; 
}
.popup-overlay.active .popup-card { transform: scale(1) translateY(0); }

/* --- 3. ส่วนหัวโค้งสีทอง (ปรับใหม่: เล็ก + ไม่ตกบรรทัด) --- */
.header-tab-gold {
    position: absolute;
    top: -18px; /* ขยับลงมานิดหน่อยให้ดูแน่นขึ้น */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    
    /* สีทองไล่เฉด */
    background: linear-gradient(180deg, #f3dba6 0%, #d4af37 100%);
    
    border: 1px solid rgba(255, 255, 255, 0.4); 
    border-bottom: none;
    
    /* ✅ ปรับให้กระชับ */
    padding: 6px 24px;   
    border-radius: 15px;
    
    /* ✅ บังคับข้อความอยู่บรรทัดเดียว */
    width: fit-content;  
    white-space: nowrap; 
    
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.header-tab-gold span {
    display: block;
    color: #1a1a1a;
    font-size: 14px; /* ลดขนาดฟอนต์ให้ดูหรู */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* ปุ่มกากบาท (Close X) */
.close-icon-gold {
    position: absolute; top: 12px; right: 16px; z-index: 20;
    background: transparent; border: none;
    color: #d4af37; font-size: 26px; line-height: 1;
    cursor: pointer; transition: 0.2s; opacity: 0.8;
}
.close-icon-gold:hover { color: #fff; transform: rotate(90deg); opacity: 1; }

/* --- 4. เนื้อหา (Body) --- */
.popup-body { padding: 40px 24px 20px 24px; }

/* กรอบรูปภาพ */
.image-wrapper {
    position: relative; width: 100%; border-radius: 16px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #000; margin-bottom: 15px;
}
.popup-img-main { width: 100%; height: auto; display: block; object-fit: cover; }

.vivid-image { filter: saturate(1.1) contrast(1.05); }

/* ส่วนข้อความ */
.text-content-custom { text-align: center; margin-bottom: 15px; }
.backend-text-white {
    color: #f1f5f9; font-size: 14px; line-height: 1.6; font-weight: 400;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* --- 5. Footer Row --- */
.popup-footer-row {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 15px; border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Checkbox */
.checkbox-wrapper {
    display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
    color: #94a3b8; font-size: 12px; font-weight: 500; transition: 0.2s;
}
.checkbox-wrapper:hover { color: #d4af37; }
.custom-checkbox { accent-color: #d4af37; transform: scale(1.1); }

/* 🔴 ปุ่มแดงเล็ก (Small Red Button) */
.small-red-close-btn {
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.4);
    transition: all 0.2s;
}
.small-red-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(185, 28, 28, 0.6);
    filter: brightness(1.1);
}
.small-red-close-btn:active { transform: translateY(0); }
