    body {
    font-family: Arial, sans-serif;
    background-color: #ffffee;
    color: #800000;
    margin: 0;
    padding: 0;
    padding-top: 25px;
    line-height: 1.4;
    max-width: 800px;
    margin: 0 auto;
}

header {
    margin-top: 30px;
    background-color: #F0E0D6;
    padding: 10px 15px;
    margin-bottom: 0;
}

header h2 {
    margin: 5px 0;
    color: #117743;
    font-size: 1.2em;
}

/* Ссылки в хедере */
header a {
    color: #800000;
    text-decoration: none;
    font-weight: bold;
}

header a:hover {
    text-decoration: underline;
}

 /* Дополнительные стили для мобильной адаптации */
        .header-gallery img {
            max-width: 100%;
            height: auto;
            display: block;
            margin: 3px auto;
        }
        
        .header-gallery {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 5px;
            overflow: hidden;
        }
        
        /* Для очень маленьких экранов */
        @media (max-width: 480px) {
            .header-gallery img {
                max-height: 150px;
                max-width: calc(50% - 10px);
            }
        }
        
        /* Для средних экранов */
        @media (min-width: 481px) and (max-width: 768px) {
            .header-gallery img {
                max-height: 180px;
                max-width: calc(33.333% - 10px);
            }
        }
        
/* Ссылки в заголовках постов */
.post-header a {
    color: inherit;
}

/* Посты */
.post {
    background-color: #f0e0d6;
    border: 1px solid #D9BFB7;
    border-radius: 5px;
    padding: 10px 15px;
    margin-bottom: 15px;
    position: relative;
    transition: background-color 0.5s ease;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
    border-bottom: none;
    padding-bottom: 5px;
}

.post-text {
    margin: 10px 0;
    word-wrap: break-word;
}

.post-text.collapsed {
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.post-text.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(245,245,245,0), rgba(245,245,245,1));
}

.toggle-btn {
    background: none;
    border: none;
    color: #800000;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.8em;
    margin-top: 5px;
}

.toggle-btn:hover {
    text-decoration: underline;
}

/* Форма сообщения */
.message-form {
    background-color: #f0e0d6;
    border: 1px solid #D9BFB7;
    border-radius: 5px;
    padding: 15px;
    margin-top: 0;
    margin-bottom: 15px;
    position: relative;
}

.message-form textarea {
    width: 100%;
    min-height: 100px;
    background-color: white;
    padding: 8px;
    border: 1px solid #D9BFB7;
    border-radius: 3px;
    box-sizing: border-box;
    resize: vertical;
}

/* Контейнер кнопок формы */
.form-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
    position: relative;
}

/* Контейнер для input file */
.file-input-container {
    position: relative;
    display: inline-block;
    flex: 1;
    min-width: 0;
    height: 35px;
}

.file-input-container input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    overflow: hidden;
    user-select: none;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    max-width: 95%;
    max-height: 95vh;
    object-fit: contain;
   
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    transition: transform 0.1s ease;
    cursor: zoom-in;
}

.modal .close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    line-height: 30px;
}

.modal .close:hover {
    color: #ff4444;
}

.modal .prev,
.modal .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    padding: 15px;
    user-select: none;
    z-index: 10001;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.modal .prev {
    left: 20px;
}

.modal .next {
    right: 20px;
}

.modal .prev:hover,
.modal .next:hover {
    color: #ddd;
}

/* Скрываем стрелки, когда только одна картинка */
.modal:has(.modal-content:only-child) .prev,
.modal:has(.modal-content:only-child) .next {
    display: none;
}

