/* ===== ПОЛНОСТЬЮ КАСТОМИЗИРУЕМЫЙ СТИЛЬ С АНИМИРОВАННЫМИ ГРАДИЕНТАМИ ===== */
:root {
    /* Основные цвета интерфейса */
    --win-gray: #81397b;
    --win-dark-gray: #ac64a6;
    --win-darker: #5e2659;
    --win-light: #a84ea1;
    --win-black: #000000;
    --win-shadow: #00000080;

    /* Заголовок окна (статичный градиент по умолчанию) */
    --title-start: #7c0080;
    --title-end: #ba10d0;
    --title-text: #ffffff;
    --title-text-gray: #d88fd8;

    /* Выделение и ссылки */
    --highlight-bg: #9d35a7;
    --highlight-text: #ffffff;
    --link-color: #7c0080;

    /* Гостевая книга */
    --gb-bg: #b955b1;
    --gb-border: #d66fce;
    --gb-border-light: #8b3d85;
    --gb-text-muted: #412d40;
    --gb-input-bg: #81397b;
    --gb-input-border: #ffffff;
    --gb-text: #ffffff;

    /* Слои */
    --layer-bg: #b955b1;
    --layer-border: #8b3d85;
    --layer-border-light: #d66fce;
    --layer-background-bg: #b955b1;
    --layer-border: #b955b1;
    --layer-active-bg: #6b0080;
    --layer-active-text: #ffffff;
    --layer-visibility-bg: #ae6cbe;
    --layer-visibility-border: #803180;
    --layer-move-btn-bg: #b955b1;
    --layer-move-btn-border-light: #d66fce;
    --layer-move-btn-border-dark: #8b3d85;

    /* Кнопки */
    --button-bg: #a7499f;
    --button-border-light: #d66fce;
    --button-border-dark: #753070;
    --button-active-bg: #74316e;
    --button-active-border-light: #7c3b77;
    --button-active-border-dark: #80397a;
    --button-text-color: #ffffff;

    /* Модальные окна */
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --modal-overlay-dark: rgba(0, 0, 0, 0.8);
    --modal-bg: #81397b;
    --modal-border-light: #af5fa9;
    --modal-border-dark: #572452;
    --modal-header-start: #660080;
    --modal-header-end: #6b3a77;
    --modal-header-text: #ffffff;
    --modal-close-bg: #c0c0c0;
    --modal-close-border-light: #f5adff;
    --modal-close-border-dark: #75327e;
    --modal-input-border: #f5adff;
    --modal-input-bg: #ffffff;
    --modal-error-bg: #ffcccc;

    /* Статус-бар */
    --status-bg: #6e3370;
    --status-border: #9144a8;
    --status-dot: #eb2beb;

    /* Популярный рисунок */
    --top-bg: #ffe246;
    --top-border: gold;
    --top-border-dark: #b8860b;

    /* Ошибка */
    --error-shadow: rgba(255, 0, 0, 0.7);
    --error-overlay: rgba(255, 0, 0, 0.3);

    /* Clippy */
    --clippy-bubble-bg: #ffffe1;
    --clippy-bubble-border: #000080;

    /* Анимированный фон страницы (по умолчанию тёмный градиент) */
    --bg-color1: #1e1e1e;
    --bg-color2: #2d2d2d;
    --bg-color3: #3a3a3a;

    /* Дополнительные переменные для анимированных градиентов интерфейса */
    /* Раскомментируй и настрой, чтобы включить анимацию для окна и заголовка */
    --win-bg-gradient: linear-gradient(45deg, #492045,#81397b);
    --win-bg-animation: win98Gradient 5s linear infinite;
    --title-gradient: linear-gradient(90deg, #660080, #6b3a77, #660080);
    --title-animation: win98Gradient 15s linear infinite;
    --gradient-size: 200% 200%; /* Раскомментировано, чтобы градиент был заметен */
}

/* ===== ШРИФТЫ ===== */
@font-face {
    font-family: 'W95Font';
    src: url('webfont/MSW98UI-Regular.woff2') format('woff2'),
         url('webfont/MSW98UI-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'W95Font';
    src: url('webfont/MSW98UI-Bold.woff2') format('woff2'),
         url('webfont/MSW98UI-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

/* ===== АНИМАЦИИ ===== */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}
@keyframes win98Gradient {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}
@keyframes softGlow {
    from { box-shadow: 0 0 5px gold, 0 0 10px gold; }
    to { box-shadow: 0 0 15px gold, 0 0 25px #ffd700; }
}
@keyframes whiteLine {
    0% { background-position: -200% -200%; }
    100% { background-position: 200% 200%; opacity: 1; }
}
@keyframes sparkleTwinkle {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    20% { transform: scale(1.2) rotate(180deg); opacity: 1; }
    40% { transform: scale(0.8) rotate(360deg); opacity: 0.8; }
    60% { transform: scale(0.5) rotate(540deg); opacity: 0.4; }
    80% { transform: scale(0.2) rotate(720deg); opacity: 0.1; }
    100% { transform: scale(0) rotate(900deg); opacity: 0; }
}
@keyframes blinkDots {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== ОСНОВНЫЕ СТИЛИ ===== */
* {
    font-size: 15px;
    box-sizing: border-box;
    font-family: 'W95Font', 'MS Sans Serif', 'Microsoft Sans Serif', 'Tahoma', 'Arial', sans-serif;
}

/* Анимированный фон страницы */
body {
    background: linear-gradient(
        45deg,
        var(--bg-color1) 0%,
        var(--bg-color2) 25%,
        var(--bg-color3) 50%,
        var(--bg-color2) 75%,
        var(--bg-color1) 100%
    );
    background-size: var(--gradient-size, 400% 400%);
    animation: win98Gradient 24s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 10px;
}

/* Блокировка прокрутки при открытых модальных окнах */
body.modal-open {
    overflow: hidden;
    padding-right: 18px;
}

/* ===== ГЛАВНОЕ ОКНО ===== */
.win95-window {
    /* По умолчанию сплошной цвет. Если задан --win-bg-gradient, используем его и анимацию */
    background: var(--win-bg-gradient, var(--win-gray));
    background-size: var(--gradient-size, auto);
    animation: var(--win-bg-animation, none);
    width: 1200px;
    max-width: 95vw;
    max-height: 95vh;
    border: 2px solid var(--win-light);
    border-right-color: var(--win-darker);
    border-bottom-color: var(--win-darker);
    box-shadow: 2px 2px 0px var(--win-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    z-index: 2000;
}

/* Заголовок окна */
.window-title {
    /* По умолчанию статичный градиент. Если задан --title-gradient, используем его и анимацию */
    background: var(--title-gradient, linear-gradient(90deg, var(--title-start), var(--title-end)));
    background-size: var(--gradient-size, auto);
    animation: var(--title-animation, none);
    color: var(--title-text);
    padding: 4px 4px 4px 8px;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 13px;
    border-bottom: 2px solid var(--win-light);
    flex-shrink: 0;
}
.title-text {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.title-buttons {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.title-buttons button {
    width: 24px;
    height: 24px;
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
    color: var(--win-black);
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    cursor: default;
    font-size: 16px;
    font-family: 'W95Font', 'MS Sans Serif', sans-serif;
    padding: 0;
    color: var(--title-text);
}
.title-buttons button:active {
    border: 2px solid var(--win-dark-gray);
    border-right-color: var(--win-light);
    border-bottom-color: var(--win-light);
}

/* Меню */
.menu-bar {
    display: flex;
    background: var(--win-gray);
    padding: 4px 8px;
    gap: 20px;
    border-bottom: 2px solid var(--win-light);
    flex-shrink: 0;
}
.menu-item {
    cursor: default;
    font-size: 12px;
    padding: 2px 4px;
}
.menu-item:hover {
    background: var(--highlight-bg);
    color: var(--highlight-text);
}

/* Панель инструментов */
.toolbar {
    display: flex;
    background: var(--win-gray);
    padding: 4px;
    gap: 4px;
    border-bottom: 2px solid var(--win-light);
    flex-shrink: 0;
}
.tool-button {
    width: 26px;
    height: 26px;
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
    font-size: 16px;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-button:active {
    border: 2px solid var(--win-dark-gray);
    border-right-color: var(--win-light);
    border-bottom-color: var(--win-light);
}
.tool-button.active {
    background: var(--button-active-bg);
    border: 2px solid var(--button-active-bg);
    border-top-color: var(--win-light);
    border-left-color: var(--win-light);
}

/* ===== КОНТЕНТ ===== */
.window-content {
    display: flex;
    background: transparent; /*Убираем фон*/
    padding: 8px;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.left-panel {
    width: 220px;
    background: var(--win-light);
    border: 2px solid var(--win-dark-gray);
    border-right-color: var(--win-light);
    border-bottom-color: var(--win-light);
    padding: 4px;
    overflow-y: auto;
    height: 100%;
    flex-shrink: 0;
}

.folder-list {
    list-style: none;
    padding-inline-start: 0;
    margin: 0;
}
.folder-list li {
    padding: 6px 8px;
    margin: 2px 0;
    cursor: default;
    font-size: 12px;
    border-bottom: 1px dotted var(--win-dark-gray);
    
    
}
.folder-list li:last-child {
    border-bottom: none;
    
}
.folder-list li a {
    color: var(--link-color);
    text-decoration: none;
    display: block;
    
}
.folder-list li.selected {
    background: var(--highlight-bg);
}
.folder-list li.selected a {
    color: var(--highlight-text);
}

.right-panel {
    flex-grow: 1;
    background: var(--win-light);
    border: 2px solid var(--win-dark-gray);
    border-right-color: var(--win-light);
    border-bottom-color: var(--win-light);
    padding: 0;
    height: 600px;
}

/* SimpleBar */
.simplebar-track {
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
    width: 18px !important;
}
.simplebar-scrollbar::before {
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
    border-radius: 0;
    opacity: 1 !important;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}
.simplebar-track.vertical::before,
.simplebar-track.vertical::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 18px;
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}
.simplebar-track.vertical::before {
    top: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4"><polygon points="0,4 4,0 8,4" fill="black"/></svg>');
}
.simplebar-track.vertical::after {
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4"><polygon points="0,0 4,4 8,0" fill="black"/></svg>');
}
.simplebar-track .simplebar-scrollbar {
    top: 18px !important;
    bottom: 18px !important;
    height: auto !important;
}
.simplebar-content {
    padding: 15px 22px 15px 15px !important;
}

/* Список слоёв */
#layersList {
    max-height: 150px;
    background-color: var(--button-active-border-dark) !important;
    border-right-color: var(--win-light) !important;
    border-bottom-color: var(--win-light) !important;
    border-left-color: var(--win-dark-gray) !important;
    border-top-color: var(--win-dark-gray) !important;
    border: 2px inset;
    padding: 4px;
    overflow: hidden;
}
#layersList::-webkit-scrollbar {
    width: 16px;
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
}
#layersList::-webkit-scrollbar-thumb {
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
    min-height: 40px;
}
#layersList::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}
#layersList::-webkit-scrollbar-track {
    background: var(--win-dark-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
}
#layersList::-webkit-scrollbar-button {
    display: none;
}

/* Секции */
.section h2 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--title-start);
    border-bottom: 2px dotted var(--button-border-light);
    padding-bottom: 4px;
}
.about-content {
    display: flex;
    gap: 20px;
    font-size: 12px;
}
.about-text {
    flex: 2;
    color: var(--title-text);
}
.about-text p {
    margin-bottom: 8px;
}
.about-photo {
    flex: 0.5;
    text-align: center;
}
.about-photo img {
    width: 160px;
    height: 160px;
    border: 4px solid var(--win-dark-gray);
    border-right-color: var(--win-darker);
    border-bottom-color: var(--win-darker);
    background: var(--win-gray);
    max-width: 100%;
    height: auto;
}

.friends-content {
    color: var(--title-text);
}

/* Проекты */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}
.project-item {
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
    padding: 10px;
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
}
.project-cover {
    width: 100%;
    height: 120px;
    background: var(--win-dark-gray);
    border: 2px solid var(--win-dark-gray);
    border-right-color: var(--win-light);
    border-bottom-color: var(--win-light);
    margin-bottom: 8px;
    overflow: hidden;
}
.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-title {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--button-text-color);
}
.project-desc {
    font-size: 11px;
    color: var(--title-text-gray);
    margin-bottom: 10px;
}
.project-button, a.project-button {
    display: inline-block;
    background: var(--button-bg);
    border: 2px solid var(--button-border-light);
    border-right-color: var(--button-border-dark);
    border-bottom-color: var(--button-border-dark);
    padding: 5px 12px;
    font-size: 12px;
    cursor: default;
    font-family: 'W95Font', 'MS Sans Serif', sans-serif;
    text-decoration: none;
    color: var(--button-text-color);
}
.project-button:active, a.project-button:active {
    border: 2px solid var(--button-active-bg);
    border-right-color: var(--button-active-border-light);
    border-bottom-color: var(--button-active-border-light);
}

/* Paint */
.canvas-container {
    position: relative;
    width: 570px;
    height: 380px;
    border: 3px solid var(--win-light);
    border-right-color: var(--win-darker);
    border-bottom-color: var(--win-darker);
    background: white;
    box-sizing: content-box;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px var(--win-dark-gray), 2px 2px 0px var(--win-shadow);
}
.canvas-container canvas {
    display: block;
    width: 570px;
    height: 380px;
    background: white;
    border: none;
}
#overlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 570px;
    height: 380px;
    pointer-events: none;
    background-color: transparent;
}
.paint-panel {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    color: var(--title-text)
}
.paint-row {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    padding-bottom: 5px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(4, 30px);
    gap: 4px;
    justify-content: center;
    margin: 10px 0;
}
.color-swatch {
    width: 30px;
    height: 30px;
    border: 2px solid var(--win-dark-gray);
    border-top-color: var(--win-light);
    border-left-color: var(--win-light);
    cursor: pointer;
}
.color-swatch.active {
    border: 2px solid var(--title-start);
    border-top-color: var(--win-light);
    border-left-color: var(--win-light);
}
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: var(--win-gray);
    border: 1px solid var(--win-dark-gray);
    border-top-color: var(--win-light);
    border-left-color: var(--win-light);
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 20px;
    background: var(--win-gray);
    border: 2px solid var(--win-light);
    border-right-color: var(--win-dark-gray);
    border-bottom-color: var(--win-dark-gray);
    cursor: default;
    margin-top: -8px;
}
input[type=range]:focus {
    outline: none;
}

