body {
    font-family: 'Arial', sans-serif;
    background-color: #1e1e1e;
    color: #d4d4d4;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.container {
    background-color: #252525;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    width: 80%;
    max-width: 900px;
}
h1, h2 {
    color: #6dd5ed;
    text-align: center;
    animation: fadeInColor 3s ease-out infinite alternate;
}
h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}
h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
}
label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #a6a6a6;
}
textarea, input, select {
    margin-bottom: 15px;
    width: calc(100% - 20px);
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 16px;
    background-color: #333;
    color: #d4d4d4;
    transition: border-color 0.3s ease;
}
textarea:focus, input:focus, select:focus {
    border-color: #6dd5ed;
    outline: none;
}
textarea {
    height: 100px;
}
.options-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}
.options-container div {
    display: flex;
    align-items: center;
}
.options-container input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}
button {
    padding: 12px 25px;
    background-color: #6dd5ed;
    color: #222;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    font-weight: bold;
}
button:hover {
    background-color: #5bc0de;
    transform: scale(1.02);
}
button:active {
    transform: scale(1);
}
#story-output {
    border: 1px solid #555;
    padding: 20px;
    margin-top: 20px;
    white-space: pre-line;
    background-color: #333;
    border-radius: 4px;
    font-size: 1.1em;
    line-height: 1.6;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}
#novel-window {
    display: none;
}
#input-form {
    display: block;
    opacity: 0;
    animation: slideIn 1s ease-out forwards;
}
.novel-text-container {
    padding: 20px;
}
.options-button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 15px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s forwards;
}
.option-button {
    padding: 12px 25px;
    background-color: #2ecc71;
    color: #222;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-right: 10px;
    margin-bottom: 5px;
    font-weight: bold;
}
.option-button:hover {
    background-color: #28b767;
    transform: scale(1.05);
}
.option-button:active {
    transform: scale(1);
}
#timer-output {
    font-weight: bold;
    color: #e74c3c;
    margin-top: 15px;
    text-align: center;
}
#speech-button, #regenerate-button {
    padding: 10px 20px;
    background-color: #f39c12;
    color: #222;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-weight: bold;
    margin-bottom: 5px;
}
#speech-button:hover, #regenerate-button:hover {
    background-color: #e08e0b;
    transform: scale(1.02);
}
#speech-button:active, #regenerate-button:active {
    transform: scale(1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInColor {
    from { color: #6dd5ed; }
    to { color: #8ee8fa; }
}

/*  Адаптация для мобильных устройств  */
@media (max-width: 768px) {
    .container {
        width: 95%; /*  Контейнер занимает 95% ширины экрана  */
        padding: 20px; /*  Уменьшаем отступы  */
    }
    h1 {
        font-size: 2em; /*  Уменьшаем размер заголовка  */
        margin-bottom: 15px;
    }
    h2 {
        font-size: 1.5em; /*  Уменьшаем размер подзаголовка  */
        margin-bottom: 10px;
    }
    textarea, input, select {
        font-size: 14px; /*  Уменьшаем размер шрифта в полях ввода  */
        padding: 8px;
        margin-bottom: 10px;
    }
    button, .option-button, #speech-button, #regenerate-button {
        font-size: 14px; /*  Уменьшаем размер шрифта на кнопках  */
        padding: 10px 20px;
    }
    .options-container {
        flex-direction: column; /*  Располагаем чекбоксы вертикально  */
        gap: 10px; /*  Уменьшаем расстояние между элементами  */
    }
    .options-container div {
        margin-bottom: 0; /*  Убираем лишний отступ у div-оберток чекбоксов  */
    }
}