/* ===== Custom overrides ===== */


/* =========================
   1) SEARCH BAR
   ========================= */

.search-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 22px;
}

.search-card {
    width: min(680px, 92%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(49, 49, 105, .6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 30px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

.search-card .search-icon {
    width: 30px;
    height: 30px;
    display: inline-block;
    line-height: 1;
    background: url("../images/icon/search.svg") no-repeat center/contain;
}

.search-card input[type="search"] {
    flex: 1;
    height: 40px;
    background: transparent;
    border: 0;
    outline: 0;
    color: #fff;
    font-family: var(--poppins);
    font-size: 14px;
}

.search-card input::placeholder {
    color: rgba(255, 255, 255, .55);
}

.search-clear {
    background: #262653;
    border: 0;
    border-radius: 18px;
    padding: 6px 12px;
    color: #fff;
    cursor: pointer;
    transition: var(--anim);
}

.search-clear:hover {
    background: #313169;
}


/* =========================
   2) GAME CARDS (thumb + title + overlay)
   ========================= */

:root {
    --thumb-w: 1;
    /* đổi 16/9, 4/3... nếu muốn */
    --thumb-h: 1;
}

.listing .gm-item {
    display: flex;
}

.gm-item .gm-card {
    display: block;
    width: 100%;
    text-decoration: none;
}

.gm-item .thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: var(--thumb-w) / var(--thumb-h);
    border-radius: 15%;
    overflow: hidden;
    background: #16162e;
}

.gm-item .thumb-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .2s ease-out;
}

@media (hover:hover) {
    .gm-item .thumb-wrap:hover img {
        transform: scale(1.035);
    }
}

.gm-item .thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

@media (hover:hover) {
    .gm-item .thumb-wrap:hover .thumb-overlay {
        opacity: 1;
    }
}

.gm-item .btn-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    pointer-events: none;
    backdrop-filter: blur(3px);
}

.gm-item .btn-play::before {
    content: "▶";
    font-size: 14px;
    line-height: 1;
}

.gm-item .gm-title {
    margin-top: 8px;
    text-align: center;
    color: #fff;
    opacity: .92;
    font-size: 15px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    /* giữ hàng đều */
}


/* disable old title overlay if exists */

.gm-item .title-overlay {
    display: none !important;
}


/* =========================
   3) NO RESULTS
   ========================= */

.no-results {
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, .7);
    font-style: italic;
    padding: 20px 0;
    display: none;
}

.no-results.show {
    display: block;
}


/* =========================
   4) BRAND (logo + wordmark) — giữ bản cuối cùng, bỏ trùng
   ========================= */

.brand {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 10px 0 28px;
    text-decoration: none;
    background: transparent !important;
    width: 100%;
    max-width: 240px;
}

.brand-logo {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 18px;
    object-fit: contain;
    background: transparent !important;
    border: none !important;
    box-shadow: none;
    filter: drop-shadow(0 0 14px rgba(110, 201, 255, .55)) drop-shadow(0 0 24px rgba(167, 88, 250, .45));
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(110, 201, 255, .45)) drop-shadow(0 0 18px rgba(167, 88, 250, .35));
    }
    50% {
        filter: drop-shadow(0 0 18px rgba(110, 201, 255, .75)) drop-shadow(0 0 30px rgba(167, 88, 250, .6));
    }
}

.brand-wordmark {
    line-height: 1.05;
    padding-top: 6px;
}

.brand-top {
    display: block;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .4px;
    background: linear-gradient(90deg, #6ec9ff, #a758fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-bottom {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    border-radius: 12px;
    background: rgba(88, 100, 250, .55);
    box-shadow: 0 0 12px rgba(88, 100, 250, .6);
}


/* =========================
   5) CATEGORIES (sidebar style) + special items
   ========================= */

.sidebar .widget .side-menu.gm-cats {
    width: 100%;
}

.gm-cats .category-item+.category-item {
    margin-top: 10px;
}

.gm-cats .category-item a {
    display: block;
    width: 100%;
    height: 68px;
    padding: 20px 18px 16px 68px;
    font-size: 17px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow;
    transition: transform .18s ease, box-shadow .18s ease;
    border: 1px solid rgba(255, 255, 255, .06);
    background: rgba(25, 25, 60, .35);
    box-shadow: 0 0 10px rgba(255, 255, 255, .02) inset;
}

.gm-cats .category-item a::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(140, 88, 250, .18), rgba(40, 40, 92, .25));
    opacity: 0;
    transition: opacity .18s ease;
}