/* Кастомная кнопка файла */
.custom-file-button {
    background-color: #EA8;
    color: #800000;
    border: 1px solid #800000;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    display: inline-block;
    font-size: 0.9em;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

/* Кнопка отправки */
.form-buttons button[type="submit"] {
    background-color: #EA8;
    color: #800000;
    border: 1px solid #800000;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    flex-shrink: 0;
    min-width: 120px;
    white-space: nowrap;
}

.form-buttons button:hover,
.custom-file-button:hover {
    background-color: #F5C396;
}

/* Тулбар форматирования */
.toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.toolbar button {
    background-color: #EA8;
    color: #800000;
    border: 1px solid #800000;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.9em;
    flex: 1;
    min-width: auto;
}

.toolbar button:hover {
    background-color: #F5C396;
}

/* Ссылки на посты */
.post-link {
    color: #117743;
    text-decoration: none;
}

.post-link:hover {
    text-decoration: underline;
}

/* Превью постов */
.post-preview {
    opacity: 1 !important;
    background-color: #eeeeee;
    border: 1px solid #D9BFB7;
    padding: 10px;
    position: absolute;
    z-index: 100;
    max-width: 400px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* Цитаты */
.quote {
    color: #8ca540;
}

/* Ответы */
.post-replies {
    margin-top: 5px;
    font-size: 0.85em;
    color: gray;
    margin-bottom: 3px;
}

/* Кнопки ответа */
.reply-btn,
.reply-text {
    background: none;
    border: none;
    color: #800000;
    cursor: pointer;
    font-size: 0.85em;
    padding: 0;
    margin: 0;
    text-decoration: none;
    font-family: inherit;
}

.reply-btn:hover,
.reply-text:hover {
    color: #aa0000;
    text-decoration: underline;
}

/* Заголовок */
.header-text.collapsed {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.header-text.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
}

/* Сообщения об ошибках */
.timer-message {
    color: #FF0000;
    background-color: #F5F5F5;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #FF0000;
    border-radius: 3px;
}

/* Спойлеры */
.spoiler.hidden {
    background-color: grey;
    color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 2px;
    padding: 0 2px;
}

.spoiler.hidden:hover {
    background-color: #f0f0f0;
    color: inherit;
    text-shadow: none;
}

.spoiler.visible {
    background-color: transparent;
    color: inherit;
    cursor: default;
    padding: 0;
}

/* Список файлов */
#file-list {
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
}

/* Капча */
.captcha-container {
    background-color: #f0e0d6;
    padding: 15px;
    margin: 10px 0;
}


.captcha-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.captcha-container strong {
    color: #800000;
}

.captcha-container input[type="text"] {
    width: 100%;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid #D9BFB7;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: white;
    color: #000;
}
/* Базовые стили для меню (светлая тема по умолчанию) */
#themeMenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px;
    min-width: 160px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    z-index: 9999;
}

.theme-option {
    padding: 6px;
    cursor: pointer;
}

/* Светлая тема (уже есть по умолчанию) */
.light-theme #themeMenu {
    background: #fff;
    border-color: #ccc;
}

.light-theme .theme-option {
    color: #333;
}

.light-theme .theme-option:hover {
    background: #f0f0f0;
}

/* ТЕМНАЯ ТЕМА - с !important чтобы перебить базовые стили */
.dark-theme #themeMenu {
    background: #2a2a2a !important;
    border: 1px solid #555 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

.dark-theme .theme-option {
    color: #eee !important;
    
}

.dark-theme .theme-option:hover {
    background: #3a3a3a !important;
}

/* Серая тема */
.gray-theme #themeMenu {
    background: #d8d8d8;
    border: 1px solid #b0b0b0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.gray-theme .theme-option {
    color: #333;
}

.gray-theme .theme-option:hover {
    background: #c0c0c0 !important;
}

/* Специальные стили постов */
.post.my-post {
    border-left: 3px solid #0077cc;
}

.post.my-replied-post {
    border-left: 3px solid #ff6600;
}

.post.reply-to-my-post {
    border-left: 3px dashed #ff6600;
}



body.dark-theme @keyframes pulse {
  0% { background-color: white; transform: scale(1); }
  50% { background-color: white; transform: scale(1.02); }
  100% { background-color: white; transform: scale(1); }
}

/* Плавность для всех скроллов на странице */
html {
  scroll-behavior: smooth;
}

.highlighted {
  animation: pulse 0.5s ease-out;
}

@keyframes pulse {
  0% { background-color: rgba(120,170,255,0.3); transform: scale(1); }
  50% { background-color: rgba(120,170,255,0.5); transform: scale(1.02); }
  100% { background-color: rgba(120,170,255,0.3); transform: scale(1); }
}

