/* ===== 游戏集合页面样式 ===== */

.games-collection {
    padding: 120px 0 100px;
    min-height: 100vh;
    background: #000000;
    position: relative;
    overflow: hidden;
}

.games-collection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(147, 51, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(147, 51, 234, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.games-collection > .container {
    position: relative;
    z-index: 1;
}

.games-header {
    text-align: center;
    margin-bottom: 60px;
}

.games-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--text-color);
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.games-header p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.games-header .leaderboard-link {
    margin-top: 30px;
}

/* ===== 游戏卡片网格 ===== */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.game-card {
    background: var(--bg-light);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(147, 51, 234, 0.2);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.game-card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2), rgba(147, 51, 234, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(147, 51, 234, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.game-card:hover .game-card-image::before {
    transform: translateX(100%);
}

.game-card-icon {
    font-size: 4rem;
    color: var(--primary-color);
    text-shadow: var(--neon-glow);
    z-index: 1;
    transition: transform 0.3s ease;
}

.game-card:hover .game-card-icon {
    transform: scale(1.2) rotate(5deg);
}

.game-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-card-title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.game-card-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid rgba(147, 51, 234, 0.2);
}

.game-card-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.game-card-btn:hover {
    background: var(--primary-color);
    color: var(--text-color);
    transform: translateX(5px);
}

.game-card-btn i {
    transition: transform 0.3s ease;
}

.game-card-btn:hover i {
    transform: translateX(3px);
}

.game-card-badge {
    padding: 5px 12px;
    background: rgba(147, 51, 234, 0.2);
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--primary-color);
}

/* ===== 排行榜入口按钮 ===== */

.leaderboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.3);
}

.leaderboard-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(147, 51, 234, 0.5);
}

.leaderboard-btn i {
    font-size: 1.2rem;
}

/* ===== 主标签切换 ===== */

.main-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.main-tab {
    padding: 15px 30px;
    background: var(--bg-light);
    border: 2px solid rgba(147, 51, 234, 0.3);
    border-radius: 25px;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.3);
}

.main-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.content-view {
    animation: gamesViewFadeIn 0.3s ease;
}

@keyframes gamesViewFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 头像库 ===== */

.category-tab {
    padding: 15px 30px;
    background: var(--bg-light);
    border: 2px solid rgba(147, 51, 234, 0.3);
    border-radius: 25px;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.3);
}

.category-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.avatar-gallery-container {
    background: var(--bg-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(147, 51, 234, 0.2);
}

.avatar-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.avatar-search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    background: rgba(147, 51, 234, 0.1);
    border: 2px solid rgba(147, 51, 234, 0.3);
    border-radius: 25px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.avatar-search-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.avatar-search-btn {
    padding: 12px 30px;
    background: var(--primary-color);
    border: none;
    border-radius: 25px;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-search-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.avatar-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.image-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(147, 51, 234, 0.1);
    border: 2px solid rgba(147, 51, 234, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.4);
    border-color: var(--primary-color);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover img {
    transform: scale(1.1);
}

.image-card .loading-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(147, 51, 234, 0.1);
}

.image-card .loading-placeholder i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.avatar-loading-more {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.avatar-loading-more i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.avatar-empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.avatar-empty-message i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.avatar-empty-message .avatar-empty-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 10px;
}

/* ===== 游戏 iframe 模态框 ===== */

.game-iframe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.game-iframe-container {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1400px;
    max-height: 900px;
    background: var(--bg-light);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.game-iframe-header {
    padding: 20px 30px;
    background: var(--bg-light);
    border-bottom: 2px solid rgba(147, 51, 234, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-iframe-header h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close-iframe-btn {
    background: rgba(147, 51, 234, 0.2);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-iframe-btn:hover {
    background: var(--primary-color);
    color: var(--text-color);
}

.game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}

/* ===== 图片预览模态框 ===== */

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.image-modal.show {
    display: flex !important;
}

.image-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.image-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    pointer-events: auto;
}

.image-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.image-modal .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.image-modal .nav-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.image-modal .nav-btn.prev-btn {
    left: 20px;
}

.image-modal .nav-btn.next-btn {
    right: 20px;
}

.image-modal #modalImage {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.image-modal .image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1rem;
    z-index: 10001;
    pointer-events: auto;
}

/* ===== 响应式 ===== */

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .games-header {
        margin-bottom: 40px;
    }
    
    .game-card-image {
        height: 150px;
    }
    
    .game-card-icon {
        font-size: 3rem;
    }
    
    .game-card-content {
        padding: 20px;
    }

    .game-iframe-container {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
    
    .game-iframe-header h3 {
        font-size: 1.2rem !important;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}
