*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #121220;
    color: #e0e0e0;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 2rem 1rem 1rem;
}

header h1 {
    font-size: 2rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.subtitle {
    color: #888;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    align-items: start;
}

/* Preview */
.preview-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: sticky;
    top: 2rem;
}

#preview {
    width: 100%;
    max-width: 440px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(107, 184, 92, 0.1);
}

/* Controls */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #1a1a2e;
    border-radius: 12px;
    padding: 1.5rem;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed #444;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    color: #888;
}

.drop-zone:hover {
    border-color: #6BB85C;
    color: #aaa;
}

.drop-zone.drag-over {
    border-color: #6BB85C;
    background: rgba(107, 184, 92, 0.08);
    color: #ccc;
}

.drop-zone.has-image {
    border-style: solid;
    border-color: #333;
    padding: 0.75rem;
    color: #666;
    font-size: 0.85rem;
}

/* Control groups */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.control-group label {
    font-size: 0.85rem;
    color: #aaa;
}

.control-group input[type="text"] {
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
}

.control-group input[type="text"]:focus {
    outline: none;
    border-color: #6BB85C;
}

/* Color row */
.color-row {
    flex-direction: row;
    gap: 1rem;
}

.color-row > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.color-row label {
    font-size: 0.85rem;
    color: #aaa;
}

input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0f0f1a;
    cursor: pointer;
    padding: 2px;
}

/* Slider + input rows */
.slider-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.slider-row input[type="range"] {
    flex: 1;
}

.num-input {
    width: 60px;
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    text-align: center;
    -moz-appearance: textfield;
}

.num-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.num-input:focus {
    outline: none;
    border-color: #6BB85C;
}

/* Sliders 2-column grid */
.sliders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Range sliders */
input[type="range"] {
    width: 100%;
    accent-color: #6BB85C;
    height: 6px;
    cursor: pointer;
}

/* Download buttons */
.download-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.download-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    background: #6BB85C;
    color: #fff;
}

.download-btn:hover {
    opacity: 0.85;
}

.download-btn--jpg {
    background: #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.5rem;
    }

    .preview-section {
        position: static;
    }

    #preview {
        max-width: 320px;
    }

    .sliders-grid {
        grid-template-columns: 1fr;
    }
}