/* URL ссылки */
.url-link {
    color: #117743;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.url-link:hover {
    text-decoration: underline;
}

/* Эмодзи */
.modern-emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.3em;
    vertical-align: middle;
    display: inline-block;
    margin: 0 2px;
    transition: transform 0.2s ease;
}

.modern-emoji:hover {
    transform: scale(1.2);
}

/* Панель темы */
#theme-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100% - 10px);
    margin-left: 5px;
    height: 25px;
    background-color: #F0E0D6;
    display: flex;
    justify-content: right;
    align-items: center;
    gap: 20px;
    padding: 0 5px;
    font-size: 12px;
    box-sizing: border-box;
    z-index: 1000;
    border-radius: 0 0 5px 5px;
}

#theme-bar .bar-btn {
    background: none;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    color: #333;
    border: none;
}

#theme-bar button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    color: #333;
}

    .new-posts-count {
    color: #0a0;      /* ярко-зелёный */
    font-weight: bold;
}
/* Горизонтальная галерея с прокруткой */
.media-files {
    display: flex;
    flex-wrap: nowrap;          /* элементы в одну строку */
    overflow-x: auto;           /* горизонтальная прокрутка */
    gap: 1px;                  /* отступы между медиа */
    padding-bottom: 8px;        /* место для полосы прокрутки */
    -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
}

/* Запрещаем сжатие элементов */
.media-files > * {
    flex-shrink: 0;
    max-height: 250px;          /* желаемая высота превью */
    max-width: 250px; 
    width: auto;
    object-fit: contain;
    border-radius: 0;           /* убираем скругления */
}

/* Видео дополнительно */
.media-files video {
    background: #000;
}

/* Картинки */
.media-files img {
    cursor: pointer;
}

/* Аудио можно оставить без изменений или тоже увеличить */
.media-files audio {
    max-width: 300px;
}

/* Для мобильных устройств — чтобы видео занимало всю ширину, но сохраняло пропорции */
@media (max-width: 600px) {
    .media-files video,
    .media-files img {
        max-width: 100%;
        height: auto;
    }
}

    .new-posts-count {
    color: #0a0;      /* ярко-зелёный */
    font-weight: bold;
}
/* Горизонтальная галерея с прокруткой */
.media-files {
    display: flex;
    flex-wrap: nowrap;          /* элементы в одну строку */
    overflow-x: auto;           /* горизонтальная прокрутка */
    gap: 1px;                  /* отступы между медиа */
    padding-bottom: 8px;        /* место для полосы прокрутки */
    -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
}

/* Запрещаем сжатие элементов */
.media-files > * {
    flex-shrink: 0;
    max-height: 250px;          /* желаемая высота превью */
    max-width: 250px; 
    width: auto;
    object-fit: contain;
    border-radius: 0;           /* убираем скругления */
}

/* Видео дополнительно */
.media-files video {
    background: #000;
}

/* Картинки */
.media-files img {
    cursor: pointer;
}

/* Аудио можно оставить без изменений или тоже увеличить */
.media-files audio {
    max-width: 300px;
}

/* Для мобильных устройств — чтобы видео занимало всю ширину, но сохраняло пропорции */
@media (max-width: 600px) {
    .media-files video,
    .media-files img {
        max-width: 100%;
        height: auto;
    }
}

/* Модальное окно формы */
.post-form-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.post-form-content {
    background: #fff;
    margin: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    max-width: 600px;
    width: 90%;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.close-post-form {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    color: gray;
    cursor: pointer;
}

.close-post-form:hover {
    color: red;
}

#form-messages {
    margin-bottom: 10px;
}

.message {
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
    font-weight: bold;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.message.warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ff9800;
}

/* Убираем стандартные стили input file */
input[type="file"]::file-selector-button {
    display: none;
}

/* ================= ТЕМНАЯ ТЕМА ================= */
body.dark-theme {
    background-color: #1e1e1e;
    color: #d4d4d4;
}

body.dark-theme header {
    background-color: #2a2a2a;
}