#guestbookPageIndicator{
    color: var(--title-text);
}

/* ===== ГОСТЕВАЯ КНИГА (полная кастомизация через !important) ===== */
.guestbook-messages {
    margin-top: 20px;
    
}

.guestbook-form{
    color: var(--link-color)
}

/* Переопределяем инлайн-стили сообщений */
#gbMessages > div {
    border: 2px solid var(--gb-border) !important;
    border-right-color: var(--gb-border-light) !important;
    border-bottom-color: var(--gb-border-light) !important;
    background-color: var(--gb-bg) !important;
    color: var(--gb-text);
    padding: 8px !important;
    margin-bottom: 10px !important;
}

/* Дата в сообщении */
#gbMessages > div > div:nth-child(2) {
    color: var(--gb-text-muted) !important;
}

/* Поля ввода (инлайн-стили из HTML) */
#gbName, #gbMessage {
    border: 2px inset var(--gb-input-border) !important;
    background-color: var(--gb-input-bg) !important;
    border-right-color: var(--gb-border-light) !important;
    border-bottom-color: var(--gb-border-light) !important;
    border-left-color: var(--gb-border-light) !important;
    border-top-color: var(--gb-border-light) !important;
    color: var(--gb-text) !important;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.captcha-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}
.captcha-modal {
    background-color: var(--modal-bg);
    border: 2px solid var(--modal-border-light);
    border-right-color: var(--modal-border-dark);
    border-bottom-color: var(--modal-border-dark);
    padding: 20px;
    width: 300px;
    box-shadow: 2px 2px 0px var(--win-shadow);
    font-family: 'W95Font', 'MS Sans Serif', sans-serif;
}
.captcha-modal h3 {
    margin-top: 0;
    text-align: center;
    color: var(--title-start);
}
.captcha-question {
    font-size: 18px;
    text-align: center;
    margin: 15px 0;
}
.captcha-input {
    width: 100%;
    padding: 4px;
    border: 2px inset var(--modal-input-border);
    background: var(--modal-input-bg);
    font-family: inherit;
    box-sizing: border-box;
}
.captcha-input.error {
    background-color: var(--modal-error-bg);
}
.captcha-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}
.captcha-buttons button {
    min-width: 80px;
}
.shake-modal {
    animation: shake 0.3s ease-in-out;
}

