/* ==========================================================================
   Heavenfall Mobile Responsiveness Stylesheet
   ========================================================================== */

html, body {
    max-width: 100%;
    /* overflow-x: hidden; */
}

@media screen and (max-width: 991px) {
    /* ── CONTAINER ── */
    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    .tab-btn-img {
        display: none !important;
    }

    /* ── FIXED & ORDINARY NAVBAR ── */
    .hero-main {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 12px 20px !important;
        margin-top: 0 !important;
        column-gap: 16px;
    }

    .hero-middle {
        display: none !important;
    }

    .hero-left {
        display: none !important;
    }

    /* Keep language switcher and menu button aligned */
    .hero-right {
        order: 2;
        flex: 0 0 auto;
    }

    /* Hide redundant elements in header list on mobile */
    .hero-right ul {
        column-gap: 12px !important;
    }

    .hero-right ul li:nth-of-type(n+2) {
        display: none !important;
    }

    .menu-btn {
        display: flex !important;
        order: 1;
        flex-shrink: 0;
    }

    /* Adjust fixed navbar height padding */
    .menu20-fixed .hero-main.menu20 {
        padding: 10px 15px !important;
    }

    /* ── HERO LOGO SECTION ── */
    .hero-logo-wrapper {
        grid-template-columns: 1fr !important;
        text-align: center;
        row-gap: 20px;
    }

    .hero-logo-left {
        display: flex;
        justify-content: center;
    }

    .hero-logo-left img {
        top: 0 !important;
        max-width: 280px !important;
        transform: none !important;
        margin: 0 auto;
    }

    .hero-logo-right {
        display: flex;
        justify-content: center;
    }

    .hero-logo-right img {
        left: 0 !important;
        top: 0 !important;
        max-height: 380px !important;
        margin: 0 auto;
    }

    /* ── NEWS PAGE / CARD STYLES ── */
    .news-main {
        grid-template-columns: 1fr !important;
        row-gap: 30px;
    }

    .news-flex {
        grid-template-columns: 1fr !important;
        row-gap: 12px;
        align-items: flex-start;
    }

    .news-col-left {
        max-width: 100%;
    }

    .news-col-left img {
        width: 100%;
        max-height: 250px;
        object-fit: cover;
    }

    .tab-buttons ul {
        flex-direction: column !important;
        align-items: stretch !important;
        row-gap: 8px;
    }

    .tab-buttons ul li a {
        display: flex !important;
        justify-content: center;
        width: 100%;
        position: relative !important;
    }

    .tab-btn-img img {
        width: auto !important;
        max-width: 160px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: -5px !important;
    }

    .news-section-heading h2 {
        font-size: 26px !important;
    }

    /* ── TOP PLAYERS & TABLES ── */
    .player-main {
        grid-template-columns: 1fr !important;
        row-gap: 30px;
    }

    .player-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ── CHARACTER PHASE SLIDER ── */
    .custom-slider {
        display: flex !important;
        flex-direction: column !important;
        row-gap: 20px;
        width: 100% !important;
    }

    .slider-left {
        width: 100% !important;
        flex-direction: row !important;
        justify-content: center !important;
        column-gap: 10px;
    }

    .slider-left .controls {
        display: none !important; /* Hide vertical arrow controls on mobile */
    }

    .indicator-wrapper {
        width: 100% !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .indicators {
        flex-direction: row !important;
        justify-content: center;
        column-gap: 12px;
        width: max-content;
        margin: 0 auto;
        padding: 5px 0;
    }

    .indicator {
        padding: 8px 12px !important;
        width: auto !important;
        margin-bottom: 0 !important;
        flex-shrink: 0;
    }

    .indicator h4 {
        font-size: 11px !important;
    }

    .slider-right {
        width: 100% !important;
    }

    .mage-right {
        padding: 20px 10px !important;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .mage-right h2 {
        font-size: 28px !important;
    }

    .mage-right p {
        margin: 15px auto 0 !important;
        text-align: center;
    }

    .menga-line {
        display: none !important;
    }

    .maga-mian-img {
        position: relative !important;
        margin: 20px auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
        height: auto !important;
    }

    .maga-mian-img img {
        position: relative !important;
        display: block !important;
        margin: 0 auto !important;
        max-width: 250px !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        width: auto !important;
        height: auto !important;
    }

    /* ── SOCIAL MEDIA GRID ── */
    .social-midea-main {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    /* ── ITEM SHOP STYLING ── */
    .shop-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: 16px !important;
    }

    .shop-sidebar {
        width: 100% !important;
        position: static !important;
    }

    .shop-layout {
        grid-template-columns: 1fr !important;
        row-gap: 30px;
    }

    /* ── DOWNLOAD PAGE ── */
    .dl-grid {
        grid-template-columns: 1fr !important;
        row-gap: 25px;
    }

    /* ── RANKING PAGE FILTERS ── */
    .rk-filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        row-gap: 14px;
        padding: 12px !important;
    }

    .rk-tabs {
        flex-direction: column !important;
        align-items: stretch !important;
        row-gap: 6px;
    }

    .rk-tab {
        justify-content: center;
        width: 100%;
    }

    .rk-controls {
        width: 100%;
    }

    .rk-search-wrap {
        width: 100%;
    }

    #rkSearch {
        width: 100% !important;
    }

    .rk-hero-content {
        flex-direction: column !important;
        text-align: center;
        row-gap: 20px;
    }

    .rk-hero-left h1 {
        font-size: 34px !important;
    }

    .rk-stats-inner {
        grid-template-columns: repeat(2, 1fr) !important;
        display: grid !important;
    }

    .rk-stat {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: 12px 15px !important;
        justify-content: center;
    }

    /* ── USER ACCOUNT DASHBOARD ── */
    .ac-tabs-nav-inner {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
    }

    .ac-nav-tab {
        flex: 1 1 calc(50% - 8px) !important;
        justify-content: center;
        font-size: 11px !important;
        padding: 10px 12px !important;
    }

    .ac-hero-content {
        flex-direction: column !important;
        text-align: center;
        row-gap: 20px;
    }

    .ac-hero-stats {
        width: 100%;
        align-items: center !important;
    }

    .ac-coin-strip {
        width: 100%;
        justify-content: center;
    }

    .ac-hero-btn {
        width: 100%;
        justify-content: center;
    }

    /* ── FOOTER STYLING ── */
    .footer-main ul {
        flex-wrap: wrap;
        justify-content: center;
        column-gap: 16px !important;
        row-gap: 10px !important;
    }

    .copyright-item ul {
        flex-wrap: wrap;
        justify-content: center;
        column-gap: 12px !important;
        row-gap: 8px !important;
    }

    .copyright-item ul li span {
        display: none !important; /* Hide static separators on mobile wrapper lines */
    }

    /* ── LOGIN/REGISTER MODALS ── */
    .modal-box-hf {
        width: 90% !important;
        padding: 0 !important;
        margin: 60px auto 30px !important;
    }

    .login-item {
        padding: 30px 22px !important;
    }

    .input-flex {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        column-gap: 12px !important;
    }

    .input-item-left {
        width: 40px !important;
        border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .input-item-right {
        flex: 1 !important;
        width: auto !important;
        padding-left: 0 !important;
    }
}

@media screen and (max-width: 640px) {
    /* More compact columns for extra small phones */
    .social-midea-main {
        grid-template-columns: 1fr !important;
    }


    .ac-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .ac-chars-grid {
        grid-template-columns: 1fr !important;
    }

    .ac-tabs-nav-inner {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
    }

    .ac-nav-tab {
        flex: 0 0 auto !important;
        padding: 10px 14px !important;
    }

    .rk-stats-inner {
        grid-template-columns: 1fr !important;
    }

    .rk-hero-left h1 {
        font-size: 28px !important;
    }
}

/* Unified responsive navigation: switch the entire header at one breakpoint. */
@media screen and (max-width: 1100px) {
    .menu20-fixed {
        display: block !important;
        height: 60px !important;
        background: transparent !important;
        border-bottom: none !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    .menu20-fixed .hero-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .menu20-fixed .hero-main.menu20 {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        height: 60px !important;
        min-height: 60px !important;
        margin-top: 0 !important;
        padding: 0 20px !important;
        background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0)) !important;
    }

    .menu20-fixed .menu-btn {
        position: relative !important;
        z-index: 3 !important;
        display: flex !important;
        order: 1 !important;
        flex-shrink: 0 !important;
    }

    .menu20-fixed .nav-brand {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        display: flex !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        transform: translate(-50%, -50%) !important;
    }

    .menu20-fixed .nav-brand img {
        width: auto !important;
        height: 100px !important;
        max-height: 100px !important;
        transform: none !important;
        filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .7)) !important;
    }

    .menu20-fixed .hero-left,
    .menu20-fixed .hero-middle,
    .menu20-fixed .hero-right {
        display: none !important;
    }

    .mobile-nav ul li.hf-logout-link {
        border-bottom: none !important;
        padding: 18px 0 0 !important;
    }

    .mobile-nav .hf-logout-link button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px;
        width: 100% !important;
        min-width: 0 !important;
        padding: 14px 0 !important;
        border: 1px solid rgba(255, 255, 255, .18) !important;
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        color: #e8e0d2 !important;
        text-align: center !important;
    }

    .hero-area {
        padding-top: 60px !important;
    }
}