body.dark-theme header a {
    color: #a0b3c5;
}

body.dark-theme header a:hover {
    color: #8fa0c8;
}

body.dark-theme .post-header a {
    color: white;
}

body.dark-theme .post-header a:hover {
    color: #ffffaa;
}

body.dark-theme .post {
    background-color: #2b2b2b;
    border-color: #444;
}

body.dark-theme .post-toggle {
    color: #a0b3c5;
   
}

body.dark-theme .post-toggle:hover {
     color: #8fa0c8 !important;
    text-decoration: underline;
}

body.dark-theme .post-text.collapsed::after {
    background: linear-gradient(to bottom, rgba(43,43,43,0), rgba(43,43,43,1));
}

body.dark-theme .message-form {
    background-color: #2b2b2b;
    border-color: #444;
}

body.dark-theme .message-form textarea {
    background-color: #1e1e1e;
    color: #d0d0d9;
    border-color: #1e1e1e;
}

body.dark-theme .message-form textarea::placeholder {
    color: #8a8a9a;
}

body.dark-theme .message-form textarea:focus {
    outline: none;
    border-color: #3f3f50;
    box-shadow: none;
}

body.dark-theme .toolbar button,
body.dark-theme .form-buttons button[type="submit"] {
    background-color: #555;
    color: #eee;
    border-color: #888;
}

body.dark-theme .custom-file-button {
    background-color: #555;
    color: #eee;
    border-color: #888;
}

body.dark-theme .reply-btn,
body.dark-theme .reply-text {
    color: #a0b3c5 !important;
}

body.dark-theme .reply-btn:hover,
body.dark-theme .reply-text:hover {
    color: #8fa0c8 !important;
    text-decoration: underline;
}

body.dark-theme .post-link {
    color: #a0b3c5 !important;
}

body.dark-theme .post-link:hover {
    color: #85a5e0 !important;
    text-decoration: underline;
}

body.dark-theme .post.my-post {
    border-left: 3px solid #0077cc;
}

body.dark-theme .post.my-replied-post {
    border-left: 3px solid #ff6600;
}

body.dark-theme .post.reply-to-my-post {
    border-left: 3px dashed #ff6600;
}

body.dark-theme .post-replies { 
    color:#a0b3c5;
}

body.dark-theme .toggle-btn {
    color: #aaffaa;
}

body.dark-theme .spoiler.hidden {
    background-color: #555;
}

body.dark-theme #theme-bar {
    background-color: #2a2a2a;
}

body.dark-theme #theme-bar button {
    color: #eee;
}

body.dark-theme .post-preview {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background-color: #2b2b2b;
    border-color: #444;
}

body.dark-theme .media-files img,
body.dark-theme .media-files video {
    background-color: #2b2b2b;
    border-color: #444;
}

body.dark-theme .url-link {
    color: #a0b3c5;
}

body.dark-theme .url-link:hover {
    color: #a0b3c5;
    text-decoration: underline;
}

body.dark-theme .captcha-container {
    background-color: #2b2b2b; /* Такой же цвет как у формы */
   
    padding: 15px;
    margin: 10px 0;
}

body.dark-theme .captcha-container strong {
    color: #eeeeee;
}

body.dark-theme .captcha-container input[type="text"] {
    background-color: #2b2b2b;
    color: #eeeeee;
    border-color: #555;
}

body.dark-theme .captcha-container input[type="text"]::placeholder {
    color: #2b2b2b;
}
/* Добавьте эти стили для поля ввода имени в темной теме */
body.dark-theme .name-input-container input {
    background-color: #2b2b2b;
    color: #eeeeee;
    border-color: #555;
}

body.dark-theme .name-input-container input::placeholder {
    color: #8a8a9a;
}

body.dark-theme .name-input-container input:focus {
    border-color: #3f3f50;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.3);
}

