
/* ======================================================================
   🎥 [1. สำหรับหลังบ้าน] สไตล์ในช่องพิมพ์แก้ไข (ทำงานเฉพาะในคลาส .ql-editor)
   ====================================================================== */

/* บล็อกไม่ให้ YouTube เล่นคลิปขณะแก้ไข เพื่อให้เมาส์คลิกเพื่อเลือกขนาดได้ */
.ql-editor iframe {
    pointer-events: none !important; 
    display: block !important;
    width: unset !important;        /* เคลียร์ค่าความกว้างให้สคริปต์ฉีดขนาดเข้าแท็กได้อิสระ */
    max-width: 100% !important;     /* คุมไม่ให้ผู้ใช้ขยายจนล้นขอบขวา */
    height: auto !important;       
    aspect-ratio: 16 / 9 !important; /* ล็อกสัดส่วนวิดีโอไม่ให้ภาพเบี้ยว */
    margin-top: 15px !important;
    margin-bottom: 15px !important;
}

/* รูปภาพในกล่องพิมพ์ */
.ql-editor img {
    max-width: 100% !important;
    height: auto !important;
    cursor: pointer;
}

/* ✨ เอฟเฟกต์เส้นประสีม่วงเรืองแสง (จะแสดงเฉพาะในกล่องแก้ไขและมีสถานะโดนเลือกเท่านั้น) */
.ql-editor img[data-focused="true"],
.ql-editor iframe[data-focused="true"] {
    outline: 2px dashed #a855f7 !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6) !important;
}


/* ======================================================================
   🌍 [2. สำหรับหน้าบ้าน] สไตล์ตอนแสดงผลข้อมูล (แก้ปัญหาเอ๋อ หน้าบ้านโชว์คลีนๆ)
   ====================================================================== */

/* คอนเทนเนอร์แสดงผลข่าวสารหน้าบ้านของคุณ (ใส่คลาสหน้าบ้านของคุณเพิ่มตรงนี้ได้) */
.modal-space-body iframe,
.news-content iframe {
    pointer-events: auto !important; /* ปลดบล็อก! เพื่อให้ลูกค้าหน้าบ้านกดเปิดดูคลิปได้ปกติ */
    display: block !important;
    max-width: 100% !important;     
    height: auto !important;       
    aspect-ratio: 16 / 9 !important; /* หน้าบ้านก็ยังล็อกสัดส่วน 16:9 ตามขนาดที่ย่อมา */
    margin: 15px auto !important;
    
    /* 🚫 ล้างเอฟเฟกต์แก้ขนาดออกให้หมด เผื่อมีคลาสหลอนหลุดจาก DB มาหน้าบ้านก็จะไม่แสดงเส้นประ */
    outline: none !important;
    box-shadow: none !important;
}

/* รูปภาพตอนโชว์หน้าบ้าน */
.modal-space-body img,
.news-content img {
    max-width: 100% !important;
    height: auto !important;
    outline: none !important;
    box-shadow: none !important;
}
/* ======================================================================
   🌈 FANCY HORIZONTAL RULE DESIGN (เส้นคั่นหน้าพรีเมียม ไซเบอร์พังค์)
   ====================================================================== */
