/* 游戏盒子样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: none;
}

/* 背景动画 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-icon {
    position: absolute;
    font-size: 24px;
    animation: float 6s ease-in-out infinite;
    opacity: 0.3;
    filter: blur(1px);
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

.floating-icon:nth-child(1) { animation-delay: 0s; }
.floating-icon:nth-child(2) { animation-delay: 1s; }
.floating-icon:nth-child(3) { animation-delay: 2s; }
.floating-icon:nth-child(4) { animation-delay: 3s; }
.floating-icon:nth-child(5) { animation-delay: 4s; }
.floating-icon:nth-child(6) { animation-delay: 5s; }

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 头部 */
.main-header {
    text-align: center;
    margin-bottom: 50px;
    animation: headerSlideIn 1s ease-out;
}

@keyframes headerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-title {
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.3); }
}

.title-icon {
    display: inline-block;
    animation: iconSpin 3s linear infinite;
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

/* 类别导航 */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-item:active {
    transform: translateY(0);
}

.nav-icon {
    font-size: 1.3rem;
    animation: navIconPulse 2s ease-in-out infinite;
}

@keyframes navIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 游戏分类区域 */
.game-category {
    margin-bottom: 80px;
    padding-top: 40px;
}

.category-title {
    font-size: 2.5rem;
    color: #fff;
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    animation: categorySlideIn 0.8s ease-out;
}

@keyframes categorySlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-icon {
    display: inline-block;
    margin-right: 15px;
    animation: categoryIconSpin 4s linear infinite;
}

@keyframes categoryIconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 游戏容器 */
.games-container {
    margin-bottom: 50px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 游戏卡片 */
.game-card {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: cardFadeIn 0.8s ease-out;
    animation-fill-mode: both;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }
.game-card:nth-child(6) { animation-delay: 0.6s; }

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .card-glow {
    opacity: 1;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

/* 不同游戏的特殊颜色 */
.sudoku-card:hover { box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4); }
.english-card:hover { box-shadow: 0 20px 40px rgba(255, 193, 7, 0.4); }
.ai-chat-card:hover { box-shadow: 0 20px 40px rgba(0, 230, 118, 0.4); }
.memory-card:hover { box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4); }
.puzzle-card:hover { box-shadow: 0 20px 40px rgba(78, 205, 196, 0.4); }
.snake-card:hover { box-shadow: 0 20px 40px rgba(69, 183, 209, 0.4); }
.tetris-card:hover { box-shadow: 0 20px 40px rgba(149, 225, 211, 0.4); }
.more-card:hover { box-shadow: 0 20px 40px rgba(249, 202, 36, 0.4); }
.cluedo-card:hover { box-shadow: 0 20px 40px rgba(156, 39, 176, 0.4); }
.circle-cat-card:hover { box-shadow: 0 20px 40px rgba(255, 152, 0, 0.4); }
.idiom-game-card:hover { box-shadow: 0 20px 40px rgba(236, 64, 122, 0.4); }

/* 卡片图标 */
.card-icon {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.icon-animation {
    position: relative;
    display: inline-block;
    font-size: 35px;
}

.main-icon {
    display: inline-block;
    animation: mainIconFloat 3s ease-in-out infinite;
}

@keyframes mainIconFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.1); }
}

.sub-icon {
    position: absolute;
    font-size: 18px;
    top: -6px;
    right: -10px;
    animation: subIconSpin 4s linear infinite;
}

@keyframes subIconSpin {
    from { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    to { transform: rotate(360deg) scale(1); }
}

/* 卡片内容 */
.card-content h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 6px;
    text-align: center;
    line-height: 1.3;
}

.card-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.3;
    font-size: 0.85rem;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.difficulty, .players {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 卡片装饰元素 */
.card-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* 数独数字装饰 */
.floating-number {
    position: absolute;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.2);
    animation: numberFloat 4s ease-in-out infinite;
}

.floating-number:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-number:nth-child(2) {
    top: 70%;
    right: 15%;
    animation-delay: 1.5s;
}

.floating-number:nth-child(3) {
    bottom: 30%;
    left: 80%;
    animation-delay: 3s;
}

@keyframes numberFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.2; }
    50% { transform: translateY(-20px) rotate(10deg); opacity: 0.4; }
}

/* 记忆卡片装饰 */
.floating-card {
    position: absolute;
    font-size: 18px;
    animation: cardFlip 3s ease-in-out infinite;
}

.floating-card:nth-child(1) {
    top: 15%;
    right: 20%;
    animation-delay: 0s;
}

.floating-card:nth-child(2) {
    bottom: 25%;
    left: 15%;
    animation-delay: 1s;
}

.floating-card:nth-child(3) {
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

@keyframes cardFlip {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

/* 拼图装饰 */
.puzzle-piece {
    position: absolute;
    width: 15px;
    height: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    animation: puzzleMove 5s ease-in-out infinite;
}

.puzzle-piece:nth-child(1) {
    top: 25%;
    left: 15%;
    animation-delay: 0s;
}

.puzzle-piece:nth-child(2) {
    top: 65%;
    right: 25%;
    animation-delay: 2s;
}

.puzzle-piece:nth-child(3) {
    bottom: 35%;
    left: 75%;
    animation-delay: 4s;
}

@keyframes puzzleMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -10px) rotate(90deg); }
    50% { transform: translate(-10px, 10px) rotate(180deg); }
    75% { transform: translate(5px, 5px) rotate(270deg); }
}