/* ================= АДАПТИВНОСТЬ ================= */
@media (max-width: 600px) {
    body {
        padding: 5px;
    }

    .post, .message-form {
        padding: 10px;
    }

       .media-files img {
        max-width: 150px;
        max-height: 150px;
    }
.media-files video {
       max-width: 200px;
        max-height: 290px;
    
}

    .post-header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 5px;
        font-size: 0.8em;
    }

    .post-preview {
        max-width: 300px;
    }
    
    /* Важные исправления для мобильной версии */
    .form-buttons {
        flex-direction: column !important;
        align-items: stretch;
        gap: 10px;
    }
    
    .file-input-container {
        max-width: 100% !important;
        width: 100%;
        height: auto;
    }
    
    .custom-file-button {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 1em;
    }
    
    .form-buttons button[type="submit"] {
        width: 100%;
        padding: 12px;
        font-size: 1em;
        min-width: auto;
    }
    
    .captcha-container {
        margin: 10px 0;
    }
    
    .captcha-container input[type="text"] {
        width: 100% !important;
        max-width: none;
        box-sizing: border-box;
    }
    
    .toolbar {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .toolbar button {
        padding: 8px;
        font-size: 0.8em;
        flex: 1;
        min-width: auto;
    }
    
    #theme-bar {
        gap: 10px;
        padding: 0 10px;
    }
    
    #theme-bar .bar-btn {
        padding: 2px 4px;
        font-size: 11px;
    }
}

.name-input-container input {
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.name-input-container input:focus {
    border-color: #66afe9;
    outline: none;
    box-shadow: 0 0 5px rgba(102, 175, 233, 0.6);
}

    /* Стили для скрытия/раскрытия постов */
        .post-toggle {
            background: none;
            border: none;
            color: #666;
            cursor: pointer;
            font-size: 12px;
            padding: 0;
            text-decoration: underline;
        }

        .post-toggle:hover {
            color: #333;
        }

        .post.hidden .post-content {
            display: none;
        }

        .post.hidden .post-toggle .hide-text {
            display: none;
        }

        .post:not(.hidden) .post-toggle .show-text {
            display: none;
        }

        .post-header {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .post-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-left: auto;
        }

        .reply-text, .post-toggle {
            color: #666;
            cursor: pointer;
            font-size: 12px;
            text-decoration: underline;
        }

        .reply-text:hover, .post-toggle:hover {
            color: #333;
        }
        
                /* Стили для кнопки автозагрузки */
#toggleAutoload {
    background-color: #4CAF50;
    color: white;
}

#toggleAutoload.disabled {
    background-color: pink;
}

#toggleAutoload::after {
    content: " Вкл";
}

#toggleAutoload.disabled::after {
    content: " Выкл";
}

/* Стили для цензуры */
.post.censored .media-files img,
.post.censored .media-files video {
    filter: blur(20px) grayscale(100%);
    transition: filter 0.3s ease;
    cursor: pointer;
}

.post.censored .media-files img:hover,
.post.censored .media-files video:hover {
    filter: blur(0px) grayscale(0%) !important;
}

/* Стили для цензуры в превью */
.post-preview.censored .media-files img,
.post-preview.censored .media-files video {
    filter: blur(20px) grayscale(100%);
    transition: filter 0.3s ease;
}

.post-preview.censored .media-files img:hover,
.post-preview.censored .media-files video:hover {
    filter: blur(0px) grayscale(0%) !important;
}

.censored-badge {
    background: #ff4444;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-left: 10px;
}

.admin-controls {
    margin-left: 10px;
}

.admin-controls a {
    margin: 0 3px;
    text-decoration: none;
    font-size: 0.9em;
}



/* Стили для цензуры в превью */
.post-preview.censored .media-files img,
.post-preview.censored .media-files video {
    filter: blur(20px) grayscale(100%);
    transition: filter 0.3s ease;
}

.post-preview.censored .media-files img:hover,
.post-preview.censored .media-files video:hover {
    filter: blur(5px) grayscale(50%);
}

.special-background {
    background-image: var(--background-image);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}

