:root {
    --nav: #071244;
    --accent: #ff3b3b;
    --muted: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(255, 255, 255, 0.03);
    --glass: rgba(255, 255, 255, 0.06);
    --radius: 14px;
    --container: 1200px;
    --max-width: 1200px;
    --text: #e6eefb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: Inter, Arial;
    background: linear-gradient(180deg, #07123a 0%, #04102a 100%);
    color: var(--text)
}

/* Container */
.wrap {
    max-width: var(--container);
    margin: 0 auto;
    padding: 28px;
}

/* Header */
header {
    background: var(--nav);
    padding: 14px 20px;
    border-radius: 8px;
    position: relative;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.logo {
    color: #fff;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, #bfe7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 22px;
    z-index: 2;
}

/* Navigation */
nav {
    display: flex;
    gap: 18px;
    align-items: center;
    transition: all 0.3s ease;
}

nav a {
    color: #bcd3ff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #fff;
}

.btn-play {
    background: #ff4b4b;
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-play:hover {
    background: #ff3333;
    transform: translateY(-2px);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 3;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Ad Banner */
.ad-banner {
    margin: 20px 0;
    padding: 22px;
    border-radius: 10px;
    background: linear-gradient(90deg, #e6eefb11, #ffffff08);
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Hero Section */
.hero {
    background: var(--glass);
    padding: 18px;
    border-radius: var(--radius);
}

.hero .big-image {
    height: 360px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffd6b6, #e0f7ff);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    box-shadow: inset 0 -80px 120px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-size 0.5s ease;
}

.hero .big-image:hover {
    background-size: 110%;
}

.hero .big-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.3;
}

.badge {
    display: inline-block;
    background: var(--accent);
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero h1 {
    margin: 8px 0 10px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
}

.hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

/* Side Cards */
.side-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.side-card {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.side-card .thumb {
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-size 0.5s ease;
}

.side-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.side-card:hover .thumb {
    background-size: 110%;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.post:hover .img {
    background-size: 110%;
}

.post {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.post:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.post .img {
    height: 120px;
    border-radius: 8px;
    background: linear-gradient(90deg, #b2d9ff, #ffb3ec);
    margin-bottom: 10px;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-size 0.5s ease;
}

.post .badge, .blog-card .badge {
    position: absolute;
    top: 16px;
    left: 16px;
}

.post h3 {
    margin: 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.post .meta {
    font-size: 12px;
    color: #a9c0ee;
}

/* Categories */
.cats {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding: 36px 0 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: space-around;
}

.cats::-webkit-scrollbar {
    height: 6px;
}

.cats::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.cats::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cat {
    min-width: 104px;
    height: 104px;
    border-radius: 50%;
    background: linear-gradient(180deg, #2b6bff, #00b3ff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background-position: center;
    background-repeat: no-repeat;
}

.text-white {
    color: #ffffff;
}

.cat:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(43, 107, 255, 0.4);
}

/* Reviews Section */
.reviews {
    margin-top: 28px;
}

.reviews h2 {
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 700;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.review-card {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.review-card:hover {
    background-size: 110%;
    border-color: var(--accent);
}

.review-card .thumb {
    height: 120px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f7b7b7, #d0f0ff);
    margin-bottom: 10px;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-size 0.5s ease;
}

.review-card:hover .thumb {
    background-size: 110%;
}

.review-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0;
}

/* Footer */
footer {
    margin-top: 40px;
    padding: 28px;
    border-radius: 10px;
    background: linear-gradient(180deg, #03102a, #061a44);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-grid>div {
    flex: 1;
    min-width: 200px;
}

.footer-col h5 {
    color: #9fb7ff;
    font-weight: 700;
    margin-bottom: 12px;
}

.muted {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.6;
}

a.muted:hover {
   color: #ff4b4b;
}

.ellipsis {
    white-space: nowrap;      /* Prevents the text from wrapping to the next line */
    overflow: hidden;         /* Hides any text that overflows the element's box */
    text-overflow: ellipsis;
}

.ellipsis-2-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Number of lines to show */
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Optional: Ensure text wrapping if needed, default is normal */
    white-space: normal; 
}

.ellipsis-3-lines {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Number of lines to show */
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Optional: Ensure text wrapping if needed, default is normal */
    white-space: normal; 
}

/* Utility Classes */
.thumb {
    width: 100%;
    border-radius: 8px;
}

/* ============================================ */
/* RESPONSIVE DESIGN - TABLET (768px - 1024px) */
/* ============================================ */
@media(max-width:1024px) {
    .wrap {
        padding: 20px;
    }

    .main-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero .big-image {
        height: 320px;
    }

    .hero h1 {
        font-size: 24px;
    }

    aside {
        order: -1;
    }

    .side-cards {
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
    }

    .side-card {
        min-width: 280px;
        flex-shrink: 0;
    }
}

/* ============================================ */
/* RESPONSIVE DESIGN - MOBILE (< 768px) */
/* ============================================ */
@media(max-width:768px) {
    .wrap {
        padding: 16px;
    }

    /* Header Mobile */
    header {
        padding: 6px 10px;
    }

    .header-row {
        flex-wrap: nowrap;
    }

    .logo {
        font-size: 20px;
    }

    /* Mobile Navigation */
    .hamburger {
        display: flex;
    }

    nav#navMenu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(7, 18, 68, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px 30px;
        gap: 24px;
        z-index: 999;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    nav#navMenu.active {
        right: 0;
    }

    nav#navMenu a {
        font-size: 18px;
        padding: 8px 0;
        width: 100%;
    }

    .btn-play {
        width: 100%;
        text-align: center;
        padding: 14px;
        margin-top: 10px;
    }

    /* Overlay when menu is open */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
    }

    .menu-overlay.active {
        display: block;
    }

    /* Hero Section Mobile */
    .hero {
        padding: 14px;
    }

    .hero .big-image {
        height: 280px;
        padding: 16px;
    }

    .hero h1 {
        font-size: 20px;
    }

    .hero p {
        font-size: 13px;
    }

    /* Posts Grid Mobile */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .post .img {
        height: 160px;
    }

    /* Categories Mobile */
    .cats {
        gap: 10px;
        padding: 12px 0;
    }

    .cat {
        min-width: 70px;
        height: 70px;
        font-size: 14px;
    }

    /* Reviews Mobile */
    .reviews {
        margin-top: 24px;
    }

    .reviews h2 {
        font-size: 24px;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .review-card .thumb {
        height: 180px;
    }

    /* Side Cards Mobile */
    .side-cards {
        flex-direction: column;
    }

    .side-card {
        min-width: 100%;
    }

    /* Ad Banner Mobile */
    .ad-banner {
        padding: 16px;
        font-size: 14px;
    }

    /* Footer Mobile */
    footer {
        padding: 24px 16px;
        margin-top: 10px;
    }

    .footer-grid {
        flex-direction: column;
        gap: 20px;
    }

    .footer-grid>div {
        min-width: 100%;
    }
}

/* ============================================ */
/* RESPONSIVE DESIGN - SMALL MOBILE (< 480px) */
/* ============================================ */
@media(max-width:480px) {
    .wrap {
        padding: 12px;
    }

    .logo {
        font-size: 18px;
    }

    .hero .big-image {
        height: 240px;
        padding: 14px;
    }

    .hero h1 {
        font-size: 18px;
    }

    .badge {
        font-size: 10px;
        padding: 5px 8px;
    }

    .post h3 {
        font-size: 15px;
    }

    .post .meta {
        font-size: 11px;
    }

    .cat {
        min-width: 60px;
        height: 60px;
        font-size: 12px;
    }

    .review-card h4 {
        font-size: 16px;
    }

    nav#navMenu {
        width: 100%;
        right: -100%;
    }
}

/* ============================================ */
/* LANDSCAPE ORIENTATION */
/* ============================================ */
@media(max-height:500px) and (orientation:landscape) {
    .hero .big-image {
        height: 200px;
    }

    nav#navMenu {
        padding: 60px 30px 20px;
        overflow-y: auto;
    }
}

@media(max-width:768px) {
    .wrap {
        padding: 16px
    }

    .hamburger {
        display: flex!important;
    }

    nav#navMenu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(7, 18, 68, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 24px;
        transition: right 0.4s
    }

    nav#navMenu.active {
        right: 0
    }
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.post,
.review-card,
.side-card {
    animation: fadeIn 0.6s ease forwards;
}

.post:nth-child(1) {
    animation-delay: 0.1s
}

.post:nth-child(2) {
    animation-delay: 0.2s
}

.post:nth-child(3) {
    animation-delay: 0.3s
}

.post:nth-child(4) {
    animation-delay: 0.4s
}

.post:nth-child(5) {
    animation-delay: 0.5s
}

.post:nth-child(6) {
    animation-delay: 0.6s
}

a, a:hover {
    text-decoration: none;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 50px 0
}

.size-full {
    width: 100%;
}

.pagination li a,
.pagination li span {
    padding: 10px 16px;
    background: var(--card-bg);
    border-radius: 8px;
    color: #bcd3ff
}

.pagination>.disabled>a, .pagination>.disabled>a:focus, .pagination>.disabled>a:hover, .pagination>.disabled>span, .pagination>.disabled>span:focus, .pagination>.disabled>span:hover {
    background: var(--card-bg);
}

.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover {
    background: var(--accent)!important;
    border-color: var(--accent)!important;
}

.pagination li a.active,
.pagination li a:hover {
    background: var(--accent);
    color: #fff
}

.article-body img {
    height: auto;
}

.article-body li {
list-style: none;
}

#sticky-ads-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
  }
  
  #sticky-ads-bottom .ads-inner {
    position: relative;
    padding: 6px 0;
    max-width: 100%;
  }
  
  #sticky-ads-bottom .ads-close {
    position: absolute;
    top: -10px;
    right: 6px;
    background: #000;
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 24px;
  }
  .popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 12px; /* chống tràn sát mép mobile */
  }
  
  .popup-box {
    background: #fff;
    width: 100%;
    max-width: 360px;          /* khóa cứng cho mobile */
    max-height: 90vh;          /* không vượt màn hình */
    padding: 16px;
    border-radius: 14px;
    position: relative;
    animation: popupZoom .25s ease;
    overflow: auto;            /* phòng ads cao bất thường */
    box-sizing: border-box;
  }
  
  /* Nút X */
  .popup-close {
    position: absolute;
    right: 10px;
    top: 8px;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
  }
  
  /* Container ads GPT */
  .popup-box > div[id^="div-gpt-ad"] {
    width: 100% !important;
    min-width: 0 !important;   /* 🔥 FIX CHÍNH */
    display: flex;
    justify-content: center;
  }
  
  /* iframe Google Ads */
  .popup-box iframe {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Button */
  .popup-btn {
    margin-top: 14px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg,#ff6a00,#ff9500);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
  }
  
  @keyframes popupZoom {
    from { transform: scale(.9); opacity: 0 }
    to   { transform: scale(1); opacity: 1 }
  }