body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.editor-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    align-items: flex-start;
    justify-content: center;
}

/* Зона обрезки */
.crop-area {
    position: relative;
    line-height: 0;
    border: 1px solid #ccc;
    overflow: hidden; /* Обрезает тень рамки, чтобы не лезла на интерфейс */
    user-select: none;
}

#sourceCanvas {
    max-width: 500px;
    height: auto;
    display: block;
}

/* Рамка-обрезчик */
#cropper {
    position: absolute;
    top: 0;
    left: 0;
    border: 2px dashed #fff;
    box-sizing: border-box;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5); /* Тень внутри контейнера */
    cursor: move;
}

/* Уголок ресайза */
#resizer {
    width: 12px;
    height: 12px;
    background: #007bff;
    border: 2px solid #fff;
    position: absolute;
    right: -7px;
    bottom: -7px;
    cursor: nwse-resize;
}

/* Превью */
.preview-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#finalCanvas {
    width: 64px; /* Визуально увеличиваем для удобства */
    height: 64px;
    image-rendering: pixelated; /* Сохраняем четкость пикселей */
    border: 1px solid #333;
    background-image: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%);
    background-size: 10px 10px;
    margin-bottom: 15px;
}

button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

button:hover { background: #218838; }