/* Для лучшей читаемости контента на фоне */
.special-background .post {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.dark-theme.special-background .post {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Полупрозрачный фон для формы */
.special-background .message-form {
    background-color: rgba(255, 255, 255, 0.85);
}

.dark-theme.special-background .message-form {
    background-color: rgba(0, 0, 0, 0.8);
}

/* ===== БАЗА ТЕМЫ ===== */
.gray-theme {
    background: #eeeeee;        /* общий фон страницы */
    color: black;
}
.gray-theme #theme-bar {
    background: #d0d0d0;
   
  
}

/* ===== ШАПКА (header) ===== */
.gray-theme header {
    background: #d8d8d8;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #c0c0c0;
}

.gray-theme header a {
    color: #ff6600; /* Розово-красный */
}

.gray-theme header a:hover {
    color: #a01830;
}


/* ===== ФОРМА ===== */
.gray-theme .message-form {
    background: #dcdcdc;
  padding: 15px;
   margin: 15px 0;
}

.gray-theme input[type="text"],
.gray-theme textarea {
    background: #f0f0f0;
    border: 1px solid #b8b8b8;
    color: #000;
    padding: 8px;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}

.gray-theme input[type="text"]:focus,
.gray-theme textarea:focus {
    background: #ffffff;
    border-color: #ff6600; /* Розовый акцент */
    outline: none;
    box-shadow: 0 0 4px rgba(196, 30, 58, 0.3);
}

/* ===== КНОПКА "ВЫБРАТЬ ФАЙЛЫ" ===== */
.gray-theme .file-input-container {
    position: relative;
    display: inline-block;
}

.gray-theme .custom-file-button {
    background: #d0d0d0;
    border: 1px solid #b0b0b0;
    color: #333;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    transition: all 0.2s;
}

.gray-theme .custom-file-button:hover {
    background: #c0c0c0;
    border-color: #a0a0a0;
}

/* ===== КОНТЕЙНЕР КАПЧИ ===== */
.gray-theme .captcha-container {
   background:#dcdcdc;
    padding: 12px;
   
    margin: 10px 0;
}

.gray-theme #captchaImage {
    border: 2px solid #b0b0b0 !important;
  
}

.gray-theme #captchaImage + button:hover {
    background: #c0c0c0;
}

/* ===== КНОПКА ОТПРАВКИ ===== */
.gray-theme button[type="submit"] {
    background: #d0d0d0;
    color: black;
    padding: 10px 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #bdbdbd; /* Устанавливаем серую рамку по умолчанию */
    outline: none; /* Убираем обводку браузера */
}

.gray-theme button[type="submit"]:hover {
    background: #e0e0e0;
    border-color: #ff6600;
}

/* ===== ПАНЕЛЬ ИНСТРУМЕНТОВ (toolbar) ===== */

.gray-theme .toolbar button {
    background: #e0e0e0;
    color: #333;
    padding: 5px 10px;
    margin-right: 4px;
  
}