.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay-dark);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
}
.image-modal {
    background-color: var(--modal-bg);
    border: 2px solid var(--modal-border-light);
    border-right-color: var(--modal-border-dark);
    border-bottom-color: var(--modal-border-dark);
    padding: 10px;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 2px 2px 0px var(--win-shadow);
    display: flex;
    flex-direction: column;
}
.image-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, var(--modal-header-start), var(--modal-header-end));
    color: var(--modal-header-text);
    padding: 5px 5px 5px 10px;
    font-weight: bold;
    margin-bottom: 10px;
}
.image-modal-header .title {
    font-size: 14px;
}
.image-modal-header .close {
    width: 24px;
    height: 24px;
    background: var(--modal-close-bg);
    border: 2px solid var(--modal-close-border-light);
    border-right-color: var(--modal-close-border-dark);
    border-bottom-color: var(--modal-close-border-dark);
    color: var(--win-black);
    text-align: center;
    line-height: 20px;
    cursor: default;
    font-size: 18px;
    font-family: 'W95Font', 'MS Sans Serif', sans-serif;
}
.image-modal-header .close:active {
    border: 2px solid var(--modal-close-border-dark);
    border-right-color: var(--modal-close-border-light);
    border-bottom-color: var(--modal-close-border-light);
}
.image-modal-content {
    overflow: auto;
    text-align: center;
    padding: 10px;
}
.image-modal-content img {
    max-width: 100%;
    max-height: 70vh;
    border: 2px solid var(--win-dark-gray);
    border-top-color: var(--win-light);
    border-left-color: var(--win-light);
    background: white;
}

