/* Home Page Specific Styles */

/* Page Header */
.page-header {
    text-align: left;
    margin: 10px 0 10px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}




/* New page header layout styles */
.page-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.title-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.module-emoji {
    font-size: 1.875rem;
    line-height: 1;
    vertical-align: middle;
    color: var(--primary-dark);
}

.more-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: var(--font-size-base);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.more-link:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.page-header h2 {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    background: linear-gradient(135deg, 
        var(--primary-color) 0%,
        var(--primary-dark) 50%,
        #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}



@keyframes line-pulse {
    0%, 100% {
        width: 80px;
        opacity: 1;
    }
    50% {
        width: 100px;
        opacity: 0.8;
    }
}

.page-header p {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 400;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
}

.page-header p::before {
    content: '»';
    color: var(--primary-color);
    opacity: 0.5;
    margin-right: 8px;
    font-size: 1.2em;
    display: inline-block;
    animation: quote-bounce 2s ease-in-out infinite;
}

@keyframes quote-bounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(3px);
    }
}

/* Sections */
.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: var(--space-xl);
    text-align: center;
    position: relative;
    padding-bottom: var(--space-sm);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}



.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.filter-controls {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

/* Game Section Styles */
.game-section {
    padding: var(--space-1xl) 0;
    position: relative;
}


@keyframes line-flow {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}


.game-section--grid {
    position: relative;
    margin: 20px 0;
    padding: 30px 0;
}

.game-section--grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
    border-radius: var(--radius-xl);
    pointer-events: none;
}

.game-section .page-header h2 {
    background: linear-gradient(135deg, 
        var(--primary-color) 0%,
        var(--primary-dark) 50%,
        #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    padding: 0;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.game-section .page-header .page-header-inner {
    position: relative;
    padding-bottom: 10px;
}



.game-section--grid .module-card:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

/* Grid Layout with Horizontal Scrolling */
.game-section--grid .game-grid {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: var(--space-sm) 0;
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Chrome, Safari and Opera */
.game-section--grid .game-grid::-webkit-scrollbar {
    display: none;
}



.game-section--grid .module-card {
    flex: 0 0 260px;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

/* Horizontal Layout */
.game-grid-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}



.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.scroll-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* Disabled state for scroll buttons */
.scroll-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: translateY(-50%) scale(1);
    box-shadow: var(--shadow-sm);
}

.scroll-btn-left {
    left: -20px;
}

.scroll-btn-right {
    right: -20px;
}

.filter-tags-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.filter-tags-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--space-xs) * -1);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
}

.filter-tag {
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--primary-color);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.filter-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left var(--transition-normal);
    z-index: -1;
}

.filter-tag:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-tag:hover::before {
    left: 0;
}

.filter-tag.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.filter-tag.active::before {
    left: 0;
}



/* Games Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    justify-items: center;
}

/* Featured Game Cards */
.featured-grid .module-card {
    position: relative;
    transform: none;
    min-width: 220px;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.featured-grid .module-card::before {
    content: '⭐ Featured';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-accent);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
}

.module-card {
    background: linear-gradient(145deg, var(--bg-primary) 0%, rgba(249, 250, 251, 0.8) 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(229, 231, 235, 0.6);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 
                0 1px 2px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    transform: translateY(0);
    will-change: transform, box-shadow, border-color;
}

.module-card:hover {
    transform: translateY(-6px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15),
                0 8px 16px rgba(0, 0, 0, 0.1),
                0 2px 4px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: linear-gradient(145deg, var(--bg-primary) 0%, rgba(31, 41, 55, 0.95) 100%);
}

.module-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
    border-radius: var(--radius-xl);
}

.module-card:hover::after {
    opacity: 1;
}

.image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 61.25%;
    /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    position: relative;
    isolation: isolate;
}

.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    z-index: 1;
    pointer-events: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.placeholder-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.placeholder-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--space-sm);
    opacity: 0.7;
}

