/* Mobile & Puffin Pro Optimization */

/* Tắt animations phức tạp trên mobile để tăng hiệu suất */
@media (max-width: 768px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    /* Giảm animation cho fireworks trên mobile */
    .newyear-container .firework,
    .newyear-container .explosion,
    .newyear-container .sparkle {
        animation-duration: 3s !important;
        will-change: auto;
    }

    /* Tối ưu touch cho Puffin */
    a, button, .server-link, .tab-btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
        min-height: 44px;
        min-width: 44px;
    }

    /* Tăng kích thước vùng chạm */
    .server-item {
        margin-bottom: 12px;
    }

    .server-link {
        padding: 16px !important;
        min-height: 60px;
    }

    /* Tối ưu scroll */
    .server-list,
    .rank-table-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Giảm độ phức tạp của gradient */
    .recharge-section,
    .tab-btn,
    .server-link {
        background-image: none !important;
        background-color: #fff !important;
    }

    /* Tắt shadow phức tạp */
    .main-container,
    .tab-navigation,
    .server-link {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    }
}

/* Puffin Pro specific optimizations */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
    /* Giảm độ phức tạp render cho Puffin cloud rendering */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }

    /* Tối ưu font rendering */
    body, * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeSpeed;
    }

    /* Giảm blur và filter effects */
    *[style*="filter"],
    *[style*="backdrop-filter"] {
        filter: none !important;
        backdrop-filter: none !important;
    }
}

/* Tối ưu cho màn hình nhỏ */
@media (max-width: 480px) {
    .content-title {
        font-size: 18px !important;
    }

    .recharge-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .tab-btn span {
        font-size: 13px;
    }

    /* Giảm padding để tiết kiệm không gian */
    .main-container {
        padding: 10px !important;
    }

    .tab-content {
        padding: 15px 10px !important;
    }
}

/* Performance boost - Reduce repaints */
.server-link,
.tab-btn,
.rank-row {
    contain: layout style paint;
}

/* Lazy load optimization */
img[loading="lazy"] {
    min-height: 100px;
    background: #f0f0f0;
}
