* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --secondary: #2563eb;
    --accent: #60a5fa;
    --bg-dark: #f0f7ff;
    --bg-card: #ffffff;
    --bg-surface: #f8fbff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
}

.site-logo i {
    color: var(--primary);
    font-size: 1.75rem;
}

.site-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 250px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

.search-btn:hover {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-list a {
    display: block;
    padding: 1rem;
    color: var(--text-secondary);
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.mobile-nav-list a:hover,
.mobile-nav-list a.active {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.mobile-nav .search-wrapper {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.mobile-nav .search-input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    min-height: 44px;
}

.mobile-nav .search-btn {
    padding: 0.625rem 1rem;
    min-width: 44px;
    min-height: 44px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

.home-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(96, 165, 250, 0.08));
    border-radius: 16px;
    padding: 4rem 3rem;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.banner-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.banner-badge {
    display: inline-block;
    background: var(--primary);
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.banner-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.banner-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.banner-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.banner-stat {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));-webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.banner-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.banner-btn-primary {
    background: var(--primary);
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.banner-btn-primary i {
    color: #ffffff;
}

.banner-btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

.banner-btn-primary i {
    color: #ffffff;
}

.banner-btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--border-color);
}

.banner-btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.banner-visual {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-icon {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    animation: floatIcon 6s ease-in-out infinite;
}

.floating-icon.icon-1 {
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.floating-icon.icon-2 {
    top: 50%;
    right: 30%;
    animation-delay: 2s;
}

.floating-icon.icon-3 {
    top: 70%;
    right: 15%;
    animation-delay: 4s;
}

.floating-icon.icon-4 {
    top: 40%;
    right: 5%;
    animation-delay: 1s;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

.home-section {
    margin-bottom: 4rem;
}

.section-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.section-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.section-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    padding: 0.35rem 1rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.section-title-modern {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.section-link-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.1);
}

.section-link-modern:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--secondary);
    gap: 0.75rem;
}

.section-link-modern i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.section-link-modern:hover i {
    transform: translateX(4px);
}

.home-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.home-featured {
    margin-bottom: 4rem;
}

.home-featured-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 1.25rem;
    align-items: stretch;
}

.home-featured-grid .game-item {
    grid-column: span 1;
    grid-row: span 1;
}

.home-featured-grid .game-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.home-featured-grid .game-item:nth-child(4) {
    grid-column: span 2;
    grid-row: span 1;
}

.home-featured-grid .game-item:nth-child(7) {
    grid-column: span 1;
    grid-row: span 2;
}

.home-featured-grid .game-item:nth-child(10) {
    grid-column: span 2;
    grid-row: span 1;
}

.home-featured-grid .game-item:nth-child(13) {
    grid-column: span 2;
    grid-row: span 1;
}

.home-featured-grid .game-item:nth-child(14),
.home-featured-grid .game-item:nth-child(15) {
    grid-column: span 1;
    grid-row: span 1;
}

.home-quick-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.quick-nav-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.quick-nav-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    border-color: var(--primary);
}

.quick-nav-item:hover::before {
    transform: scaleX(1);
}

.quick-nav-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.quick-nav-item:hover .quick-nav-icon {
    transform: scale(1.1) rotate(5deg);
}

.quick-nav-text {
    flex: 1;
}

.quick-nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.quick-nav-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.home-categories-preview {
    margin-bottom: 4rem;
}

.categories-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.category-preview-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-preview-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.category-preview-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    border-color: var(--primary);
}

.category-preview-item:hover::before {
    transform: scaleX(1);
}

.category-preview-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.category-preview-item:hover .category-preview-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    transform: scale(1.1);
}

.category-preview-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.category-preview-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.page-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));-webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    align-items: start;
}

.games-container > .game-item,
.games-container > div {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
}


.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}



