<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Word Frequency Counter</title>
</head>
<body>
    <h1>Word Frequency Counter</h1>
    <form action="/count" method="post">
        <textarea name="text" rows="10" cols="50"></textarea><br>
        <input type="submit" value="Count Words">
    </form>
    {% if top_words %}
        <h2>Top 10 Most Common Words:</h2>
        <ul>
            {% for word, count in top_words %}
                <li>{{ word }}: {{ count }}</li>
            {% endfor %}
        </ul>
    {% endif %}
</body>
</html>