.gray-theme .toolbar button:hover {
    background: #d0d0d0;
    border-color: #a0a0a0;
}
/* ===== ПОСТ (серый прямоугольник) ===== */
.gray-theme .post {
    background: #dddddd;        /* цвет блока поста */
    border: 1px solid #cfcfcf;
    padding: 10px;
    margin: 6px 0;
}
.gray-theme .post-preview {
    opacity: 1 !important;
 background: #dcdcdc;        /* цвет блока поста */
    border: 1px solid #cfcfcf;
    padding: 10px;
    position: absolute;
    z-index: 100;
    max-width: 400px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* ===== БЛОК ФОРМЫ ===== */
.gray-theme .post-form,
.gray-theme form {
    background: #dcdcdc;
    border: 1px solid #cfcfcf;
    padding: 10px;
    margin: 10px 0;
}

/* ===== ПОДПИСИ ПОЛЕЙ ===== */
.gray-theme label {
    color: #444;
    font-size: 0.9em;
}

/* ===== ПОЛЯ ВВОДА ===== */
.gray-theme input[type="text"],
.gray-theme textarea {
    background: #f0f0f0;
    border: 1px solid #cfcfcf;
    color: #000;
    padding: 6px;
}

/* при фокусе — чуть темнее, но всё ещё серо */
.gray-theme input:focus,
.gray-theme textarea:focus {
    outline: none;
    border-color: #bdbdbd;
    background: #eaeaea;
}

/* ===== КНОПКА ОТПРАВКИ ===== */
.gray-theme button,
.gray-theme input[type="submit"] {
    background: #dcdcdc;
    border: 1px solid #bdbdbd;
    color: #000;
    padding: 6px 10px;
    cursor: pointer;
}

.gray-theme button:hover,
.gray-theme input[type="submit"]:hover {
    background: #cfcfcf;
}

/* ===== ШАПКА ПОСТА (дата/номер) ===== */
.gray-theme .post-header,
.gray-theme .post-meta {
    color: #999999;
    font-size: 0.9em;
}
/* Специальные стили постов */
.gray-theme .post.my-post {
    border-left: 3px solid #0077cc;
}

.gray-theme .post.my-replied-post {
    border-left: 3px solid #ff6600;
}

.gray-theme .post.reply-to-my-post {
    border-left: 3px dashed #ff6600;
}
/* ===== ЦИТАТЫ (>>номер) — ОРАНЖЕВЫЕ ===== */
.gray-theme .post-link {
    color: #ff6600;
}

/* если у вас цитаты оформлены иначе — можно так: */

.gray-theme .reply-to {
    color: #ff6600;
}

/* ===== ЗЕЛЁНЫЙ ТЕКСТ (как на скрине) ===== */
.gray-theme .quote {
    color: #789922;
}

/* ===== ССЫЛКИ ===== */
.gray-theme a {
    color: #ff6600;
}

.gray-theme a:hover {
    text-decoration: underline;
}

/* ===== КНОПКИ (в стиле скрина) ===== */
.gray-theme .bar-btn {
    background: #dcdcdc;
    border: 1px solid #bdbdbd;
    color: #000;
}

.gray-theme .bar-btn:hover {
    background: #cfcfcf;
}

/* ===== ФОРМЫ (если есть) ===== */
.gray-theme input,
.gray-theme textarea {
    background: #f0f0f0;
    border: 1px solid #cfcfcf;
}
      /* Пост на премодерации – только фон */
        .post.premod-post {
            background-color: #fff5e0 !important;
        }
        .dark-theme .post.premod-post {
            background-color: #3a2a1a !important;
        }
        .pre-moderation-placeholder {
            display: none !important;
        }


    /* Мобильные: уменьшаем стрелки в модальном окне (без кружков) */
@media (max-width: 768px) {
    .modal .prev,
    .modal .next {
        font-size: 28px !important;
        width: auto !important;
        height: auto !important;
        background: none !important;
        border-radius: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 0 10px !important;
        margin: 0 !important;
        opacity: 0.7 !important;
        color: #fff !important;
        text-shadow: 0 0 3px black !important;
    }
    
    .modal .prev {
        left: 5px !important;
        right: auto !important;
    }
    .modal .next {
        right: 5px !important;
        left: auto !important;
    }
}

    .new-posts-count {
    color: #0a0;      /* ярко-зелёный */
    font-weight: bold;
}
/* Горизонтальная галерея с прокруткой */
.media-files {
    display: flex;
    flex-wrap: nowrap;          /* элементы в одну строку */
    overflow-x: auto;           /* горизонтальная прокрутка */
    gap: 1px;                  /* отступы между медиа */
    padding-bottom: 8px;        /* место для полосы прокрутки */
    -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
}

/* Запрещаем сжатие элементов */
.media-files > * {
    flex-shrink: 0;
    max-height: 250px;          /* желаемая высота превью */
    max-width: 250px; 
    width: auto;
    object-fit: contain;
    border-radius: 0;           /* убираем скругления */
}

/* Видео дополнительно */
.media-files video {
    background: #000;
}

/* Картинки */
.media-files img {
    cursor: pointer;
}

/* Аудио можно оставить без изменений или тоже увеличить */
.media-files audio {
    max-width: 300px;
}

/* Для мобильных устройств — чтобы видео занимало всю ширину, но сохраняло пропорции */
@media (max-width: 600px) {
    .media-files video,
    .media-files img {
        max-width: 100%;
        height: auto;
    }
}