.bubble-letter-tool {
    background-color: #FAF7F0;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.input-area,
.output-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    height: 50px; /* Ensure input box is fixed height */
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    width: 100%;
    margin-top: 1rem;
}

button:hover {
    background-color: #45a049;
}

.copy-btn {
    background-color: #008CBA;
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    width: auto;
}

.copy-btn:hover {
    background-color: #007B9A;
}

.output-area {
    display: flex;
    flex-direction: column;
}

#output-word {
    font-size: 2rem;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid #ccc; /* Add a border to the output area to match input box */
    padding: 1rem;
    border-radius: 8px;
    min-height: 70px; /* Ensure output area is at least as tall as the input box */
}

.bubble-letter {
    display: inline-block;
    background: linear-gradient(145deg, #ffcc00, #ff9900);
    color: #333;
    padding: 0.5rem 1rem;
    margin: 0.3rem;
    border-radius: 50%;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    font-size: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Bubble color effect on hover */
.bubble-letter:hover {
    background: linear-gradient(145deg, #ff9900, #ffcc00);
    color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .bubble-letter-tool {
        flex-direction: column;
        align-items: stretch;
    }

    .input-area,
    .output-area {
        width: 100%;
    }

    button {
        width: auto;
    }
}

@media (max-width: 320px) {
    input[type="text"],
    #output-word {
        font-size: 1.2rem;
    }

    button {
        padding: 0.8rem;
    }
}