.gm-cats .category-item a:hover::before {
    opacity: 1;
}

.gm-cats .category-item a:hover {
    transform: translateX(3px) translateY(-3px);
    animation: catSoftPulse 1.6s ease-in-out;
    border-color: rgba(255, 255, 255, .15);
    background: rgba(40, 40, 90, .45);
    box-shadow: 0 8px 28px rgba(120, 100, 255, .20), inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 0 6px rgba(255, 255, 255, .05);
}


/* icon positioning inside category item */

.gm-cats .g-icon {
    background: transparent !important;
    box-shadow: none !important;
}

.gm-cats .category-item a .g-icon {
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
}

@keyframes blinkSoft {
    0%,
    100% {
        filter: drop-shadow(0 0 0 rgba(140, 88, 250, 0));
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(140, 88, 250, .8));
    }
}

.gm-cats .category-item a:hover .g-icon img {
    animation: blinkSoft 1.8s ease-in-out infinite;
}


/* idle float effect */

.gm-cats .category-item:nth-child(odd) a {
    animation: catFloat 6s ease-in-out infinite;
}

.gm-cats .category-item:nth-child(even) a {
    animation: catFloat 7s ease-in-out infinite;
    animation-delay: .6s;
}

@keyframes catSoftPulse {
    0%,
    100% {
        box-shadow: 0 6px 18px rgba(120, 100, 255, .12), inset 0 0 0 1px rgba(255, 255, 255, .05);
    }
    50% {
        box-shadow: 0 10px 28px rgba(110, 201, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .09);
    }
}

@keyframes catFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}


/* shine line */

.gm-cats .category-item a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient( 90deg, transparent 0%, rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, .06) 55%, transparent 100%);
    transform: translateX(-120%);
    transition: transform .6s ease;
    pointer-events: none;
}

.gm-cats .category-item a:hover::after,
.gm-cats .category-item a:focus-visible::after {
    transform: translateX(120%);
}


/* special flashing items (Discord + Tiktok) */

.special-glow a {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 255, 255, .25), rgba(255, 0, 255, .25));
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    animation: pulseGlow 1.5s ease-in-out infinite alternate;
    box-shadow: 0 0 20px rgba(140, 88, 250, .5);
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 8px rgba(140, 88, 250, .4), 0 0 16px rgba(0, 200, 255, .4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 200, .8), 0 0 40px rgba(0, 200, 255, .8);
        transform: scale(1.03);
    }
    100% {
        box-shadow: 0 0 8px rgba(140, 88, 250, .4), 0 0 16px rgba(0, 200, 255, .4);
        transform: scale(1);
    }
}

.special-glow .g-icon img {
    animation: iconBlink 1.4s ease-in-out infinite alternate;
}

@keyframes iconBlink {
    0%,
    100% {
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 1));
    }
}


/* reduced motion */

@media (prefers-reduced-motion: reduce) {
    .gm-cats .category-item a,
    .gm-cats .category-item:nth-child(odd) a,
    .gm-cats .category-item:nth-child(even) a {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    .gm-cats .category-item a::after {
        display: none !important;
    }
}


/* =========================
   6) FOOTER BUTTONS
   ========================= */

.footer-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-link {
    display: inline-block;
    padding: 10px 16px;
    font-size: 14px;
    color: #fff;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(49, 49, 105, .55);
    backdrop-filter: blur(4px);
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
    text-decoration: none;
}

.btn-link:hover {
    transform: translateY(-1px);
    background: rgba(79, 79, 105, .78);
    border-color: rgba(255, 255, 255, .28);
    box-shadow: 0 6px 22px rgba(0, 0, 0, .25);
    color: #fff;
}


/* =========================
   7) REQUEST / DISCORD BANNERS
   ========================= */

.form-banners {
    margin: 50px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-items: start;
    justify-items: center;
}

.form-banners .form-banner {
    margin: 0;
    width: 100%;
    max-width: 360px;
}

.form-banners .form-banner img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
    transition: transform .25s ease, box-shadow .25s ease;
    cursor: pointer;
}

.form-banners .form-banner img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
}

.form-banner p {
    margin-top: 1rem;
    font-size: 20px;
    opacity: .85;
}


/* =========================
   8) BURGER ICON (svg mask)
   ========================= */

.icon-burger,
.icon-burger:before {
    font-family: inherit !important;
    content: "" !important;
}

