body {
    background-color: #0a0a0a;
    color: #dcdcdc;
    font-family: 'Special Elite', monospace;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    max-width: 800px;
    width: 100%;
    text-align: center;
    padding: 30px;
    background-color: #121212;
    border: 1px solid #2a0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.25);
    border-radius: 5px;
}

h1 {
    font-family: 'Creepster', cursive;
    color: #b30000;
    font-size: 3.5em;
    text-shadow: 2px 2px 4px #000;
    margin-bottom: 0;
    letter-spacing: 2px;
}

.subtitle {
    color: #777;
    margin-top: 5px;
    font-size: 1.1em;
}

.input-area {
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

input[type="text"], select {
    padding: 12px;
    font-size: 16px;
    background-color: #1f1f1f;
    border: 1px solid #444;
    color: #dcdcdc;
    font-family: 'Special Elite', monospace;
    border-radius: 3px;
    flex-grow: 1;
    min-width: 200px;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #b30000;
    box-shadow: 0 0 5px rgba(179, 0, 0, 0.5);
}

input[type="file"] {
    display: none;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #1f1f1f;
    border: 1px solid #444;
    border-radius: 3px;
    padding-right: 12px;
}

.image-upload-label {
    padding: 12px 15px;
    background-color: #333;
    color: #dcdcdc;
    cursor: pointer;
    border-radius: 3px 0 0 3px;
    transition: background-color 0.3s;
}

.image-upload-label:hover {
    background-color: #444;
}

#file-name {
    color: #888;
    font-style: italic;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

button#generate-btn {
    padding: 12px 30px;
    font-size: 18px;
    background-color: #b30000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Creepster', cursive;
    letter-spacing: 1px;
    border-radius: 3px;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    margin-top: 15px;
    text-transform: uppercase;
}

button#generate-btn:hover {
    background-color: #cc0000;
}

button#generate-btn:active {
    transform: scale(0.98);
}

button#generate-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

#story-output {
    margin-top: 30px;
    padding: 25px;
    border: 1px dashed #333;
    background-color: #0f0f0f;
    text-align: left;
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 1.1em;
    min-height: 100px;
    border-radius: 3px;
}

.hidden {
    display: none;
}

#loader {
    width: 50px;
    height: 50px;
    border: 5px solid #333;
    border-top: 5px solid #b30000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