.placeholder-text {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.game-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 0.5s ease;
    filter: brightness(0.98);
    z-index: 2;
    transform: scale(1);
}

.module-card:hover .game-image {
    filter: brightness(1.02) contrast(1.02);
}

.image-placeholder {
    display: none;
}

.game-image.loading+.image-placeholder {
    display: flex;
}

.game-image.error {
    display: none;
}

.game-image.error+.image-placeholder {
    display: flex;
}

.game-info {
    padding: 16px 16px 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-top: 1px solid rgba(229, 231, 235, 0.5);
}

.game-title {
    font-size: var(--font-size-lg);
    font-weight: 800;
    color: white !important; /* 强制白色文字 */
    text-align: left;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden !important; /* 确保隐藏溢出 */
    text-overflow: ellipsis;
    margin: 0;
    letter-spacing: -0.01em;
    min-height: 3.6em; /* 增加高度确保两行完全容纳 */
    max-height: 3.6em; /* 限制最大高度，防止第三行露出 */
    
    /* 新添加的样式：默认隐藏，悬停时显示 */
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important; /* 大幅提高z-index */
    padding: 2px 16px !important;
    background: rgba(0, 0, 0, 0.85) !important; /* 更深的半透明黑色背景 */
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important;
    opacity: 0 !important;
    transform: translateY(100%) !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
    pointer-events: none; /* 避免干扰悬停 */
}

.module-card:hover .game-title {
    opacity: 0.8 !important;
    transform: translateY(0) !important;
}

.game-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 4px 0 0;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Line clamp variations for brief comments */
.line2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.line3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.line4 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.line5 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 5;
    line-clamp: 5;
}

.line6 {
    -webkit-line-clamp: 6;
    line-clamp: 6;
}
.line7 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 7;
    line-clamp: 7;
}

.line-full {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
}

@media (max-width: 768px) {
    .line-full {
        -webkit-line-clamp: 3;
        line-clamp: 3;
        display: -webkit-box;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
    }
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f59e0b;
    font-size: 0.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    margin-top: 4px;
    align-self: flex-start;
}

.game-genre {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

.genre-tag {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.5px;
}



.game-featured {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #d97706 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4),
                0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: pulse-featured 2s infinite;
}

@keyframes pulse-featured {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4),
                    0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.6),
                    0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Animation */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.section-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Animation */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Category Sections */
.arcade-section .section-title {
    color: #ff6b6b;
}

.multiplayer-section .section-title {
    color: #4ecdc4;
}

.strategy-section .section-title {
    color: #ffd166;
}

.idle-games-section .section-title {
    color: #95e1d3;
}

.casual-games-section .section-title {
    color: #f38181;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: var(--space-2xl);
}

