body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url(/style/img/background.png) center center fixed;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Затемнение фона как на основном модуле */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.vayland {
    width: 100%;
    max-width: 500px; /* Совпадает с шириной app-container */
    text-align: center;
    margin-bottom: 10px;
}

.vayland img {
    width: 100%; /* Растягивается на всю ширину рамки */
    height: auto;
    display: block;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}
#canvas-container {
    border: 3px solid #333;
    background: #fff;
    line-height: 0;
    margin-bottom: 15px;
    max-width: 100%; /* Чтобы не выходил за рамки экрана */
    display: inline-block;
}

canvas {
    width: 448px; /* Базовый размер */
    height: 448px;
    max-width: 100%; /* Резиновый размер на мобилках */
    height: auto;    /* Сохранение пропорций */
    image-rendering: pixelated;
    cursor: crosshair;
    display: block;
}
.app-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.info-steps {
    background-color: #f1f4f9;
    border: 1px dashed #3498db;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    text-align: left;
}

.controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

#canvas-container {
    border: 3px solid #333;
    background: #fff;
    line-height: 0;
    margin-bottom: 15px;
}

canvas {
    width: 448px; 
    height: 448px;
    image-rendering: pixelated;
    cursor: crosshair;
}

button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: 0.2s;
}

button:hover { background: #f0f0f0; }

.primary-btn {
    background: #28a745 !important;
    color: white !important;
    border: none !important;
}

.link-container {
    text-align: left;
    margin-top: 10px;
}

#image-link {
    flex-grow: 1;
    height: 40px;
    padding: 5px;
    font-size: 12px;
    font-family: monospace;
    resize: none;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#copyBtn {
    background: #3498db;
    color: white;
    border: none;
}
/* Стили для кнопки возврата как в модуле оплаты */
#backButton {
    display: inline-block;
    width: 400px;
    max-width: 90%; /* Адаптивность для мобильных */
    padding: 12px;
    margin-top: 20px;
    background-color: #3498db;
    color: #fff;
    border: 1px solid #2c81ba;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

#backButton:hover {
    background-color: #2980b9;
}
/* Уведомление над кнопкой */
.copy-tooltip {
    position: absolute;
    bottom: 120%; /* Над кнопкой */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, bottom 0.3s;
    pointer-events: none;
    z-index: 10;
}

/* Треугольник внизу уведомления */
.copy-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Класс для показа */
.copy-tooltip.show {
    opacity: 1;
    visibility: visible;
    bottom: 110%;
}
.input-block {
    margin-bottom: 10px;
    text-align: left;
}

.input-block label {
    display: block;
    font-size: 12px;
    margin-bottom: 3px;
    font-weight: bold;
}

.input-group {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

/* Однострочные поля с авто-скрытием лишнего текста */
#image-link, #cmd-link, #art-name {
    flex-grow: 1;
    height: 40px;
    padding: 0 10px;
    font-size: 13px;
    font-family: monospace;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f9f9f9;
    /* Запрет переноса и скрытие */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#art-name {
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .app-container {
        padding: 15px;
        width: 95%;
    }
    
    .button-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 5px;
    }
    
    .button-group button, .button-group div {
        width: 100%;
    }
    
    canvas {
        width: 300px; /* Уменьшаем холст на узких экранах */
        height: 300px;
    }
}

/* Блок инструментов (Цвет + Прозрачность) */
.tool-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #fdfdfd;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 15px; /* Отступ перед кнопками действия */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

/* Красивый переключатель (Toggle Switch) */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #3498db; }
input:checked + .slider:before { transform: translateX(18px); }

.transparent-label {
    font-size: 13px;
    font-weight: bold;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

/* Группа кнопок (Очистить, Скачать, Сгенерировать) */
.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* ФИКС КНОПОК КОПИРОВАНИЯ И ПОЛЕЙ */
.input-group {
    display: flex;
    gap: 0; /* Убираем зазор, если хотим слитный вид, или ставим 5px */
    margin-bottom: 15px;
    align-items: flex-start;
}

#image-link, #cmd-link, #art-name {
    flex-grow: 1;
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px; /* Скругление только слева */
    background: #f9f9f9;
    box-sizing: border-box;
}

/* Кнопки копировать: выравниваем высоту */
.input-group button {
    height: 40px;
    padding: 0 15px;
    border: 1px solid #ccc;
    border-left: none; /* Чтобы не было двойной границы */
    border-radius: 0 4px 4px 0; /* Скругление только справа */
    background: #fff;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: 0.2s;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group button:hover { background: #f0f0f0; }

/* Холст и шахматка */
#canvas-container {
    border: 3px solid #333;
    line-height: 0;
    margin-bottom: 15px;
    display: inline-block;
    background-color: #fff;
    background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee), 
                      linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

#canvas-container.no-transparent { background-image: none; background-color: #fff; }
/* Стили для кнопок инструментов */
.tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.tool-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.tool-btn:hover:not(.active) {
    background: #f0f0f0;
}