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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    border-bottom: 2px solid #1a1a1a;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: #888;
    font-weight: 300;
}

.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    align-items: start;
}

.preview-section {
    position: sticky;
    top: 20px;
}

.canvas-container {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    min-height: 552px;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 1.1rem;
    z-index: 10;
}

#previewCanvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    background: #0f0f0f;
}

.save-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #3a3a3a;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.save-btn:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border-color: #4a4a4a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.save-btn:active {
    transform: translateY(0);
}

.traits-section {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.traits-section::-webkit-scrollbar {
    width: 8px;
}

.traits-section::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 4px;
}

.traits-section::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

.traits-section::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

.trait-category {
    margin-bottom: 40px;
}

.trait-category:last-child {
    margin-bottom: 0;
}

.trait-category h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
    font-weight: 600;
}

.trait-selector {
    margin-bottom: 25px;
}

.trait-selector label {
    display: block;
    font-size: 1rem;
    color: #b0b0b0;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.trait-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trait-option {
    position: relative;
    width: 80px;
    height: 80px;
    border: 2px solid #2a2a2a;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #0f0f0f;
}

.trait-option:hover {
    border-color: #4a4a4a;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.trait-option.active {
    border-color: #ffffff;
    border-width: 3px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.trait-option.none {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #666;
    font-weight: 600;
}

.trait-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.trait-option.none:hover {
    background: #1a1a1a;
    color: #888;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .preview-section {
        position: relative;
    }

    .traits-section {
        max-height: none;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .trait-option {
        width: 60px;
        height: 60px;
    }
}

