body {
    background-color: #e0e0e0;
    margin: 0;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
}

#mazeGeneratorApp {
    display: flex;
    gap: 15px;
    background-color: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 1600px;
    align-items: flex-start;
}

.controls-panel {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

h3 { margin: 0; padding-bottom: 6px; border-bottom: 2px solid #eee; text-align: center; color: #333; font-size: 1.05em; }
.control-group { display: flex; flex-direction: column; gap: 4px; }
label { font-weight: bold; font-size: 0.7em; color: #555; }
input[type="text"], .style-select { padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.8em; }

.text-controls { display: flex; gap: 4px; margin-top: 4px; }
.style-select.small { padding: 4px; font-size: 0.7em; flex: 1; min-width: 0; }

input[type="color"] {
    -webkit-appearance: none; border: 1px solid #ccc; border-radius: 4px;
    width: 100%; height: 28px; cursor: pointer; background: white; padding: 2px;
}
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }

.slider-label-value { display: flex; justify-content: space-between; }
.slider-label-value span { color: #007bff; font-weight: bold; font-size: 0.75em; }

.brush-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.brush-btn { padding: 6px 2px; border: 1px solid #ccc; background: white; cursor: pointer; font-weight: bold; border-radius: 4px; font-size: 0.7em; transition: 0.1s; }
.brush-btn.active { border: 2px solid #007bff; background-color: #e7f3ff; }

.button-stack { display: flex; flex-direction: column; gap: 4px; }
.panel-button { padding: 8px 5px; border: none; border-radius: 6px; color: white; font-weight: bold; cursor: pointer; font-size: 0.75em; }
.btn-generate { background-color: #28a745; }
.btn-clear { background-color: #6c757d; }
.btn-download { background-color: #007bff; }
.toggle-container { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: bold; font-size: 0.7em; }

.canvas-area { background-color: #555; padding: 10px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; }

.asset-selection-panel {
    background: #fff; width: 100%; margin-bottom: 8px; padding: 8px;
    border-radius: 6px; display: flex; flex-direction: column; gap: 4px; box-sizing: border-box;
}

.asset-row { display: flex; align-items: center; justify-content: flex-start; margin-bottom: 0px; }
.asset-group { display: flex; align-items: center; gap: 6px; }
.asset-divider { width: 20px; }
.asset-group label { width: 42px; font-size: 0.65em; color: #888; text-transform: uppercase; }
.thumb-container { display: flex; gap: 4px; flex-wrap: wrap; }

.thumb {
    position: relative; width: 30px; height: 30px; border-radius: 4px;
    border: 2px solid #eee; cursor: pointer; background-size: cover; background-position: center;
}
.thumb.active { border: 2px solid #007bff; transform: scale(1.1); box-shadow: 0 0 5px rgba(0,123,255,0.4); }

.delete-thumb-btn {
    position: absolute; top: -6px; right: -6px; width: 15px; height: 15px;
    background: #dc3545; color: white; border-radius: 50%; border: 1px solid white;
    font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10;
}

.upload-btn {
    width: 30px; height: 30px; border: 1.5px dashed #bbb; background: #fdfdfd;
    color: #999; font-size: 18px; font-weight: bold; cursor: pointer; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
}
.upload-btn:hover { border-color: #007bff; color: #007bff; }

#coloringCanvas { background-color: white; width: 530px; height: auto; display: block; box-shadow: 0 0 15px rgba(0,0,0,0.5); cursor: crosshair; }
.hidden { display: none !important; }
hr { width: 100%; border: 0; border-top: 1px solid #eee; margin: 4px 0; }