body {
    font-family: sans-serif;
    text-align: center;
    margin: 20px;
    background-color: #f0f8ff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #333;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: min(90%, 800px);
    margin: 0 auto;
}

.xkcd-link {
    margin-bottom: 2rem;
}

.xkcd-link a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #428bca;
    text-decoration: none;
    transition: color 0.3s ease;
}

.xkcd-link a:hover {
    color: #3071a9;
    text-decoration: underline;
}

.input-area, .output-area {
    margin: 1rem 0;
}

.input-section {
    font-size: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.text-container {
    flex: 1;
    min-width: 250px;
}

.buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
    text-align: left;
}

textarea {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: none;
    font-size: 1rem;
    box-sizing: border-box;
}
button {
    padding: 0.75rem 1.5rem;
    background-color: #428bca;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1rem;
}

button:hover {
    background-color: #3071a9;
}

button:active {
    transform: translateY(1px);
}

.keypad {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.key-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.key {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.25rem;
}

.delete-key {
    background-color: #d9534f;
}

.delete-key:hover {
    background-color: #c9302c;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
        width: 95%;
    }

    .buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .key {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
}