/* ==================== 导航栏（与画廊页一致） ==================== */

.navbar {
    background: linear-gradient(90deg, #9B59B6, #3498DB);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-title {
    font-size: 1.8rem;
    text-align: center;
    flex: 1;
    font-weight: 600;
}

.nav-back, .nav-home {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-back:hover, .nav-home:hover {
    background: white;
    color: #9B59B6;
    transform: scale(1.05);
}

/* ==================== 游戏主页面 ==================== */

.games-main {
    min-height: 100vh;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5e6ff 0%, #e6f2ff 50%, #ffe6f2 100%);
}

/* 覆盖全局 .container 的 flex 布局，改为纵向块 */
.games-main .container {
    display: block;
    min-height: unset;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
}

/* ==================== 顶部筛选条（复用 gallery 样式） ==================== */

.games-main .filter-section {
    background: white;
    border-radius: 20px;
    padding: 22px 30px;
    margin-bottom: 36px;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.1);
    border: 2px solid rgba(155, 89, 182, 0.08);
    display: flex;
    align-items: center;
    gap: 30px;
}

.games-main .filter-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 160px;
}

.games-main .filter-left label,
.games-main .filter-right label {
    font-weight: 600;
    color: #9B59B6;
    font-size: 0.95rem;
    white-space: nowrap;
}

.games-main .sort-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #3498DB;
    border-radius: 10px;
    font-size: 0.95rem;
    background: white;
    color: #333;
    cursor: pointer;
}

.games-main .filter-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.games-main .filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.games-main .filter-btn {
    background: white;
    border: 2px solid #E0E0E0;
    color: #555;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease;
    font-size: 0.9rem;
}

.games-main .filter-btn:hover {
    border-color: #9B59B6;
    color: #9B59B6;
    transform: translateY(-2px);
}

.games-main .filter-btn.active {
    background: linear-gradient(90deg, #3498DB, #9B59B6);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.3);
}

/* ==================== 游戏网格（固定2列） ==================== */

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 40px;
}

/* ==================== 游戏卡片 ==================== */

.game-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 3px solid transparent;
    animation: fadeIn 0.6s ease-out both;
}

.game-card:nth-child(1) { animation-delay: 0.1s; border-color: #9B59B6; }
.game-card:nth-child(2) { animation-delay: 0.2s; border-color: #3498DB; }
.game-card:nth-child(3) { animation-delay: 0.3s; border-color: #E91E63; }
.game-card:nth-child(4) { animation-delay: 0.4s; border-color: #FFD700; }
.game-card:nth-child(5) { animation-delay: 0.5s; border-color: #1ABC9C; }

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

.game-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 15px 40px rgba(155, 89, 182, 0.3);
}

/* 游戏卡片的背景颜色 */
.game-1 {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.05) 0%, rgba(155, 89, 182, 0) 100%);
    border-top: 6px solid #9B59B6;
}

.game-2 {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(52, 152, 219, 0) 100%);
    border-top: 6px solid #3498DB;
}

.game-3 {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.05) 0%, rgba(233, 30, 99, 0) 100%);
    border-top: 6px solid #E91E63;
}

.game-4 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(255, 215, 0, 0) 100%);
    border-top: 6px solid #FFD700;
}

.game-5 {
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.05) 0%, rgba(26, 188, 156, 0) 100%);
    border-top: 6px solid #1ABC9C;
}

/* ==================== 游戏卡片头部 ==================== */

.game-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px;
    background: linear-gradient(90deg, rgba(155, 89, 182, 0.05), transparent);
}

.game-icon {
    font-size: 3rem;
    animation: iconWave 2s ease-in-out infinite;
}

@keyframes iconWave {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-10deg) scale(1.1);
    }
    75% {
        transform: rotate(10deg) scale(1.1);
    }
}

.game-card:hover .game-icon {
    animation: spin 0.6s ease-out;
}

@keyframes spin {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(360deg) scale(1.2); }
}

.game-header h3 {
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}

/* ==================== 游戏内容 ==================== */

.game-content {
    flex: 1;
    padding: 0 25px 20px;
}

.game-description {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.game-details {
    margin-bottom: 15px;
}

.difficulty {
    display: inline-block;
    color: #555;
    font-weight: 600;
}

.stars {
    margin-left: 8px;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.game-summary {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ==================== 游戏按钮 ==================== */

.game-btn {
    background: linear-gradient(90deg, #9B59B6, #3498DB);
    color: white;
    border: none;
    padding: 15px 25px;
    margin: 20px 25px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.5s ease;
    z-index: 1;
}

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

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.4);
}

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

/* ==================== 游戏说明 ==================== */

.games-info {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.1);
    border: 2px solid rgba(155, 89, 182, 0.1);
    text-align: center;
    animation: slideUp 0.8s ease-out;
}

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

.games-info h3 {
    color: #9B59B6;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.games-info p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 900px) {
    .games-main .filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .games-main .filter-left {
        flex: none;
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .games-main .sort-select { flex: 1; }
}

@media (max-width: 768px) {
    .games-main {
        padding: 30px 15px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-card {
        border-radius: 15px;
    }

    .game-header {
        padding: 20px;
    }

    .game-icon {
        font-size: 2.5rem;
    }

    .game-header h3 {
        font-size: 1.1rem;
    }

    .game-content {
        padding: 0 20px 15px;
    }

    .game-btn {
        margin: 15px 20px 20px;
        padding: 12px 20px;
        font-size: 1rem;
    }

    .games-info {
        padding: 30px 20px;
    }

    .games-info h3 {
        font-size: 1.5rem;
    }

    .games-info p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .games-main {
        padding: 20px 10px;
    }

    .games-header h2 {
        font-size: 1.5rem;
    }

    .games-header p {
        font-size: 0.9rem;
    }

    .game-card {
        border-radius: 12px;
    }

    .game-header {
        padding: 15px;
    }

    .game-icon {
        font-size: 2rem;
    }

    .game-header h3 {
        font-size: 1rem;
    }

    .game-description {
        font-size: 0.9rem;
    }

    .game-summary {
        font-size: 0.9rem;
    }

    .game-btn {
        margin: 12px 15px 15px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .games-info {
        padding: 20px 15px;
    }

    .games-info h3 {
        font-size: 1.3rem;
    }

    .games-info p {
        font-size: 0.95rem;
    }
}
