@import url('https://fonts.com/css2?family=Poppins:wght@400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    background: radial-gradient(circle at 50% 120%, #0a0e1a, #00020a);
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 15% 85%, rgba(0, 255, 234, 0.1), transparent 50%), radial-gradient(circle at 85% 15%, rgba(255, 0, 102, 0.1), transparent 50%), #000411;
    background-size: 200% 200%;
    animation: cosmic-shift 25s infinite alternate ease-in-out;
    z-index: -4;
    pointer-events: none;
}

@keyframes cosmic-shift {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 100% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}

.earth-gif {
    position: fixed;
    width: 900px;
    height: 900px;
    bottom: -350px;
    right: -350px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: inset 50px 50px 100px rgba(0, 0, 0, 0.95), inset -50px -50px 100px rgba(255, 255, 255, 0.2), 0 0 120px rgba(0, 150, 255, 0.5);
    z-index: -3;
    pointer-events: none;
    filter: brightness(1.1) saturate(1.2);
    transform: none;
}

.particles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    background-image: none;
    background-size: 45px 45px;
}

.particles span {
    position: absolute;
    background: #ffffff;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    box-shadow: 0 0 5px #ffffff, 0 0 10px #00ffea;
    animation: float-star 12s linear infinite;
    opacity: 0.6;
}

@keyframes float-star {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
}

.particles span:nth-child(1) {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.particles span:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 1s;
}

.particles span:nth-child(3) {
    top: 50%;
    left: 30%;
    animation-delay: 2s;
}

.particles span:nth-child(4) {
    top: 80%;
    left: 50%;
    animation-delay: 3s;
}

.particles span:nth-child(5) {
    top: 30%;
    left: 70%;
    animation-delay: 4s;
}

.shooting-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.shooting-star-js {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffffff, 0 0 20px #00ffea, 0 0 30px #ff00ff;
    opacity: 0;
    pointer-events: none;
    animation: twinkle-star 4s linear infinite alternate;
    transform-origin: center center;
}

@keyframes twinkle-star {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }

    100% {
        opacity: 0.3;
        transform: scale(0.9);
    }
}

.shooting-star-tail-js {
    display: none;
}

.logo-container h1 {
    font-size: 4rem;
    font-weight: 800;
    display: inline-block;
}

.logo-container h1 span {
    background: linear-gradient(90deg, #ff00ff, #00b4ff, #ffcc00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    animation: rgb-flicker 1.5s infinite alternate;
}

@keyframes rgb-flicker {
    0% {
        text-shadow:
            0 0 3px #ff0000,
            0 0 6px #ff0000;
        filter: brightness(1);
    }

    33% {
        text-shadow:
            0 0 3px #00ff00,
            0 0 6px #00ff00;
        filter: brightness(1.2);
    }

    66% {
        text-shadow:
            0 0 3px #0000ff,
            0 0 6px #0000ff;
        filter: brightness(1.2);
    }

    100% {
        text-shadow:
            0 0 3px #ff00ff,
            0 0 6px #ff00ff;
        filter: brightness(1);
    }
}

.main-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    flex: 1 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.games-section,
.posts-section {
    flex: 1 1 100%;
    margin-bottom: 2rem;
}

.card,
.post-card {
    background: rgba(20, 25, 40, 0.8);
    border-radius: 15px;
    transition: transform 0.3s, background 0.3s, box-shadow 0.4s;
    display: flex;
    flex-direction: column;
}

.card {
    padding: 1rem;
    width: calc(50% - 1rem);
}

.card:hover,
.post-card:hover {
    transform: scale(1.05);
    background: rgba(0, 180, 255, 0.15);
    box-shadow: 0 0 20px #00b4ff, 0 0 40px #ff0066;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.post-card img {
    width: 100%;
    /* ĐÃ SỬA: Tăng chiều cao để ảnh có không gian hiển thị lớn hơn */
    height: 250px;
    /* ĐÃ SỬA: Dùng 'contain' để ảnh hiển thị full nội dung, không bị cắt */
    object-fit: contain;
    border-radius: 15px 15px 0 0;
}

.post-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.post-content h3 {
    font-size: 1.2rem;
    color: #00b4ff;
    margin: 0;
}

.post-meta {
    font-size: 12px;
    color: #99aacc;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 5px;
}

.post-meta span {
    margin-right: 8px;
}

.read-btn,
.download-btn {
    text-decoration: none;
    padding: 6px 12px;
    font-size: 0.9rem;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: 0.3s;
    margin-top: auto;
}

.download-btn {
    background: linear-gradient(90deg, #00b4ff, #ff0066);
    box-shadow: 0 0 10px #00b4ff70, 0 0 20px #ff006670;
}

.read-btn {
    background: #ff0000;
}

.download-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px #00b4ff, 0 0 40px #ff0066, 0 0 60px #00ffea;
}

.read-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #ff0000, 0 0 30px #ff6666;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(0, 180, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.3s;
    margin: 0 5px;
}

.pagination a:hover {
    background: linear-gradient(90deg, #00b4ff, #ff0066);
    box-shadow: 0 0 15px #00b4ff, 0 0 30px #ff0066;
}

.no-result {
    text-align: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    font-size: 1.2rem;
    color: #ff6666;
}

@media(max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .card {
        width: 100%;
    }
}

nav.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 2rem;
    background: rgba(20, 25, 40, 0.85);
    position: sticky;
    top: 0;
    z-index: 10;
}

#notification-popup {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

#notification-popup.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

#notification-popup.closing {
    opacity: 0;
    pointer-events: none;
}

.notification-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

.notification-content {
    position: relative;
    z-index: 2;
    background: rgba(20, 25, 40, 0.97);
    border-radius: 14px;
    padding: 22px;
    color: #fff;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
    animation: popupSlideIn 0.3s ease;
    overflow-y: auto;
    max-height: 80vh;
}

@keyframes popupSlideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-content h2 {
    color: #00b4ff;
    font-size: 1.4rem;
    margin-bottom: 10px;
    text-align: center;
}

.notification-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 6px;
}

.notification-body::-webkit-scrollbar {
    width: 6px;
}

.notification-body::-webkit-scrollbar-thumb {
    background: #00b4ff;
    border-radius: 6px;
}

.popup-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.popup-buttons button {
    flex: 1;
    margin: 0 5px;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #fff;
    transition: 0.3s;
}

.close-popup {
    background: #ff0033;
}

.close-popup:hover {
    background: #ff4d6d;
}

.hide-3h {
    background: linear-gradient(90deg, #00b4ff, #ff0066);
}

.hide-3h:hover {
    filter: brightness(1.2);
}

@media (max-width: 480px) {
    .notification-content {
        width: 92%;
        padding: 18px;
    }
}