/* =========================================================================
   CHARACTER CREATOR UI
   ========================================================================= */

.char-creator {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.char-creator-section {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.char-creator-section h5 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.5rem;
}

/* Preset Grid */
.char-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.4rem;
}

.char-preset-btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.4rem;
    text-align: center;
    line-height: 1.3;
    transition: all 0.2s;
}

.char-preset-btn.active {
    background: var(--accent, #5a9e4b) !important;
    border-color: var(--accent, #5a9e4b) !important;
    color: #fff !important;
}

.char-preset-btn strong {
    display: block;
    font-size: 0.75rem;
}

.char-preset-btn small {
    opacity: 0.7;
    font-size: 0.6rem;
}

/* Gender Select — pixel style, all four buttons with visible borders */
#char-gender-select {
    display: flex; gap: 0; width: 100%;
}
#char-gender-select .btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem; padding: 0.4rem 0.5rem;
    flex: 1; border: 2px solid rgba(201,169,92,0.4) !important;
    margin-left: -2px;
    background: rgba(14,10,5,0.95);
    color: rgba(200,180,140,0.8);
}
#char-gender-select .btn:first-child { margin-left: 0; }
/* Ensure last button (Androgyn) keeps right border */
#char-gender-select .btn:last-child { border-right: 2px solid rgba(201,169,92,0.4) !important; }
#char-gender-select .btn.active {
    background: rgba(201,169,92,0.2) !important;
    border-color: var(--px-gold, #c8a028) !important;
    color: var(--px-gold2, #e8c840) !important;
}
#char-gender-select .btn:hover:not(.active) {
    background: rgba(201,169,92,0.08) !important;
    color: rgba(220,200,150,0.95) !important;
}

/* Part Selectors */
.char-parts-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.char-part-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.char-part-selector label {
    font-size: 0.7rem;
    min-width: 70px;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.char-part-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.char-part-btn {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.35rem !important;
    border-radius: 3px !important;
    transition: all 0.15s;
}

.char-part-btn.active {
    background: var(--primary, #556b2f) !important;
    border-color: var(--primary, #556b2f) !important;
    color: #fff !important;
}

.char-part-btn:hover {
    transform: scale(1.05);
}

/* Color Pickers */
.char-color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.char-color-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.char-color-picker label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    margin: 0;
}

.char-color-input {
    width: 36px;
    height: 28px;
    padding: 1px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

.char-color-input::-webkit-color-swatch-wrapper {
    padding: 1px;
}

.char-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

/* Skills */
.char-skills-grid {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.char-skill-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.char-skill-icon {
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
}

.char-skill-name {
    font-size: 0.7rem;
    min-width: 65px;
    color: rgba(255,255,255,0.8);
}

.char-skill-slider {
    flex: 1;
    height: 4px;
    accent-color: var(--accent, #5a9e4b);
}

.char-skill-value {
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
    color: var(--accent, #5a9e4b);
}

#char-skill-total {
    font-size: 0.65rem;
    vertical-align: middle;
    margin-left: 0.3rem;
}

/* Emotion Preview */
.char-emotion-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.char-emotion-btn {
    font-size: 0.6rem !important;
    padding: 0.1rem 0.3rem !important;
    border-radius: 3px !important;
}

.char-emotion-btn.active {
    background: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: #fff !important;
}

/* Dialog Bubble */
.char-dialog-bubble {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    animation: charDialogFadeIn 0.3s ease-out;
    z-index: 100;
}

.char-dialog-bubble::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(0, 0, 0, 0.75);
}

@keyframes charDialogFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Skill Bar (for profile display) */
.char-skill-bar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.15rem;
}

.char-skill-bar-label {
    font-size: 0.65rem;
    min-width: 60px;
    color: rgba(255,255,255,0.7);
}

.char-skill-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.char-skill-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.char-skill-bar-fill.skill-staerke { background: #E74C3C; }
.char-skill-bar-fill.skill-mut { background: #E67E22; }
.char-skill-bar-fill.skill-charme { background: #9B59B6; }
.char-skill-bar-fill.skill-handwerk { background: #3498DB; }
.char-skill-bar-fill.skill-weisheit { background: #2ECC71; }

.char-skill-bar-value {
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 14px;
    text-align: right;
}

/* Character Profile Card */
.char-profile-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.char-profile-card h6 {
    margin-bottom: 0.25rem;
    color: var(--accent, #5a9e4b);
}

.char-profile-card .char-archetype {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.4rem;
}

.char-profile-card .char-tagline {
    font-size: 0.7rem;
    font-style: italic;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.5rem;
}
