* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a2e;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

#app {
    max-width: 900px;
    margin: 20px auto;
    padding: 10px;
}

.main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.planet-display {
    flex-shrink: 0;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f23;
    border-radius: 8px;
    border: 1px solid #333;
    cursor: crosshair;
}

#planetCanvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.settings-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 260px;
}

.control-group {
    background: #16213e;
    padding: 10px 12px;
    border-radius: 6px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #8899aa;
}

select, input[type="number"], textarea {
    width: 100%;
    padding: 6px 8px;
    background: #0f0f23;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 13px;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #5588ff;
}

input[type="range"] {
    width: 100%;
    accent-color: #5588ff;
}

.seed-row {
    display: flex;
    gap: 6px;
}

.seed-row input {
    flex: 1;
}

.seed-row button {
    width: 36px;
    flex-shrink: 0;
}

button {
    padding: 6px 12px;
    background: #1e3a5f;
    color: #e0e0e0;
    border: 1px solid #2a5080;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s;
}

button:hover {
    background: #2a5080;
}

button:active {
    background: #3a6090;
}

.toggle-btn {
    min-width: 50px;
}

.toggle-btn.active {
    background: #2a7040;
    border-color: #3a9050;
}

.inline-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-group label {
    margin-bottom: 0;
}

.color-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
}

.color-btn.selected {
    border-color: #fff;
}

.color-actions, .export-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.layer-toggles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.layer-toggle input[type="checkbox"] {
    accent-color: #5588ff;
    width: auto;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: #16213e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    min-width: 300px;
    max-width: 400px;
}

.modal-content h3 {
    margin-bottom: 12px;
    color: #aabbcc;
}

.modal-field {
    margin-bottom: 10px;
}

.modal-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.modal-field input {
    width: 100px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.color-picker-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

#colorPickerInput {
    width: 200px;
    height: 200px;
    border: none;
    background: none;
    cursor: pointer;
}

.progress-container {
    width: 100%;
    height: 20px;
    background: #0f0f23;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    background: #5588ff;
    width: 0%;
    transition: width 0.1s;
}

textarea {
    resize: vertical;
    font-family: monospace;
}

@media (max-width: 650px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
    }
    .settings-panel {
        width: 100%;
    }
}