/* ===== CLIPPY ===== */
.clippy-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 30000;
    pointer-events: none;
}
.clippy-character {
    width: 180px;
    height: auto;
    display: block;
    pointer-events: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.clippy-bubble {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background-color: var(--clippy-bubble-bg);
    border: 2px solid var(--clippy-bubble-border);
    border-radius: 5px;
    padding: 8px 12px;
    font-family: 'W95Font', 'MS Sans Serif', sans-serif;
    font-size: 13px;
    color: var(--win-black);
    box-shadow: 2px 2px 0px var(--win-shadow);
    max-width: 200px;
    word-wrap: break-word;
    white-space: normal;
    display: none;
}
.clippy-container.show .clippy-bubble {
    display: block;
}
.clippy-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--clippy-bubble-bg);
}

/* ===== СТАТУС-БАР ===== */
.status-bar {
    background: var(--status-bg);
    border-top: 2px solid var(--status-border);
    padding: 4px 8px;
    display: flex;
    gap: 12px;
    font-size: 12px;
    flex-shrink: 0;
}
.status-bar span {
    border-right: 1px dotted var(--status-dot);
    padding-right: 12px;
    color: var(--title-text)
}
.status-bar span:last-child {
    border-right: none;
}

/* ===== КНОПКА ЛАЙКА ===== */
.like-button {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s;
    vertical-align: middle;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.like-button:hover:not(:disabled) {
    transform: scale(1.2);
}
.like-button:disabled {
    opacity: 0.6;
    cursor: default;
}
.like-button.unliked {
    background-image: url('materialsl/like.png');
}
.like-button.liked {
    background-image: url('materialsl/liked.png');
}

/* ===== ПОПУЛЯРНЫЙ РИСУНОК ===== */
.painting{
    background-color: var(--button-bg) !important;
    border: 3px solid var(--button-border-light) !important;
    border-right-color: var(--button-border-dark) !important;
    border-bottom-color: var(--button-border-dark) !important;
    color: var(--title-text);
}

.top-painting {
    background-color: var(--top-bg) !important;
    border: 3px solid var(--top-border) !important;
    border-right-color: var(--top-border-dark) !important;
    border-bottom-color: var(--top-border-dark) !important;
    color: var(--win-black);
    position: relative;
    z-index: 1;
    animation: softGlow 2s infinite alternate;
}
.top-painting::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 39px;
    height: 27px;
    background-image: url('materialsl/king.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 30;
    image-rendering: pixelated;
    pointer-events: none;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
}
.top-painting::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(255,255,255,0.8) 35%,
        rgba(255,255,255,1) 45%,
        rgba(255,255,255,0.8) 55%,
        transparent 70%
    );
    background-size: 250% 250%;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    animation: whiteLine 3.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: inherit;
}