@media (max-width: 1200px) {
    .home-featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .home-featured-grid .game-item {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .home-featured-grid .game-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }
    
    .home-featured-grid .game-item:nth-child(10),
    .home-featured-grid .game-item:nth-child(13) {
        grid-column: span 2;
    }
    
    .home-split {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 900px) {
    .home-featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .home-featured-grid .game-item {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
    
    .banner-title {
        font-size: 2rem;
    }
    
    .banner-text {
        font-size: 1rem;
    }
    
    .banner-visual {
        display: none;
    }
    
    .banner-stats {
        gap: 2rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .section-title-modern {
        font-size: 1.5rem;
    }
    
    .home-quick-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .quick-nav-item {
        padding: 1.25rem;
    }
    
    .quick-nav-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .categories-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
}

.category-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.75rem 1.25rem;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(6, 182, 212, 0.05));
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
    border: 2px solid var(--border-color);
}

.category-card:hover .category-icon {
    transform: scale(1.15) rotate(5deg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.category-icon i {
    font-size: 2rem;
    color: var(--text-primary);
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.category-card:hover .category-icon i {
    filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.5));
}


.category-info {
    position: relative;
    z-index: 1;
    width: 100%;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.category-card:hover .category-name {
    color: var(--primary);
}

.category-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.category-count::before {
    content: '🎮';
    font-size: 0.9rem;
}


.games-container .game-item {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 0;
    grid-column: span 1 !important;
    grid-row: span 1 !important;
}

.games-container .game-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15), 0 4px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.game-thumb {
    width: 100%;
    padding-top: 75%;
    position: relative;
    overflow: hidden;
    background: var(--bg-surface);
    z-index: 1;
    flex-shrink: 0;
}

.game-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.games-container .game-item:hover .game-thumb img {
    transform: scale(1.1);
}

.game-info {
    padding: 1.25rem;
    z-index: 1;
    position: relative;
    background: var(--bg-surface);
    transition: background 0.4s ease;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.game-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.8em;
    flex-shrink: 0;
}

.game-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: auto;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-rating .stars {
    color: var(--secondary);
}

.game-reviews {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-reviews::before {
    content: '💬';
    font-size: 0.9rem;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    font-size: 0;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-45deg);
}

.back-to-top::before {
    content: '▲';
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
    color: #ffffff;
    transform: rotate(45deg);
    display: block;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    transform: rotate(-45deg) translateY(-6px) scale(1.05);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
}

.loading-more {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    grid-column: 1 / -1 !important;
    width: 100%;
    grid-row: span 1 !important;
}

.loading-more::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin-left: 0.75rem;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.save-btn-small {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
    padding: 0;
    margin: 0;
}

.save-btn-small:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--primary);
    transform: scale(1.1);
}

.save-btn-small i {
    transition: color 0.3s ease;
    font-size: 1rem;
}

.save-btn-small.saved {
    background: rgba(59, 130, 246, 0.8);
    border-color: var(--primary);
}

.save-btn-small.saved i {
    color: var(--text-primary);
}

.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 2rem 1.5rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

.footer-block {
    display: flex;
    flex-direction: column;
}

.footer-block h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-block a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-block a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

@media (max-width: 768px) {
    .header-inner {
        padding: 1rem;
    }

    .site-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .search-input {
        width: 180px;
    }

    .main-wrapper {
        padding: 1rem;
    }

    .games-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .categories-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
    }
    
    .category-icon i {
        font-size: 1.75rem;
    }
    
    .category-card {
        padding: 1.5rem 1rem;
    }
    
    .home-title {
        font-size: 1.75rem;
    }
    
    .home-subtitle {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .section-link {
        font-size: 0.85rem;
    }
    
    .section-with-bg {
        padding: 1.5rem;
    }
    
    .section-description {
        margin-left: 0;
    }
    
    .site-footer {
        padding: 2rem 1rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .footer-bottom {
        padding: 1rem 1rem 0;
    }
}



    
    .section,
    .games-section {
        margin-bottom: 2rem !important;
    }
    
    .games-grid,
    .featured-grid {
        gap: 0.75rem !important;
    }
    
    .item-info,
    .game-card-content {
        padding: 0.875rem 0.75rem !important;
    }
    
    .section-title {
        margin-bottom: 0.75rem !important;
    }
}


