* {
    box-sizing: border-box;
    user-select: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e1e2f, #2a2a3b);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 1600px;
    width: 100%;
    background: rgba(30, 30, 40, 0.9);
    border-radius: 0;
    padding: 20px 24px 24px 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
}

h1 {
    text-align: center;
    color: white;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: 1px;
}

.upload-area {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
}

.upload-card {
    background: #2d2d3a;
    border-radius: 20px;
    padding: 12px 20px;
    flex: 1;
    min-width: 200px;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid #4a4a5a;
}

.upload-card label {
    display: inline-block;
    background: #3a6ea5;
    color: white;
    padding: 6px 18px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.upload-card label:hover {
    background: #2c5a8c;
    transform: scale(1.02);
}

.upload-card p {
    color: #aaa;
    margin: 6px 0 0;
    font-size: 0.7rem;
}

.preview-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    overflow: auto;
    background: #15151f;
    border-radius: 20px;
    padding: 16px;
    min-height: 500px;
    max-height: 70vh;
    position: relative;
}

.canvas-wrapper {
    background: #1e1e28;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #4a4a60;
}

canvas {
    display: block;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: grab;
    background: repeating-conic-gradient(#3a3a4a 0% 25%, #2a2a38 0% 50%) 50% / 20px 20px;
}

canvas:active {
    cursor: grabbing;
}

.controls-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 12px;
}

.sliders-group {
    background: #252532;
    border-radius: 20px;
    padding: 14px 20px;
    flex: 1;
    min-width: 260px;
    border: 1px solid #45455a;
}

.sliders-group h3 {
    color: #ddd;
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    border-left: 4px solid #5a9bd5;
    padding-left: 12px;
}

.control-item {
    margin-bottom: 12px;
}

.control-item label {
    display: flex;
    justify-content: space-between;
    color: #ccc;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
    background: #3a3a4a;
    height: 4px;
    border-radius: 4px;
    -webkit-appearance: none;
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #5a9bd5;
    cursor: pointer;
    box-shadow: 0 0 4px white;
}

.value-display {
    background: #1e1e28;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: monospace;
    font-size: 0.75rem;
}

/* Стили для переключателя */
.toggle-switch {
    display: flex;
    align-items: center;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90px;
    height: 34px;
    background: #3a3a4a;
    border-radius: 34px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.toggle-off, .toggle-on {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50%;
    height: 100%;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 2;
}

.toggle-off {
    color: #aaa;
    background: #2a2a38;
}

.toggle-on {
    color: #aaa;
    background: #3a3a4a;
}

.toggle-input:checked + .toggle-label {
    background: #2c8c5e;
}

.toggle-input:checked + .toggle-label .toggle-off {
    background: #3a3a4a;
    color: #aaa;
}

.toggle-input:checked + .toggle-label .toggle-on {
    background: #2c8c5e;
    color: white;
}

.toggle-label::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 30px;
    border-radius: 30px;
    background: #5a9bd5;
    left: 2px;
    transition: all 0.3s ease;
    z-index: 1;
}

.toggle-input:checked + .toggle-label::before {
    left: 48px;
    background: #1f704a;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Стили для социальных ссылок */
.social-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(90, 155, 213, 0.2);
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.social-link:hover {
    transform: translateY(-3px);
    opacity: 1;
}

.social-icon {
    width: 36px;
    height: 36px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .social-icon {
        width: 30px;
        height: 30px;
    }
    
    .social-links {
        gap: 20px;
    }
}

.btn {
    background: #3a6ea5;
    border: none;
    padding: 8px 18px;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #2c8c5e;
}

.btn-primary:hover {
    background: #1f704a;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-reset {
    background: #6c3e5a;
}

.btn-reset:hover {
    background: #542e46;
}

.btn-scale {
    background: #5a4a2c;
}

.btn-scale:hover {
    background: #4a3a1f;
}

.btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.view-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* Стили для футера */
.footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(90, 155, 213, 0.3);
}

.footer a {
    color: #5a9bd5;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer a strong {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer a:hover {
    color: #8bbbe8;
    text-decoration: underline;
}

.footer a::before {
    content: "©";
    font-size: 0.9rem;
    font-weight: normal;
}