/* Custom Character Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal--active {
    display: flex;
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow);
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-header h2 {
    color: var(--accent);
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.form-submit:hover {
    background: var(--primary-dark);
}

.character-card--add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(230, 190, 96, 0.3);
    background: rgba(230, 190, 96, 0.05) !important;
}

.character-card--add:hover {
    border-color: var(--accent);
    background: rgba(230, 190, 96, 0.1) !important;
}

/* Delete Button for Custom Characters */
.character-card {
    position: relative;
}

.delete-custom-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s, background 0.2s;
}

.delete-custom-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.edit-custom-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    /* delete-custom-btn과 반대편에 위치 */
    width: 24px;
    height: 24px;
    background: rgba(0, 122, 255, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s, background 0.2s;
}

.edit-custom-btn:hover {
    background: rgba(0, 122, 255, 1);
    transform: scale(1.1);
}

.character-card--add .add-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.character-card--add .add-text {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: bold;
}

/* Image preview */
.image-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    display: block;
    border: 2px solid var(--accent);
    background: #333;
}