body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    text-align: center;
}

.container {
    background-color: white;
    padding: 20px 40px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

h1 {
    color: #333;
}

#category-selection h2 {
    margin-bottom: 15px;
}

.category-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.category-btn:hover {
    background-color: #45a049;
}

#word-display {
    font-size: 2em;
    letter-spacing: 5px;
    margin: 20px 0;
    min-height: 30px; /* Ensure space even when empty */
}

#guesses-left, #wrong-letters {
    font-size: 1.1em;
    margin-bottom: 10px;
}

#wrong-letters span {
    color: red;
    font-weight: bold;
}

#hangman-canvas {
    width: 300px; /* Match canvas element attributes */
    height: 300px; /* Match canvas element attributes */
    border: 1px solid #ccc;
    margin: 20px auto;
    display: block; /* Center the canvas */
}

#keyboard {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.key {
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.key:hover {
    background-color: #d0d0d0;
}

.key.disabled {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

#message {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    min-height: 25px; /* Ensure space for messages */
}

#reset-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

#reset-button:hover {
    background-color: #0056b3;
}