/* Tối ưu hóa toàn bộ trang */
* { 
    box-sizing: border-box; 
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Oswald', sans-serif;
    background-color: #2b0404; /* Nền đỏ đô đậm chất Studio */
    color: #fff;
    overflow-x: hidden;
}

/* 1. THANH MENU THU NHỎ TINH TẾ */
.menu-top {
    background: linear-gradient(to bottom, #420606 0%, #1a0202 100%);
    border-bottom: 2px solid #ff3333;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 10px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
}

/* Kiểu dáng đồng bộ cho nút bấm Popup và liên kết Zalo, Fanpage */
.menu-top .menu-btn, .menu-top a {
    color: #ffffff;
    text-decoration: none;
    padding: 10px 22px;
    margin: 4px;
    font-size: 17px;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    display: inline-block;
    text-align: center;
    cursor: pointer;
}

/* Hiệu ứng tia chớp bạc quét ngang */
.menu-top .menu-btn::before, .menu-top a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.6s ease;
}
.menu-top .menu-btn:hover::before, .menu-top a:hover::before { 
    left: 150%; 
}

/* Hiệu ứng di chuột nút mặc định */
.menu-top .menu-btn:hover, .menu-top a:hover {
    color: #ffcc00; /* Vàng hoàng kim đặc trưng vật phẩm hiếm MU */
    border-color: #ff3333;
    background: rgba(138, 16, 16, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 51, 51, 0.3);
}

/* NÚT NỔI BẬT: ZALO, TẢI GAME, ĐĂNG KÝ, FANPAGE */
.btn-highlight {
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
    background: linear-gradient(145deg, #dd1111, #660000) !important;
    box-shadow: 0 0 12px rgba(255, 50, 50, 0.4) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.btn-highlight:hover {
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.6) !important;
    background: linear-gradient(145deg, #ff3333, #aa0000) !important;
    color: #ffffff !important;
    border-color: #ffcc00 !important;
    transform: translateY(-2px);
}

/* 2. HỆ THỐNG POPUP MODAL */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Tạo lớp mờ đen sâu phía sau */
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s ease;
}

/* Kích hoạt hiển thị popup */
.popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.popup-content {
    background: linear-gradient(145deg, #2b0404, #0f0202); /* Phối màu rương đồ cổ điển */
    border: 2px solid #ff3333; /* Viền đỏ sắc nét */
    box-shadow: 0 0 35px rgba(255, 51, 51, 0.4);
    width: 90%;
    max-width: 750px;
    border-radius: 6px;
    padding: 30px;
    position: relative;
    transform: scale(0.75);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

/* Nút Đóng (X) */
.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaaaaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}
.popup-close:hover {
    color: #ff3333;
}

/* Tiêu đề bên trong bảng thông tin */
.popup-title {
    font-size: 26px;
    font-weight: bold;
    color: #ffcc00; /* Tone màu vàng Gold hoàng gia */
    border-bottom: 1px solid #420606;
    padding-bottom: 12px;
    margin-top: 0;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.9);
}

/* Nội dung của bài viết trong Popup */
.popup-body {
    margin-top: 15px;
    font-size: 16px;
    line-height: 1.6;
    color: #e0e0e0;
    font-family: sans-serif; /* Đổi font text bài viết giúp người chơi dễ đọc text dài */
    max-height: 60vh; /* Giới hạn chiều cao popup tránh vỡ khung */
    overflow-y: auto; /* Sinh thanh cuộn nếu bài viết dài */
    padding-right: 8px;
}

/* Thanh cuộn scrollbar nội dung thông tin */
.popup-body::-webkit-scrollbar { width: 6px; }
.popup-body::-webkit-scrollbar-track { background: #0f0202; }
.popup-body::-webkit-scrollbar-thumb { background: #ff3333; border-radius: 3px; }

/* 3. KHU VỰC VIDEO BACKGROUND */
.video-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    background: #000;
    padding: 0;
}

#videoBG {
    width: 100%;
    height: auto;
    max-width: 1920px;
    display: block;
    border-bottom: 2px solid #420606;
}

/* 4. CHÂN TRANG (FOOTER) */
.footer {
    background: #140202;
    padding: 60px 20px;
    text-align: center;
    border-top: 2px solid #420606;
}


.footer-info {
    color: #8c2626;
    margin-top: 25px;
    font-size: 16px;
    letter-spacing: 1px;
    font-family: sans-serif;
    font-weight: bold;
    line-height: 1.6;
}

/* ĐÁP ỨNG THIẾT BỊ DI ĐỘNG (RESPONSIVE) */
@media (max-width: 992px) {
    .menu-top .menu-btn, .menu-top a {
        padding: 8px 16px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .menu-top {
        padding: 8px 4px;
        display: grid;
        /* Tối ưu hiển thị thành 3 cột cân đối cho 9 nút trên di động, tránh tràn hàng dọc */
        grid-template-columns: repeat(3, 1fr); 
        gap: 6px;
    }
    .menu-top .menu-btn, .menu-top a {
        font-size: 13px;
        padding: 10px 2px;
        margin: 0;
        letter-spacing: 0px;
    }
    .silver-text { 
        font-size: 18px; 
        letter-spacing: 1px;
    }
    .footer {
        padding: 40px 15px;
    }
    .popup-content {
        padding: 20px;
        width: 95%;
    }
    .popup-title { font-size: 20px; }
}

@keyframes blinker {
    50% { opacity: 0.3; }
}

#subEventModal.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex !important; /* Ép buộc kích hoạt flexbox */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}


/* Hiệu ứng Viền Ma Thuật nhịp thở (Glow Pulse) Đăng Ký */
.mu-pulse-box {
    animation: border-pulse 2s infinite alternate ease-in-out;
}

@keyframes border-pulse {
    0% {
        border-color: #540a0a; /* Lúc mờ là màu đỏ sậm */
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    }
    100% {
        border-color: #ffcc00; /* Lúc sáng rực lên màu vàng kim */
        box-shadow: 0 0 15px rgba(255, 204, 0, 0.4), inset 0 0 10px rgba(255, 204, 0, 0.1);
    }
}

/* 7. Popup Tải Game */
/* Thiết lập hiệu ứng tráng gương (Shine/Mirror Effect) chu kỳ 1.5 giây liên tục */
.mu-mirror-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-30deg); /* Độ nghiêng vệt tráng gương */
    animation: mu-mirror-sweep 1.5s linear infinite;
}

@keyframes mu-mirror-sweep {
    0% {
        left: -150%;
    }
    70% {
        left: 150%; /* Vệt sáng lướt qua nhanh chóng */
    }
    100% {
        left: 150%; /* Chờ một nhịp nhỏ ở cuối chu kỳ 1.5s trước khi lặp lại */
    }
}