.modal-space-body hr.fancy-hr {
    border: none !important;
    height: 5px !important;
    display: block !important;
    margin: 2.5rem auto !important;
    border-radius: 10px !important;
    clear: both !important;
    opacity: 1 !important;
}
/* แบบที่ 1: ไล่เฉดสีม่วง-ชมพู */
.modal-space-body hr.fancy-hr.hr-gradient {
    background: linear-gradient(90deg, #8a2be2, #4a00e0, #ff007f) !important;
}
/* แบบที่ 2: เขียวนีออนเรืองแสง */
.modal-space-body hr.fancy-hr.hr-neon {
    background: #00ffcc !important;
    box-shadow: 0 0 10px #00ffcc, 0 0 20px rgba(0, 255, 204, 0.5) !important;
}
/* แบบที่ 3: สีทองล้ำค่า */
.modal-space-body hr.fancy-hr.hr-gold {
    background: linear-gradient(90deg, transparent, #d4af37, #f3e5ab, #d4af37, transparent) !important;
    height: 3px !important;
}
/* ระบุขอบเขตไฮไลต์เมื่อคลิกเลือกรูปภาพ/วิดีโอ เพื่อเตรียมสั่งย่อขยายขนาด */
.ql-editor img[data-focused="true"],
.ql-editor iframe[data-focused="true"] {
    outline: 2px dashed #a855f7 !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6) !important;
}
/* 🌌 CORE PANEL DESIGN & THEMING (ม่วง-ดำ พรีเมียม) */
.space-sticker-hud {
    background: #07090e; 
    padding: 16px; 
    border-radius: 0 0 16px 16px; 
    border: 1px solid #4c1d95; 
    border-top: none; 
    font-family: 'Kanit', 'Orbitron', monospace; 
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255,255,255,0.05);
}

.cosmic-hud-title {
    color: #c084fc; 
    margin: 0 0 14px 0; 
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(192, 132, 252, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 📦 TAB CONTENT PANELS CONTAINER */
.cosmic-tab-container {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.6) 0%, rgba(7, 9, 14, 0.9) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.cosmic-panel {
    display: none;
}
.cosmic-panel.active {
    display: block;
    animation: cosmicFadeIn 0.3s ease-in-out forwards;
}

@keyframes cosmicFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 🎛️ ICON GRID LAYOUT (รองรับไอคอน 200+ ไม่ล้นจอ มี Scrollbar แฟนซี) */
.icon-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 6px;
}

/* ปรับแต่ง Scrollbar สไตล์นีออนม่วง */
.icon-grid-layout::-webkit-scrollbar,
.sticker-grid-layout::-webkit-scrollbar {
    width: 5px;
}
.icon-grid-layout::-webkit-scrollbar-track,
.sticker-grid-layout::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}
.icon-grid-layout::-webkit-scrollbar-thumb,
.sticker-grid-layout::-webkit-scrollbar-thumb {
    background: #6d28d9;
    border-radius: 10px;
    border: 1px solid #a78bfa;
}

/* 🕹️ NEW MODERN ICON TOOL BUTTONS */
.icon-grid-layout .space-tool-btn {
    background: rgba(26, 21, 44, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #fff;
    height: 40px;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.icon-grid-layout .space-tool-btn:hover {
    background: #2e1065;
    border-color: #00f3ff;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.icon-grid-layout .space-tool-btn i {
    filter: drop-shadow(0 0 4px var(--fa-navy));
    transition: transform 0.2s;
}
.icon-grid-layout .space-tool-btn:hover i {
    transform: rotate(10deg);
}

/* 🖼️ STICKER GRID LAYOUT */
.sticker-grid-layout {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px 0;
}

.sticker-thumb {
    width: 55px;
    height: 55px;
    border: 2px solid #581c87;
    border-radius: 8px;
    background: #000;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
    object-fit: contain;
}

.sticker-thumb:hover {
    border-color: #00f3ff;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 243, 255, 0.4);
}

/* 🪐 PREMIUM CYBERPUNK DOWNTAB NAVIGATOR */
.cosmic-downtab-navigator {
    display: flex;
    background: #0f111a;
    border: 1px solid rgba(147, 51, 234, 0.4);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    overflow-x: auto;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.cosmic-tab-trigger {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 90px;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.cosmic-tab-trigger i {
    font-size: 14px;
    transition: transform 0.2s;
}

.cosmic-tab-trigger.active {
    background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%);
    border-color: #a855f7;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
    text-shadow: 0 0 4px rgba(255,255,255,0.5);
}

.cosmic-tab-trigger.active i {
    color: #c084fc;
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px #c084fc);
}

.cosmic-tab-trigger:hover:not(.active) {
    background: rgba(147, 51, 234, 0.1);
    color: #e2e8f0;
    border-color: rgba(147, 51, 234, 0.2);
}

.cosmic-tab-trigger.premium-trigger {
    border: 1px dashed rgba(0, 243, 255, 0.4);
    color: #00f3ff;
}
.cosmic-tab-trigger.premium-trigger:hover {
    background: rgba(0, 243, 255, 0.08);
}
.cosmic-tab-trigger.premium-trigger.active {
    background: linear-gradient(135deg, #09334f 0%, #061524 100%);
    border-color: #00f3ff;
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.5);
}
.cosmic-tab-trigger.premium-trigger.active i {
    color: #00f3ff;
    filter: drop-shadow(0 0 5px #00f3ff);
}

.ql-editor .space-custom-icon {
    display: inline-block;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 10, 0.7);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.space-modal {
    background: linear-gradient(135deg, #090d16 0%, #0f1123 100%);
    border: 1px solid rgba(147, 51, 234, 0.3);
    box-shadow: 0 0 25px rgba(147, 51, 234, 0.2), inset 0 0 15px rgba(147, 51, 234, 0.1);
    border-radius: 16px;
    padding: 24px;
    width: 320px;
    color: #f3f4f6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .space-modal {
    transform: scale(1);
}

.space-modal h4 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field label {
    font-size: 0.85rem;
    color: #9ca3af;
}

.space-modal select, 
.space-modal input[type="number"] {
    background: #05070f;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.space-modal select:focus, 
.space-modal input[type="number"]:focus {
    border-color: #a855f7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.btn-space {
    padding: 11px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary-space {
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary-space:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
}

.btn-secondary-space {
    background: transparent;
    color: #9ca3af;
    border: 1px solid #374151;
}

.btn-secondary-space:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.icon-dropdown-wrapper {
    display: inline-block;
    position: relative;
}

.space-menu-trigger-btn {
    background: linear-gradient(135deg, #0f1123 0%, #05070f 100%);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 10px;
    color: #f3f4f6;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.1), inset 0 0 10px rgba(168, 85, 247, 0.05);
}

.space-menu-trigger-btn .fa-table {
    color: #34d399;
    filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.6));
    transition: transform 0.3s ease;
}

.space-menu-trigger-btn .fa-plus {
    font-size: 11px;
    color: #a855f7;
    filter: drop-shadow(0 0 2px rgba(168, 85, 247, 0.6));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.space-menu-trigger-btn:hover {
    color: #ffffff;
    border-color: #a855f7;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.4), inset 0 0 15px rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
}

.space-menu-trigger-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(168, 85, 247, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(25deg);
    transition: none;
}

.space-menu-trigger-btn:hover::after {
    left: 140%;
    transition: all 0.6s ease-in-out;
}

.space-menu-trigger-btn:hover .fa-table {
    transform: scale(1.1);
}

.space-menu-trigger-btn:hover .fa-plus {
    transform: rotate(90deg) scale(1.2);
    color: #34d399;
}

.space-menu-trigger-btn:active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* ======================================================================
   🔥 MAP FONT TO BODY & EDITOR (ปรับปรุงให้รองรับฟอนต์ทุกสถานการณ์)
   ====================================================================== */
.modal-space-body .ql-font-kanit, .ql-editor .ql-font-kanit { font-family: 'Kanit', sans-serif !important; }
.modal-space-body .ql-font-orbitron, .ql-editor .ql-font-orbitron { font-family: 'Orbitron', sans-serif !important; }
.modal-space-body .ql-font-chakrapetch, .ql-editor .ql-font-chakrapetch { font-family: 'Chakra Petch', sans-serif !important; }
.modal-space-body .ql-font-audiowide, .ql-editor .ql-font-audiowide { font-family: 'Audiowide', sans-serif !important; }
.modal-space-body .ql-font-syncopate, .ql-editor .ql-font-syncopate { font-family: 'Syncopate', sans-serif !important; }
.modal-space-body .ql-font-sharetech, .ql-editor .ql-font-sharetech { font-family: 'Share Tech Mono', monospace !important; }
.modal-space-body .ql-font-teko, .ql-editor .ql-font-teko { font-family: 'Teko', sans-serif !important; }
.modal-space-body .ql-font-krona, .ql-editor .ql-font-krona { font-family: 'Krona One', sans-serif !important; }
.modal-space-body .ql-font-baijamjuree, .ql-editor .ql-font-baijamjuree { font-family: 'Bai Jamjuree', sans-serif !important; }
.modal-space-body .ql-font-yantramanav, .ql-editor .ql-font-yantramanav { font-family: 'Yantramanav', sans-serif !important; }
.modal-space-body .ql-font-anuphan, .ql-editor .ql-font-anuphan { font-family: 'Anuphan', sans-serif !important; }

/* ======================================================================
   🔥 QUILL.JS COMPATIBILITY PATCH (การจัดข้อความแบบกางเต็ม 100%)
   ====================================================================== */
/* 1. บังคับทิศทางข้อความตามโครงสร้างคลาสหลัก */
.modal-space-body .ql-align-center, .ql-editor .ql-align-center { text-align: center !important; }
.modal-space-body .ql-align-left, .ql-editor .ql-align-left { text-align: left !important; }
.modal-space-body .ql-align-justify, .ql-editor .ql-align-justify { text-align: justify !important; }

/* 🚨 แก้ปัญหาจัดชิดขวาแล้วติดตรงกลาง: บังคับบล็อกเนื้อหาที่เป็น ql-align-right ให้ชิดขอบกาง 100% */
.modal-space-body .ql-align-right, .ql-editor .ql-align-right { 
    text-align: right !important; 
    width: 100% !important; 
    display: block !important;
}

/* 2. ขนาดฟอนต์ */
.modal-space-body .ql-size-small, .ql-editor .ql-size-small { font-size: 0.75em !important; }
.modal-space-body .ql-size-large, .ql-editor .ql-size-large { font-size: 1.5em !important; }
.modal-space-body .ql-size-huge, .ql-editor .ql-size-huge { font-size: 2.5em !important; }

/* 3. สไตล์เสริม */
.modal-space-body .ql-direction-rtl, .ql-editor .ql-direction-rtl { direction: rtl !important; }
.modal-space-body .ql-indent-1, .ql-editor .ql-indent-1 { padding-left: 3em !important; }
.modal-space-body .ql-indent-2, .ql-editor .ql-indent-2 { padding-left: 6em !important; }
.modal-space-body .ql-indent-3, .ql-editor .ql-indent-3 { padding-left: 9em !important; }

/* ===================================================
   STYLE: INTERFACE หน้าเว็บหลัก 
   =================================================== */
.galaxy-news-section {
    background: #06030e; padding: 60px 20px; font-family: 'Prompt', sans-serif;
}
.space-terminal-container { max-width: 1200px; margin: 0 auto; }
.terminal-core {
    background: rgba(13, 7, 34, 0.4); border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px; padding: 40px; position: relative; box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
.terminal-hud-grid {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(168, 85, 247, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(168, 85, 247, 0.02) 1px, transparent 1px);
    background-size: 25px 25px; pointer-events: none;
}
.nebula-glow-bg {
    position: absolute; top: -10%; left: 50%; transform: translateX(-50%); width: 500px; height: 300px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.12) 0%, transparent 70%); pointer-events: none;
}
.terminal-header { text-align: center; color: #fff; }
.terminal-title { font-size: 2.2rem; font-weight: 800; margin: 0; text-shadow: 0 0 15px rgba(168,85,247,0.4); }
.terminal-subtitle { color: #94a3b8; font-size: 0.95rem; margin-top: 5px; }
.hud-deco-line { width: 150px; height: 2px; background: linear-gradient(90deg, transparent, #a855f7, transparent); margin: 10px auto; position: relative; }
.deco-energy-pulse { position: absolute; top: -1px; left: 0; width: 15px; height: 4px; background: #fff; box-shadow: 0 0 8px #fff; border-radius: 50%; animation: pulseRun 2.5s infinite linear; }
@keyframes pulseRun { 0% { left: 0%; } 100% { left: 100%; } }

.space-tabs-navigation { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.space-tab-btn { background: #0f0a24; border: 1px solid rgba(168, 85, 247, 0.2); color: #94a3b8; padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: all 0.3s; }
.space-tab-btn:hover, .space-tab-btn.active { border-color: #a855f7; color: #fff; background: linear-gradient(135deg, #2e1065 0%, #0f0a24 100%); box-shadow: 0 0 15px rgba(168, 85, 247, 0.3); }

.terminal-content-viewport {
    display: flex; flex-direction: column; gap: 10px;
}

.news-card {
    background: rgba(11, 6, 28, 0.6);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: 8px; padding: 12px 20px; 
    display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 20px;
    transition: all 0.2s ease-in-out; position: relative;
    overflow: hidden;
}
.news-card:hover {
    border-color: rgba(168, 85, 247, 0.4); background: rgba(168, 85, 247, 0.03);
    transform: translateX(4px); box-shadow: 0 0 15px rgba(168, 85, 247, 0.1);
}

.card-body {
    display: flex; flex-direction: row; align-items: center; gap: 15px; flex: 1; min-width: 0;
}

.card-tag {
    flex-shrink: 0; padding: 3px 10px; font-size: 0.7rem; font-weight: bold; border-radius: 4px; color: #fff; text-transform: uppercase; text-align: center; min-width: 80px; box-sizing: border-box;
    z-index: 5; background: #0f0a24;
}
.card-tag.status-event { background: #c084fc; border: 1px solid #a855f7; }
.card-tag.status-promo { background: #f43f5e; border: 1px solid #e11d48; }
.card-tag.status-update { background: #38bdf8; border: 1px solid #0284c7; }

.card-title {
    color: #cbd5e1; font-size: 0.98rem; font-weight: 500; margin: 0; line-height: 1.2;
    white-space: nowrap; flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis;
}
.news-card:hover .card-title { color: #fff; text-shadow: 0 0 10px rgba(168, 85, 247, 0.3); }

.card-desc {
    display: flex !important; align-items: center; color: #64748b; font-size: 0.88rem; margin: 0; line-height: 1.2;
    overflow: hidden; 
    flex: 1; min-width: 0;
    white-space: nowrap;
}
.card-desc::before {
    content: "— "; margin-right: 8px; color: rgba(168, 85, 247, 0.3); flex-shrink: 0;
}

.marquee-inner {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
    width: 100%;
}

.news-card:hover .marquee-inner {
    color: #94a3b8;
    overflow: visible;
    text-overflow: clip;
    animation: spaceTextMarquee 10s linear infinite;
    padding-right: 100px;
}

@keyframes spaceTextMarquee {
    0% { transform: translateX(0%); }
    20% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}

.card-date {
    font-family: monospace; color: #475569; font-size: 0.82rem; white-space: nowrap; flex-shrink: 0;
    padding-left: 20px; border-left: 1px solid rgba(168, 85, 247, 0.15);
    z-index: 5; background: #06030e;
}
.news-card:hover .card-date { color: #a78bfa; }

/* ===================================================
   STYLE: SYSTEM MODAL & HTML COMPATIBILITY RESETS
   =================================================== */
.galaxy-modal-overlay {
    position: fixed !important; top: 0 !important; left: 0 !important; width: 100vw !important; height: 100vh !important;
    background: #04020a !important; z-index: 9999999999 !important; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease-in-out; overflow: hidden;
}
.galaxy-modal-overlay.show { opacity: 1 !important; pointer-events: auto !important; }
.galaxy-modal-wrapper {
    width: 100% !important; height: 100% !important; background: transparent; position: relative; z-index: 10;
    display: flex; flex-direction: column; transform: scale(1); box-sizing: border-box;
}
.modal-deep-nebula {
    position: absolute; top: 50%; left: 50%; width: 100vw; height: 100vh; transform: translate(-50%, -50%);
    background: radial-gradient(circle at 50% 50%, rgba(15, 8, 42, 1) 0%, #030106 100%); z-index: 1;
}
.modal-hud-grid {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(147, 51, 234, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(147, 51, 234, 0.02) 1px, transparent 1px);
    background-size: 30px 30px; z-index: 2;
}
.terminal-scanner-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.2), transparent); z-index: 3; animation: radarScan 5s linear infinite;
}
@keyframes radarScan { 0% { top: 0%; } 100% { top: 100%; } }

.corner-laser { position: absolute; width: 20px; height: 20px; z-index: 4; }
.neon-tl { top: 20px; left: 20px; border-top: 2px solid #a855f7; border-left: 2px solid #a855f7; }
.neon-tr { top: 20px; right: 20px; border-top: 2px solid #a855f7; border-right: 2px solid #a855f7; }
.neon-bl { bottom: 20px; left: 20px; border-bottom: 2px solid #a855f7; border-left: 2px solid #a855f7; }
.neon-br { bottom: 20px; right: 20px; border-bottom: 2px solid #a855f7; border-right: 2px solid #a855f7; }

.modal-space-header { padding: 40px 60px 20px 60px; position: relative; z-index: 20; }
.header-action-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-header-meta { display: flex; gap: 15px; align-items: center; }
.modal-badge { padding: 3px 10px; font-size: 0.75rem; font-weight: bold; border-radius: 4px; color: #fff; }
.modal-badge.status-event { background: #c084fc; border: 1px solid #a855f7; }
.modal-badge.status-promo { background: #f43f5e; border: 1px solid #e11d48; }
.modal-badge.status-update { background: #38bdf8; border: 1px solid #0284c7; }
.system-status-blink { color: #475569; font-size: 0.7rem; font-family: monospace; display: flex; align-items: center; gap: 5px; }
.blink-dot { width: 6px; height: 6px; background-color: #22c55e; border-radius: 50%; animation: statusPulse 1.2s infinite; }
@keyframes statusPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.modal-date { color: #a78bfa; font-size: 0.9rem; font-family: monospace; }
.modal-space-title { color: #f3e8ff; font-size: 2rem; margin: 10px 0 0 0; font-weight: 800; text-shadow: 0 0 15px rgba(168, 85, 247, 0.4); }

.modal-close-plasma {
    background: rgba(168, 85, 247, 0.05); border: 1px solid rgba(168, 85, 247, 0.2);
    color: #c084fc; font-size: 1.4rem; padding: 5px 14px; border-radius: 20px; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.modal-close-plasma:hover { background: #ff0055; color: #fff; border-color: #ff0055; box-shadow: 0 0 15px #ff0055; }
.modal-close-plasma .close-text { font-size: 0.7rem; font-family: monospace; color: rgba(192, 132, 252, 0.6); }
.modal-close-plasma:hover .close-text { color: #fff; }

.modal-header-line { height: 1px; background: linear-gradient(90deg, rgba(168, 85, 247, 0.5) 0%, transparent 100%); margin-top: 15px; position: relative; }

/* ======================================================================
   🔥 โซนแก้ไขปัญหา: ปลดล็อกพลัง HTML เต็มจอ 100% (เคลียร์ท่อนกักบริเวณ 1000px ออกแล้ว)
   ====================================================================== */
.modal-space-body {
    flex: 1; 
    padding: 30px 80px; 
    overflow-y: auto; 
    position: relative; 
    z-index: 20;
    color: #cbd5e1; 
    font-size: 1.05rem; 
    line-height: 1.7; 
    box-sizing: border-box;
    scroll-behavior: smooth;
    width: 100% !important; /* 👈 สั่งกางเต็มตัวถังหน้าบ้าน 100% */
}

/* 🚨 ปล่อยอิสระ: เคลียร์ max-width: 1000px ที่เคยบล็อกตรงนี้ออกไป เพื่อปลดพันธนาการให้รูปภาพและอักษรวิ่งได้สุดขอบจอ */
.modal-space-body > * { 
    width: 100%;
    box-sizing: border-box;
}

/* ปลดล็อกตัวคลุมสำหรับรูปภาพและวิดีโอ */
.modal-space-body > .ql-align-left,
.modal-space-body > .ql-align-right {
    margin-left: inherit;
    margin-right: inherit;
}

/* 🎥 โครงสร้างวิดีโอ */
.modal-space-body iframe {
    display: block !important;
    max-width: 100% !important;
    margin-top: 15px !important;
    margin-bottom: 15px !important;
}
.modal-space-body .ql-align-center iframe { margin-left: auto !important; margin-right: auto !important; }
.modal-space-body .ql-align-right iframe  { margin-left: auto !important; margin-right: 0 !important; }
.modal-space-body .ql-align-left iframe   { margin-left: 0 !important; margin-right: auto !important; }

/* ======================================================================
   🔥 ชุดปราบเซียนตาราง
   ====================================================================== */
.modal-space-body table { 
    display: table !important; 
    border-collapse: collapse !important; 
    width: 100% !important; 
    max-width: 100% !important; 
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    background: rgba(13, 7, 34, 0.5) !important;
}

.modal-space-body .ql-align-center table,
.modal-space-body .ql-align-right table,
.modal-space-body .ql-align-left table,
.modal-space-body table[align="center"],
.modal-space-body table[align="right"],
.modal-space-body table[align="left"] { 
    width: auto !important; 
    min-width: 40% !important;     
}

.modal-space-body .ql-align-center table,
.modal-space-body table[align="center"] { margin-left: auto !important; margin-right: auto !important; }
.modal-space-body .ql-align-right table,
.modal-space-body table[align="right"]   { margin-left: auto !important; margin-right: 0 !important; }
.modal-space-body .ql-align-left table,
.modal-space-body table[align="left"]    { margin-left: 0 !important; margin-right: auto !important; }

.modal-space-body table .ql-align-center { text-align: center !important; }
.modal-space-body table .ql-align-right  { text-align: right !important; }
.modal-space-body table .ql-align-left   { text-align: left !important; }

.modal-space-body tr { display: table-row; }
.modal-space-body th, .modal-space-body td { display: table-cell; padding: 12px; border: 1px solid rgba(168, 85, 247, 0.2); }
.modal-space-body th { background: rgba(168, 85, 247, 0.15); color: #fff; font-weight: bold; }
.modal-space-body td:not([style*="color"]) { color: #cbd5e1; }

/* ======================================================================
   🪐 จัดการแท็กหัวข้อ และเนื้อหาทั่วไป
   ====================================================================== */
.modal-space-body h1, .modal-space-body h2, .modal-space-body h3, .modal-space-body h4, .modal-space-body h5, .modal-space-body h6 {
    color: #f3e8ff; font-weight: 700; margin-top: 1.5rem; margin-bottom: 1rem; display: block; line-height: 1.3;
}
.modal-space-body h1:not([style*="font-size"]) { font-size: 2rem; border-bottom: 1px solid rgba(168, 85, 247, 0.2); padding-bottom: 8px; }
.modal-space-body h2:not([style*="font-size"]) { font-size: 1.65rem; }
.modal-space-body h3:not([style*="font-size"]) { font-size: 1.4rem; }

.modal-space-body p { 
    margin-top: 0; 
    margin-bottom: 1.2rem; 
    display: block; 
}
.modal-space-body p:not([style*="color"]) { color: #cbd5e1; }
.modal-space-body span:not([style*="color"]) { color: inherit; }

.modal-space-body strong, .modal-space-body b { color: #fff; font-weight: bold; text-shadow: 0 0 5px rgba(255,255,255,0.2); }
.modal-space-body em, .modal-space-body i { font-style: italic; }
.modal-space-body a { color: #c084fc; text-decoration: underline; transition: color 0.2s; }
.modal-space-body a:hover { color: #f43f5e; }

.modal-space-body ul, .modal-space-body ol { padding-left: 30px; margin-bottom: 1.2rem; display: block; }
.modal-space-body ul { list-style-type: disc; }
.modal-space-body ol { list-style-type: decimal; }
.modal-space-body li { display: list-item; margin-bottom: 0.5rem; }
.modal-space-body li:not([style*="color"]) { color: #cbd5e1; }

/* 🖼️ โครงสร้างรูปภาพ: ปล่อยอิสระให้ชิดขอบซ้าย-ขวา ตามคลาส Quill */
.modal-space-body img { 
    max-width: 100%; 
    height: auto; 
    border-radius: 6px; 
    margin: 15px 0; 
    display: block; 
    box-shadow: 0 0 15px rgba(0,0,0,0.6); 
}
/* สั่งงานรูปภาพตามคลาสจัดตำแหน่ง */
.modal-space-body .ql-align-center img { margin-left: auto !important; margin-right: auto !important; }
.modal-space-body .ql-align-right img  { margin-left: auto !important; margin-right: 0 !important; }
.modal-space-body .ql-align-left img   { margin-left: 0 !important; margin-right: auto !important; }

/* ส่วนท้าย */
.modal-space-footer { padding: 20px 60px; border-top: 1px solid rgba(168, 85, 247, 0.15); display: flex; justify-content: space-between; align-items: center; background: #05030d; position: relative; z-index: 20; }
.footer-system-specs { display: flex; gap: 25px; font-family: monospace; }
.spec-item { display: flex; gap: 6px; }
.spec-label { color: #475569; }
.spec-val { font-weight: bold; }
.text-purple { color: #c084fc; }
.text-green { color: #22c55e; }

.modal-btn-close-system { 
    background: linear-gradient(135deg, #1e1b4b 0%, #581c87 100%); 
    border: 1px solid #a855f7; 
    color: #f3e8ff; 
    padding: 8px 20px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 0.85rem; 
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: all 0.2s; 
}
.modal-btn-close-system:hover { 
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5); 
    transform: translateY(-1px); 
}

.galaxy-loading { color: #c084fc; text-align: center; padding: 40px; font-family: monospace; }
.empty-system-notice { 
    text-align: center; 
    color: #64748b; 
    padding: 40px; 
    font-family: monospace; 
    border: 1px dashed rgba(168, 85, 247, 0.15); 
    border-radius: 8px; 
    width: 100%; 
    box-sizing: border-box; 
}

/* ล็อกสกรอลล์บาร์ของหน้าเว็บหลักไม่ให้เลื่อนเมื่อเปิด Modal / SweetAlert */
body.modal-open,
body.swal2-shown {
    overflow: hidden !important;
}

/* ==========================================
   1. QUILL EDITOR FONT INTEGRATION
   ========================================== */
.ql-container .ql-font-kanit { font-family: 'Kanit', sans-serif !important; }
.ql-container .ql-font-orbitron { font-family: 'Orbitron', sans-serif !important; }
.ql-container .ql-font-chakrapetch { font-family: 'Chakra Petch', sans-serif !important; }
.ql-container .ql-font-audiowide { font-family: 'Audiowide', sans-serif !important; }
.ql-container .ql-font-syncopate { font-family: 'Syncopate', sans-serif !important; }
.ql-container .ql-font-sharetech { font-family: 'Share Tech Mono', monospace !important; }
.ql-container .ql-font-teko { font-family: 'Teko', sans-serif !important; }
.ql-container .ql-font-krona { font-family: 'Krona One', sans-serif !important; }
.ql-container .ql-font-baijamjuree { font-family: 'Bai Jamjuree', sans-serif !important; }
.ql-container .ql-font-yantramanav { font-family: 'Yantramanav', sans-serif !important; }
.ql-container .ql-font-anuphan { font-family: 'Anuphan', sans-serif !important; }

/* ==========================================
   2. QUILL TOOLBAR & DROPDOWN CUSTOMIZATION
   ========================================== */
/* ปรับความกว้างของปุ่มเลือกฟอนต์ให้รองรับชื่อยาวๆ */
.ql-snow .ql-picker.ql-font {
    width: 160px !important;
}

/* ลบค่าเริ่มต้นเดิมของ Quill */
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
    content: 'เลือกฟอนต์' !important;
}

/* Mapping ข้อความภาษาไทยและ Emoji ตาม Data-Value ใน JS */
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="kanit"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="kanit"]::before {
    content: 'Kanit (หลัก)' !important; font-family: 'Kanit', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="orbitron"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="orbitron"]::before {
    content: '🚀 Orbitron' !important; font-family: 'Orbitron', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="chakrapetch"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="chakrapetch"]::before {
    content: '🤖 Chakra Petch' !important; font-family: 'Chakra Petch', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="audiowide"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="audiowide"]::before {
    content: '🛸 Audiowide' !important; font-family: 'Audiowide', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="syncopate"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="syncopate"]::before {
    content: '🌌 Syncopate' !important; font-family: 'Syncopate', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="sharetech"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="sharetech"]::before {
    content: '💻 Share Tech' !important; font-family: 'Share Tech Mono', monospace;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="teko"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="teko"]::before {
    content: '💥 Teko' !important; font-family: 'Teko', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="krona"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="krona"]::before {
    content: '🪐 Krona One' !important; font-family: 'Krona One', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="baijamjuree"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="baijamjuree"]::before {
    content: '🧬 Bai Jamjuree' !important; font-family: 'Bai Jamjuree', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="yantramanav"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="yantramanav"]::before {
    content: '⚙️ Yantramanav' !important; font-family: 'Yantramanav', sans-serif;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="anuphan"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="anuphan"]::before {
    content: '✨ Anuphan' !important; font-family: 'Anuphan', sans-serif;
}

/* ==========================================
   3. QUILL EDITOR COSMIC THEME & FIXES
   ========================================== */
.ql-container {
    font-family: 'Kanit', sans-serif !important;
    font-size: 15px;
    height: 320px;
    background: #0b111e !important;
    color: #e2e8f0 !important;
    border-color: #1e293b !important;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}
.ql-toolbar.ql-snow {
    background: #131c2e !important;
    border-color: #1e293b !important;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}
/* บังคับให้ Dropdown ของ Quill ลอยทะลุครอบคลุม Bootstrap Modal และ SweetAlert2 */
.ql-snow .ql-picker-options {
    background-color: #131c2e !important;
    border: 1px solid #334155 !important;
    z-index: 1070 !important; /* อัปเกรดให้สูงกว่า Sub-modal (1060) */
}
.ql-snow .ql-picker { color: #94a3b8 !important; }
.ql-snow .ql-stroke { stroke: #94a3b8 !important; }
.ql-snow .ql-fill { fill: #94a3b8 !important; }
.ql-snow .ql-picker-item:hover, 
.ql-snow .ql-picker-label:hover {
    color: #38bdf8 !important;
}

/* ==========================================
   4. GALAXY LOADING & WARP ANIMATIONS
   ========================================== */
.galaxy-loading-overlay {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
    transition: all 0.3s ease;
}
.galaxy-loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #a855f7, #ec4899, #a855f7, transparent);
    box-shadow: 0 0 15px #ec4899, 0 0 30px #a855f7;
    animation: galaxyScan 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes galaxyScan {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.galaxy-warp-in {
    animation: galaxyWarpIn 0.5s ease-out forwards;
}
@keyframes galaxyWarpIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ==========================================
   5. SWEETALERT2 & MODAL ARCHITECTURE
   ========================================== */
.swal2-container {
    z-index: 999999 !important; /* ดันให้อยู่สูงสุดเหนือกรงเล็บทุกหน้าต่าง */
}

.modal { pointer-events: none; }
.modal-dialog { pointer-events: auto; }

.galaxy-admin-modal-wrapper { z-index: 1050 !important; }
.galaxy-sub-modal-wrapper { z-index: 1060 !important; } 

.galaxy-admin-modal .modal-content { 
    background: radial-gradient(circle at 30% 20%, #15092b 0%, #07030f 100%) !important; 
    border: 2px solid #a855f7 !important; 
    border-radius: 18px !important; 
    color: #ffffff; 
    box-shadow: 0 0 40px rgba(147, 51, 234, 0.5); 
    position: relative; 
}
.galaxy-admin-modal .modal-header { border-bottom: 1px dashed rgba(168, 85, 247, 0.3); padding: 20px; }
.galaxy-admin-modal .modal-title-space { font-family: 'Orbitron', sans-serif; font-weight: 800; color: #d946ef; letter-spacing: 2px; text-shadow: 0 0 12px rgba(217, 70, 239, 0.6); font-size: 1.3rem; }
.galaxy-admin-modal .btn-close-space { background: none; border: none; color: #a855f7; font-size: 1.6rem; transition: 0.3s; text-shadow: 0 0 8px #a855f7; opacity: 0.8; }
.galaxy-admin-modal .btn-close-space:hover { color: #f472b6; transform: scale(1.15); opacity: 1; }
.galaxy-admin-modal .modal-body { padding: 25px; max-height: 75vh; overflow-y: auto; }

.galaxy-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 15px 25px 25px 25px;
    border-top: 1px solid rgba(168, 85, 247, 0.15);
}

/* ==========================================
   6. GALAXY FORMS & INPUTS
   ========================================== */
.galaxy-input-group { margin-bottom: 20px; position: relative; width: 100%; display: block; }
.galaxy-input-group label { display: block; font-size: 0.8rem; color: #c084fc; margin-bottom: 8px; font-weight: 600; letter-spacing: 0.5px; text-align: left; }
.galaxy-input-group label.label-danger { color: #f87171 !important; }
.galaxy-input-group input, 
.galaxy-input-group textarea, 
.galaxy-input-group select { 
    width: 100%; 
    background: rgba(11, 5, 20, 0.85); 
    border: 1px solid rgba(168, 85, 247, 0.35); 
    border-radius: 8px; 
    padding: 12px 14px; 
    color: #fff; 
    font-size: 0.9rem; 
    transition: 0.3s;
    box-sizing: border-box; /* [FIXED] แก้ไขจาก border-radius เป็น border-box เพื่อป้องกัน Input ล้นขอบ */
}
.galaxy-input-group input:focus, 
.galaxy-input-group textarea:focus, 
.galaxy-input-group select:focus { 
    outline: none; 
    border-color: #d946ef; 
    box-shadow: 0 0 12px rgba(217, 70, 239, 0.4); 
    background: rgba(22, 10, 41, 0.95); 
}

.btn-galaxy-action {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    transition: 0.3s;
    border: none;
}
.btn-galaxy-cancel { background: rgba(255, 255, 255, 0.1); color: #fff; }
.btn-galaxy-cancel:hover { background: rgba(255, 255, 255, 0.2); }

@keyframes purplePulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px #bc34fa); opacity: 0.7; }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 20px #d946ef); opacity: 1; }
    100% { transform: scale(1); filter: drop-shadow(0 0 5px #bc34fa); opacity: 0.7; }
}
.glow-scan {
    animation: purplePulse 2s infinite ease-in-out;
}

/* ==========================================
   7. SPACE WARP EFFECT (BACKGROUND ONLY)
   ========================================== */
.nebula-viewport {
    position: relative;
    overflow: hidden;
    background: #080412;
}
.nebula-slide {
    position: relative;
    overflow: hidden;
}
.nebula-slide .nebula-full-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover; 
    background-position: center center;
    background-repeat: no-repeat;
    transform: scale(1); 
    z-index: 1; 
}
.nebula-slide.active .nebula-full-bg {
    animation: spaceBackgroundWarp 25s cubic-bezier(0.1, 0.4, 0.2, 1) forwards;
}
@keyframes spaceBackgroundWarp {
    0% {
        transform: scale(1);
        filter: saturate(1) brightness(1);
    }
    50% {
        filter: saturate(1.15) brightness(1.03);
    }
    100% {
        transform: scale(1.15);
        filter: saturate(1.2) brightness(1.05);
    }
}

.nebula-content-container {
    position: relative;
    z-index: 3; 
}

/* ==========================================
   8. GALAXY HOVER EFFECT FOR INTERNAL ITEMS
   ========================================== */
.matrix-item {
    position: relative;
    background: rgba(15, 5, 25, 0.6); 
    border: 1px solid rgba(147, 51, 234, 0.2); 
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
    overflow: hidden;
    cursor: pointer;
}
/* เอฟเฟคเมื่อนำเมาส์ไปวาง (Hover Action) */
/* ========================================================
   1. GALAXY MATRIX HOVER EFFECT
   ======================================================== */
.matrix-item:hover {
    transform: translateY(-4px) scale(1.02); /* ลอยขึ้นและขยายเล็กน้อย */
    border-color: rgba(168, 85, 247, 1); /* ขอบม่วงนีออนสว่าง */
    
    /* เอฟเฟคกล่องเรืองแสงสไตล์กาแล็คซี่ม่วงดำ (Nebula Glow) */
    box-shadow: 
        0 0 15px rgba(147, 51, 234, 0.5), 
        0 0 30px rgba(0, 0, 0, 0.8) inset,
        0 0 20px rgba(147, 51, 234, 0.2) inset;
}

/* สร้างแสงสะท้อนคอสมิกวิ่งผ่านกล่อง (Cosmic Flash Line) เมื่อ Hover */
.matrix-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(168, 85, 247, 0.4), 
        transparent
    );
    transform: skewX(-25deg);
    transition: none;
}
.matrix-item:hover::before {
    left: 150%;
    transition: all 0.7s ease-in-out; /* แสนวิ่งตัดกล่องข้อมูล */
}

/* เอฟเฟกต์สำหรับตัวหนังสือด้านในเมื่อ Hover */
.matrix-item:hover .item-label {
    color: #e9d5ff !important; /* เปลี่ยนเป็นสีม่วงอ่อนสว่าง */
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.8); /* ตัวอักษรเรืองแสง */
}
.matrix-item:hover .item-value {
    text-shadow: 0 0 12px currentColor; /* ดึงสีดั้งเดิมให้เรืองแสงเข้มข้นขึ้น */
}

/* คลาสสีเสริมความอวกาศ */
.text-cyan { color: #06b6d4; transition: all 0.3s ease; }
.text-purple { color: #a855f7; transition: all 0.3s ease; }
.text-pink { color: #ec4899; transition: all 0.3s ease; }

/* ========================================================
   2. SPACESHIP NEON PURPLE (ULTIMATE OVERRIDE)
   ======================================================== */
/* แก้ไข Z-Index แบบเบ็ดเสร็จเด็ดขาด */
.modal.modal-purple-dark { z-index: 999999 !important; }
.modal-backdrop.fade.show { z-index: 999998 !important; }
.modal-purple-dark .modal-dialog { position: relative; z-index: 999999; }

/* โครงสร้างหลักหน้าต่างยานอวกาศ (สี่เหลี่ยมมุมตัด) */
.modal-purple-dark .modal-content {
    background: linear-gradient(135deg, #070312 0%, #110826 100%) !important;
    border: 2px solid #a855f7 !important;
    color: #f3e8ff !important;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.5) !important;
    clip-path: polygon(30px 0%, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%, 0% 30px);
}

/* เอฟเฟกต์เส้นสแกนเนอร์เรดาร์ */
.modal-purple-dark .modal-content::before {
    content: "";
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(168, 85, 247, 0) 0%, rgba(168, 85, 247, 0.15) 50%, rgba(168, 85, 247, 0) 100%);
    animation: spaceshipScanner 4s linear infinite;
    pointer-events: none;
    z-index: 5;
}
@keyframes spaceshipScanner {
    0% { transform: translateY(0%); }
    100% { transform: translateY(150%); }
}

/* Header */
.modal-purple-dark .modal-header {
    border-bottom: 1px solid rgba(168, 85, 247, 0.3) !important;
    background: rgba(168, 85, 247, 0.08);
    padding: 1.5rem 1.5rem 1rem 2.5rem;
}
.modal-purple-dark .modal-title {
    color: #e9d5ff !important;
    text-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
    font-weight: 800;
    letter-spacing: 2px;
}

/* กล่องข้อมูลมุมตัด */
.modal-purple-dark .list-group-item {
    background: rgba(22, 13, 41, 0.7) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    color: #f3e8ff !important;
    margin-bottom: 8px;
    padding: 12px 15px;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    transition: all 0.25s ease;
}
.modal-purple-dark .list-group-item:hover {
    border-color: #06b6d4 !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

/* ตารางมุมตัด */
.modal-purple-dark .table-responsive {
    background: rgba(12, 7, 26, 0.85) !important;
    border: 1px solid rgba(168, 85, 247, 0.4) !important;
    padding: 10px;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}
.modal-purple-dark .table th {
    color: #06b6d4 !important;
    background: rgba(168, 85, 247, 0.15);
    border-bottom: 2px solid rgba(168, 85, 247, 0.5) !important;
}
.modal-purple-dark .table td { color: #e2d5f8 !important; }

/* ปุ่มไซไฟมุมตัด */
.modal-purple-dark .btn-cyber {
    background: transparent !important;
    border: 1px solid #a855f7 !important;
    color: #c084fc !important;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    transition: all 0.3s ease;
}
.modal-purple-dark .btn-cyber:hover {
    background: rgba(168, 85, 247, 0.2) !important;
    color: #ffffff !important;
}
.modal-purple-dark .btn-cyber-primary {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

/* ป้ายและ Inputs */
.modal-purple-dark .badge-cash, 
.modal-purple-dark .badge-level-cut {
    background: #e11d48 !important;
    color: #ffffff !important;
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.modal-purple-dark .badge-level-cut { background: #0284c7 !important; }

.modal-purple-dark .form-control {
    background: rgba(14, 8, 31, 0.9) !important;
    border: 1px solid rgba(168, 85, 247, 0.5) !important;
    color: #ffffff !important;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.modal-purple-dark .sub-text-soft { color: #06b6d4 !important; }

/* ========================================================
   3. SYSTEM LOGOUT & ALERTS
   ======================================================== */
.space-logout-border {
    border: 2px solid #f97316 !important;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4), inset 0 0 15px rgba(239, 68, 68, 0.2) !important;
    border-radius: 12px !important;
}
@keyframes logoutPulse {
    0% { opacity: 0.4; transform: scale(0.95); text-shadow: none; }
    50% { opacity: 1; transform: scale(1.1); text-shadow: 0 0 10px #ef4444; }
    100% { opacity: 0.4; transform: scale(0.95); text-shadow: none; }
}

.space-popup-border {
    border: 2px solid #a855f7 !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4), inset 0 0 15px rgba(59, 130, 246, 0.2) !important;
    border-radius: 12px !important;
}

@keyframes loadingBar { 0% { width: 0%; } 100% { width: 100%; } }
@keyframes pulse {
    0% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.1); text-shadow: 0 0 10px #3b82f6; }
    100% { opacity: 0.4; transform: scale(0.95); }
}

/* ========================================================
   4. PROPULSION MENU SYSTEM (SIDE PANEL BUTTONS)
   ======================================================== */
.menu-action-list {
    display: flex;
    flex-direction: column;
    gap: 16px; 
    padding: 10px 0;
}

.galaxy-btn {
    position: relative;
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #e2e8f0 !important;
    text-decoration: none !important;
    font-family: 'Orbitron', 'Kanit', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, rgba(26, 11, 46, 0.85) 0%, rgba(13, 6, 24, 0.95) 100%);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 4px;
    clip-path: polygon(0 0, 93% 0, 100% 30%, 100% 100%, 7% 100%, 0 70%); 
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.1);
}
.galaxy-btn i {
    font-size: 1.1rem;
    color: #00f3ff;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
    transition: transform 0.5s ease;
}
.galaxy-btn:hover {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(38, 16, 66, 0.9) 0%, rgba(21, 9, 38, 0.98) 100%);
    border-color: #00f3ff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5), 
                inset 0 0 15px rgba(0, 243, 255, 0.3);
}
.galaxy-btn:hover i {
    transform: rotate(360deg);
    color: #a855f7;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.8);
}
.galaxy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.2), transparent);
    transform: skewX(-25deg);
    transition: none;
}
.galaxy-btn:hover::before {
    left: 150%;
    transition: left 0.8s ease-in-out;
}

/* 🚨 ปุ่มสำหรับคำสั่งออกจากระบบ */
.galaxy-btn-logout {
    border-color: rgba(255, 0, 170, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 0, 170, 0.1);
}
.galaxy-btn-logout i {
    color: #ff00aa;
    text-shadow: 0 0 8px rgba(255, 0, 170, 0.6);
}
.galaxy-btn-logout:hover {
    border-color: #ff0055;
    box-shadow: 0 0 20px rgba(255, 0, 170, 0.5), 
                inset 0 0 15px rgba(255, 0, 85, 0.3);
    animation: warpBlink 1.5s infinite alternate; 
}
.galaxy-btn-logout:hover i {
    color: #ff0055;
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.9);
}
.galaxy-btn-logout::before {
    background: linear-gradient(90deg, transparent, rgba(255, 0, 170, 0.3), transparent);
}
@keyframes warpBlink {
    0% { opacity: 0.9; box-shadow: 0 0 15px rgba(255, 0, 170, 0.4); }
    100% { opacity: 1; box-shadow: 0 0 25px rgba(255, 0, 85, 0.7); }
}

/* =========================================================================
   5. ULTRA QUANTUM SCROLLBAR KILLER & PORTAL OVERLAY
   ========================================================================= */
:root {
    --neon-purple: #bd5fff;
    --neon-cyan: #00f3ff;
    --neon-pink: #ff00aa;
    --deep-space: rgba(10, 5, 22, 0.96);
}

.quantum-portal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999 !important; 
    background: rgba(4, 2, 8, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.quantum-portal-overlay.portal-active {
    opacity: 1;
    pointer-events: auto;
}

.portal-energy-field {
    position: absolute;
    width: 70%; height: 70%;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, rgba(0, 243, 255, 0.03) 60%, transparent 100%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 1;
}

/* 🖥️ โครงสร้างกล่องหน้าต่างหลัก */
.portal-terminal-window {
    position: relative;
    width: 100%;
    max-width: 1400px; 
    height: 85vh;      
    background: linear-gradient(135deg, var(--deep-space) 0%, #05020a 100%);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 
                inset 0 0 25px rgba(189, 95, 255, 0.08),
                0 0 30px rgba(157, 78, 221, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2;
    transform: scale(0.9) translateY(20px); 
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.quantum-portal-overlay.portal-active .portal-terminal-window {
    transform: scale(1) translateY(0);
}

.terminal-grid-bg {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(157, 78, 221, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(157, 78, 221, 0.02) 1px, transparent 1px);
    background-size: 25px 25px; pointer-events: none; z-index: 1;
}
.terminal-scanline {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 98%, rgba(0, 243, 255, 0.06) 98%);
    background-size: 100% 16px; animation: modalScan 20s linear infinite; pointer-events: none; z-index: 1;
}
@keyframes modalScan { 0% { background-position: 0 0; } 100% { background-position: 0 1000px; } }

/* 🛰️ Header */
.terminal-header {
    padding: 20px 24px;
    background: transparent !important;
    border-bottom: 1px solid rgba(189, 95, 255, 0.25);
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    z-index: 3;
    margin: 0 !important;
}
.terminal-title-group { display: flex; align-items: center; gap: 15px; }

.terminal-beacon {
    width: 14px; height: 14px; border: 1px solid rgba(0, 243, 255, 0.4); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.beacon-dot {
    width: 6px; height: 6px; background: var(--neon-cyan); border-radius: 50%; box-shadow: 0 0 8px var(--neon-cyan);
    animation: beaconBlink 1.2s infinite alternate;
}
@keyframes beaconBlink { 0% { opacity: 0.2; } 100% { opacity: 1; } }

.terminal-main-title { font-family: 'Orbitron', sans-serif; font-size: 1.15rem; font-weight: 900; color: #fff; margin: 0; letter-spacing: 2px; text-shadow: 0 0 10px rgba(0, 243, 255, 0.4); }
.terminal-sub-title { font-family: 'Orbitron', sans-serif; font-size: 0.6rem; color: #64748b; margin: 3px 0 0 0; letter-spacing: 1px; }

.portal-close-btn {
    position: relative; width: 36px; height: 36px;
    background: rgba(255, 0, 170, 0.05); border: 1px solid rgba(255, 0, 170, 0.3);
    border-radius: 6px; color: var(--neon-pink); font-size: 0.85rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-corner { position: absolute; width: 4px; height: 4px; border: 1px solid var(--neon-cyan); }
.btn-corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.btn-corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.portal-close-btn:hover {
    background: #ff00aa; color: #fff; border-color: #ff00aa;
    box-shadow: 0 0 15px #ff00aa; transform: rotate(90deg);
}
.portal-close-btn:hover .btn-corner { opacity: 0; }

/* 🖼️ Terminal Body & Iframe (Quantum Scrollbar Engine) */
.terminal-body {
    position: relative;
    flex: 1; 
    background: #040207 !important;
    z-index: 2;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important; /* [FIXED] บังคับล็อกกล่องแม่ไม่ให้ระเบิดแถบสกรอลล์ */
}

/* ผสานกลไก Iframe ซ่อนแถบสกรอลล์ให้ไร้รอยต่อ */
.portal-core-iframe {
    width: calc(100% + 17px) !important; /* [FIXED] ดัน Scrollbar ออกไปนอกจอสายตา */
    height: 100%;
    background: #ffffff !important; 
    border: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.portal-core-iframe.iframe-loaded { opacity: 1; }

/* ดักซ่อน Scrollbar สำหรับทุก Engines */
.terminal-body::-webkit-scrollbar,
.portal-terminal-window::-webkit-scrollbar,
.quantum-portal-overlay::-webkit-scrollbar,
.portal-core-iframe::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.terminal-body, .portal-terminal-window, .quantum-portal-overlay {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* HUD หมุนโหลดพิกัดขณะดึงข้อมูลหน้าเว็บ */
.iframe-loading-hud {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px;
    background: var(--deep-space); 
    z-index: 5; transition: opacity 0.3s ease;
}
.loading-ring-orbit {
    width: 45px; height: 45px; border: 2px dashed var(--neon-purple); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    animation: orbitSpin 3s linear infinite; box-shadow: 0 0 15px rgba(189, 95, 255, 0.2);
}
.loading-nucleus { width: 8px; height: 8px; background: var(--neon-cyan); border-radius: 50%; box-shadow: 0 0 12px var(--neon-cyan); }
@keyframes orbitSpin { 100% { transform: rotate(360deg); } }
.loading-hud-text { font-family: 'Orbitron', sans-serif; font-size: 0.68rem; color: var(--neon-purple); letter-spacing: 2px; }

/* 📊 ส่วนท้าย (Footer) */
.terminal-footer {
    padding: 12px 24px; 
    border-top: none !important; /* ลบเส้นขาวกวนสายตา */
    background: rgba(8, 4, 18, 0.95); 
    display: flex; 
    justify-content: space-between;
    align-items: center; 
    font-family: 'Orbitron', sans-serif; 
    font-size: 0.65rem; 
    color: #475569; 
    z-index: 3;
    box-shadow: 0 -10px 30px rgba(4, 2, 8, 0.9); /* เงาฟุ้งมืดทดแทนเส้นทึบ */
}
.footer-hud-signal { color: var(--neon-cyan); text-shadow: 0 0 5px rgba(0, 243, 255, 0.3); font-weight: bold; }
.footer-deco-brackets { color: rgba(157, 78, 221, 0.3); }
.footer-hud-core { color: #475569; }

/* =========================================================================
   6. COSMIC IMAGE LOGO TERMINAL
   ========================================================================= */
.footer-logo-area {
    display: flex;
    align-items: center;
    justify-content: flex-start; 
}
.logo-space-capsule {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 20px; 
    cursor: pointer;
} /* [FIXED] ปิดปีกกาให้เรียบร้อย บอร์ดไม่พังแน่นอน */

/* =========================================================================
   🌐 GLOBAL FONTS IMPORT (รวมไว้ที่บนสุดจุดเดียว เพื่อประสิทธิภาพสูงสุด)
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@300;400;500;600;700;900&family=Kanit:wght@300;400;500;700&display=swap');

/* =========================================================================
   📐 COSMIC LOGO & SPACE CAPSULE CONTROL
   ========================================================================= */
.cosmic-logo-img {
    width: 150px;         /* 👈 ปรับความกว้างของรูปภาพโลโก้ตรงนี้ */
    height: auto;        /* ให้ความสูงคำนวณออโต้อัตโนมัติป้องกันภาพเบี้ยว */
    z-index: 3;
    filter: drop-shadow(0 0 10px rgba(189, 95, 255, 0.3)); /* เงาเรืองแสงบางๆ ใต้ภาพ */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 🌌 เอฟเฟกต์ 1: มวลหมอกเนบิวลาสีม่วงชมพูเรืองแสงเบื้องหลังภาพ */
.logo-nebula-flare {
    position: absolute;
    inset: 10px;
    background: radial-gradient(circle, rgba(189, 95, 255, 0.25) 0%, rgba(255, 0, 170, 0.05) 50%, transparent 100%);
    border-radius: 50%;
    filter: blur(8px);
    z-index: 1;
    opacity: 0.6;
    transition: all 0.4s ease;
}

/* ⚡ เอฟเฟกต์ 2: วงแหวนวงโคจรอะตอม (ไฮไลท์สีฟ้าคริสตัล) */
.logo-laser-orbit {
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(0, 243, 255, 0.3);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    animation: cosmicSpin 12s linear infinite;
    transition: all 0.4s ease;
}
@keyframes cosmicSpin { 100% { transform: rotate(360deg); } }

/* 📡 เอฟเฟกต์ 3: เส้นสแกนรังสีสีฟ้าวิ่งผ่านตัวภาพ */
.logo-scanner-line {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, #00f3ff, transparent);
    box-shadow: 0 0 8px #00f3ff;
    z-index: 4;
    opacity: 0;
    pointer-events: none;
}

/* 🎯 HOVER ACTIONS */
.logo-space-capsule:hover .cosmic-logo-img {
    transform: scale(1.1) translateY(-3px);
    filter: drop-shadow(0 0 18px rgba(0, 243, 255, 0.7)) drop-shadow(0 0 30px rgba(189, 95, 255, 0.4));
}

.logo-space-capsule:hover .logo-nebula-flare {
    opacity: 1;
    transform: scale(1.3);
    background: radial-gradient(circle, rgba(0, 243, 255, 0.4) 0%, rgba(189, 95, 255, 0.2) 60%, transparent 100%);
}

.logo-space-capsule:hover .logo-laser-orbit {
    inset: 5px;
    border: 1.5px solid #bd5fff;
    box-shadow: 0 0 12px #bd5fff, inset 0 0 8px #bd5fff;
    animation: cosmicSpin 3s linear infinite;
}

.logo-space-capsule:hover .logo-scanner-line {
    animation: scanPass 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes scanPass {
    0% { top: 0%; opacity: 0; }
    30%, 70% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* =========================================================================
   🛸 GALAXY INFO SECTION & MATRIX CARD
   ========================================================================= */
.galaxy-info-section {
    font-family: 'Orbitron', 'Kanit', sans-serif;
    width: 100%;
    max-width: 1200px;
    margin: 25px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.info-matrix-card {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, rgba(16, 8, 36, 0.85) 0%, rgba(6, 3, 14, 0.95) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(157, 78, 221, 0.15);
    border-radius: 16px;
    padding: 22px 28px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(189, 95, 255, 0.05);
}

.matrix-laser-border {
    position: absolute; top: 0; left: -100%; width: 50%; height: 1px;
    background: linear-gradient(90deg, transparent, #bd5fff, #00f3ff, transparent);
    animation: laserRun 6s linear infinite;
    will-change: left;
}
@keyframes laserRun { 0% { left: -100%; } 100% { left: 200%; } }

.matrix-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.matrix-column.flex-double { flex: 2; }

.column-header { display: flex; align-items: center; gap: 8px; }
.column-icon { font-size: 1rem; filter: drop-shadow(0 0 5px rgba(255,255,255,0.2)); }
.column-title { font-size: 0.72rem; font-weight: 900; color: #94a3b8; margin: 0; letter-spacing: 1.5px; }

.matrix-list { display: flex; flex-direction: column; gap: 8px; }
.matrix-item {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 6px 12px; border-radius: 8px;
}
.item-label { font-size: 0.75rem; color: #64748b; font-weight: 400; }
.item-value { font-size: 0.85rem; font-weight: 900; letter-spacing: 0.5px; }

.drop-rate-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Cosmic Neon Colors */
.text-cyan { color: #00f3ff; text-shadow: 0 0 10px rgba(0, 243, 255, 0.5); }
.text-purple { color: #bd5fff; text-shadow: 0 0 10px rgba(189, 95, 255, 0.5); }
.text-pink { color: #ff00aa; text-shadow: 0 0 10px rgba(255, 0, 170, 0.5); }

.matrix-divider {
    width: 1px; height: 75px;
    background: linear-gradient(to bottom, transparent, rgba(157, 78, 221, 0.2), transparent);
}

/* 📡 HOLOGRAM BUTTON DESIGN */
.matrix-action-block { display: flex; align-items: center; justify-content: center; }

.holo-info-btn {
    position: relative;
    width: 140px; height: 52px;
    background: rgba(189, 95, 255, 0.05);
    border: 1px solid rgba(189, 95, 255, 0.4);
    border-radius: 10px;
    text-decoration: none;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 0 10px rgba(189, 95, 255, 0.1);
}

.btn-ripple {
    position: absolute; inset: 0;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.2) 0%, transparent 70%);
    opacity: 0; transition: all 0.4s ease;
}

.btn-inside { display: flex; flex-direction: column; align-items: center; gap: 1px; z-index: 2; }
.btn-main-txt { font-size: 0.78rem; font-weight: 900; color: #fff; letter-spacing: 1px; transition: all 0.3s ease; }
.btn-sub-txt { font-size: 0.55rem; color: #bd5fff; font-weight: 500; letter-spacing: 0.5px; transition: all 0.3s ease; }

.holo-info-btn:hover {
    border-color: #00f3ff;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3), inset 0 0 15px rgba(0, 243, 255, 0.1);
    transform: scale(1.03);
}
.holo-info-btn:hover .btn-ripple { opacity: 1; transform: scale(1.3); }
.holo-info-btn:hover .btn-main-txt { color: #00f3ff; text-shadow: 0 0 8px #00f3ff; }
.holo-info-btn:hover .btn-sub-txt { color: #fff; text-shadow: 0 0 5px #fff; }

/* Responsive 900px */
@media (max-width: 900px) {
    .info-matrix-card { flex-direction: column; align-items: stretch; padding: 20px; gap: 15px; }
    .matrix-column.flex-double { flex: 1; }
    .drop-rate-grid { grid-template-columns: 1fr; }
    .matrix-divider { width: 100%; height: 1px; background: linear-gradient(90deg, rgba(157, 78, 221, 0.15), transparent); }
    .holo-info-btn { width: 100%; height: 45px; }
}

/* =========================================================================
   🔮 GALAXY HUD BUTTON CONTAINER & PERSPECTIVES
   ========================================================================= */
.galaxy-btn-container {
    font-family: 'Orbitron', 'Kanit', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 950px;
    margin: 30px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.galaxy-hud-btn {
    position: relative;
    flex: 1;
    height: 70px;
    background: linear-gradient(135deg, rgba(20, 10, 38, 0.8) 0%, rgba(8, 4, 18, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(157, 78, 221, 0.2);
    border-radius: 12px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.btn-scanline {
    position: absolute;
    top: -100%; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: btnScan 4s infinite linear;
    pointer-events: none;
    will-change: top;
}
@keyframes btnScan { 0% { top: -100%; } 100% { top: 100%; } }

.btn-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.btn-main-text {
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
}
.btn-sub-text {
    font-size: 0.7rem;
    color: #64748b;
    letter-spacing: 0.5px;
    font-weight: 400;
    transition: all 0.3s ease;
}
.btn-icon {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

/* 💎 REGISTER BUTTON */
.btn-register .btn-corner-border {
    position: absolute; width: 8px; height: 8px;
    border: 2px solid #bd5fff; filter: drop-shadow(0 0 5px #bd5fff);
    transition: all 0.3s ease;
}
.btn-register .btn-corner-border.top-left { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.btn-register .btn-corner-border.bottom-right { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.btn-register:hover {
    border-color: #bd5fff;
    box-shadow: 0 0 25px rgba(189, 95, 255, 0.4), inset 0 0 15px rgba(189, 95, 255, 0.2);
    transform: translateY(-3px);
}
.btn-register:hover .btn-main-text { color: #bd5fff; text-shadow: 0 0 10px #bd5fff; }
.btn-register:hover .btn-sub-text { color: #c084fc; }
.btn-register:hover .btn-corner-border { width: 15px; height: 15px; }

/* ⚡ DOWNLOAD BUTTON */
.btn-download .btn-loading-bar {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
    background: rgba(255, 255, 255, 0.05);
}
.btn-download .bar-fill {
    width: 35%; height: 100%; background: #00f3ff;
    box-shadow: 0 0 8px #00f3ff; transition: all 0.4s ease;
}

.btn-download:hover {
    border-color: #00f3ff;
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.4), inset 0 0 15px rgba(0, 243, 255, 0.2);
    transform: translateY(-3px);
}
.btn-download:hover .btn-main-text { color: #00f3ff; text-shadow: 0 0 10px #00f3ff; }
.btn-download:hover .btn-sub-text { color: #22d3ee; }
.btn-download:hover .bar-fill { width: 100%; }
.btn-download:hover .icon-bounce { animation: iconJump 0.5s ease infinite alternate; }
@keyframes iconJump { 0% { transform: translateY(0); } 100% { transform: translateY(-5px); } }

/* 🌌 WORLDMAP BUTTON */
.btn-worldmap .hologram-radar {
    position: absolute; right: -20px; top: -20px; width: 80px; height: 80px;
    border: 1px dashed rgba(255, 0, 170, 0.2); border-radius: 50%;
    transition: all 0.4s ease;
}

.btn-worldmap:hover {
    border-color: #ff00aa;
    box-shadow: 0 0 25px rgba(255, 0, 170, 0.4), inset 0 0 15px rgba(255, 0, 170, 0.2);
    transform: translateY(-3px);
}
.btn-worldmap:hover .btn-main-text { color: #ff00aa; text-shadow: 0 0 10px #ff00aa; }
.btn-worldmap:hover .btn-sub-text { color: #f472b6; }
.btn-worldmap:hover .hologram-radar { transform: scale(1.4); border-color: rgba(255, 0, 170, 0.6); }
.btn-worldmap:hover .icon-spin { animation: iconRotate 2s linear infinite; }
@keyframes iconRotate { 100% { transform: rotate(360deg); } }

/* Responsive 768px (Buttons) */
@media (max-width: 768px) {
    .galaxy-btn-container { flex-direction: column; gap: 12px; }
    .galaxy-hud-btn { width: 100%; }
}

/* =========================================================================
   🌌 QUANTUM NEO-GALAXY FOOTER
   ========================================================================= */
.galaxy-footer-section {
    font-family: 'Orbitron', 'Kanit', sans-serif;
    position: relative;
    width: 100%;
    background: linear-gradient(to top, #06030d 0%, rgba(12, 6, 26, 0.95) 100%);
    border-top: 1px solid rgba(157, 78, 221, 0.15);
    padding: 60px 0 20px 0;
    box-sizing: border-box;
    overflow: hidden;
}

.footer-hud-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(157, 78, 221, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(157, 78, 221, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.7;
    pointer-events: none;
}
.footer-nebula-glow {
    position: absolute;
    bottom: -30%; left: 50%; transform: translateX(-50%);
    width: 600px; height: 300px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.12) 0%, transparent 70%);
    pointer-events: none;
    filter: blur(40px);
}
.footer-laser-top {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, #bd5fff, #00f3ff, transparent);
}

.footer-container {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
}

.footer-main-grid {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand-block { flex: 1.5; display: flex; flex-direction: column; gap: 15px; }
.footer-logo-area { display: flex; align-items: center; gap: 12px; }

.logo-quantum-ring {
    width: 28px; height: 28px;
    border: 2px solid #bd5fff; border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px rgba(189, 95, 255, 0.5);
    transform: rotateX(45deg);
    animation: ringSpin 3s linear infinite;
}
.logo-core-spark {
    position: absolute; top: 35%; left: 35%; width: 30%; height: 30%;
    background: #00f3ff; border-radius: 50%; box-shadow: 0 0 12px #00f3ff;
}
@keyframes ringSpin { 100% { transform: rotateX(45deg) rotate(360deg); } }

.logo-text { font-size: 1.4rem; font-weight: 900; color: #fff; letter-spacing: 2px; text-shadow: 0 0 10px rgba(255, 255, 255, 0.2); }
.highlight-cyan { color: #00f3ff; text-shadow: 0 0 15px rgba(0, 243, 255, 0.6); }
.brand-desc { font-size: 0.8rem; color: #64748b; line-height: 1.6; margin: 0; font-weight: 300; }

.server-status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(0, 243, 255, 0.04); border: 1px solid rgba(0, 243, 255, 0.15);
    padding: 6px 12px; border-radius: 6px; width: fit-content;
}
.pulse-beacon { width: 5px; height: 5px; background: #00f3ff; border-radius: 50%; box-shadow: 0 0 8px #00f3ff; animation: beaconPulse 1s infinite alternate; }
@keyframes beaconPulse { 0% { opacity: 0.3; } 100% { opacity: 1; } }
.pill-text { font-size: 0.65rem; color: #00f3ff; letter-spacing: 1px; font-weight: 700; }

.footer-links-block { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.footer-block-title { font-size: 0.85rem; font-weight: 700; color: #f1f5f9; margin: 0; letter-spacing: 1.5px; }
.title-deco { color: #bd5fff; text-shadow: 0 0 8px #bd5fff; }

.footer-links-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

.warp-link {
    font-size: 0.8rem; color: #94a3b8; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 300;
}
.arrow-hud { color: rgba(157, 78, 221, 0.5); font-size: 0.65rem; transition: transform 0.25s ease; }

.warp-link:hover {
    color: #fff; transform: translateX(5px); text-shadow: 0 0 8px rgba(255,255,255,0.4);
}
.warp-link:hover .arrow-hud {
    color: #00f3ff; transform: rotate(90deg); text-shadow: 0 0 8px #00f3ff;
}

.footer-bottom-divider {
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(157, 78, 221, 0.15) 20%, rgba(157, 78, 221, 0.15) 80%, transparent);
    margin-bottom: 20px;
}

.footer-copyright-area {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.72rem; color: #475569; letter-spacing: 0.5px;
}
.glow-text-purple { color: #bd5fff; font-weight: bold; }
.creator-credit { margin: 0; }
.creator-signature {
    color: #64748b; text-decoration: none; font-weight: 700; letter-spacing: 1px;
    padding: 2px 6px; border: 1px dashed transparent; transition: all 0.2s ease;
}
.creator-signature:hover {
    color: #ff00aa; border-color: rgba(255, 0, 170, 0.3); background: rgba(255, 0, 170, 0.02);
    text-shadow: 0 0 8px #ff00aa; border-radius: 4px;
}

/* Responsive 768px (Footer) */
@media (max-width: 768px) {
    .footer-main-grid { flex-direction: column; gap: 30px; }
    .footer-brand-block { text-align: center; align-items: center; }
    .footer-links-block { text-align: center; }
    .footer-links-list { align-items: center; }
    .footer-copyright-area { flex-direction: column; gap: 10px; text-align: center; }
}

/* =========================================================================
   🛸 NEBULA GALAXY HORIZON DIVIDER & HUD PANEL
   ========================================================================= */
.laser-core-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(157, 78, 221, 0.3) 15%, 
        #bd5fff 35%, 
        #00f3ff 50%, 
        #ff00aa 65%, 
        rgba(157, 78, 221, 0.3) 85%, 
        transparent 100%
    );
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.8), 
                0 0 25px rgba(189, 95, 255, 0.5), 
                0 0 2px #fff;
    z-index: 2;
}

.hud-header-panel {
    width: 100%;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    padding-left: 0;
    align-items: center;
    text-align: center;
}

.hud-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.hud-terminal-icon {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(0, 243, 255, 0.4);
    background: rgba(12, 6, 26, 0.6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #00f3ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #00f3ff;
    animation: iconGlow 1.5s infinite ease-in-out alternate;
}
@keyframes iconGlow {
    0% { transform: scale(0.8); opacity: 0.5; box-shadow: 0 0 4px #00f3ff; }
    100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px #00f3ff; }
}

.hud-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-main-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(189, 95, 255, 0.6), 0 0 30px rgba(189, 95, 255, 0.2);
}

.hud-sub-title {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
    letter-spacing: 1.5px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.cyber-bracket { color: #bd5fff; font-weight: bold; }

.terminal-cursor {
    color: #00f3ff;
    font-weight: bold;
    animation: cursorBlink 1s infinite steps(2, start);
    text-shadow: 0 0 5px #00f3ff;
}
@keyframes cursorBlink { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

.hud-deco-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 243, 255, 0.5) 50%, transparent 100%);
    position: relative;
    overflow: hidden;
}

.deco-energy-pulse {
    position: absolute;
    top: 0; left: -60px;
    width: 60px; height: 100%;
    background: linear-gradient(90deg, transparent, #00f3ff, transparent);
    animation: energyShoot 3s infinite linear;
    will-change: left;
}
@keyframes energyShoot {
    0% { left: -60px; }
    40%, 100% { left: 110%; }
}

@media (max-width: 768px) {
    .hud-main-title { font-size: 1.05rem; letter-spacing: 1px; }
    .hud-sub-title { font-size: 0.68rem; }
}

/* =========================================================================
   👾 GALAXY STATUS SECTION & CYBER HUD CARD
   ========================================================================= */
.galaxy-status-section {
    font-family: 'Orbitron', 'Kanit', sans-serif;
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.hud-status-card {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, rgba(15, 7, 32, 0.9) 0%, rgba(8, 4, 18, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(157, 78, 221, 0.2);
    border-radius: 16px;
    padding: 25px 30px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(189, 95, 255, 0.05);
}

.hud-scanner-bar {
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.05), transparent);
    transform: skewX(-25deg);
    animation: hudScan 8s linear infinite;
    pointer-events: none;
    will-change: left;
}
@keyframes hudScan { 0% { left: -100%; } 100% { left: 200%; } }

.hud-glow-line {
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, #bd5fff, #00f3ff, #ff00aa, transparent);
    opacity: 0.7;
}

.hud-block {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.quantum-core-wrapper {
    position: relative;
    width: 40px; height: 40px;
}
.core-orbit {
    position: absolute; inset: 0;
    border: 2px dashed #00f3ff; border-radius: 50%;
    animation: orbitSpin 4s linear infinite;
}
.core-nucleus {
    position: absolute; top: 25%; left: 25%; width: 50%; height: 50%;
    background: #00f3ff; border-radius: 50%;
    box-shadow: 0 0 15px #00f3ff;
    animation: corePulse 1.5s ease-in-out infinite alternate;
}
@keyframes orbitSpin { 100% { transform: rotate(360deg); } }
@keyframes corePulse { 0% { transform: scale(0.8); opacity: 0.6; } 100% { transform: scale(1.1); opacity: 1; } }

.hud-icon-box {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.02);
}
.cyan-glow { border: 1px solid rgba(0, 243, 255, 0.3); box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.1); }
.purple-glow { border: 1px solid rgba(189, 95, 255, 0.3); box-shadow: inset 0 0 10px rgba(189, 95, 255, 0.1); }
.pink-glow { border: 1px solid rgba(255, 0, 170, 0.3); box-shadow: inset 0 0 10px rgba(255, 0, 170, 0.1); }

.status-info { display: flex; flex-direction: column; gap: 2px; }
.hud-label { font-size: 0.65rem; color: #64748b; letter-spacing: 1.5px; font-weight: 700; }
.value-container { display: flex; align-items: baseline; gap: 5px; }
.hud-value { font-size: 1.4rem; font-weight: 900; color: #f1f5f9; margin: 0; letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 255, 255, 0.1); }
.hud-sub { font-size: 0.65rem; color: #475569; margin: 0; letter-spacing: 0.5px; }
.unit { font-size: 0.6rem; color: #00f3ff; font-weight: 700; }
.status-online { color: #00f3ff; text-shadow: 0 0 15px rgba(0, 243, 255, 0.6); }

.hud-divider {
    width: 1px; height: 45px;
    background: linear-gradient(to bottom, transparent, rgba(157, 78, 221, 0.3), transparent);
}

.live-pulse-bar {
    width: 100px; height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px; overflow: hidden; margin-top: 4px;
}
.pulse-fill {
    height: 100%; background: linear-gradient(90deg, #bd5fff, #00f3ff);
    box-shadow: 0 0 8px #00f3ff;
    position: relative;
}

/* Responsive 900px (Status Card) */
@media (max-width: 900px) {
    .hud-status-card { flex-direction: column; align-items: flex-start; padding: 20px; gap: 15px; }
    .hud-block { width: 100%; justify-content: flex-start; }
    .hud-divider { width: 100%; height: 1px; background: linear-gradient(90deg, rgba(157, 78, 221, 0.2), transparent); }
    .live-pulse-bar { width: 100%; max-width: 180px; }
}

/* =========================================================================
   📡 GALAXY NEWS SECTION & SPACE TERMINAL
   ========================================================================= */
.galaxy-news-section {
    font-family: 'Orbitron', 'Kanit', sans-serif;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background: transparent;
    display: flex;
    justify-content: center;
}

.space-terminal-container {
    position: relative;
    width: 100%;
    max-width: 1170px;
    padding: 2px;
    box-sizing: border-box;
}

.terminal-laser-border {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: conic-gradient(from 0deg, transparent 30%, #bd5fff 40%, #00f3ff 50%, #ff00aa 60%, transparent 70%);
    animation: borderSpin 6s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 2px;
    pointer-events: none;
    z-index: 2;
}
@keyframes borderSpin { 100% { transform: rotate(360deg); } }

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Kanit:wght@300;500&display=swap');

/* =========================================================================
   🌐 GLOBAL VARIABLES & CORE SETUP
   ========================================================================= */
:root {
    --bg-void: #040208;
    --void-black: #06030c;
    --nebula-purple-dark: #12072b;
    --neon-purple: #bd5fff;
    --neon-cyan: #00f3ff;
    --neon-magenta: #ff00aa;
}

/* ระบบล็อก Scrollbar ช่วง Preload */
html.preload-locked, 
body.preload-active {
    overflow: hidden !important;
    height: 100vh !important;
    width: 100vw !important;
    position: fixed !important;
}

html.preload-locked::-webkit-scrollbar,
body.preload-active::-webkit-scrollbar {
    display: none !important;
}

body.preload-active * {
    overflow: hidden !important;
}

body.preload-active nav,
body.preload-active .navbar,
body.preload-active #main-nav,
body.preload-active .header-navigation,
body.preload-active .sidebar,
body.preload-active [class*="sidebar"],
body.preload-active [class*="offcanvas-menu"] {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-20px) !important;
}

/* ซ่อน Scrollbar หน้าเว็บหลักแต่ยังสกรอลล์ได้ */
html::-webkit-scrollbar, 
body::-webkit-scrollbar {
    display: none;
}
html, body {
    scrollbar-width: none;
    -ms-overflow-style: none; 
}

/* =========================================================================
   📦 DEEP SPACE CORE BOARD (กล่องบอร์ดกระจกฝ้า)
   ========================================================================= */
.terminal-core {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, rgba(12, 6, 26, 0.93) 0%, rgba(20, 10, 41, 0.8) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    border: 1px solid rgba(157, 78, 221, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(189, 95, 255, 0.1);
    padding: 30px;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1;
}

.terminal-hud-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(157, 78, 221, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(157, 78, 221, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.6;
    pointer-events: none;
}

.nebula-glow-bg {
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.07) 0%, transparent 60%);
    pointer-events: none;
}

/* ส่วนหัวคอร์ */
.terminal-header { text-align: center; margin-bottom: 25px; position: relative; z-index: 3; }
.status-indicator { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 20px; margin-bottom: 10px; }
.status-indicator.online { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); }
.status-text { font-size: 0.65rem; color: #22c55e; letter-spacing: 2px; font-weight: 700; }
.beacon-ping { width: 6px; height: 6px; background: #22c55e; border-radius: 50%; position: relative; }
.beacon-ping::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid #22c55e; animation: pingWave 1.5s infinite ease-out; }

@keyframes pingWave { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }

.terminal-title { font-size: 1.8rem; font-weight: 900; color: #fff; letter-spacing: 2px; margin: 0 0 6px 0; text-shadow: 0 0 15px rgba(189, 95, 255, 0.5); }
.terminal-subtitle { font-size: 0.8rem; color: #94a3b8; margin: 0; font-weight: 300; }

/* แท็บสลับหน้า */
.space-tabs-navigation { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 25px; position: relative; z-index: 5; }
.space-tab-btn { background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(157, 78, 221, 0.2); color: #cbd5e1; font-family: 'Orbitron', 'Kanit', sans-serif; font-size: 0.8rem; padding: 10px 20px; border-radius: 12px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.tab-icon { color: #bd5fff; margin-right: 4px; }
.space-tab-btn.active, .space-tab-btn:hover { background: linear-gradient(135deg, rgba(189, 95, 255, 0.2) 0%, rgba(0, 243, 255, 0.08) 100%); border-color: #00f3ff; color: #fff; box-shadow: 0 0 15px rgba(0, 243, 255, 0.2); transform: translateY(-2px); }

/* VIEWPORT CONTAINER */
.terminal-content-viewport {
    position: relative;
    z-index: 3;
    max-height: 520px; 
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin; 
    scrollbar-color: #bd5fff rgba(0,0,0,0);
}

/* Custom Scrollbar สำหรับ Viewport ข่าวสาร */
.terminal-content-viewport::-webkit-scrollbar { width: 5px; }
.terminal-content-viewport::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.01); border-radius: 10px; }
.terminal-content-viewport::-webkit-scrollbar-thumb { background: linear-gradient(to bottom, #bd5fff, #00f3ff); border-radius: 10px; box-shadow: 0 0 8px #00f3ff; }

/* =========================================================================
   📰 NEWS CARD (Info Matrix Style)
   ========================================================================= */
a.news-card {
    background: linear-gradient(135deg, rgba(16, 8, 36, 0.85) 0%, rgba(6, 3, 14, 0.95) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(157, 78, 221, 0.2);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-sizing: border-box;
    min-height: 54px; /* แก้ไขจาก height คงที่ เป็น min-height ป้องกันข้อความล้นเบียด */
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: contentWarp 0.4s ease forwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(189, 95, 255, 0.05);
}

@keyframes contentWarp { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }

a.news-card:hover {
    background: linear-gradient(135deg, rgba(28, 14, 61, 0.9) 0%, rgba(12, 6, 26, 0.98) 100%);
    border-color: rgba(0, 243, 255, 0.5);
    transform: translateX(6px);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.15), inset 0 0 15px rgba(0, 243, 255, 0.1);
}

a.news-card.highlight { 
    border-color: rgba(255, 0, 170, 0.4); 
    background: linear-gradient(135deg, rgba(26, 10, 46, 0.9) 0%, rgba(10, 3, 20, 0.98) 100%);
}
a.news-card.highlight:hover { border-color: #00f3ff; }

.card-body { display: flex; align-items: center; gap: 12px; flex: 1; overflow: hidden; }
.card-tag { font-size: 0.6rem; font-weight: 800; padding: 2px 8px; border-radius: 4px; flex-shrink: 0; min-width: 55px; text-align: center; }
.tag-update { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
.tag-event { background: rgba(189, 95, 255, 0.12); color: #bd5fff; border: 1px solid rgba(189, 95, 255, 0.25); }
.tag-promo { background: rgba(234, 179, 8, 0.12); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.25); }
.tag-sys { background: rgba(0, 243, 255, 0.12); color: #00f3ff; border: 1px solid rgba(0, 243, 255, 0.25); }

.card-title { font-size: 0.85rem; color: #f1f5f9; margin: 0; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-desc { font-size: 0.75rem; color: #64748b; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-date { font-size: 0.7rem; color: #475569; font-family: 'Orbitron', sans-serif; flex-shrink: 0; }

a.news-card:hover .card-title { color: #fff; }
a.news-card:hover .card-desc { color: #94a3b8; }

.empty-system-notice { text-align: center; color: #475569; font-size: 0.85rem; padding: 40px 0; letter-spacing: 1px; }

/* =========================================================================
   📢 SPACE NODE TICKER CONTAINER (แถบประกาศวิ่ง)
   ========================================================================= */
.space-node-container {
    font-family: 'Orbitron', 'Kanit', sans-serif;
    position: relative;
    width: 100%;
    max-width: 850px;
    margin: 10px auto;
    padding: 2px; 
    box-sizing: border-box;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.5s ease;
    max-height: 500px; /* แก้ไขจาก 100px เพื่อให้รองรับ Auto height บนมือถือได้ลื่นไหล */
    opacity: 1;
}

/* เอฟเฟกต์หลุมดำยุบตัวเมื่อปิด */
.space-node-container.void-collapse {
    opacity: 0 !important;
    transform: scale(0.9) translateY(-10px) !important;
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.galaxy-glass-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    height: 44px;
    padding: 0 20px 0 24px;
    background: linear-gradient(135deg, rgba(10, 5, 22, 0.85) 0%, rgba(22, 11, 46, 0.65) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid rgba(157, 78, 221, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(189, 95, 255, 0.1);
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.hud-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(157, 78, 221, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(157, 78, 221, 0.03) 1px, transparent 1px);
    background-size: 15px 15px;
    opacity: 0.7;
    pointer-events: none;
}

.node-badge {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(189, 95, 255, 0.12) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    flex-shrink: 0;
}

.badge-text { font-size: 0.75rem; font-weight: 800; color: #ffffff; letter-spacing: 2px; text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.pulsar-dot { width: 6px; height: 6px; background: #00f3ff; border-radius: 50%; position: relative; }
.pulsar-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid #00f3ff; animation: pulsarWave 1.8s infinite ease-out; }

@keyframes pulsarWave { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }

.galaxy-ticker-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 90%, transparent 100%);
}

.galaxy-ticker-stream {
    display: flex;
    gap: 60px;
    width: max-content;
    white-space: nowrap;
    animation: spaceWarpScroll 25s linear infinite;
}

.stream-item { font-size: 0.85rem; color: #cbd5e1; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.cyan-neon { color: #00f3ff; text-shadow: 0 0 8px rgba(0, 243, 255, 0.6); font-weight: 700; }
.purple-neon { color: #bd5fff; text-shadow: 0 0 8px rgba(189, 95, 255, 0.6); }
.magenta-neon { color: #ff00aa; text-shadow: 0 0 8px rgba(255, 0, 170, 0.6); }

@keyframes spaceWarpScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.cosmic-close-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(203, 213, 225, 0.7); cursor: pointer;
    z-index: 10; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0; padding: 0;
}
.cosmic-close-btn svg { width: 14px; height: 14px; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.cosmic-close-btn:hover { background: rgba(255, 0, 170, 0.15); border-color: rgba(255, 0, 170, 0.6); color: #ff00aa; box-shadow: 0 0 12px rgba(255, 0, 170, 0.5); transform: scale(1.1); }
.cosmic-close-btn:hover svg { transform: rotate(180deg); }
.cosmic-close-btn:active { transform: scale(0.9); }

/* Hover คอนเทนเนอร์ใหญ่ */
.space-node-container:hover .galaxy-glass-box {
    background: linear-gradient(135deg, rgba(16, 7, 36, 0.95) 0%, rgba(33, 13, 66, 0.8) 100%);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.8), 0 0 20px rgba(189, 95, 255, 0.2), inset 0 0 25px rgba(0, 243, 255, 0.15);
    transform: translateY(-1px) scale(1.001);
}

/* แก้ไขบั๊กกระตุก: เปลี่ยนจากเร่งความเร็วอนิเมชันมาเป็นสั่งให้หยุดนิ่งชั่วคราวเมื่อชี้ (หรือลบออกหากต้องการให้วิ่งต่อ) */
.space-node-container:hover .galaxy-ticker-stream {
    animation-play-state: paused;
}

.warp-glow { color: #fff; animation: textFlicker 1.5s infinite alternate; }
@keyframes textFlicker { 0%, 100% { text-shadow: 0 0 4px #fff, 0 0 10px #bd5fff; } 50% { text-shadow: 0 0 2px #fff, 0 0 4px #bd5fff; } }

/* =========================================================================
   🌌 BACKGROUND EFFECTS (Canvas, Meteors, Lightning)
   ========================================================================= */
#cosmic-cursor-canvas {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 999998;
}

.web-main-meteor-shower {
    position: fixed; inset: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: -1; overflow: hidden;
    transform: rotate(-35deg);
}

.web-meteor, .web-meteor-long {
    position: absolute; height: 2px;
    background: linear-gradient(90deg, #00f3ff, transparent);
    opacity: 0; animation: webMeteorFly 5s infinite linear;
}
.web-meteor { width: 120px; }
.web-meteor-long { width: 380px; background: linear-gradient(90deg, #ff00aa, transparent); }

.web-main-meteor-shower .web-meteor:nth-child(1) { top: 10%; left: -20%; animation-delay: 0s; animation-duration: 4s; }
.web-main-meteor-shower .web-meteor:nth-child(2) { top: 40%; left: -30%; animation-delay: 1.5s; animation-duration: 5.5s; background: linear-gradient(90deg, #bd5fff, transparent); }
.web-main-meteor-shower .web-meteor-long { top: 70%; left: -45%; animation-delay: 0.8s; animation-duration: 3.2s; }
.web-main-meteor-shower .web-meteor:nth-child(4) { top: 25%; left: -25%; animation-delay: 2.8s; animation-duration: 6s; }

@keyframes webMeteorFly {
    0% { transform: translateX(0); opacity: 0; }
    5% { opacity: 0.6; }
    30%, 100% { transform: translateX(140vw); opacity: 0; }
}

/* QUANTUM PRELOADER & LIGHTNING */
#quantum-preloader {
    position: fixed; inset: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-void); z-index: 9999999 !important;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden !important;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
}

.space-void-bg { position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(24, 11, 56, 0.5) 0%, var(--bg-void) 100%); z-index: 1; }
.lightning-strike-flash { position: absolute; inset: 0; background: #ffffff; opacity: 0; z-index: 2; pointer-events: none; animation: lightningBlast 7s infinite linear; }

@keyframes lightningBlast {
    0%, 91%, 93.5%, 95.5%, 100% { opacity: 0; background: #ffffff; filter: blur(0px); }
    92% { opacity: 0.35; background: linear-gradient(135deg, #ffffff 30%, var(--neon-cyan) 100%); filter: blur(4px); }
    93% { opacity: 0; }
    94% { opacity: 0.5; background: linear-gradient(210deg, #ffffff 20%, var(--neon-purple) 100%); filter: blur(8px); }
    95% { opacity: 0.1; background: var(--neon-magenta); }
}

.meteor-shower { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; transform: rotate(-35deg); }
.meteor, .meteor-long { position: absolute; height: 2px; background: linear-gradient(90deg, var(--neon-cyan), transparent); opacity: 0; animation: meteorFly 4s infinite linear; }
.meteor { width: 120px; }
.meteor-long { width: 380px; background: linear-gradient(90deg, var(--neon-magenta), transparent); }

.meteor:nth-child(1) { top: 15%; left: -20%; animation-delay: 0s; animation-duration: 3s; }
.meteor:nth-child(2) { top: 45%; left: -30%; animation-delay: 1.2s; animation-duration: 4s; background: linear-gradient(90deg, var(--neon-purple), transparent); }
.meteor-long { top: 65%; left: -45%; animation-delay: 0.5s; animation-duration: 2.2s; }
.meteor:nth-child(4) { top: 28%; left: -25%; animation-delay: 2s; animation-duration: 4.8s; }

@keyframes meteorFly { 0% { transform: translateX(0); opacity: 0; } 5% { opacity: 0.8; } 25%, 100% { transform: translateX(140vw); opacity: 0; } }

/* LOGO ORBIT */
.preloader-core { position: relative; z-index: 5; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 450px; padding: 20px; }
.logo-galaxy-wrapper { position: relative; width: 400px; height: 400px; display: flex; align-items: center; justify-content: center; margin-bottom: 45px; }

.orbit-line {
    position: absolute; border-radius: 50%; border: 2px solid transparent; background-origin: border-box; background-clip: content-box, border-box;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0); -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out; mask-composite: exclude;
}
.line-1 { width: 100%; height: 100%; background-image: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0)), conic-gradient(from 0deg, var(--neon-cyan) 15%, transparent 16%, transparent 60%, var(--neon-cyan) 75%, transparent 76%); filter: drop-shadow(0 0 12px var(--neon-cyan)); animation: spinClockwise 3s linear infinite; }
.line-2 { width: 82%; height: 82%; background-image: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0)), conic-gradient(from 120deg, var(--neon-purple) 20%, transparent 21%, transparent 70%, var(--neon-purple) 85%, transparent 86%); filter: drop-shadow(0 0 15px var(--neon-purple)); animation: spinCounterClockwise 4.5s linear infinite; }
.line-3 { width: 64%; height: 64%; background-image: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0)), conic-gradient(from 240deg, var(--neon-magenta) 25%, transparent 26%); filter: drop-shadow(0 0 10px var(--neon-magenta)); animation: spinClockwise 2s linear infinite; opacity: 0.8; }

@keyframes spinClockwise { 100% { transform: rotate(360deg); } }
@keyframes spinCounterClockwise { 100% { transform: rotate(-360deg); } }

.quantum-logo { position: relative; z-index: 10; max-width: 600px; max-height: 600px; object-fit: contain; animation: logoFloat 3.5s ease-in-out infinite; }
@keyframes logoFloat { 0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.2)); } 50% { transform: translateY(-6px) scale(1.03); filter: drop-shadow(0 10px 20px rgba(0,243,255,0.3)); } }

/* PROGRESS BAR */
.loading-matrix { width: 100%; }
.status-text-panel { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-family: 'Orbitron', 'Kanit', sans-serif; letter-spacing: 1px; font-size: 0.85rem; }
#quantum-status { color: #cbd5e1; text-shadow: 0 0 8px rgba(255, 255, 255, 0.2); }
#quantum-percent { color: var(--neon-cyan); font-weight: 700; text-shadow: 0 0 10px var(--neon-cyan); }
.quantum-bar-track { width: 100%; height: 8px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(189, 95, 255, 0.25); padding: 1px; overflow: hidden; clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px)); }
.quantum-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--neon-purple) 0%, var(--neon-cyan) 100%); position: relative; transition: width 0.4s ease-out; }
.bar-plasma-glow { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); animation: barWave 1.8s infinite linear; }
@keyframes barWave { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* =========================================================================
   🔮 PREMIUM CYBER BUTTONS (GALAXY BUTTONS)
   ========================================================================= */
.galaxy-btn-wrapper { position: relative; padding: 10px; z-index: 10; }

/* BUTTON 1: PRIMARY */
.galaxy-btn-primary {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    padding: 16px 45px; background: var(--void-black); color: #ffffff;
    font-family: 'Orbitron', 'Kanit', sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: 1px;
    text-decoration: none; overflow: hidden; text-transform: uppercase;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    box-shadow: 0 0 20px rgba(189, 95, 255, 0.25); transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s; cursor: pointer;
}
.galaxy-btn-primary .laser-track-purple {
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 40%, var(--neon-purple-glow) 45%, var(--neon-magenta-glow) 50%, var(--neon-purple-glow) 55%, transparent 60%);
    animation: galaxyLaserSpin 3.5s linear infinite; z-index: 1;
}
@keyframes galaxyLaserSpin { 100% { transform: rotate(360deg); } }

.galaxy-btn-primary::after {
    content: ''; position: absolute; inset: 2px;
    background: linear-gradient(135deg, var(--nebula-purple-dark) 0%, #06030c 100%);
    clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
    z-index: 2; transition: background 0.3s;
}
.galaxy-btn-primary::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(189, 95, 255, 0.4), transparent);
    transform: skewX(-25deg); animation: cosmicFlareWarp 4s infinite ease-in-out; z-index: 4;
}
@keyframes cosmicFlareWarp { 0% { left: -100%; } 25%, 100% { left: 150%; } }

.galaxy-btn-primary .galaxy-btn-inner { position: relative; z-index: 5; display: flex; align-items: center; text-shadow: 0 0 8px rgba(255, 255, 255, 0.5); transition: all 0.3s; }
.galaxy-btn-primary:hover { transform: scale(1.03) translateY(-2px); box-shadow: 0 0 35px var(--neon-purple-glow), 0 0 10px #ffffff; }
.galaxy-btn-primary:hover::after { background: linear-gradient(135deg, #1d0b47 0%, var(--nebula-purple-dark) 100%); }
.galaxy-btn-primary:hover .galaxy-btn-inner { text-shadow: 0 0 12px var(--neon-purple-glow); }

/* BUTTON 2: SECONDARY */
.galaxy-btn-secondary {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    padding: 16px 45px; background: rgba(18, 7, 43, 0.3); border: 1px solid rgba(189, 95, 255, 0.4);
    color: #dec8ff; font-family: 'Orbitron', 'Kanit', sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: 1px;
    text-decoration: none; overflow: hidden; text-transform: uppercase; box-shadow: inset 0 0 15px rgba(189, 95, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); cursor: pointer;
}
.galaxy-btn-secondary .plasma-wave-bg {
    position: absolute; inset: 0; background: linear-gradient(90deg, var(--neon-purple-glow), var(--neon-magenta-glow));
    opacity: 0; transform: scaleX(0); transform-origin: center; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease; z-index: 1;
}
.galaxy-btn-secondary::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--neon-purple-glow), transparent); z-index: 3; }
.galaxy-btn-secondary .galaxy-btn-inner { position: relative; z-index: 5; display: flex; align-items: center; transition: all 0.3s; }

.galaxy-btn-secondary:hover { border-color: var(--neon-purple-glow); color: #ffffff; transform: scale(1.03) translateY(-2px); box-shadow: 0 0 25px rgba(189, 95, 255, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.3); }
.galaxy-btn-secondary:hover .plasma-wave-bg { opacity: 1; transform: scaleX(1); }
.galaxy-btn-secondary:hover .galaxy-btn-inner { text-shadow: 0 0 8px #000000; }

/* =========================================================================
   📱 RESPONSIVE SYSTEM (Mobile Friendly 100%)
   ========================================================================= */
@media (max-width: 768px) {
    /* ส่วนของ News Board */
    a.news-card { height: auto; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; }
    .card-body { flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; }
    .card-title, .card-desc { white-space: normal; }
    
    /* ส่วนของ Ticker Stream (แถบข้อความวิ่ง) */
    .galaxy-glass-box { height: auto; padding: 14px; flex-direction: column; align-items: flex-start; gap: 10px; }
    .node-badge { width: max-content; }
    .galaxy-ticker-viewport { width: 100%; }
    .cosmic-close-btn { position: absolute; top: 14px; right: 14px; }
}

@media (max-width: 576px) {
    .logo-galaxy-wrapper { width: 210px; height: 210px; }
    .quantum-logo { max-width: 100px; max-height: 100px; }
    .status-text-panel { font-size: 0.75rem; }
    
    /* ขยายปุ่มให้เต็มหน้าจอบนมือถือ */
    .galaxy-btn-wrapper { width: 100%; padding: 0 15px; }
    .galaxy-btn-primary, .galaxy-btn-secondary { width: 100%; padding: 14px 0; font-size: 0.95rem; }
}
/* ==========================================
   1. ตัวแปรปรับแต่งสไลด์ (แก้ขนาดความกว้าง/สูง ตรงนี้ได้เลย)
   ========================================== */
:root {
    --n-max-width: 1100px;     /* ความกว้างสูงสุดบนคอม */
    --n-pc-height: 460px;      /* ความสูงสไลด์บนคอม */
    --n-border-radius: 20px;   /* ความโค้งมนของมุมกล่อง */
    --n-laser-size: 2px;       /* ความหนาของเส้นแสงวิ่งรอบกล่อง */
    --neon-purple: #bd5fff;
    --neon-cyan: #00f3ff;
}

.nebula-core-title {
    color: #f3e8ff;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(189, 95, 255, 0.4);
}
.nebula-core-subtitle {
    color: #64748b !important;
}

/* ==========================================
   2. โครงสร้าง Viewport และแอนิเมชันขอบแสงวิ่ง (Laser Edge)
   ========================================== */
.nebula-viewport {
    position: relative;
    width: 100%;
    max-width: var(--n-max-width);
    height: var(--n-pc-height);
    margin: 0 auto;
    border-radius: var(--n-border-radius);
    background: #06030c;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85);
    overflow: hidden;
}

/* เอฟเฟกต์แสงคอนทัวร์วิ่งรอบตัวการ์ดสไลด์ */
.nebula-laser-border {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 30%,
        var(--neon-purple) 40%,
        var(--neon-cyan) 50%,
        var(--neon-purple) 60%,
        transparent 70%
    );
    animation: nebulaLaserSpin 6s linear infinite;
    z-index: 1;
}
@keyframes nebulaLaserSpin {
    100% { transform: rotate(360deg); }
}

/* หน้ากากกรอง บีบให้แสง conic กลายเป็นเส้นขอบบางคมสวย */
.nebula-viewport::after {
    content: '';
    position: absolute;
    inset: var(--n-laser-size);
    background: #080412;
    border-radius: calc(var(--n-border-radius) - var(--n-laser-size));
    z-index: 2;
}

.nebula-slider-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 3;
}

/* ==========================================
   3. รายละเอียดแผ่นสไลด์และเอฟเฟกต์ภาพพื้นหลังแบบเต็ม (Full BG)
   ========================================== */
.nebula-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center; /* จัดให้ข้อความอยู่กึ่งกลางแนวตั้งบนคอม */
    padding: 0 80px;
    box-sizing: border-box;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
}
.nebula-slide.active {
    opacity: 1;
    visibility: visible;
}

/* แผ่นภาพพื้นหลังเต็มกล่องสไลด์ */
.nebula-full-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -1;
    transform: scale(1.15) blur(3px); /* ซูมและเบลอรอไว้เมื่อถูกซ่อน */
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), filter 1.2s;
}
.nebula-slide.active .nebula-full-bg {
    transform: scale(1) blur(0); /* ดึงกลับมาคมชัดเต็มพิกัดเมื่อ Slide Active */
}

/* กล่องครอบข้อความภายใน */
.nebula-content-container {
    max-width: 580px;
    position: relative;
    z-index: 5;
}

/* แท็กอวกาศขนาดเล็ก */
.nebula-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(-15px);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.2s;
}

/* หัวข้อหลักภาพยนตร์ไซไฟ */
.nebula-main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 15px 0;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.25);
    opacity: 0;
    filter: blur(8px);
    transform: scale(0.95) translateY(15px);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.4s;
}

/* ข้อความบรรยายคุณสมบัติ */
.nebula-sub-title {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.6s;
}

/* สั่งทำงานแอนิเมชันเมื่อคลาสหน้าปัจจุบัน Active */
.nebula-slide.active .nebula-badge-tag,
.nebula-slide.active .nebula-main-title,
.nebula-slide.active .nebula-sub-title {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) translateY(0);
}

/* ==========================================
   4. ปุ่มกดสไตล์ Capsule และอุปกรณ์ลูกศร
   ========================================== */
.nebula-action-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: rgba(189, 95, 255, 0.1);
    border: 1px solid var(--neon-purple);
    border-radius: 8px;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(189, 95, 255, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.7s, transform 0.6s ease 0.7s, all 0.3s ease;
}
.nebula-slide.active .nebula-action-btn {
    opacity: 1;
    transform: translateY(0);
}

.nebula-action-btn:hover {
    color: #ffffff;
    background: var(--neon-purple);
    box-shadow: 0 0 25px var(--neon-purple), 0 0 10px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* ลำแสงวิ่งพาดผ่านตัวปุ่ม */
.btn-flare-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: nebulaBtnFlash 4s infinite linear;
}
@keyframes nebulaBtnFlash {
    0% { left: -100%; }
    25%, 100% { left: 150%; }
}

/* ปุ่มกดลูกศร */
.nebula-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(6, 3, 15, 0.6);
    border: 1px solid rgba(189, 95, 255, 0.3);
    color: #ffffff;
    font-size: 1.1rem;
    width: 42px;
    height: 42px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.nebula-nav-arrow:hover {
    background: var(--neon-purple);
    border-color: #ffffff;
    box-shadow: 0 0 15px var(--neon-purple);
}
.nebula-nav-arrow.nav-left { left: 20px; }
.nebula-nav-arrow.nav-right { right: 20px; }

/* จุดขีดระบุตำแหน่งด้านล่าง */
.nebula-dots-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 15;
}
.nebula-dot {
    width: 14px;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s;
}
.nebula-dot.active {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    width: 28px;
}

/* ==========================================
   5. 📱 ระบบล็อกสัดส่วนมือถือป้องกันหลุดขอบ 100% (Mobile Safety Core)
   ========================================== */
@media (max-width: 768px) {
    /* ปลดล็อกความสูงตายตัวทิ้ง ปล่อยให้ความสูงขยายตามปริมาณตัวหนังสือจริง */
    .nebula-viewport {
        height: auto !important;
        border-radius: 16px;
    }
    
    .nebula-viewport::after {
        border-radius: calc(16px - var(--n-laser-size));
    }

    /* เปลี่ยนวิธีซ่อนจากพิกัด Absolute เป็นใช้การสั่งบล็อกการแสดงผล (Display) แทนเพื่อช่วยคำนวณขนาด */
    .nebula-slide {
        position: relative !important;
        display: none; 
        padding: 45px 20px 50px 20px; /* เว้นพื้นที่สี่ด้านอย่างสมดุล */
        width: 100%;
        height: 100%;
    }
    .nebula-slide.active {
        display: flex;
    }

    /* ภาพพื้นหลังแผ่เต็มกล่องตลอดเวลาตามบรีฟใหม่ */
    .nebula-full-bg {
        transform: scale(1.1);
    }

    /* จัดข้อความให้อยู่เซนเตอร์กลางจอมือถือเพื่อความโมเดิร์น */
    .nebula-content-container {
        max-width: 100%;
        width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .nebula-main-title {
        font-size: 1.7rem; /* ย่อขนาดอักษรหัวข้อลงเล็กน้อยบนมือถือ */
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .nebula-sub-title {
        font-size: 0.85rem; /* ปรับขนาดข้อความรองให้อ่านง่ายไม่ล้นจอ */
        margin-bottom: 20px;
        line-height: 1.5;
    }

    /* ปุ่มกางเต็มพิกัดสมาร์ทโฟนกดง่าย */
    .nebula-action-btn {
        width: 100%;
        max-width: 240px;
        padding: 12px 0;
    }

    /* ซ่อนลูกศรทิ้ง เพื่อป้องกันตัวอักษรไปทับลูกศรบนหน้าจอเล็ก */
    .nebula-nav-arrow {
        display: none !important;
    }
    
    .nebula-dots-indicator {
        bottom: 15px;
    }
}
/* ==========================================
   1. สไตล์เวอร์ชัน PC: อยู่ตรงกลาง Scroll bar ขวามือ
   ========================================== */
.space-dock-system {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%); /* จัดให้อยู่กึ่งกลางจอแนวตั้งเป๊ะๆ */
    display: flex;
    align-items: center;
    z-index: 999999 !important; /* ลอยเหนือเนื้อหาทั้งหมดบนหน้าเว็บ */
}

/* ปุ่มกดเปิด/ปิด: แนบชิดขอบขวาสุดติดกับ Scroll Bar */
.space-dock-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 46px;
    background: linear-gradient(135deg, #1e1145 0%, #0a0518 100%);
    border: 1px solid rgba(168, 85, 247, 0.6);
    border-right: none; /* ฝั่งขวาแนบกลืนไปกับขอบจอ */
    border-radius: 10px 0 0 10px; /* มนเฉพาะฝั่งซ้าย */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: -5px 0 20px rgba(168, 85, 247, 0.3);
    z-index: 100000;
    outline: none;
    transition: all 0.3s ease;
}
.space-dock-toggle:hover {
    background: #3b1175;
    box-shadow: -5px 0 25px rgba(168, 85, 247, 0.7);
    border-color: #d8b4fe;
}

/* ไอคอนขีดเมนูบาร์ */
.dock-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 18px;
}
.dock-line {
    width: 100%;
    height: 2px;
    background-color: #d8b4fe;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

/* เอฟเฟกต์หมุนไขว้ปุ่มเมื่อเปิดใช้งาน (.open) */
.space-dock-system.open .dock-line:nth-child(1) { transform: translateY(6px) rotate(45deg); background-color: #ffffff; }
.space-dock-system.open .dock-line:nth-child(2) { opacity: 0; }
.space-dock-system.open .dock-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); background-color: #ffffff; }

/* หน้าต่างเมนูกรอบเล็กกะทัดรัด (ซ่อนอยู่หลัง Scroll Bar) */
.space-dock-content {
    position: fixed;
    right: -240px; /* ซ่อนเก็บไว้หลังขอบจอทางขวา */
    top: 50%;
    transform: translateY(-50%);
    width: 210px; /* กรอบเล็กไม่ใหญ่มากตามบรีฟ */
    background: linear-gradient(135deg, rgba(12, 6, 28, 0.97) 0%, rgba(24, 11, 48, 0.93) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-right: none; /* แนบเนียนไร้ขอบเมื่อสไลด์ออกมาชนขอบจอ */
    border-radius: 16px 0 0 16px; /* มนฝั่งซ้ายที่สไลด์ยื่นออกมา */
    padding: 25px 18px;
    box-sizing: border-box;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.8), 
                inset 5px 0 15px rgba(168, 85, 247, 0.1);
    transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1); /* สไลด์นุ่มพริ้วสไตล์อวกาศ */
}

/* เมื่อสั่งเปิดเมนู: ให้สไลด์พุ่งออกมาจากขอบ Scroll bar ขวามือ */
.space-dock-system.open .space-dock-content {
    right: 0; 
}

/* ลูกเล่นปรับตำแหน่งปุ่มกดให้ขยับถอยหลบมาต่อท้ายเมนูเมื่อกางออก */
.space-dock-system.open .space-dock-toggle {
    right: 210px; /* ขยับถอยไปทางซ้ายเท่ากับความกว้างของเมนู */
}

/* ตกแต่งด้านในกล่องเมนู */
.dock-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #a855f7;
    letter-spacing: 2px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    padding-bottom: 8px;
}
.orbit-pulse {
    width: 6px;
    height: 6px;
    background: #00ffcc;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ffcc;
    animation: dockPulse 2s infinite ease-in-out;
}

.dock-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dock-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #c084fc;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.dock-item i { font-size: 1rem; width: 18px; text-align: center; }

/* เอฟเฟกต์โฮเวอร์เรืองแสงพลาสม่าม่วงขาว */
.dock-item:hover, .dock-item.active {
    color: #ffffff;
    background: rgba(168, 85, 247, 0.2);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.2);
}
.dock-item.dock-member {
    margin-top: 10px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px dashed rgba(168, 85, 247, 0.3);
}

@keyframes dockPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ==========================================
   2. สไตล์เวอร์ชันมือถือ: แปลงกายเป็น Bottom Bar ติดหนึบถาวรขอบล่าง
   ========================================== */
@media (max-width: 768px) {
    /* ปรับตัวระบบมาตรึงไว้ขอบล่างสุดของหน้าจอ */
    .space-dock-system {
        position: fixed !important;
        right: 0 !important;
        left: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        transform: none !important;
        width: 100% !important;
        height: 65px !important; /* ล็อกความสูงให้พอดียิ้มมือจิ้ม */
        z-index: 999995 !important; /* ดันขึ้นมาสูงเกือบเท่ามอดอล เพื่อให้กดได้ปกติในหน้าแรก */
        pointer-events: auto !important; /* บังคับให้รับแรงจิ้มจากนิ้วมือแน่นอน */
    }

    /* ⚡ หมัดเด็ดแก้มอดอลบัง: ถ้าในหน้าจอมีมอดอลกาแล็กซีโผล่ขึ้นมา (ไม่ว่าจะเปิดตัวไหน) 
       สั่งให้แถบด้านล่างนี้หลบวูบลงไปใต้แผ่นดำทันที ไม่ไปขวางทางกด */
    .galaxy-admin-modal-wrapper.show ~ .space-dock-system,
    .galaxy-sub-modal-wrapper.show ~ .space-dock-system,
    body.modal-open .space-dock-system {
        z-index: 1000 !important; /* ลดสิทธิ์ลงไปอยู่ชั้นล่างสุด */
        opacity: 0 !important;    /* ซ่อนหายไปเลยตอนมอดอลเปิด จะได้ไม่เกะกะสายตา */
        pointer-events: none !important; /* ปิดการกดทับ */
    }

    /* ซ่อนปุ่มเปิด/ปิดแฮมเบอร์เกอร์ทิ้งไปเลย เพราะบนมือถือจะกางปุ่มเมนูให้ใช้ถาวร */
    .space-dock-toggle {
        display: none !important;
    }

    /* บังคับหน้าต่างเมนูให้แปลงร่างเป็นแถบยาวแนวนอนเรียบเนียน */
    .space-dock-content {
        position: relative !important;
        right: 0 !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
        border: none !important;
        border-top: 2px solid #a855f7 !important; /* แถบเส้นนีออนอวกาศขอบบน */
        border-radius: 16px 16px 0 0 !important; /* มนเฉพาะหัวสองข้าง */
        background: linear-gradient(0deg, #090514 0%, #170d2c 100%) !important;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.9) !important;
        display: flex;
        align-items: center;
        padding: 0 10px !important;
        pointer-events: auto !important;
    }

    /* ซ่อนตัวอักษรหัวข้อเมนูบนมือถือ */
    .dock-header {
        display: none !important;
    }

    /* เปลี่ยนการเรียงเมนูจาก "แนวตั้งบนคอม" เป็น "แนวนอนเรียงหน้ากระดานบนมือถือ" */
    .dock-nav-list {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        height: 100%;
    }

    .dock-item {
        display: flex !important;
        flex-direction: column !important; /* ไอคอนอยู่ด้านบน ข้อความสั้นอยู่ด้านล่าง */
        gap: 3px !important;
        padding: 6px 0 !important;
        font-size: 0.65rem !important; /* ปรับฟอนต์ให้เล็กกระชับพอดีหน้าจอ */
        flex: 1;
        justify-content: center;
        align-items: center;
        pointer-events: auto !important;
    }
    .dock-item i {
        font-size: 1.25rem !important; /* ขยายขนาดไอคอนให้กดง่ายเต็มตา */
    }

    /* รีเซ็ตดีไซน์ปุ่มล็อกอินบนมือถือให้เข้าพวก */
    .dock-item.dock-member {
        margin-top: 0 !important;
        background: none !important;
        border: none !important;
    }

    /* เทคนิคดันเนื้อหาเว็บเดิมขึ้นเล็กน้อยเพื่อป้องกันไม่ให้เมนูบาร์ด้านล่างไปบังเนื้อหาสำคัญ */
    body {
        padding-bottom: 70px !important;
    }
}
/* ==========================================
   1. ปุ่มเปิด/ปิด ระบบสมาชิก (Toggle Button)
   ========================================== */
.space-member-toggle {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 65px;
    height: 65px;
    background: radial-gradient(circle, #a855f7 0%, #4c1d95 100%);
    border: 2px solid #d8b4fe;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6),
                inset 0 0 10px rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.space-member-toggle i {
    font-size: 22px;
    margin-bottom: 2px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.space-member-toggle .toggle-text {
    font-size: 9px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
}

/* เอฟเฟกต์วงแหวนชีพจร (Pulse) กระจายออกจากปุ่ม */
.space-member-toggle .pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #a855f7;
    border-radius: 50%;
    animation: spacePulse 2s linear infinite;
    opacity: 0;
    pointer-events: none;
}

.space-member-toggle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.9),
                inset 0 0 15px rgba(255, 255, 255, 0.6);
    border-color: #ffffff;
}

@keyframes spacePulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ==========================================
   2. ตัวการ์ดป๊อปอัพ (Member Login Card)
   ========================================== */
.space-member-card {
    position: fixed;
    left: -420px; /* ซ่อนไว้ฝั่งซ้ายของจอตอนเริ่มต้น */
    top: 50%;
    transform: translateY(-50%);
    width: 360px;
    background: rgba(15, 12, 28, 0.75); /* ดำอวกาศโปร่งแสง */
    backdrop-filter: blur(20px); /* เอฟเฟกต์กระจกฝ้า */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-left: 4px solid #a855f7; /* ขอบหนาเน้นมิติด้านซ้ายติดขอบจอ */
    border-radius: 0 24px 24px 0; /* มนเฉพาะฝั่งขวา */
    padding: 40px 30px;
    box-sizing: border-box;
    color: #ffffff;
    z-index: 10000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(168, 85, 247, 0.15);
    transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1); /* แอนิเมชันเลื่อนแบบสมูทนุ่มลึก */
}

/* คลาสที่จะถูกเติมด้วย JS เพื่อดึงการ์ดออกมาแสดง */
.space-member-card.active {
    left: 0; /* วิ่งมาแนบชิดซ้ายมุมจอ */
}

/* ปุ่มกากบาทปิดการ์ด */
.close-card-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
}
.close-card-btn:hover { color: #a855f7; }

/* หัวข้อการ์ด */
.card-header {
    text-align: center;
    margin-bottom: 35px;
}
.space-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #d8b4fe 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}
.space-subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    margin: 5px 0 0 0;
    color: #9333ea;
    letter-spacing: 4px;
}

/* ช่องกรอกข้อมูล (Inputs) */
.input-group {
    position: relative;
    margin-bottom: 25px;
}
.input-group label {
    display: block;
    font-family: 'Anuphan', sans-serif;
    font-size: 0.9rem;
    color: #c084fc;
    margin-bottom: 8px;
}
.input-group label i { margin-right: 6px; }

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s;
}
/* ลูกเล่นขอบแสงวิ่งเมื่อกดโฟกัสช่องกรอก */
.input-group input:focus {
    background: rgba(168, 85, 247, 0.08);
    border-color: #c084fc;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

/* ลิงก์ลืมรหัสผ่าน */
.form-actions {
    margin-bottom: 30px;
    text-align: right;
}
.forgot-link {
    font-size: 0.8rem;
    color: #a78bfa;
    text-decoration: none;
    transition: color 0.3s;
}
.forgot-link:hover { color: #ffffff; text-shadow: 0 0 5px #a78bfa; }

/* ปุ่มล็อกอินหลอมละลายเอฟเฟกต์แสงไฟ */
.login-submit-btn {
    position: relative;
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, #6b21a8, #a855f7, #6b21a8);
    background-size: 200% auto;
    border: none;
    border-radius: 8px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}
.login-submit-btn:hover {
    background-position: right center; /* ขยับแสงไฟที่ปุ่ม */
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.8);
    transform: scale(1.02);
}

/* ท้ายการ์ด */
.card-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.85rem;
    color: #94a3b8;
}
.register-link {
    color: #c084fc;
    text-decoration: none;
    font-weight: 600;
}
.register-link:hover { text-shadow: 0 0 8px #c084fc; color: white; }
/* ==========================================================================
   1. Global Styles & Background
   ========================================================================== */
:root {
    /* แถบเมนู Navbar Logo */
    --nav-logo-width: 140px; 

    /* โลโก้หลักตรงกลางหน้าจอ (Hero) */
    --logo-width: 800px; 
    /* ปรับค่านี่ลดลงเพื่อร่นระยะให้องค์ประกอบด้านล่างขยับเข้ามาใกล้ชายขอบของโลโก้มากขึ้น */
    --logo-margin-bottom: -100px; 
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: #0b0514; /* สีพื้นหลังดำอมม่วงเข้มข้น */
    background-image: linear-gradient(180deg, rgba(11, 7, 19, 0.6) 0%, rgba(15, 5, 30, 0.4) 100%), 
                      url('images/bg/bg.png'); /* ปรับ Path เผื่อกรณีไฟล์อยู่ในโฟลเดอร์ css */
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: #ffffff;
}

/* พื้นผิว Canvas สำหรับรันเอฟเฟกต์สายฟ้าและดวงดาวร่วงหล่นทั่วเว็บ */
#cosmic-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* อยู่หลังเนื้อหา แต่อยู่หน้าภาพพื้นหลัง */
    pointer-events: none; /* กดทะลุไปคลิกปุ่มด้านหลังได้ */
    mix-blend-mode: screen;
}

.glass-background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 6, 20, 0.15); /* กรองแสงให้มีความละมุนตา */
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    z-index: 2; 
    pointer-events: none; 
}

.main-content-wrapper {
    position: relative;
    z-index: 3; /* ดันเนื้อหาหลักทั้งหมดให้อยู่หน้าเอฟเฟกต์เพื่อกดปุ่มได้ปกติ */
}

/* ==========================================================================
   2. Premium Sticky Navbar & Cute-Modern Hover Effects
   ========================================================================== */
.main-navbar {
    position: fixed !important;  
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 25px 0;
    background: linear-gradient(180deg, rgba(11, 5, 20, 0.95) 0%, rgba(11, 5, 20, 0.4) 70%, rgba(11, 5, 20, 0) 100%) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-bottom: 1px solid rgba(157, 78, 221, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    /* 🛠️ แก้ไขจุดนี้: ปรับลดระดับลงมาให้อยู่ใต้เงาของมอดอลทุกตัว */
    z-index: 1030 !important; 
}

.main-navbar.navbar-scrolled {
    padding: 12px 0 !important;
    background: rgba(11, 7, 19, 0.96) !important; 
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 2px solid #9d4ede !important;
    box-shadow: 0 8px 30px rgba(157, 78, 221, 0.35) !important; 
}

/* โครงสร้างเมนูแบบ 2 บรรทัด (ภาษาไทย + อังกฤษ) */
.main-navbar .nav-link {
    color: #e0aaff !important;
    padding: 8px 18px !important;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 8px;
    margin: 0 4px;
}

/* ข้อความหลักด้านบน (ภาษาไทย) */
.nav-text-main {
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: block;
    line-height: 1.2;
}

/* ข้อความย่อยด้านล่าง (ภาษาอังกฤษ) */
.nav-text-sub {
    font-family: 'Cinzel', serif; /* ใช้ฟอนต์คลาสสิกสไตล์โรมัน */
    font-size: 0.68rem;          /* ขนาดเล็กแบบพอดีตัวไม่แย่งซีนภาษาไทย */
    font-weight: 700;
    letter-spacing: 1.5px;       /* เว้นระยะห่างตัวอักษรให้ดูโปรและอ่านง่าย */
    color: #9d4ede;              /* สีม่วงเข้มสไตล์ดาร์กเอลฟ์ */
    margin-top: 3px;
    display: block;
    transition: all 0.3s ease;
}

/* เอฟเฟกต์แอนิเมชันไอคอนขยับดุ๊กดิ๊กตอน Hover */
.main-navbar .nav-link i {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.main-navbar .nav-link:hover i {
    color: #ffffff !important;
    animation: cuteIconJump 0.6s ease infinite alternate;
    filter: drop-shadow(0 0 8px #c77dff);
}

@keyframes cuteIconJump {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.1) rotate(-5deg); }
    100% { transform: translateY(-5px) scale(1.1) rotate(5deg); }
}

/* เอฟเฟกต์เมื่อเอาเมาส์มาชี้ที่เมนู (Hover) */
.main-navbar .nav-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 12px rgba(224, 170, 255, 0.85), 0 0 20px rgba(157, 78, 221, 0.5);
    transform: translateY(-2px);
    background: rgba(157, 78, 221, 0.08);
}

.main-navbar .nav-link:hover .nav-text-sub {
    color: #e0aaff;
    text-shadow: 0 0 8px rgba(224, 170, 255, 0.6);
}

/* เส้นขีดใต้เมนูวิ่งขยายจากตรงกลาง */
.main-navbar .nav-link::after {
    content: ''; 
    position: absolute; 
    bottom: -2px; 
    left: 50%; 
    width: 0; 
    height: 3px;
    background: linear-gradient(90deg, transparent, #e0aaff, #9d4ede, #e0aaff, transparent);
    box-shadow: 0 0 10px #e0aaff; 
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); 
    transform: translateX(-50%);
    border-radius: 4px;
}

.main-navbar .nav-link:hover::after { 
    width: 80%; 
}

/* กรอบวิเศษยาม Hover แถบเมนู */
.main-navbar .nav-link::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    pointer-events: none;
    scale: 0.9;
    opacity: 0;
}

.main-navbar .nav-link:hover::before {
    border-color: rgba(199, 125, 255, 0.25);
    scale: 1;
    opacity: 1;
}

/* สถานะเมนูที่กำลังเลือกใช้งานอยู่ (Active State) */
.main-navbar .nav-link.active {
    color: #ffffff !important;
    background: rgba(157, 78, 221, 0.15) !important;
    border: 1px solid rgba(224, 170, 255, 0.25);
    box-shadow: inset 0 0 10px rgba(157, 78, 221, 0.2);
    text-shadow: 0 0 8px rgba(224, 170, 255, 0.8);
}

.main-navbar .nav-link.active .nav-text-sub {
    color: #ffffff;
}

.main-navbar .nav-link.active::after {
    width: 85%;
    background: linear-gradient(90deg, #9d4ede, #fff, #9d4ede);
}

/* แถบควบคุมโลโก้บนเมนูและแสงออร่า */
.nav-logo-magic-container {
    position: relative;
    display: inline-block;
    width: var(--nav-logo-width);
    height: auto;
    padding: 10px;
    box-sizing: border-box;
}

.nav-main-logo {
    position: relative;
    z-index: 3;
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 8px rgba(157, 78, 221, 0.6));
    transition: all 0.4s ease;
}

.navbar-brand:hover .nav-main-logo {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(224, 170, 255, 0.9));
}

.nav-logo-aura-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    z-index: 1;
    border-radius: 50%;
    mix-blend-mode: screen;
    pointer-events: none;
    background: radial-gradient(circle, rgba(157, 78, 221, 0.5) 0%, rgba(90, 24, 154, 0.2) 40%, rgba(16, 0, 37, 0.6) 70%, transparent 100%);
    filter: blur(12px);
    animation: navAuraRotate 8s linear infinite, navAuraPulse 3s ease-in-out infinite alternate;
}

.navbar-brand:hover .nav-logo-aura-glow {
    background: radial-gradient(circle, rgba(224, 170, 255, 0.7) 0%, rgba(157, 78, 221, 0.4) 45%, rgba(16, 0, 37, 0.8) 75%, transparent 100%);
    filter: blur(8px);
    animation-duration: 4s, 1.5s;
}

@keyframes navAuraRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes navAuraPulse {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* ปุ่มพรีเมียม PLAY NOW */
.btn-premium-play {
    position: relative; display: inline-block; padding: 12px 30px; color: #ffffff; background: #1a0c2b;
    text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.95rem; font-weight: 600; text-decoration: none;
    overflow: hidden; transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border-radius: 6px; box-shadow: 0 0 15px rgba(157, 78, 221, 0.25);
    border: 1px solid rgba(157, 78, 221, 0.3);
}

.btn-premium-play:hover { 
    background: #9d4ede; 
    color: #10002b !important; 
    box-shadow: 0 0 25px #9d4ede, 0 0 50px rgba(157, 78, 221, 0.6); 
    font-weight: 700;
    transform: scale(1.05) translateY(-2px);
}

.btn-premium-play i { transition: transform 0.4s ease; }
.btn-premium-play:hover i { transform: scale(1.2) rotate(-10deg); color: #10002b !important; filter: none; animation: none; }
        
.btn-premium-play span { position: absolute; display: block; }
.btn-premium-play span:nth-child(1) { top: 0; left: -100%; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #e0aaff); animation: btn-left-right 1.5s linear infinite; }
@keyframes btn-left-right { 0% { left: -100%; } 50%, 100% { left: 100%; } }
.btn-premium-play span:nth-child(2) { top: -100%; right: 0; width: 2px; height: 100%; background: linear-gradient(180deg, transparent, #e0aaff); animation: btn-top-bottom 1.5s linear infinite; animation-delay: 0.375s; }
@keyframes btn-top-bottom { 0% { top: -100%; } 50%, 100% { top: 100%; } }
.btn-premium-play span:nth-child(3) { bottom: 0; right: -100%; width: 100%; height: 2px; background: linear-gradient(270deg, transparent, #e0aaff); animation: btn-right-left 1.5s linear infinite; animation-delay: 0.75s; }
@keyframes btn-right-left { 0% { right: -100%; } 50%, 100% { right: 100%; } }
.btn-premium-play span:nth-child(4) { bottom: -100%; left: 0; width: 2px; height: 100%; background: linear-gradient(360deg, transparent, #e0aaff); animation: btn-bottom-top 1.5s linear infinite; animation-delay: 1.125s; }
@keyframes btn-bottom-top { 0% { bottom: -100%; } 50%, 100% { bottom: 100%; } }


/* ==========================================================================
   3. Hero Header Section & Main Logo Controls
   ========================================================================== */
.hero-section {
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    text-align: center;
    padding-top: 140px; 
    padding-bottom: 60px;
}

.logo-cosmic-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: var(--logo-width);
    margin: 0 auto var(--logo-margin-bottom) auto; 
    padding: 60px 60px 20px 60px; 
    box-sizing: border-box;
}

.main-logo {
    position: relative;
    z-index: 5;
    width: 100%;
    height: auto;
    max-width: 100%;
    filter: drop-shadow(0 0 25px rgba(157, 78, 221, 0.75));
    animation: roLogoFloat 6s ease-in-out infinite;
}

.logo-lightning-glow {
    position: relative;
    display: block;
}

.logo-lightning-glow::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 95%; height: 95%;
    background: radial-gradient(circle, rgba(224, 170, 255, 0.45) 0%, rgba(157, 78, 221, 0.25) 40%, rgba(16, 0, 37, 0) 70%),
                repeating-conic-gradient(from 0deg, transparent 0deg, rgba(157, 78, 221, 0.2) 10deg, transparent 20deg);
    filter: blur(30px);
    z-index: 1;
    mix-blend-mode: screen;
    border-radius: 50%;
    animation: lightningAuraSpin 10s linear infinite, auraPulse 4s ease-in-out infinite alternate;
}

/* เอฟเฟกต์ละอองดาวฟองสบู่รอบโลโก้ */
.cosmic-particles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    pointer-events: none;
}

.particle {
    position: absolute;
    bottom: 25%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(199, 125, 255, 0.4) 60%, rgba(157, 78, 221, 0) 100%);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(224, 170, 255, 0.8);
    opacity: 0;
    animation: particleRise infinite ease-in-out;
}

.p-1  { left: 22%; width: 10px; height: 10px; animation-duration: 4s;   animation-delay: 0s; }
.p-2  { left: 45%; width: 16px; height: 16px; animation-duration: 5.5s; animation-delay: 0.8s; }
.p-3  { left: 68%; width: 8px;  height: 8px;  animation-duration: 3.5s; animation-delay: 1.5s; }
.p-4  { left: 82%; width: 13px; height: 13px; animation-duration: 4.8s; animation-delay: 0.3s; }
.p-5  { left: 12%; width: 18px; height: 18px; animation-duration: 6s;   animation-delay: 2.2s; }
.p-6  { left: 55%; width: 9px;  height: 9px;  animation-duration: 3.8s; animation-delay: 1.1s; }
.p-7  { left: 32%; width: 14px; height: 14px; animation-duration: 5s;   animation-delay: 2.7s; }
.p-8  { left: 74%; width: 11px; height: 11px; animation-duration: 4.2s; animation-delay: 1.9s; }
.p-9  { left: 50%; width: 17px; height: 17px; animation-duration: 5.8s; animation-delay: 3.2s; }
.p-10 { left: 88%; width: 7px;  height: 7px;  animation-duration: 3.2s; animation-delay: 0.5s; }


@keyframes roLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes lightningAuraSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes auraPulse {
    0% { opacity: 0.6; scale: 0.93; }
    100% { opacity: 1; scale: 1.05; }
}

@keyframes particleRise {
    0% { transform: translateY(0) translateX(0) scale(0.5); opacity: 0; }
    15% { opacity: 1; }
    50% { transform: translateY(-60px) translateX(20px) scale(1.1); }
    80% { opacity: 0.7; }
    100% { transform: translateY(-130px) translateX(-15px) scale(0.3); opacity: 0; }
}

/* ==========================================================================
   4. Space Hero Wrapper (Title & Subtitle Typography)
   ========================================================================== */
.space-hero-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px; 
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 40px; 
}

.hero-title, .hero-subtitle {
    text-align: center;
    margin: 0;
    padding: 0;
    display: block;
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                letter-spacing 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, filter, letter-spacing;
}

/* หัวข้อหลัก: เพิ่มเอฟเฟกต์สายฟ้าวิ่งช้าๆ */
.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem; 
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px; 
    
    /* แก้ไขการไล่สี: เพิ่มแถบสีขาวสว่างจ้าตรงกลาง (สายฟ้า) และขยายขนาดพื้นหลังเพื่อใช้ขยับ */
    background: linear-gradient(
        110deg, 
        #4c1d95 0%, 
        #a855f7 30%, 
        #d8b4fe 45%, 
        #ffffff 50%, /* แกนกลางสายฟ้าสีขาวสว่าง */
        #d8b4fe 55%, 
        #a855f7 70%, 
        #1e1b4b 100%
    );
    background-size: 200% auto; /* ขยายพื้นหลังเพื่อให้มีพื้นที่วิ่ง */
    
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    /* เพิ่มออร่าแสงสีขาวเรืองรอง (Neon Glow) เพื่อเพิ่มความสมจริงของสายฟ้า */
    filter: drop-shadow(0px 0px 8px rgba(0, 0, 0, 0.95))
            drop-shadow(0px 0px 20px rgba(0, 0, 0, 0.85))
            drop-shadow(0px 0px 15px rgba(255, 255, 255, 0.3)); /* แสงนีออนขาวจางๆ */

    /* เรียกใช้งานเอนิเมชัน: วิ่งจากหัวไปท้าย ใช้เวลา 6 วินาที วนลูปไม่สิ้นสุด */
    animation: lightningShine 6s linear infinite;
}

/* คำโปรยภาษาไทย */
.hero-subtitle {
    font-family: 'Anuphan', sans-serif;
    font-size: 1.25rem; 
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #e9d5ff 50%, #7e22ce 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 0px 6px rgba(0, 0, 0, 0.95));
    margin-bottom: 25px; 
}

/* เอฟเฟกต์ Hover */
.hero-title:hover {
    transform: translateY(-10px) scale(1.02); 
    letter-spacing: 6px;
    filter: drop-shadow(0px 5px 15px rgba(0, 0, 0, 0.95))
            drop-shadow(0px 15px 35px rgba(168, 85, 247, 0.5))
            drop-shadow(0px 0px 25px rgba(255, 255, 255, 0.6)); /* เพิ่มแสงสายฟ้าตอนโฮเวอร์ */
}

.hero-subtitle:hover {
    transform: translateY(-5px);
    letter-spacing: 1.5px;
    filter: drop-shadow(0px 4px 12px rgba(0, 0, 0, 0.95))
            drop-shadow(0px 10px 25px rgba(168, 85, 247, 0.4)); 
}

/* โค้ดคำสั่งควบคุมการวิ่งของสายฟ้า จากซ้ายไปขวา */
@keyframes lightningShine {
    0% {
        background-position: -100% center;
    }
    100% {
        background-position: 100% center;
    }
}

/* ==========================================================================
   5. Cosmic Divider (เส้นคั่นทางช้างเผือก)
   ========================================================================== */
.cute-cosmic-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 650px; 
    margin: 15px auto 25px auto; 
    position: relative;
    z-index: 15;
}

.mystic-line {
    flex: 1;
    height: 3px;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.mystic-line.line-left {
    background: linear-gradient(90deg, transparent 0%, rgba(16, 0, 37, 0.85) 20%, rgba(157, 78, 221, 0.75) 60%, #ffc6ff 100%);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.5), 0 0 20px rgba(255, 198, 255, 0.3);
}

.mystic-line.line-right {
    background: linear-gradient(90deg, #ffc6ff 0%, rgba(157, 78, 221, 0.75) 40%, rgba(16, 0, 37, 0.85) 80%, transparent 100%);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.5), 0 0 20px rgba(255, 198, 255, 0.3);
}

.soft-lightning-spark {
    position: absolute;
    top: 0;
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #ffffff 50%, rgba(224, 170, 255, 0.9) 100%);
    filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 8px #b388ff);
    opacity: 0;
    animation: cuteLightning 2.5s ease-in-out infinite;
}

.delay-spark {
    animation-delay: 1.25s;
}

.chibi-galaxy-core {
    position: relative;
    width: 28px;
    height: 28px;
    margin: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cute-star-planet {
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px #ffc6ff, 0 0 30px #9d4ede;
    z-index: 5;
    animation: planetFloat 2s ease-in-out infinite alternate;
}

.galaxy-orbit-ring {
    position: absolute;
    width: 36px;
    height: 14px;
    border: 2px solid rgba(224, 170, 255, 0.8);
    border-radius: 50%;
    transform: rotate(-15deg);
    box-shadow: 0 0 8px rgba(157, 78, 221, 0.6);
    z-index: 6;
    animation: orbitRotate 4s linear infinite;
}

.twinkle-dust {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #ffc6ff;
    opacity: 0;
    animation: dustTwinkle 1.5s infinite ease-in-out;
}

.td-1 { top: -6px; left: 2px; animation-delay: 0.2s; }
.td-2 { bottom: -4px; left: 20px; animation-delay: 0.6s; }
.td-3 { top: 10px; left: -8px; animation-delay: 1.1s; }

@keyframes cuteLightning {
    0% { left: -100%; opacity: 0; }
    10% { opacity: 1; }
    30%, 100% { left: 100%; opacity: 0; }
}

@keyframes planetFloat {
    0% { transform: translateY(0) scale(0.95); filter: brightness(1); }
    100% { transform: translateY(-3px) scale(1.05); filter: brightness(1.2); }
}

@keyframes orbitRotate {
    0%, 100% { transform: rotate(-15deg) scale(1); opacity: 0.8; }
    50% { transform: rotate(-15deg) scale(1.1); opacity: 1; }
}

@keyframes dustTwinkle {
    0%, 100% { opacity: 0; transform: scale(0.4); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* ==========================================================================
   6. Content Section & Grid Cards
   ========================================================================== */
.btn-ro-action {
    background: linear-gradient(45deg, #5a189a, #9d4ede);
    color: #fff;
    border: 1px solid #c77dff;
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    letter-spacing: 1px;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.4);
    transition: all 0.4s ease;
}

.btn-ro-action:hover {
    background: linear-gradient(45deg, #9d4ede, #e0aaff);
    color: #10002b;
    box-shadow: 0 0 30px rgba(224, 170, 255, 0.8);
    transform: translateY(-3px);
}

.content-section {
    padding: 80px 0;
    position: relative;
}

.glass-card {
    background: rgba(36, 16, 62, 0.45);
    border: 1px solid rgba(157, 78, 221, 0.25);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(224, 170, 255, 0.5);
}

/* ==========================================================================
   7. Responsive Design (Media Queries)
   ========================================================================== */

/* หน้าจอแท็บเล็ตและสมาร์ทโฟนทั่วไป */
@media (max-width: 991px) {
    :root {
        --nav-logo-width: 110px;
    }
    .nav-logo-aura-glow {
        filter: blur(8px);
    }
    .main-navbar .nav-link {
        align-items: flex-start !important;
        text-align: left !important;
        padding: 12px 20px !important;
        margin: 4px 0;
    }
    .main-navbar .nav-link::after {
        left: 20px;
        transform: none;
    }
    .main-navbar .nav-link:hover::after {
        width: 40px; 
    }
}

@media (max-width: 768px) {
    :root {
        --logo-margin-bottom: -10px; 
    }
    .logo-cosmic-container {
        padding: 15px 15px 5px 15px; 
    }
    .particle {
        animation-name: none; 
        display: none;
    }
    .logo-lightning-glow::before {
        width: 100%; height: 100%;
        filter: blur(20px); 
    }
    .cute-cosmic-divider {
        max-width: 85%;
        margin: 10px auto 20px auto;
    }
    .mystic-line {
        height: 2px; 
    }
    .galaxy-orbit-ring {
        width: 28px;
        height: 10px;
    }
    .hero-title {
        font-size: 3rem; /* ลดขนาดหัวข้อใหญ่ลงบนมือถือไม่ให้ตกขอบ */
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
}