.load-more-btn {
    padding: var(--space-md) var(--space-2xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-xl);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-base);
    position: relative;
    overflow: hidden;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2xl);
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:active {
    transform: translateY(-1px);
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.load-more-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--container-padding);
    }

    /* Sections */
    .game-section,
    .featured-section,
    .arcade-section,
    .multiplayer-section,
    .strategy-section,
    .all-games-section {
        padding: 10px 0;
    }

    .page-header {
        margin: 10px 0 10px;
    }

    .page-header h2 {
        font-size: var(--font-size-2xl);
        padding: 0 15px;
    }

    .page-header p {
        font-size: var(--font-size-base);
        max-width: 90%;
    }

    .page-header p::before {
        font-size: 1.1em;
        margin-right: 6px;
    }

    @keyframes line-pulse {
        0%, 100% {
            width: 60px;
        }
        50% {
            width: 80px;
        }
    }

    /* Horizontal Layout */
    .game-grid-wrapper {
        gap: var(--space-sm);
    }

    .game-section--horizontal .game-grid {
        gap: var(--space-md);
    }

    .game-section--horizontal .module-card {
        flex: 0 0 180px;
        max-width: 180px;
    }

    .scroll-btn {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-lg);
    }

    .scroll-btn-left {
        left: -16px;
    }

    .scroll-btn-right {
        right: -16px;
    }

    .section-title {
        font-size: var(--font-size-xl);
        margin-bottom: var(--space-lg);
    }

    .section-description {
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-lg);
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-lg);
    }

    /* Alternate Layout */
    .game-section--alternate .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--space-md);
    }


    /* Filter Controls */
    .filter-controls {
        flex-direction: column;
        gap: var(--space-md);
        width: 100%;
    }

    .filter-tags-container {
        width: 100%;
    }

    .filter-tags-label {
        text-align: center;
        margin-bottom: var(--space-sm);
        font-size: var(--font-size-base);
    }

    .filter-tags {
        justify-content: center;
        max-width: none;
        gap: var(--space-sm);
        overflow-x: auto;
        padding: var(--space-xs);
        justify-content: flex-start;
    }

    .filter-tag {
        padding: var(--space-xs) var(--space-md);
        font-size: var(--font-size-sm);
        flex-shrink: 0;
    }

    /* Games Grid */
    .game-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .game-grid .module-card {
        width: calc(50% - 10px);
        max-width: none;
        margin: 0;
    }

    .game-section--grid .game-grid .module-card {
        width: 300px;
        flex: 0 0 300px;
        min-width: 300px;
        max-width: 300px;
        box-sizing: border-box;
    }

    /* Vertical Grid Layout - Responsive */
    .game-section--vertical-grid .game-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: var(--space-md);
    }

    .featured-section:not(.game-section--horizontal) .game-grid .module-card {
        width: auto;
    }

    .featured-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .featured-grid .module-card {
        width: calc(50% - 30px);
        min-width: auto;
        max-width: none;
        margin: 0;
    }

    .module-card {
        max-width: 200px;
        margin: 0 auto;
    }

    .game-title {
        font-size: var(--font-size-sm);
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .game-rating {
        font-size: var(--font-size-xs);
    }

    .game-info {
        padding: var(--space-md);
        gap: var(--space-xs);
    }

    .game-genre {
        gap: var(--space-xs);
    }

    .genre-tag {
        font-size: var(--font-size-xs);
        padding: var(--space-xs) var(--space-sm);
    }



    .game-featured {
        font-size: var(--font-size-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    .load-more-btn {
        padding: var(--space-md) var(--space-xl);
        font-size: var(--font-size-base);
        min-height: 44px;
        width: 100%;
        max-width: 200px;
    }

    /* Loading States */
    .loading-shimmer {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--container-padding);
    }

    .section-title {
        font-size: var(--font-size-lg);
        margin-bottom: var(--space-md);
    }

    .section-description {
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-md);
    }

    /* Games Grid */
    .game-grid,
    .game-section--horizontal .game-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .game-grid .module-card,
    .game-section--horizontal .module-card {
        width: calc(50% - 10px);
        max-width: none;
        margin: 0;
        flex: none;
    }

    /* Alternate Layout */
    .game-section--alternate .game-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    /* Vertical Grid Layout - Mobile */
    .game-section--vertical-grid .game-grid {
        grid-template-columns: repeat(1, minmax(200px, 1fr));
        gap: var(--space-md);
    }

    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--space-sm);
    }

    /* Hide scroll buttons on mobile */
    .scroll-btn {
        display: none;
    }

    .module-card {
        max-width: 160px;
    }

    .game-title {
        font-size: var(--font-size-sm);
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .game-rating {
        font-size: var(--font-size-xs);
    }

    .game-info {
        padding: var(--space-sm);
        gap: var(--space-xs);
    }

    .game-genre {
        gap: var(--space-xs);
    }

    .genre-tag {
        font-size: var(--font-size-xs);
        padding: var(--space-xs) var(--space-sm);
    }


    .game-featured {
        font-size: var(--font-size-xs);
        padding: var(--space-xs) var(--space-sm);
    }

    .filter-tag {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--font-size-xs);
    }

    .featured-section,
    .arcade-section,
    .multiplayer-section,
    .strategy-section,
    .all-games-section {
        padding: var(--space-xl) 0;
    }

    .load-more-btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: var(--font-size-sm);
        min-height: 40px;
        width: 100%;
        max-width: 180px;
    }

    .page-header {
        margin: 15px 0 25px;
        padding: 15px 10px;
        border-radius: var(--radius-md);
    }

    .page-header h2 {
        font-size: var(--font-size-xl);
        padding: 0 10px;
        margin-bottom: 8px;
    }

   

    .page-header p {
        font-size: var(--font-size-sm);
        max-width: 95%;
        line-height: 1.6;
    }

    .page-header p::before {
        font-size: 1em;
        margin-right: 4px;
        animation: none;
    }

    .page-header::before {
        animation: none;
        opacity: 0.5;
    }
}