.icon-burger {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 0;
    color: #fff;
}

.icon-burger::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: currentColor;
    -webkit-mask: url("/assets/images/burger.svg") no-repeat center/contain;
    mask: url("/assets/images/burger.svg") no-repeat center/contain;
}

.burger:hover .icon-burger {
    color: #00A3FF;
}


/* =========================
   9) TOPBAR COMPACT (desktop) + mCustomScrollbar fix + align
   ========================= */

@media (min-width:1025px) {
    /* layout */
    .master {
        display: flex !important;
        flex-direction: column !important;
        float: none !important;
    }
    .g-content {
        width: 100% !important;
        float: none !important;
    }
    /* topbar */
    .sidebar {
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100px !important;
        padding: 0 18px !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 14px !important;
        z-index: 9999 !important;
        background: #262653 !important;
        border-bottom: 1px solid rgba(255, 255, 255, .06) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .18) !important;
    }
    .side-header {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: 0 0 auto !important;
    }
    .for-mobile {
        display: none !important;
    }
    /* menu horizontal */
    .side-menu {
        position: static !important;
        float: none !important;
        width: auto !important;
        max-height: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex: 1 1 auto !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        white-space: nowrap !important;
        padding: 0 6px !important;
        margin: 0 !important;
        justify-content: center;
    }
    .side-menu li {
        width: auto !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
    }
    .side-menu li a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        height: 36px !important;
        padding: 0 12px !important;
        border-radius: 12px !important;
        line-height: 1 !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        letter-spacing: .2px !important;
        color: rgba(255, 255, 255, .86) !important;
        background: rgba(255, 255, 255, .06) !important;
    }
    .side-menu li a:hover {
        background: rgba(255, 255, 255, .10) !important;
        color: #fff !important;
    }
    .side-menu li.active a {
        background: rgba(140, 88, 250, .28) !important;
        color: #fff !important;
    }
    /* kill old gradient bar */
    .side-menu li a::before {
        display: none !important;
    }
    /* icon + text align */
    .side-menu li a .g-icon {
        position: static !important;
        width: 18px !important;
        height: 18px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 6px !important;
        margin: 0 !important;
    }
    .side-menu li a .g-icon img {
        width: 18px !important;
        height: 18px !important;
        display: block !important;
        object-fit: contain !important;
    }
    .side-menu li a span {
        display: inline-block !important;
        white-space: nowrap !important;
        transform: translateY(-.5px) !important;
    }
    /* mCustomScrollbar wrapper: make it behave like flex row + hide tools */
    .side-menu>.mCustomScrollBox,
    .side-menu>.mCustomScrollBox>.mCSB_container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        width: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        white-space: nowrap !important;
        justify-content: center !important;
    }
    .side-menu .mCSB_container>li {
        width: auto !important;
        float: none !important;
        flex: 0 0 auto !important;
    }
    .side-menu .mCSB_scrollTools,
    .side-menu .mCSB_draggerContainer {
        display: none !important;
    }
    .side-menu .mCSB_container {
        position: static !important;
        transform: none !important;
    }
}


/* =========================
   RESPONSIVE TOPBAR: KHÔNG OVERFLOW, TỰ XUỐNG DÒNG
   ========================= */


/* breakpoint bạn có thể đổi: 1200 / 1024 / 900 tuỳ layout */

@media (max-width: 1800px) {
    /* topbar cho phép cao hơn để chứa nhiều dòng */
    .sidebar {
        /* height: auto !important; */
        padding: 10px 14px !important;
        align-items: center !important;
        /* tránh bị “ép giữa” khi có 2 dòng */
    }
    /* menu: cho xuống dòng, tắt overflow ngang */
    .side-menu {
        flex-wrap: wrap !important;
        white-space: normal !important;
        overflow: visible !important;
        gap: 8px !important;
    }
    /* các item/pill gọn hơn để dễ xuống dòng */
    .side-menu li a {
        height: 34px !important;
        padding: 0 10px !important;
        font-size: 12.5px !important;
        border-radius: 12px !important;
    }
    /* --- QUAN TRỌNG: nếu có mCustomScrollbar wrapper, ép wrapper cũng wrap --- */
    .side-menu>.mCustomScrollBox,
    .side-menu>.mCustomScrollBox>.mCSB_container {
        display: flex !important;
        flex-wrap: wrap !important;
        white-space: normal !important;
        width: 100% !important;
        overflow: visible !important;
    }
    /* tắt hẳn các tool/scrollbar của plugin */
    .side-menu .mCSB_scrollTools,
    .side-menu .mCSB_draggerContainer {
        display: none !important;
    }
}

