body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background-color: #1a1a1a;
    color: #ff6600;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    text-align: center;
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

textarea {
    width: 80%;
    height: 100px;
    margin-bottom: 20px;
    padding: 10px;
    border: 2px solid #ff6600;
    border-radius: 5px;
    background-color: #444;
    color: #fff;
    font-size: 1em;
}

#history {
    margin-top: 20px;
    text-align: left;
    width: 80%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    background-color: #333;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#history h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #ff6600;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#history-list li {
    margin-bottom: 5px;
}

#history-list a {
    color: #fff;
    text-decoration: none;
}

#history-list a:hover {
    text-decoration: underline;
}

/* Mobile optimization and centering */
body {
    padding: 20px; /* Add padding for mobile */
    flex-direction: column; /* Stack elements vertically on small screens */
    min-height: 100vh; /* Use min-height for better mobile support */
}

.container {
    width: 100%; /* Make container take full width on small screens */
    max-width: 600px; /* Limit max width on larger screens */
    margin-bottom: 20px; /* Add space between container and history */
}

textarea {
    width: calc(100% - 20px); /* Adjust width for padding */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

#history {
    margin-top: 0; /* Remove top margin as container has bottom margin */
    width: 100%; /* Make history take full width on small screens */
    max-width: 600px; /* Limit max width on larger screens */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

/* Media query for smaller screens */
@media (max-width: 600px) {
    .container, #history {
        padding: 15px; /* Reduce padding on smaller screens */
    }

    h1 {
        font-size: 2em; /* Reduce heading size on smaller screens */
    }

    textarea {
        height: 80px; /* Reduce textarea height on smaller screens */
    }
}

button {
    padding: 10px 20px;
    background-color: #ff6600;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

button:hover {
    background-color: #e65c00;
}

#countdown {
    font-size: 2em;
    margin-top: 20px;
}

#image-result img {
    max-width: 100%;
    margin-top: 20px;
    border: 2px solid #ff6600;
    border-radius: 5px;
}