/* ============================================
   移动端导航栏完整修复 (480px及以下)
   ============================================ */
@media (max-width: 480px) {
    /* 导航栏容器 */
    .top-nav,
    .nav-bar,
    .header,
    .site-header {
        padding: 0.5rem 0.75rem !important;
        min-height: 56px;
    }
    
    /* 导航栏包装器 - 关键修复 */
    .nav-wrapper,
    .header-container,
    .nav-content,
    .header-inner {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        flex-wrap: nowrap !important;
    }
    
    /* Logo和品牌 - 左侧 */
    .brand,
    .site-logo,
    .logo-wrapper,
    .brand-logo,
    .logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        font-size: 0.875rem !important;
        font-weight: 600;
        flex: 0 1 auto !important;
        min-width: 0;
        max-width: calc(100% - 50px);
        overflow: hidden;
    }
    
    .brand span,
    .site-logo span,
    .logo-wrapper span,
    .brand-logo span,
    .logo span {
        font-size: 0.875rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .brand img,
    .site-logo img,
    .logo-wrapper img,
    .brand-logo img,
    .logo img {
        height: 28px !important;
        width: auto !important;
        flex-shrink: 0;
    }
    
    /* 搜索框 - 导航栏中隐藏 */
    .search-wrapper,
    .search-container,
    .search-box {
        display: none !important;
    }
    
    /* 导航菜单 - 隐藏 */
    .nav-menu,
    .nav-links,
    .site-nav,
    .nav-actions,
    nav > ul {
        display: none !important;
    }
    
    /* 移动菜单按钮 - 右侧显示 */
    .mobile-menu-btn,
    .mobile-menu-toggle,
    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer;
        z-index: 1001;
        order: 999;
    }
    
    .mobile-menu-btn span,
    .menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: currentColor;
        margin: 3px 0;
        transition: all 0.3s;
    }
    
    /* 移动菜单中的搜索框 */
    .mobile-nav .search-wrapper,
    .mobile-nav .search-container,
    .mobile-menu .search-wrapper {
        display: flex !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
        border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1)) !important;
        gap: 0.5rem !important;
        box-sizing: border-box !important;
    }
    
    .mobile-nav .search-input,
    .mobile-menu .search-input {
        flex: 1 !important;
        padding: 0.625rem 0.75rem !important;
        font-size: 14px !important;
        border-radius: 6px !important;
        border: 1px solid var(--border, rgba(255, 255, 255, 0.2)) !important;
        background: rgba(255, 255, 255, 0.1) !important;
        color: var(--text-main, #ffffff) !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
    }
    
    .mobile-nav .search-btn,
    .mobile-menu .search-btn {
        padding: 0.625rem 1rem !important;
        min-width: 44px !important;
        min-height: 44px !important;
        flex-shrink: 0 !important;
    }
}

/* ============================================
   中等屏幕导航栏优化 (768px及以下)
   ============================================ */
@media (max-width: 768px) {
    .top-nav,
    .nav-bar,
    .header,
    .site-header {
        padding: 0.75rem 1rem;
    }
    
    .nav-wrapper,
    .header-container,
    .nav-content,
    .header-inner {
        padding: 0;
        gap: 1rem;
    }
    
    .brand,
    .site-logo,
    .logo-wrapper,
    .brand-logo,
    .logo {
        font-size: 1rem !important;
    }
    
    .brand img,
    .site-logo img,
    .logo-wrapper img,
    .brand-logo img,
    .logo img {
        height: 32px !important;
    }
    
    .search-wrapper,
    .search-container {
        max-width: 200px;
        flex: 0 1 auto;
    }
    
    .nav-menu,
    .nav-links,
    .site-nav {
        display: none;
    }
    
    .mobile-menu-btn,
    .menu-toggle {
        display: flex !important;
    }
}