@media (max-width: 1040px) {
    /* topbar cho phép cao hơn để chứa nhiều dòng */
    .sidebar {
        height: auto !important;
    }
}


/* nhỏ hơn nữa thì giảm spacing + icon cho “đỡ chật” */

@media (max-width: 768px) {
    .sidebar {
        gap: 10px !important;
    }
    .side-menu {
        gap: 6px !important;
        overflow: visible !important;
    }
    .side-menu li a {
        height: 32px !important;
        padding: 0 9px !important;
        font-size: 12px !important;
    }
    .side-menu li a .g-icon,
    .side-menu li a .g-icon img {
        width: 16px !important;
        height: 16px !important;
    }
}


/* =========================
   10) RESPONSIVE (small screens)
   ========================= */

@media (max-width:768px) {
    .icon-burger {
        width: 24px;
        height: 24px;
    }
    .form-banners {
        grid-template-columns: 1fr;
    }
    .form-banners .form-banner {
        max-width: 320px;
    }
    .brand-logo {
        width: 56px;
        height: 56px;
    }
    .brand-top {
        font-size: 18px;
    }
    .brand-bottom {
        font-size: 12px;
        padding: 2px 8px;
    }
    .gm-cats .category-item a {
        height: 62px;
        padding-left: 64px;
        font-size: 16px;
    }
    .gm-cats .category-item a .g-icon {
        top: 12px;
        left: 12px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width:640px) {
    .search-card {
        gap: 8px;
        padding: 8px 12px;
    }
    .search-clear {
        padding: 6px 10px;
    }
    .gm-item .gm-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
        min-height: 2.6em;
    }
}


/* =========================
   11) CONTACT PAGE
   ========================= */

.contact-content,
.contact-content p {
    font-size: 25px;
}


/* =========================
   MOBILE MENU (burger): làm category gọn + icon đẹp
   ========================= */

@media (max-width: 1024px) {
    /* 1) Tắt các hiệu ứng "nhún/float" gây xấu + dễ bị cắt */
    .gm-cats .category-item a,
    .gm-cats .category-item:nth-child(odd) a,
    .gm-cats .category-item:nth-child(even) a {
        animation: none !important;
        transform: none !important;
    }
    .gm-cats .category-item a:hover {
        transform: none !important;
    }
    /* 2) Item dạng hàng ngang gọn (icon trái, chữ phải) */
    .gm-cats .category-item a {
        height: 54px !important;
        padding: 0 14px !important;
        border-radius: 14px !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        background: rgba(255, 255, 255, .05) !important;
        border: 1px solid rgba(255, 255, 255, .08) !important;
        box-shadow: none !important;
    }
    /* 3) Xóa pseudo gradient/shine kiểu desktop để đỡ “thô” */
    .gm-cats .category-item a::before,
    .gm-cats .category-item a::after {
        display: none !important;
    }
    /* 4) Icon: bỏ absolute, cho thành ô vuông đẹp */
    .gm-cats .category-item a .g-icon {
        position: static !important;
        width: 34px !important;
        height: 34px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 12px !important;
        background: rgba(140, 88, 250, .18) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .18) !important;
    }
    .gm-cats .category-item a .g-icon img {
        width: 20px !important;
        height: 20px !important;
        object-fit: contain !important;
        display: block !important;
    }
    /* 5) Text: cân baseline + không bị tụt */
    .gm-cats .category-item a {
        font-size: 15px !important;
        line-height: 1 !important;
    }
    .gm-cats .category-item a span {
        display: inline-block !important;
        transform: translateY(-.5px) !important;
        white-space: nowrap !important;
    }
    /* 6) Special items (Discord/Tiktok) cũng gọn, không nhấp nháy quá mạnh */
    .special-glow a {
        animation: none !important;
        background: rgba(0, 255, 255, .10) !important;
        border-color: rgba(255, 255, 255, .14) !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, .20) !important;
    }
}


/* nhỏ hơn nữa: tăng tap-target nhưng vẫn gọn */

@media (max-width: 480px) {
    .gm-cats .category-item a {
        height: 56px !important;
        padding: 0 12px !important;
        font-size: 14px !important;
    }
    .gm-cats .category-item a .g-icon {
        width: 36px !important;
        height: 36px !important;
    }
}