.character-display {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.character-card {
    background: var(--sec-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 700px;
    width: 100%;
    transition: var(--transition);
}

.character-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.character-text {
    flex: 1;
}

.character-text h2 {
    text-align: right;
    margin-bottom: 0.5rem;
}

.character-text .blurb {
    text-align: right;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    color: var(--white);
    font-weight: 600;
    text-align: left;
}

.info-value {
    color: var(--green);
    text-align: right;
    font-weight: bold;
}

.character-image {
    width: 180px;
    height: 180px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-fallback {
    width: 100%;
    height: 100%;
    background: var(--green);
}

hr {
    border: 1px solid var(--green);
    margin: 15px 0;
}

.traits {
    text-align: center;
}

.traits h3 {
    margin-bottom: 0.6rem;
}

.traits-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 0.6rem;
}

.trait-tag {
    background: var(--green);
    color: var(--bg-color);
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: var(--transition);
}

.trait-link {
    background-color: #a855f7 !important;
    color: var(--bg-color);
}

.trait-tag:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.create-title-input,
.create-blurb-input,
.custom-input {
    width: 100%;
    padding: 0.6rem;
    border-radius: 10px;
    border: 2px solid var(--green);
    background: var(--sec-color);
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 0.6rem;
    box-sizing: border-box;
    transition: var(--transition);
}

.create-title-input:focus,
.create-blurb-input:focus,
.custom-input:focus {
    outline: none;
    border-color: #a855f7;
}

.create-blurb-input {
    resize: vertical;
    min-height: 70px;
}

.custom-btn {
    margin-top: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: var(--green);
    color: var(--bg-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.custom-btn:hover {
    opacity: 0.85;
}

.custom-select {
    position: relative;
    width: 50%;
    min-height: 42px;
    border-radius: 10px;
    border: 2px solid var(--green);
    background: var(--sec-color);
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}

.custom-select-display {
    padding: 0.6rem;
    color: var(--white);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: var(--sec-color);
    border: 2px solid var(--green);
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    z-index: 999;
    box-sizing: border-box;
}

.custom-select.open {
    z-index: 1000;
}

.custom-select.open .custom-select-dropdown {
    display: block;
}

.custom-option {
    padding: 0.5rem 0.6rem;
    color: var(--white);
    transition: var(--transition);
}

.custom-option:hover {
    background: var(--green);
    color: var(--bg-color);
}

.custom-option-group-label {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--green);
    font-weight: bold;
    padding: 0.4rem 0.6rem;
    cursor: default;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4px;
    user-select: none;
    font-size: 0.85rem;
}

.custom-option-group-label:first-of-type {
    margin-top: 0;
}

.custom-option-group-label + .custom-option {
    margin-top: 2px;
}

.create-input-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.editable {
    outline: 2px dashed var(--green);
    padding: 4px;
}

.editable:focus {
    outline: 2px solid var(--green);
}

.add-info-btn,
.add-trait-btn {
    margin-top: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: var(--green);
    color: var(--bg-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.add-info-btn:hover,
.add-trait-btn:hover {
    opacity: 0.85;
}