/* Navigation Mobile Styles */
@media (max-width: 768px) {
    /* 移动端直接显示游戏标题 */
    .game-title {
        opacity: 0.6 !important;
        transform: translateY(0) !important;
        min-height: 50px;
    }
    
    /* 移动端悬停时保持标题显示 */
    .module-card:hover .game-title {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    .module-card {
        min-height: 160px;
    }

    .load-more-btn {
        min-height: 44px;
        /* Minimum touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }


}

/* Landscape orientation support */
@media (max-width: 768px) and (orientation: landscape) {

    .game-grid,
    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

}

/* Game Tags Styles */
.game-tags {
    display: flex;
    text-transform: none;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 12px;
    min-height: 28px;
}

.game-tag {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(147, 197, 253, 0.08) 100%);
    text-transform: none;
    color: var(--primary-dark);
    padding: 6px 6px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid rgba(59, 130, 246, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    z-index: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.game-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s ease;
    z-index: -1;
    transform: scale(0.95);
    border-radius: 20px;
}

.game-tag:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2),
                0 2px 6px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.4);
    color: white;
    z-index: 2;
}

.game-tag:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Color variations for different tag categories */
.game-tag:nth-child(3n+1) {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(147, 197, 253, 0.08) 100%);
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
}

.game-tag:nth-child(3n+2) {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(251, 191, 36, 0.08) 100%);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.2);
}

.game-tag:nth-child(3n+3) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(34, 197, 94, 0.08) 100%);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.2);
}

/* 新增炫酷视觉效果 */
@keyframes glow-border {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(59, 130, 246, 0.7),
            0 0 20px rgba(59, 130, 246, 0.5),
            inset 0 0 10px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 
            0 0 25px rgba(59, 130, 246, 1),
            0 0 40px rgba(59, 130, 246, 0.7),
            inset 0 0 15px rgba(59, 130, 246, 0.6);
    }
}



@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.module-card {
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0) 0%,
        rgba(59, 130, 246, 0.8) 50%,
        rgba(59, 130, 246, 0) 100%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: var(--radius-xl);
    animation: glow-border 2s infinite;
}

.module-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent);
    z-index: 1;
    transition: left 0.7s ease;
}

.module-card:hover::before {
    opacity: 1;
}

.module-card:hover::after {
    left: 100%;
}



/* 增强主模块标题效果 */
.game-section .page-header h2 {
    position: relative;
    display: inline-block;
}

.game-section .page-header h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: 2px;
    opacity: 0.7;
    animation: line-flow 3s ease-in-out infinite;
}

/* 新增布局变体 */
.game-grid--columns-3 {
    grid-template-columns: repeat(3, minmax(200px, 1fr)) !important;
}

.game-grid--columns-2 {
    grid-template-columns: repeat(2, minmax(200px, 1fr)) !important;
}

.game-grid--masonry {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: masonry;
}

/* 垂直网格布局 - 一行4个游戏 */
.game-section--vertical-grid .game-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    gap: var(--space-lg);
    justify-content: center;
}

.game-section--vertical-grid .module-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-section--vertical-grid .module-card:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-light);
    transform: translateY(-3px);
}