body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #1e1e1e;
    color: #fff;
}

header {
    background-color: #2d2d2d;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3f3f3f;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#toolbar {
    width: 250px;
    background-color: #252526;
    border-right: 1px solid #3f3f3f;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 15px;
    overflow-y: auto;
}

.tool-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-section h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 5px;
}

button {
    background-color: #3e3e42;
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

button:hover {
    background-color: #4e4e52;
}

button.active {
    background-color: #007acc;
}

#editor-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1e1e1e;
    overflow: auto;
    position: relative;
}

#drawing-canvas {
    background-color: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    cursor: crosshair;
    touch-action: none;
}

.tool-section label {
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
}

#preview-container {
    width: 300px;
    background-color: #252526;
    border-left: 1px solid #3f3f3f;
    display: flex;
    flex-direction: column;
}

#three-canvas-container {
    flex: 1;
}

.status-bar {
    height: 25px;
    background-color: #007acc;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 0.8rem;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
}

.tool-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

#load-avatar-btn {
    background-color: #007acc;
}

#download-avatar-btn {
    background-color: #28a745;
}

#download-avatar-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}