/* 贪吃蛇装饰 */
.snake-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #4ecdc4;
    border-radius: 50%;
    animation: snakeMove 6s linear infinite;
}

.snake-dot:nth-child(1) {
    top: 30%;
    left: 20%;
    animation-delay: 0s;
}

.snake-dot:nth-child(2) {
    top: 70%;
    right: 30%;
    animation-delay: 2s;
}

.food-item {
    position: absolute;
    font-size: 16px;
    bottom: 20%;
    left: 70%;
    animation: foodPulse 2s ease-in-out infinite;
}

@keyframes snakeMove {
    0% { transform: translate(0, 0); }
    25% { transform: translate(20px, -10px); }
    50% { transform: translate(40px, 0); }
    75% { transform: translate(20px, 10px); }
    100% { transform: translate(0, 0); }
}

@keyframes foodPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 俄罗斯方块装饰 */
.tetris-block {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    animation: tetrisFall 4s ease-in-out infinite;
}

.tetris-block:nth-child(1) {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.tetris-block:nth-child(2) {
    top: 60%;
    right: 20%;
    animation-delay: 1.5s;
}

.tetris-block:nth-child(3) {
    bottom: 40%;
    left: 70%;
    animation-delay: 3s;
}

@keyframes tetrisFall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
    50% { transform: translateY(0) rotate(180deg); opacity: 1; }
    100% { transform: translateY(20px) rotate(360deg); opacity: 0; }
}

/* 英语单词大挑战字母装饰 */
.floating-letter {
    position: absolute;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
    animation: letterFloat 5s ease-in-out infinite;
}

.floating-letter:nth-child(1) {
    top: 25%;
    left: 15%;
    animation-delay: 0s;
}

.floating-letter:nth-child(2) {
    top: 65%;
    right: 20%;
    animation-delay: 2s;
}

.floating-letter:nth-child(3) {
    bottom: 35%;
    left: 75%;
    animation-delay: 4s;
}

@keyframes letterFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1); 
        opacity: 0.3;
    }
    25% { 
        transform: translateY(-15px) rotate(90deg) scale(1.1); 
        opacity: 0.5;
    }
    50% { 
        transform: translateY(0) rotate(180deg) scale(1); 
        opacity: 0.3;
    }
    75% { 
        transform: translateY(15px) rotate(270deg) scale(0.9); 
        opacity: 0.5;
    }
}

/* 成语接龙装饰 */
.floating-character {
    position: absolute;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
    animation: characterFloat 5s ease-in-out infinite;
}

.floating-character:nth-child(1) {
    top: 25%;
    left: 15%;
    animation-delay: 0s;
}

.floating-character:nth-child(2) {
    top: 65%;
    right: 20%;
    animation-delay: 2s;
}

.floating-character:nth-child(3) {
    bottom: 35%;
    left: 75%;
    animation-delay: 4s;
}

@keyframes characterFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1); 
        opacity: 0.3;
    }
    25% { 
        transform: translateY(-15px) rotate(90deg) scale(1.1); 
        opacity: 0.5;
    }
    50% { 
        transform: translateY(0) rotate(180deg) scale(1); 
        opacity: 0.3;
    }
    75% { 
        transform: translateY(15px) rotate(270deg) scale(0.9); 
        opacity: 0.5;
    }
}

/* 克鲁伊多推理游戏装饰 */
.clue-item {
    position: absolute;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    animation: clueInvestigate 6s ease-in-out infinite;
}

.clue-item:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.clue-item:nth-child(2) {
    top: 70%;
    right: 25%;
    animation-delay: 2s;
}

.clue-item:nth-child(3) {
    bottom: 30%;
    left: 80%;
    animation-delay: 4s;
}

@keyframes clueInvestigate {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
        opacity: 0.4;
    }
    25% { 
        transform: translate(15px, -10px) scale(1.2); 
        opacity: 0.6;
    }
    50% { 
        transform: translate(-10px, 5px) scale(1); 
        opacity: 0.4;
    }
    75% { 
        transform: translate(5px, 10px) scale(0.8); 
        opacity: 0.6;
    }
}

/* 即将上线装饰 */
.coming-soon {
    position: absolute;
    font-size: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: constructionPulse 2s ease-in-out infinite;
}

@keyframes constructionPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* 底部 */
.main-footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    animation: footerSlideUp 1s ease-out;
}

@keyframes footerSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-footer p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.footer-decoration {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-icon {
    font-size: 20px;
    animation: footerIconBounce 2s ease-in-out infinite;
}

.footer-icon:nth-child(1) { animation-delay: 0s; }
.footer-icon:nth-child(2) { animation-delay: 0.5s; }
.footer-icon:nth-child(3) { animation-delay: 1s; }
.footer-icon:nth-child(4) { animation-delay: 1.5s; }

@keyframes footerIconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .icon-animation {
        font-size: 50px;
    }
    
    body {
        cursor: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .game-card {
        padding: 15px;
    }
    
    .card-content h3 {
        font-size: 1.2rem;
    }
    
    .card-content p {
        font-size: 0.9rem;
    }
}