/* ===== БЛЁСТКИ ===== */
.sparkle {
    position: absolute;
    background-image: url('materialsl/star.png');
    background-size: contain;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    pointer-events: none;
    z-index: 25;
}
.loading-dots {
    animation: blinkDots 1s infinite;
}

/* ===== СЛОИ ===== */

.layers-panel{
    background-color: var(--layer-background-bg);
    border: 2px solid var(--gb-border) !important;
    border-right-color: var(--gb-border-light) !important;
    border-bottom-color: var(--gb-border-light) !important;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    margin: 2px 0;
    background: var(--layer-bg);
    border: 2px solid var(--layer-border);
    border-top-color: var(--layer-border-light);
    border-left-color: var(--layer-border-light);
    cursor: default;
}
.layer-item.active {
    background: var(--layer-active-bg);
    color: var(--layer-active-text);
}
.layer-item.active input,
.layer-item.active span {
    color: var(--layer-active-text);
}
.layer-visibility {
    width: 20px;
    height: 20px;
    background: var(--layer-visibility-bg);
    border: 2px solid var(--layer-visibility-border);
    border-top-color: var(--layer-border-light);
    border-left-color: var(--layer-border-light);
    text-align: center;
    line-height: 16px;
    cursor: pointer;
    background-size: cover;
    image-rendering: pixelated;
}
.layer-visibility.visible {
    background-image: url('materialsl/eye-open.png');
}
.layer-visibility.hidden {
    background-image: url('materialsl/eye-closed.png');
}
.layer-name {
    flex: 1;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.layer-opacity {
    width: 60px;
}
.layer-move {
    display: flex;
    gap: 2px;
}
.layer-move button {
    width: 22px;
    height: 22px;
    background: var(--layer-move-btn-bg);
    border: 2px solid var(--layer-move-btn-border-light);
    border-right-color: var(--layer-move-btn-border-dark);
    border-bottom-color: var(--layer-move-btn-border-dark);
    font-size: 12px;
    line-height: 18px;
    cursor: default;
}
.layer-move button:active {
    border: 2px solid var(--layer-move-btn-border-dark);
    border-right-color: var(--layer-move-btn-border-light);
    border-bottom-color: var(--layer-move-btn-border-light);
}

/* ===== МОДАЛЬНОЕ ОКНО ПЕРЕИМЕНОВАНИЯ СЛОЯ ===== */
.rename-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    z-index: 40000;
    display: none;
    justify-content: center;
    align-items: center;
}
.rename-modal {
    background-color: var(--modal-bg);
    border: 2px solid var(--modal-border-light);
    border-right-color: var(--modal-border-dark);
    border-bottom-color: var(--modal-border-dark);
    padding: 0;
    width: 300px;
    box-shadow: 2px 2px 0px var(--win-shadow);
    font-family: 'W95Font', 'MS Sans Serif', sans-serif;
}
.rename-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, var(--modal-header-start), var(--modal-header-end));
    color: var(--modal-header-text);
    padding: 5px 5px 5px 10px;
    font-weight: bold;
}
.rename-modal-header .close {
    width: 24px;
    height: 24px;
    background: var(--modal-close-bg);
    border: 2px solid var(--modal-close-border-light);
    border-right-color: var(--modal-close-border-dark);
    border-bottom-color: var(--modal-close-border-dark);
    color: var(--win-black);
    text-align: center;
    line-height: 20px;
    cursor: default;
    font-size: 18px;
}
.rename-modal-header .close:active {
    border: 2px solid var(--modal-close-border-dark);
    border-right-color: var(--modal-close-border-light);
    border-bottom-color: var(--modal-close-border-light);
}
.rename-modal-content {
    padding: 20px;
}
.rename-input {
    width: 100%;
    padding: 4px;
    border: 2px inset var(--modal-input-border);
    background: var(--modal-input-bg);
    font-family: inherit;
    margin-bottom: 15px;
    box-sizing: border-box;
}
.rename-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.rename-buttons button {
    min-width: 80px;
}

/* ===== ЭФФЕКТ ОШИБКИ ===== */
.error-effect {
    animation: shake 0.3s ease-in-out;
    box-shadow: 0 0 20px var(--error-shadow);
}



/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 800px) {
    .left-panel { width: 150px; }
    .paint-row { flex-wrap: wrap !important; }
    .canvas-container { width: 100%; height: auto; max-width: 570px; margin: 0 auto; }
    .canvas-container canvas { width: 100%; height: auto; }
    .paint-panel { flex: 0 0 100%; width: 100%; }
    .paint-panel > div:first-child { flex-wrap: wrap; }
    * { font-size: 14px; }
    .project-button, a.project-button, .tool-button { padding: 4px 8px; font-size: 12px; }
    #paintGallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
@media (max-width: 500px) {
    .left-panel { width: 120px; }
    .paint-panel > div:first-child button,
    .paint-panel > div:first-child a.project-button { font-size: 11px; padding: 3px 4px; }
    #paintGallery { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .color-swatch { width: 25px; height: 25px; }
}