* {
    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;
    color: #333;
}

header {
    text-align: center;
    padding: 2rem;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.game-card p {
    color: #666;
    font-size: 1rem;
}

#game-area {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    min-height: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 井字棋样式 */
.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 10px;
    justify-content: center;
    margin: 2rem auto;
}

.tic-tac-toe-cell {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.tic-tac-toe-cell:hover {
    background: #e8e8ff;
}

.tic-tac-toe-cell.disabled {
    cursor: not-allowed;
}

/* 记忆翻牌样式 */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 80px);
    gap: 15px;
    justify-content: center;
    margin: 2rem auto;
}

.memory-card {
    width: 80px;
    height: 80px;
    background: #667eea;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: transform 0.3s ease;
}

.memory-card.flipped {
    background: #f0f0f0;
    color: #333;
}

.memory-card:hover {
    transform: scale(1.05);
}

/* 贪吃蛇样式 */
.snake-container {
    text-align: center;
}

#snake-canvas {
    border: 2px solid #667eea;
    border-radius: 10px;
    background: #f0f0f0;
}

.snake-controls {
    margin-top: 1rem;
}

.snake-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.snake-controls button:hover {
    background: #5568d3;
}

.game-status {
    text-align: center;
    font-size: 1.2rem;
    margin: 1rem 0;
    font-weight: bold;
}

.game-controls {
    text-align: center;
    margin-top: 1rem;
}

.game-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.game-controls button:hover {
    background: #5568d3;
}

footer {
    text-align: center;
    padding: 2rem;
    color: white;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .games-container {
        grid-template-columns: 1fr;
    }
    
    .tic-tac-toe-board {
        grid-template-columns: repeat(3, 80px);
    }
    
    .tic-tac-toe-cell {
        width: 80px;
        height: 80px;
    }
    
    .memory-board {
        grid-template-columns: repeat(4, 60px);
    }
    
    .memory-card {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}